Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
08fdbba
address comment from part 1 PR
ChuckHastings Jun 10, 2025
af6215d
Next batch of updates, also update MG tests to work in ctest
ChuckHastings Jun 11, 2025
fe1f115
remove some debugging statements, remove FIXME and size check since t…
ChuckHastings Jun 11, 2025
770e85f
Merge branch 'branch-25.08' into variant_work_part2
ChuckHastings Jun 11, 2025
f823b23
Documentation update based on PR comment
ChuckHastings Jun 11, 2025
ffb8ac9
First group of changes for this... clean up some shuffle functions
ChuckHastings Jun 11, 2025
12ef996
Merge branch 'variant_work_part2' into variant_work_part3
ChuckHastings Jun 11, 2025
098a179
move shuffle_wrappers file into source
ChuckHastings Jun 11, 2025
2ff2963
adjust shuffle_vertex_pairs functions
ChuckHastings Jun 12, 2025
ca22513
Merge branch 'branch-25.08' into variant_work_part3
ChuckHastings Jun 12, 2025
f4a4a4b
remove extra copy of shuffle_vertices_with_properties
ChuckHastings Jun 12, 2025
1238da8
change shuffle_and_organize_output to be a non-templated function
ChuckHastings Jun 12, 2025
0456a49
clean up files
ChuckHastings Jun 12, 2025
2ac4adb
rename file
ChuckHastings Jun 12, 2025
a8529a5
move shuffle_wrappers in test files
ChuckHastings Jun 13, 2025
7707e5b
fix bug in MTMG changes
ChuckHastings Jun 13, 2025
a101220
finish updating shuffle_and_organize for sampling output
ChuckHastings Jun 25, 2025
2f45968
Merge branch 'branch-25.08' into variant_work_part4
ChuckHastings Jun 26, 2025
5e42443
Merge branch 'branch-25.08' into variant_work_part4
ChuckHastings Jun 26, 2025
8c3dc5a
more work on shuffle vertex pairs
ChuckHastings Jun 26, 2025
0c247f0
Merge branch 'branch-25.08' into variant_work_part4
ChuckHastings Jun 26, 2025
eee2d8e
Merge remote-tracking branch 'refs/remotes/upstream/variant_work_part…
ChuckHastings Jun 26, 2025
7537304
Close the loop on the shuffle_ext_edges work... remove all references…
ChuckHastings Jun 26, 2025
bd27d77
Merge branch 'branch-25.08' into variant_work_part3
ChuckHastings Jun 26, 2025
3c69ad9
missed update MTMG code
ChuckHastings Jun 27, 2025
6ff43d2
Merge branch 'branch-25.08' into variant_work_part3
ChuckHastings Jun 27, 2025
a1a0727
bug in last commit
ChuckHastings Jun 27, 2025
15b2983
round 1 of PR comments
ChuckHastings Jun 27, 2025
73082d7
refactor shuffle_and_organize signature based on PR review feedback
ChuckHastings Jun 29, 2025
f0865fa
Merge branch 'branch-25.08' into variant_work_part4
ChuckHastings Jun 29, 2025
6c611d9
fix bugs in last push
ChuckHastings Jun 30, 2025
52978f8
fix bug in shuffle change
ChuckHastings Jun 30, 2025
ed201b7
Merge branch 'branch-25.08' into variant_work_part4
ChuckHastings Jun 30, 2025
632c396
sampled edges will always have a size > 2 since have src/dst
ChuckHastings Jun 30, 2025
347427f
missed deleting a function definition, a few cosmetic changes
ChuckHastings Jul 1, 2025
6649d1b
Merge branch 'variant_work_part4' into variant_work_part3
ChuckHastings Jul 1, 2025
30d8070
Merge branch 'branch-25.08' into variant_work_part3
ChuckHastings Jul 1, 2025
71f15cb
a bit more cleanup of shuffle_int_*
ChuckHastings Jul 1, 2025
af93e39
Merge branch 'branch-25.08' into variant_work_part3
ChuckHastings Jul 1, 2025
711b7cc
clean up includes
ChuckHastings Jul 2, 2025
9d1ffe8
Merge branch 'branch-25.08' into variant_work_part3
ChuckHastings Jul 2, 2025
430fa23
error identified in PR review
ChuckHastings Jul 7, 2025
873392a
Bug fix in assert() (#5142)
seunghwak Jul 2, 2025
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
25 changes: 12 additions & 13 deletions cpp/include/cugraph/mtmg/detail/per_device_edgelist.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

#pragma once

#include <cugraph/detail/shuffle_wrappers.hpp>
#include <cugraph/mtmg/handle.hpp>
#include <cugraph/shuffle_functions.hpp>

// FIXME: Could use std::span once compiler supports C++20
#include <raft/core/host_span.hpp>
Expand Down Expand Up @@ -310,23 +310,22 @@ class per_device_edgelist_t {
auto tmp_edge_end_time =
edge_end_time_ ? std::make_optional(std::move((*edge_end_time_)[0])) : std::nullopt;

std::tie(store_transposed ? dst_[0] : src_[0],
store_transposed ? src_[0] : dst_[0],
std::tie(src_[0],
dst_[0],
tmp_wgt,
tmp_edge_id,
tmp_edge_type,
tmp_edge_start_time,
tmp_edge_end_time,
std::ignore) =
cugraph::detail::shuffle_ext_vertex_pairs_with_values_to_local_gpu_by_edge_partitioning(
handle.raft_handle(),
store_transposed ? std::move(dst_[0]) : std::move(src_[0]),
store_transposed ? std::move(src_[0]) : std::move(dst_[0]),
std::move(tmp_wgt),
std::move(tmp_edge_id),
std::move(tmp_edge_type),
std::move(tmp_edge_start_time),
std::move(tmp_edge_end_time));
std::ignore) = cugraph::shuffle_ext_edges(handle.raft_handle(),
std::move(src_[0]),
std::move(dst_[0]),
std::move(tmp_wgt),
std::move(tmp_edge_id),
std::move(tmp_edge_type),
std::move(tmp_edge_start_time),
std::move(tmp_edge_end_time),
store_transposed);

if (tmp_wgt) ((*wgt_)[0]) = std::move(*tmp_wgt);
if (tmp_edge_id) ((*edge_id_)[0]) = std::move(*tmp_edge_id);
Expand Down
41 changes: 2 additions & 39 deletions cpp/include/cugraph/shuffle_functions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/
#pragma once

#include <cugraph/utilities/dataframe_buffer.hpp>

#include <raft/core/handle.hpp>
#include <raft/core/host_span.hpp>

Expand All @@ -30,23 +32,6 @@

namespace cugraph {

/**
* @ingroup shuffle_functions_cpp
* @brief Shuffle external vertex IDs to the owning GPUs (by vertex partitioning)
*
* @deprecated Replaced with shuffle_ext_vertices
*
* @tparam vertex_t Type of vertex identifiers. Needs to be an integral type.
*
* @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and
* handles to various CUDA libraries) to run graph algorithms.
* @param vertices List of vertex ids
* @return Vector of vertex ids mapped to this GPU.
*/
template <typename vertex_t>
rmm::device_uvector<vertex_t> shuffle_external_vertices(raft::handle_t const& handle,
rmm::device_uvector<vertex_t>&& vertices);

/**
* @ingroup shuffle_functions_cpp
* @brief Shuffle external vertex IDs to the owning GPUs (by vertex partitioning)
Expand All @@ -62,28 +47,6 @@ template <typename vertex_t>
rmm::device_uvector<vertex_t> shuffle_ext_vertices(raft::handle_t const& handle,
rmm::device_uvector<vertex_t>&& vertices);

/**
* @ingroup shuffle_functions_cpp
* @brief Shuffle external vertex ID & value pairs to the owning GPUs (by vertex partitioning)
*
* @deprecated Replaced with shuffle_ext_vertex_value_pairs
*
* @tparam vertex_t Type of vertex identifiers. Needs to be an integral type.
* @tparam value_t Type of values. currently supported types are int32_t,
* int64_t, size_t, float and double.
*
* @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and
* handles to various CUDA libraries) to run graph algorithms.
* @param vertices List of vertex ids
* @param values List of values
* @return Tuple of vectors storing vertex ids and values mapped to this GPU.
*/
template <typename vertex_t, typename value_t>
std::tuple<rmm::device_uvector<vertex_t>, rmm::device_uvector<value_t>>
shuffle_external_vertex_value_pairs(raft::handle_t const& handle,
rmm::device_uvector<vertex_t>&& vertices,
rmm::device_uvector<value_t>&& values);

/**
* @ingroup shuffle_functions_cpp
* @brief Shuffle external vertex ID & value pairs to the owning GPUs (by vertex partitioning)
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/c_api/allgather.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023-2024, NVIDIA CORPORATION.
* Copyright (c) 2023-2025, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,13 +19,13 @@
#include "c_api/induced_subgraph_result.hpp"
#include "c_api/resource_handle.hpp"
#include "c_api/utils.hpp"
#include "detail/shuffle_wrappers.hpp"

#include <cugraph_c/algorithms.h>
#include <cugraph_c/graph_generators.h>

#include <cugraph/algorithms.hpp>
#include <cugraph/detail/collect_comm_wrapper.hpp>
#include <cugraph/detail/shuffle_wrappers.hpp>
#include <cugraph/detail/utility_wrappers.hpp>
#include <cugraph/graph_functions.hpp>

Expand Down
2 changes: 1 addition & 1 deletion cpp/src/c_api/decompress_to_edgelist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
#include "c_api/graph.hpp"
#include "c_api/resource_handle.hpp"
#include "c_api/utils.hpp"
#include "detail/shuffle_wrappers.hpp"

#include <cugraph_c/algorithms.h>

#include <cugraph/algorithms.hpp>
#include <cugraph/detail/shuffle_wrappers.hpp>
#include <cugraph/detail/utility_wrappers.hpp>
#include <cugraph/graph_functions.hpp>

Expand Down
3 changes: 2 additions & 1 deletion cpp/src/c_api/ecg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@
* limitations under the License.
*/

#include "detail/shuffle_wrappers.hpp"

#include <cugraph_c/community_algorithms.h>

#include <cugraph/algorithms.hpp>
#include <cugraph/detail/shuffle_wrappers.hpp>
#include <cugraph/detail/utility_wrappers.hpp>
#include <cugraph/graph_functions.hpp>

Expand Down
2 changes: 1 addition & 1 deletion cpp/src/c_api/extract_vertex_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
#include "c_api/graph.hpp"
#include "c_api/resource_handle.hpp"
#include "c_api/utils.hpp"
#include "detail/shuffle_wrappers.hpp"

#include <cugraph_c/algorithms.h>

#include <cugraph/algorithms.hpp>
#include <cugraph/detail/shuffle_wrappers.hpp>
#include <cugraph/detail/utility_wrappers.hpp>
#include <cugraph/graph_functions.hpp>

Expand Down
25 changes: 11 additions & 14 deletions cpp/src/c_api/graph_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
#include "c_api/graph_helper.hpp"
#include "c_api/resource_handle.hpp"
#include "c_api/utils.hpp"
#include "detail/shuffle_wrappers.hpp"

#include <cugraph_c/graph_functions.h>

#include <cugraph/algorithms.hpp>
#include <cugraph/detail/shuffle_wrappers.hpp>
#include <cugraph/detail/utility_wrappers.hpp>
#include <cugraph/graph_functions.hpp>
#include <cugraph/shuffle_functions.hpp>
Expand Down Expand Up @@ -81,19 +81,16 @@ struct create_vertex_pairs_functor : public cugraph::c_api::abstract_functor {
std::ignore,
std::ignore,
std::ignore) =
cugraph::detail::shuffle_ext_vertex_pairs_with_values_to_local_gpu_by_edge_partitioning<
vertex_t,
edge_t,
weight_t,
edge_type_type_t,
int32_t>(handle_,
std::move(first_copy),
std::move(second_copy),
std::nullopt,
std::nullopt,
std::nullopt,
std::nullopt,
std::nullopt);
cugraph::shuffle_ext_edges<vertex_t, edge_t, weight_t, edge_type_type_t, int32_t>(
handle_,
std::move(first_copy),
std::move(second_copy),
std::nullopt,
std::nullopt,
std::nullopt,
std::nullopt,
std::nullopt,
false);
}
// FIXME: use std::tuple (template) instead.
result_ = new cugraph::c_api::cugraph_vertex_pairs_t{
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/c_api/hits.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2024, NVIDIA CORPORATION.
* Copyright (c) 2022-2025, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,11 +18,11 @@
#include "c_api/graph.hpp"
#include "c_api/resource_handle.hpp"
#include "c_api/utils.hpp"
#include "detail/shuffle_wrappers.hpp"

#include <cugraph_c/algorithms.h>

#include <cugraph/algorithms.hpp>
#include <cugraph/detail/shuffle_wrappers.hpp>
#include <cugraph/detail/utility_wrappers.hpp>
#include <cugraph/graph_functions.hpp>

Expand Down
2 changes: 1 addition & 1 deletion cpp/src/c_api/induced_subgraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
#include "c_api/induced_subgraph_result.hpp"
#include "c_api/resource_handle.hpp"
#include "c_api/utils.hpp"
#include "detail/shuffle_wrappers.hpp"

#include <cugraph_c/algorithms.h>

#include <cugraph/algorithms.hpp>
#include <cugraph/detail/shuffle_wrappers.hpp>
#include <cugraph/detail/utility_wrappers.hpp>
#include <cugraph/graph_functions.hpp>

Expand Down
2 changes: 1 addition & 1 deletion cpp/src/c_api/k_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
#include "c_api/graph.hpp"
#include "c_api/resource_handle.hpp"
#include "c_api/utils.hpp"
#include "detail/shuffle_wrappers.hpp"

#include <cugraph_c/algorithms.h>

#include <cugraph/algorithms.hpp>
#include <cugraph/detail/shuffle_wrappers.hpp>
#include <cugraph/detail/utility_wrappers.hpp>
#include <cugraph/graph_functions.hpp>

Expand Down
2 changes: 1 addition & 1 deletion cpp/src/c_api/k_truss.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
#include "c_api/induced_subgraph_result.hpp"
#include "c_api/resource_handle.hpp"
#include "c_api/utils.hpp"
#include "detail/shuffle_wrappers.hpp"

#include <cugraph_c/algorithms.h>

#include <cugraph/algorithms.hpp>
#include <cugraph/detail/shuffle_wrappers.hpp>
#include <cugraph/detail/utility_wrappers.hpp>
#include <cugraph/graph_functions.hpp>

Expand Down
2 changes: 1 addition & 1 deletion cpp/src/c_api/katz.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
#include "c_api/graph.hpp"
#include "c_api/resource_handle.hpp"
#include "c_api/utils.hpp"
#include "detail/shuffle_wrappers.hpp"

#include <cugraph_c/algorithms.h>

#include <cugraph/algorithms.hpp>
#include <cugraph/detail/shuffle_wrappers.hpp>
#include <cugraph/detail/utility_wrappers.hpp>
#include <cugraph/graph_functions.hpp>

Expand Down
2 changes: 1 addition & 1 deletion cpp/src/c_api/leiden.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
#include "c_api/random.hpp"
#include "c_api/resource_handle.hpp"
#include "c_api/utils.hpp"
#include "detail/shuffle_wrappers.hpp"

#include <cugraph_c/community_algorithms.h>

#include <cugraph/algorithms.hpp>
#include <cugraph/detail/shuffle_wrappers.hpp>
#include <cugraph/detail/utility_wrappers.hpp>
#include <cugraph/graph_functions.hpp>

Expand Down
2 changes: 1 addition & 1 deletion cpp/src/c_api/lookup_src_dst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
#include "c_api/graph_helper.hpp"
#include "c_api/resource_handle.hpp"
#include "c_api/utils.hpp"
#include "detail/shuffle_wrappers.hpp"

#include <cugraph_c/algorithms.h>

#include <cugraph/algorithms.hpp>
#include <cugraph/detail/shuffle_wrappers.hpp>
#include <cugraph/detail/utility_wrappers.hpp>
#include <cugraph/graph_functions.hpp>
#include <cugraph/sampling_functions.hpp>
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/c_api/louvain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
#include "c_api/hierarchical_clustering_result.hpp"
#include "c_api/resource_handle.hpp"
#include "c_api/utils.hpp"
#include "detail/shuffle_wrappers.hpp"

#include <cugraph_c/community_algorithms.h>

#include <cugraph/algorithms.hpp>
#include <cugraph/detail/shuffle_wrappers.hpp>
#include <cugraph/detail/utility_wrappers.hpp>
#include <cugraph/graph_functions.hpp>

Expand Down
2 changes: 1 addition & 1 deletion cpp/src/c_api/negative_sampling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
#include "c_api/random.hpp"
#include "c_api/resource_handle.hpp"
#include "c_api/utils.hpp"
#include "detail/shuffle_wrappers.hpp"

#include <cugraph_c/sampling_algorithms.h>

#include <cugraph/algorithms.hpp>
#include <cugraph/detail/shuffle_wrappers.hpp>
#include <cugraph/detail/utility_wrappers.hpp>
#include <cugraph/sampling_functions.hpp>

Expand Down
2 changes: 1 addition & 1 deletion cpp/src/c_api/pagerank.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
#include "c_api/graph.hpp"
#include "c_api/resource_handle.hpp"
#include "c_api/utils.hpp"
#include "detail/shuffle_wrappers.hpp"

#include <cugraph_c/algorithms.h>

#include <cugraph/algorithms.hpp>
#include <cugraph/detail/shuffle_wrappers.hpp>
#include <cugraph/detail/utility_wrappers.hpp>
#include <cugraph/graph_functions.hpp>
#include <cugraph/shuffle_functions.hpp>
Expand Down
5 changes: 3 additions & 2 deletions cpp/src/c_api/random.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023-2024, NVIDIA CORPORATION.
* Copyright (c) 2023-2025, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -13,17 +13,18 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include "c_api/random.hpp"

#include "c_api/abstract_functor.hpp"
#include "c_api/error.hpp"
#include "c_api/graph.hpp"
#include "c_api/resource_handle.hpp"
#include "c_api/utils.hpp"
#include "detail/shuffle_wrappers.hpp"

#include <cugraph_c/algorithms.h>

#include <cugraph/detail/shuffle_wrappers.hpp>
#include <cugraph/utilities/host_scalar_comm.hpp>

namespace {
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/c_api/similarity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
#include "c_api/graph_functions.hpp"
#include "c_api/resource_handle.hpp"
#include "c_api/utils.hpp"
#include "detail/shuffle_wrappers.hpp"

#include <cugraph_c/algorithms.h>

#include <cugraph/algorithms.hpp>
#include <cugraph/detail/shuffle_wrappers.hpp>
#include <cugraph/detail/utility_wrappers.hpp>
#include <cugraph/graph_functions.hpp>
#include <cugraph/shuffle_functions.hpp>
Expand Down
Loading