Skip to content

Commit

Permalink
Merge branch 'branch-24.08' into sssp_dijkstra
Browse files Browse the repository at this point in the history
  • Loading branch information
rlratzel authored Jul 24, 2024
2 parents cc84d5f + 0900a06 commit 342ad63
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 30 deletions.
10 changes: 6 additions & 4 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -573,10 +573,6 @@ dependencies:
- *numba
- *numpy
- *thrift
- output_types: pyproject
packages:
- *cugraph
- cugraph-service-client==24.8.*,>=0.0.0a0
- output_types: conda
packages:
- *ucx_py
Expand All @@ -586,13 +582,19 @@ dependencies:
- matrix:
cuda: "11.*"
packages:
- *cugraph_cu11
- cugraph-service-client-cu11==24.8.*,>=0.0.0a0
- *ucx_py_cu11
- matrix:
cuda: "12.*"
packages:
- *cugraph_cu12
- cugraph-service-client-cu12==24.8.*,>=0.0.0a0
- *ucx_py_cu12
- matrix:
packages:
- *cugraph
- cugraph-service-client==24.8.*,>=0.0.0a0
- *ucx_py
test_cpp:
common:
Expand Down
30 changes: 7 additions & 23 deletions python/cugraph/cugraph/tests/community/test_triangle_count.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,48 +105,32 @@ def test_triangles(input_combo):
@pytest.mark.sg
def test_triangles_int64(input_combo):
Gnx = input_combo["Gnx"]
count_legacy_32 = cugraph.triangle_count(Gnx)
count_int32 = cugraph.triangle_count(Gnx)["counts"].sum()

graph_file = input_combo["graph_file"]
G = graph_file.get_graph()
G.edgelist.edgelist_df = G.edgelist.edgelist_df.astype(
{"src": "int64", "dst": "int64"}
)
count_int64 = cugraph.triangle_count(G)["counts"].sum()

count_exp_64 = (
cugraph.triangle_count(G)
.sort_values("vertex")
.reset_index(drop=True)
.rename(columns={"counts": "exp_cugraph_counts"})
)
cugraph_exp_triangle_results = count_exp_64["exp_cugraph_counts"].sum()
assert G.edgelist.edgelist_df["src"].dtype == "int64"
assert G.edgelist.edgelist_df["dst"].dtype == "int64"
assert cugraph_exp_triangle_results == count_legacy_32
assert count_int32 == count_int64


@pytest.mark.sg
def test_triangles_no_weights(input_combo):
G_weighted = input_combo["Gnx"]
count_legacy = (
cugraph.triangle_count(G_weighted)
.sort_values("vertex")
.reset_index(drop=True)
.rename(columns={"counts": "exp_cugraph_counts"})
)
count_triangles_nx_graph = cugraph.triangle_count(G_weighted)["counts"].sum()

graph_file = input_combo["graph_file"]
G = graph_file.get_graph(ignore_weights=True)

assert G.is_weighted() is False
triangle_count = (
cugraph.triangle_count(G)
.sort_values("vertex")
.reset_index(drop=True)
.rename(columns={"counts": "exp_cugraph_counts"})
)
cugraph_exp_triangle_results = triangle_count["exp_cugraph_counts"].sum()
assert cugraph_exp_triangle_results == count_legacy
count_triangles = cugraph.triangle_count(G)["counts"].sum()

assert count_triangles_nx_graph == count_triangles


@pytest.mark.sg
Expand Down
16 changes: 13 additions & 3 deletions python/cugraph/cugraph/tests/traversal/test_paths.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019-2023, NVIDIA CORPORATION.
# Copyright (c) 2019-2024, NVIDIA CORPORATION.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand All @@ -22,6 +22,7 @@
import cupy
import cugraph
from cugraph.testing import get_resultset, load_resultset
from cudf.testing.testing import assert_series_equal
from cupyx.scipy.sparse import coo_matrix as cupy_coo_matrix


Expand Down Expand Up @@ -204,7 +205,11 @@ def test_shortest_path_length_no_path(graphs):
def test_shortest_path_length_no_target(graphs, load_traversal_results):
cugraph_G, cupy_df = graphs

cugraph_path_1_to_all = cugraph.shortest_path_length(cugraph_G, 1)
cugraph_path_1_to_all = (
cugraph.shortest_path_length(cugraph_G, 1)
.sort_values("vertex")
.reset_index(drop=True)
)
golden_path_1_to_all = get_resultset(
resultset_name="traversal",
algo="shortest_path_length",
Expand All @@ -217,7 +222,12 @@ def test_shortest_path_length_no_target(graphs, load_traversal_results):

# Cast networkx graph on cugraph vertex column type from str to int.
# SSSP preserves vertex type, convert for comparison
assert cugraph_path_1_to_all == cupy_path_1_to_all
assert_series_equal(
cugraph_path_1_to_all["distance"],
cupy_path_1_to_all["distance"],
check_names=False,
check_dtype=False,
)

# results for vertex 8 and 9 are not returned
assert cugraph_path_1_to_all.shape[0] == len(golden_path_1_to_all) + 2
Expand Down

0 comments on commit 342ad63

Please sign in to comment.