Skip to content

Commit

Permalink
Add call to deload internal dataset edge list
Browse files Browse the repository at this point in the history
  • Loading branch information
nv-rliu committed Mar 13, 2024
1 parent 39a4e97 commit 8390264
Show file tree
Hide file tree
Showing 7 changed files with 170 additions and 211 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ def setup_function():

@pytest.mark.mg
@pytest.mark.skipif(is_single_gpu(), reason="skipping MG testing on Single GPU system")
@pytest.mark.parametrize(
"graph_file", DATASETS, ids=[f"dataset={d.get_path().stem}" for d in DATASETS]
)
@pytest.mark.parametrize("dataset", DATASETS)
@pytest.mark.parametrize("directed", IS_DIRECTED)
@pytest.mark.parametrize("subset_size", SUBSET_SIZES)
@pytest.mark.parametrize("normalized", IS_NORMALIZED)
Expand All @@ -68,7 +66,7 @@ def setup_function():
@pytest.mark.parametrize("subset_seed", SUBSET_SEEDS)
@pytest.mark.parametrize("result_dtype", RESULT_DTYPES)
def test_mg_betweenness_centrality(
graph_file,
dataset,
directed,
subset_size,
normalized,
Expand All @@ -79,7 +77,7 @@ def test_mg_betweenness_centrality(
dask_client,
):
sorted_df = calc_betweenness_centrality(
graph_file,
dataset,
directed=directed,
normalized=normalized,
k=subset_size,
Expand All @@ -95,3 +93,6 @@ def test_mg_betweenness_centrality(
second_key="ref_bc",
epsilon=DEFAULT_EPSILON,
)

# Clean-up stored dataset edge-lists
dataset.unload()
Original file line number Diff line number Diff line change
Expand Up @@ -55,23 +55,21 @@ def setup_function():
# FIXME: Fails for directed = False(bc score twice as much) and normalized = True.
@pytest.mark.mg
@pytest.mark.skipif(is_single_gpu(), reason="skipping MG testing on Single GPU system")
@pytest.mark.parametrize(
"graph_file", DATASETS, ids=[f"dataset={d.get_path().stem}" for d in DATASETS]
)
@pytest.mark.parametrize("dataset", DATASETS)
@pytest.mark.parametrize("directed", IS_DIRECTED)
@pytest.mark.parametrize("subset_size", SUBSET_SIZES)
@pytest.mark.parametrize("normalized", IS_NORMALIZED)
@pytest.mark.parametrize("result_dtype", RESULT_DTYPES)
def test_mg_edge_betweenness_centrality(
graph_file,
dataset,
directed,
subset_size,
normalized,
result_dtype,
dask_client,
):
sorted_df = calc_edge_betweenness_centrality(
graph_file,
dataset,
directed=directed,
normalized=normalized,
k=subset_size,
Expand All @@ -86,3 +84,5 @@ def test_mg_edge_betweenness_centrality(
second_key="ref_bc",
epsilon=DEFAULT_EPSILON,
)
# Clean-up stored dataset edge-lists
dataset.unload()
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,14 @@ def setup_function():


def get_sg_graph(dataset, directed):
dataset.unload()
G = dataset.get_graph(create_using=cugraph.Graph(directed=directed))

return G


def get_mg_graph(dataset, directed):
dataset.unload()
ddf = dataset.get_dask_edgelist()
dg = cugraph.Graph(directed=directed)
dg.from_dask_cudf_edgelist(
Expand Down Expand Up @@ -141,3 +143,6 @@ def test_dask_mg_betweenness_centrality(
diff = cupy.isclose(mg_bc_results, sg_bc_results)

assert diff.all()

# Clean-up stored dataset edge-lists
dataset.unload()
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@ def setup_function():


def get_sg_graph(dataset, directed):
dataset.unload()
G = dataset.get_graph(create_using=cugraph.Graph(directed=directed))

return G


def get_mg_graph(dataset, directed):
dataset.unload()
ddf = dataset.get_dask_edgelist()
dg = cugraph.Graph(directed=directed)
dg.from_dask_cudf_edgelist(
Expand Down Expand Up @@ -116,3 +118,6 @@ def test_dask_mg_degree(dask_client, dataset, directed):
check_names=False,
check_dtype=False,
)

# Clean-up stored dataset edge-lists
dataset.unload()
Loading

0 comments on commit 8390264

Please sign in to comment.