Skip to content

Commit

Permalink
Merge branch 'branch-24.12' into allow_pyt_24
Browse files Browse the repository at this point in the history
  • Loading branch information
jakirkham authored Oct 15, 2024
2 parents f040eff + 21fe9bf commit b8ae527
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ repos:
types: [python]
language: python
pass_filenames: false
additional_dependencies: ["networkx>=3.3"]
additional_dependencies: ["networkx>=3.4"]
- repo: local
hooks:
- id: nx-cugraph-readme-update
Expand All @@ -78,4 +78,4 @@ repos:
types_or: [python, markdown]
language: python
pass_filenames: false
additional_dependencies: ["networkx>=3.3"]
additional_dependencies: ["networkx>=3.4"]
14 changes: 7 additions & 7 deletions cpp/src/detail/graph_partition_utils.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ struct compute_gpu_id_from_ext_vertex_t {

__host__ __device__ int operator()(vertex_t v) const
{
cuco::detail::MurmurHash3_32<vertex_t> hash_func{};
cuco::murmurhash3_32<vertex_t> hash_func{};
auto vertex_partition_id = static_cast<int>(hash_func(v) % comm_size);
return partition_manager::compute_global_comm_rank_from_vertex_partition_id(
major_comm_size, minor_comm_size, vertex_partition_id);
Expand All @@ -58,7 +58,7 @@ struct compute_gpu_id_from_ext_edge_id_t {

__host__ __device__ int operator()(edge_t e) const
{
cuco::detail::MurmurHash3_32<edge_t> hash_func{};
cuco::murmurhash3_32<edge_t> hash_func{};
auto vertex_partition_id = static_cast<int>(hash_func(e) % comm_size);
return partition_manager::compute_global_comm_rank_from_vertex_partition_id(
major_comm_size, minor_comm_size, vertex_partition_id);
Expand Down Expand Up @@ -88,7 +88,7 @@ struct compute_vertex_partition_id_from_ext_vertex_t {

__host__ __device__ int operator()(vertex_t v) const
{
cuco::detail::MurmurHash3_32<vertex_t> hash_func{};
cuco::murmurhash3_32<vertex_t> hash_func{};
return hash_func(v) % comm_size;
}
};
Expand All @@ -114,7 +114,7 @@ struct compute_gpu_id_from_ext_edge_endpoints_t {

__host__ __device__ int operator()(vertex_t major, vertex_t minor) const
{
cuco::detail::MurmurHash3_32<vertex_t> hash_func{};
cuco::murmurhash3_32<vertex_t> hash_func{};
auto major_vertex_partition_id = static_cast<int>(hash_func(major) % comm_size);
auto minor_vertex_partition_id = static_cast<int>(hash_func(minor) % comm_size);
auto major_comm_rank = major_vertex_partition_id % major_comm_size;
Expand All @@ -126,7 +126,7 @@ struct compute_gpu_id_from_ext_edge_endpoints_t {
__host__ __device__ int operator()(
thrust::tuple<vertex_t, vertex_t> pair /* major, minor */) const
{
cuco::detail::MurmurHash3_32<vertex_t> hash_func{};
cuco::murmurhash3_32<vertex_t> hash_func{};
auto major_vertex_partition_id = static_cast<int>(hash_func(thrust::get<0>(pair)) % comm_size);
auto minor_vertex_partition_id = static_cast<int>(hash_func(thrust::get<1>(pair)) % comm_size);
auto major_comm_rank = major_vertex_partition_id % major_comm_size;
Expand Down Expand Up @@ -192,15 +192,15 @@ struct compute_edge_partition_id_from_ext_edge_endpoints_t {

__host__ __device__ int operator()(vertex_t major, vertex_t minor) const
{
cuco::detail::MurmurHash3_32<vertex_t> hash_func{};
cuco::murmurhash3_32<vertex_t> hash_func{};
return (hash_func(major) % comm_size) * minor_comm_size +
(hash_func(minor) % comm_size) / major_comm_size;
}

__host__ __device__ int operator()(
thrust::tuple<vertex_t, vertex_t> pair /* major, minor */) const
{
cuco::detail::MurmurHash3_32<vertex_t> hash_func{};
cuco::murmurhash3_32<vertex_t> hash_func{};
return (hash_func(thrust::get<0>(pair)) % comm_size) * minor_comm_size +
(hash_func(thrust::get<1>(pair)) % comm_size) / major_comm_size;
}
Expand Down
5 changes: 3 additions & 2 deletions cpp/src/structure/remove_multi_edges_impl.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

#include <rmm/device_uvector.hpp>

#include <cuda/std/cstddef>
#include <thrust/binary_search.h>
#include <thrust/distance.h>
#include <thrust/iterator/zip_iterator.h>
Expand All @@ -53,8 +54,8 @@ struct hash_src_dst_pair {
vertex_t pair[2];
pair[0] = thrust::get<0>(t);
pair[1] = thrust::get<1>(t);
cuco::detail::MurmurHash3_32<vertex_t*> hash_func{};
return hash_func.compute_hash(reinterpret_cast<std::byte*>(pair), 2 * sizeof(vertex_t)) %
cuco::murmurhash3_32<vertex_t*> hash_func{};
return hash_func.compute_hash(reinterpret_cast<cuda::std::byte*>(pair), 2 * sizeof(vertex_t)) %
num_groups;
}
};
Expand Down
2 changes: 1 addition & 1 deletion cpp/tests/prims/mg_count_if_v.cu
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct test_predicate {
test_predicate(int mod_count) : mod(mod_count) {}
__device__ bool operator()(vertex_t, const vertex_t& val)
{
cuco::detail::MurmurHash3_32<vertex_t> hash_func{};
cuco::murmurhash3_32<vertex_t> hash_func{};
return (0 == (hash_func(val) % mod));
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class Tests_MGPerVPairTransformDstNbrIntersection
cugraph::get_dataframe_buffer_begin(mg_vertex_pair_buffer),
cugraph::get_dataframe_buffer_end(mg_vertex_pair_buffer),
[comm_rank, num_vertices = mg_graph_view.number_of_vertices()] __device__(size_t i) {
cuco::detail::MurmurHash3_32<size_t>
cuco::murmurhash3_32<size_t>
hash_func{}; // use hash_func to generate arbitrary vertex pairs
auto v0 = static_cast<vertex_t>(hash_func(i + comm_rank) % num_vertices);
auto v1 = static_cast<vertex_t>(hash_func(i + num_vertices + comm_rank) % num_vertices);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class Tests_MGPerVPairTransformDstNbrIntersection
cugraph::get_dataframe_buffer_begin(mg_vertex_pair_buffer),
cugraph::get_dataframe_buffer_end(mg_vertex_pair_buffer),
[comm_rank, num_vertices = mg_graph_view.number_of_vertices()] __device__(size_t i) {
cuco::detail::MurmurHash3_32<size_t>
cuco::murmurhash3_32<size_t>
hash_func{}; // use hash_func to generate arbitrary vertex pairs
auto v0 = static_cast<vertex_t>(hash_func(i + comm_rank) % num_vertices);
auto v1 = static_cast<vertex_t>(hash_func(i + num_vertices + comm_rank) % num_vertices);
Expand Down
2 changes: 1 addition & 1 deletion cpp/tests/prims/mg_transform_reduce_v.cu
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ struct v_op_t {

__device__ auto operator()(vertex_t, vertex_t val) const
{
cuco::detail::MurmurHash3_32<vertex_t> hash_func{};
cuco::murmurhash3_32<vertex_t> hash_func{};
return cugraph::test::detail::make_property_value<property_t>(hash_func(val) % mod);
}
};
Expand Down
4 changes: 2 additions & 2 deletions cpp/tests/utilities/property_generator_kernels.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ struct vertex_property_transform {
{
static_assert(cugraph::is_thrust_tuple_of_arithmetic<property_t>::value ||
std::is_arithmetic_v<property_t>);
cuco::detail::MurmurHash3_32<vertex_t> hash_func{};
cuco::murmurhash3_32<vertex_t> hash_func{};
return make_property_value<property_t>(hash_func(v) % mod);
}
};
Expand All @@ -74,7 +74,7 @@ struct edge_property_transform {
{
static_assert(cugraph::is_thrust_tuple_of_arithmetic<property_t>::value ||
std::is_arithmetic_v<property_t>);
cuco::detail::MurmurHash3_32<vertex_t> hash_func{};
cuco::murmurhash3_32<vertex_t> hash_func{};
return make_property_value<property_t>(hash_func(src + dst) % mod);
}
};
Expand Down
4 changes: 2 additions & 2 deletions python/nx-cugraph/_nx_cugraph/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"backend_name": "cugraph",
"project": "nx-cugraph",
"package": "nx_cugraph",
"url": f"https://rapids.ai/nx-cugraph",
"url": "https://rapids.ai/nx-cugraph",
"short_summary": "GPU-accelerated backend.",
# "description": "TODO",
"functions": {
Expand Down Expand Up @@ -180,7 +180,7 @@
"ego_graph": "Weighted ego_graph with negative cycles is not yet supported. `NotImplementedError` will be raised if there are negative `distance` edge weights.",
"eigenvector_centrality": "`nstart` parameter is not used, but it is checked for validity.",
"from_pandas_edgelist": "cudf.DataFrame inputs also supported; value columns with str is unsuppported.",
"generic_bfs_edges": "`neighbors` and `sort_neighbors` parameters are not yet supported.",
"generic_bfs_edges": "`neighbors` parameter is not yet supported.",
"katz_centrality": "`nstart` isn't used (but is checked), and `normalized=False` is not supported.",
"louvain_communities": "`seed` parameter is currently ignored, and self-loops are not yet supported.",
"pagerank": "`dangling` parameter is not supported, but it is checked for validity.",
Expand Down
3 changes: 1 addition & 2 deletions python/nx-cugraph/nx_cugraph/tests/test_ego_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,14 @@ def test_ego_graph_cycle_graph(
nx.ego_graph(Gnx, n, **kwargs, backend="cugraph")
with pytest.raises(NotImplementedError, match="ego_graph"):
nx.ego_graph(Gcg, n, **kwargs, backend="cugraph")
if _nxver < (3, 4):
if _nxver < (3, 4) or not nx.config.fallback_to_nx:
with pytest.raises(NotImplementedError, match="ego_graph"):
nx.ego_graph(Gcg, n, **kwargs)
else:
# This is an interesting case. `nxcg.ego_graph` is not implemented for
# these arguments, so it falls back to networkx. Hence, as it is currently
# implemented, the input graph is `nxcg.CudaGraph`, but the output graph
# is `nx.Graph`. Should networkx convert back to "cugraph" backend?
# TODO: make fallback to networkx configurable.
H2cg = nx.ego_graph(Gcg, n, **kwargs)
assert type(H2nx) is type(H2cg)
assert_graphs_equal(H2nx, nxcg.from_networkx(H2cg, preserve_all_attrs=True))
Expand Down

0 comments on commit b8ae527

Please sign in to comment.