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

Remove Deprecated Sampling Options #3816

Merged
1 change: 1 addition & 0 deletions python/cugraph-pyg/cugraph_pyg/data/cugraph_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ def __construct_graph(
-------
A newly-constructed directed cugraph.MultiGraph object.
"""

# Ensure the original dict is not modified.
edge_info_cg = {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,21 @@ def test_neighbor_sample(dask_client, basic_graph_1):
F, G, N = basic_graph_1
cugraph_store = CuGraphStore(F, G, N, multi_gpu=True)

batches = cudf.DataFrame(
{
"start": cudf.Series([0, 1, 2, 3, 4], dtype="int64"),
"batch": cudf.Series(cupy.zeros(5, dtype="int32")),
}
)

sampling_results = (
uniform_neighbor_sample(
cugraph_store._subgraph(),
cudf.Series([0, 1, 2, 3, 4], dtype="int64"),
batches,
with_batch_ids=True,
fanout_vals=[-1],
with_replacement=False,
with_edge_properties=True,
batch_id_list=cudf.Series(cupy.zeros(5, dtype="int32")),
random_state=62,
return_offsets=False,
return_hops=True,
Expand Down Expand Up @@ -90,16 +97,23 @@ def test_neighbor_sample_multi_vertex(dask_client, multi_edge_multi_vertex_graph
F, G, N = multi_edge_multi_vertex_graph_1
cugraph_store = CuGraphStore(F, G, N, multi_gpu=True)

batches = cudf.DataFrame(
{
"start": cudf.Series([0, 1, 2, 3, 4], dtype="int64"),
"batches": cudf.Series(cupy.zeros(5, dtype="int32")),
}
)

sampling_results = (
uniform_neighbor_sample(
cugraph_store._subgraph(),
cudf.Series([0, 1, 2, 3, 4], dtype="int64"),
batches,
fanout_vals=[-1],
with_replacement=False,
with_edge_properties=True,
batch_id_list=cudf.Series(cupy.zeros(5, dtype="int32")),
random_state=62,
return_offsets=False,
with_batch_ids=True,
)
.sort_values(by=["sources", "destinations"])
.compute()
Expand Down
22 changes: 18 additions & 4 deletions python/cugraph-pyg/cugraph_pyg/tests/test_cugraph_sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,20 @@ def test_neighbor_sample(basic_graph_1):
F, G, N = basic_graph_1
cugraph_store = CuGraphStore(F, G, N)

batches = cudf.DataFrame(
{
"start": cudf.Series([0, 1, 2, 3, 4], dtype="int64"),
"batch": cudf.Series(cupy.zeros(5, dtype="int32")),
}
)

sampling_results = uniform_neighbor_sample(
cugraph_store._subgraph(),
cudf.Series([0, 1, 2, 3, 4], dtype="int64"),
batches,
fanout_vals=[-1],
with_replacement=False,
with_edge_properties=True,
batch_id_list=cudf.Series(cupy.zeros(5, dtype="int32")),
with_batch_ids=True,
random_state=62,
return_offsets=False,
).sort_values(by=["sources", "destinations"])
Expand Down Expand Up @@ -82,15 +89,22 @@ def test_neighbor_sample_multi_vertex(multi_edge_multi_vertex_graph_1):
F, G, N = multi_edge_multi_vertex_graph_1
cugraph_store = CuGraphStore(F, G, N)

batches = cudf.DataFrame(
{
"start": cudf.Series([0, 1, 2, 3, 4], dtype="int64"),
"batch": cudf.Series(cupy.zeros(5, dtype="int32")),
}
)

sampling_results = uniform_neighbor_sample(
cugraph_store._subgraph(),
cudf.Series([0, 1, 2, 3, 4], dtype="int64"),
batches,
fanout_vals=[-1],
with_replacement=False,
with_edge_properties=True,
batch_id_list=cudf.Series(cupy.zeros(5, dtype="int32")),
random_state=62,
return_offsets=False,
with_batch_ids=True,
).sort_values(by=["sources", "destinations"])

out = _sampler_output_from_sampling_results(
Expand Down
Loading