Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Enforce renumbering for MNMG algos #1943

Merged
merged 7 commits into from
Nov 12, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions benchmarks/python_e2e/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ def run(algos,
success = benchmark.run()

algo_name = benchmark.results[1].name
algo_name = f"benchmarks.{algo_name}"
algo_time = benchmark.results[1].runtime
# Generate json files containing the benchmark results
if benchmark_dir is not None:
Expand Down
2 changes: 2 additions & 0 deletions python/cugraph/cugraph/structure/graph_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@ def from_dask_cudf_edgelist(
If source and destination indices are not in range 0 to V where V
is number of vertices, renumber argument should be True.
"""
if renumber is False:
raise ValueError("'renumber' must be set to 'True' for MNMG algos")
if self._Impl is None:
self._Impl = simpleDistributedGraphImpl(self.graph_properties)
elif type(self._Impl) is not simpleDistributedGraphImpl:
Expand Down
48 changes: 48 additions & 0 deletions python/cugraph/cugraph/tests/dask/test_mg_renumber.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,51 @@ def test_dask_pagerank(dask_client):
err = err + 1
print("Mismatches:", err)
assert err == 0


@pytest.mark.skipif(
is_single_gpu(), reason="skipping MG testing on Single GPU system"
)
@pytest.mark.parametrize("renumber", [False])
def test_digraph_renumber_false(renumber, dask_client):
gc.collect()
rlratzel marked this conversation as resolved.
Show resolved Hide resolved

input_data_path = (RAPIDS_DATASET_ROOT_DIR_PATH /
"karate.csv").as_posix()
chunksize = dcg.get_chunksize(input_data_path)

ddf = dask_cudf.read_csv(
input_data_path,
chunksize=chunksize,
delimiter=" ",
names=["src", "dst", "value"],
dtype=["int32", "int32", "float32"],
)
dg = cugraph.DiGraph()
rlratzel marked this conversation as resolved.
Show resolved Hide resolved

with pytest.raises(ValueError):
dg.from_dask_cudf_edgelist(ddf, "src", "dst", renumber=renumber)


@pytest.mark.skipif(
is_single_gpu(), reason="skipping MG testing on Single GPU system"
)
@pytest.mark.parametrize("renumber", [False])
def test_multi_digraph_renumber_false(renumber, dask_client):
gc.collect()

input_data_path = (RAPIDS_DATASET_ROOT_DIR_PATH /
"karate_multi_edge.csv").as_posix()
chunksize = dcg.get_chunksize(input_data_path)

ddf = dask_cudf.read_csv(
input_data_path,
chunksize=chunksize,
delimiter=" ",
names=["src", "dst", "value"],
dtype=["int32", "int32", "float32"],
)
dg = cugraph.MultiDiGraph()
rlratzel marked this conversation as resolved.
Show resolved Hide resolved

with pytest.raises(ValueError):
dg.from_dask_cudf_edgelist(ddf, "src", "dst", renumber=renumber)