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

Temporal sampling implementation, still debugging #4994

Draft
wants to merge 6 commits into
base: branch-25.04
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
19 changes: 17 additions & 2 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,13 @@ endif()
# which should give us a better parallel schedule.

set(CUGRAPH_SOURCES
src/sampling/temporal_sampling_sg_v32_e32.cu
src/sampling/temporal_sampling_sg_v64_e64.cu
src/utilities/shuffle_vertices_mg_v32_fp.cu
src/utilities/shuffle_vertices_mg_v32_integral.cu
src/utilities/shuffle_vertices_mg_v64_fp.cu
src/utilities/shuffle_vertices_mg_v64_integral.cu
src/utilities/validation_checks.cu
src/detail/permute_range_v32.cu
src/detail/permute_range_v64.cu
src/utilities/shuffle_vertex_pairs_mg_v32_e32.cu
Expand Down Expand Up @@ -262,12 +265,24 @@ set(CUGRAPH_SOURCES
src/sampling/detail/check_edge_bias_values_sg_v32_e32.cu
src/sampling/detail/check_edge_bias_values_mg_v64_e64.cu
src/sampling/detail/check_edge_bias_values_mg_v32_e32.cu
src/sampling/detail/temporal_partition_vertices_v64.cu
src/sampling/detail/temporal_partition_vertices_v32.cu
src/sampling/detail/sample_edges_sg_v64_e64.cu
src/sampling/detail/sample_edges_sg_v32_e32.cu
src/sampling/detail/sample_edges_mg_v64_e64.cu
src/sampling/detail/sample_edges_mg_v32_e32.cu
src/sampling/detail/shuffle_and_organize_output_mg_v64_e64.cu
src/sampling/detail/shuffle_and_organize_output_mg_v32_e32.cu
src/sampling/detail/temporal_sample_edges_sg_v64_e64.cu
src/sampling/detail/temporal_sample_edges_sg_v32_e32.cu
src/sampling/detail/temporal_sample_edges_mg_v64_e64.cu
src/sampling/detail/temporal_sample_edges_mg_v32_e32.cu
src/sampling/detail/shuffle_and_organize_output_mg_v64_e64_t32_w32.cu
src/sampling/detail/shuffle_and_organize_output_mg_v32_e32_t32_w32.cu
src/sampling/detail/shuffle_and_organize_output_mg_v64_e64_t32_w64.cu
src/sampling/detail/shuffle_and_organize_output_mg_v32_e32_t32_w64.cu
src/sampling/detail/shuffle_and_organize_output_mg_v64_e64_t64_w32.cu
src/sampling/detail/shuffle_and_organize_output_mg_v32_e32_t64_w32.cu
src/sampling/detail/shuffle_and_organize_output_mg_v64_e64_t64_w64.cu
src/sampling/detail/shuffle_and_organize_output_mg_v32_e32_t64_w64.cu
src/sampling/neighbor_sampling_mg_v32_e32.cu
src/sampling/neighbor_sampling_mg_v64_e64.cu
src/sampling/neighbor_sampling_sg_v32_e32.cu
Expand Down
27 changes: 27 additions & 0 deletions cpp/include/cugraph/detail/shuffle_wrappers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,33 @@ shuffle_int_vertex_value_pairs_to_local_gpu_by_vertex_partitioning(
rmm::device_uvector<value_t>&& values,
raft::host_span<vertex_t const> vertex_partition_range_lasts);

/**
* @ingroup shuffle_wrappers_cpp
* @brief Shuffle vertices using the internal vertex key function which returns the target GPU ID.
*
* @tparam vertex_t Type of vertex identifiers. Needs to be an integral type.
* @tparam value1_t Type of first vertex values. Needs to be an integral type.
* @tparam value2_t Type of second vertex values. Needs to be an integral type.
*
* @param[in] handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator,
* @param[in] vertices Vertex IDs to shuffle
* @param[in] values1 First Vertex Values to shuffle
* @param[in] values2 Second Vertex Values to shuffle
* @param[in] vertex_partition_range_lasts From graph view, vector of last vertex id for each gpu
*
* @return tuple containing device vector of shuffled vertices and device vectors of corresponding
* values
*/
template <typename vertex_t, typename value1_t, typename value2_t>
std::
tuple<rmm::device_uvector<vertex_t>, rmm::device_uvector<value1_t>, rmm::device_uvector<value2_t>>
shuffle_int_vertex_two_value_pairs_to_local_gpu_by_vertex_partitioning(
raft::handle_t const& handle,
rmm::device_uvector<vertex_t>&& vertices,
rmm::device_uvector<value1_t>&& values1,
rmm::device_uvector<value2_t>&& values2,
raft::host_span<vertex_t const> vertex_partition_range_lasts);

/**
* @ingroup shuffle_wrappers_cpp
* @brief Groupby and count edgelist using the key function which returns the target local partition
Expand Down
13 changes: 13 additions & 0 deletions cpp/include/cugraph/edge_property.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <thrust/iterator/iterator_traits.h>

#include <optional>
#include <tuple>
#include <type_traits>

namespace cugraph {
Expand Down Expand Up @@ -202,4 +203,16 @@ auto view_concat(edge_property_view_t<edge_t, Iters, Types> const&... views)
edge_partition_concat_value_firsts, first_view.edge_counts());
}

template <typename... Ts, std::size_t... Is>
auto view_concat_impl(std::tuple<Ts...> const& tuple, std::index_sequence<Is...>)
{
return view_concat(std::get<Is>(tuple)...);
}

template <typename... Ts>
auto view_concat(std::tuple<Ts...> const& tuple)
{
return view_concat_impl(tuple, std::index_sequence_for<Ts...>{});
}

} // namespace cugraph
Loading