-
Notifications
You must be signed in to change notification settings - Fork 310
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
Add support to create temporal graphs #4819
base: branch-25.02
Are you sure you want to change the base?
Changes from 5 commits
373627b
818f21f
55ddb04
ef18f75
8332626
e16ddc2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,9 @@ | |
namespace cugraph { | ||
namespace detail { | ||
|
||
// FIXME: Consider moving this file (or most of this file) into the src directory... | ||
// at least some of these functions don't really belong in the public API | ||
|
||
/** | ||
* @brief Shuffle external (i.e. before renumbering) vertex pairs (which can be edge end points) to | ||
* their local GPUs based on edge partitioning. | ||
|
@@ -33,6 +36,7 @@ namespace detail { | |
* @tparam edge_t Type of edge identifiers. Needs to be an integral type. | ||
* @tparam weight_t Type of edge weights. Needs to be a floating point type. | ||
* @tparam edge_type_t Type of edge type identifiers. Needs to be an integral type. | ||
* @tparam edge_time_t The type of the edge time stamp | ||
* | ||
* @param[in] handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, | ||
* and handles to various CUDA libraries) to run graph algorithms. | ||
|
@@ -44,24 +48,34 @@ namespace detail { | |
* @param[in] weights Optional vector of vertex pair weight values. | ||
* @param[in] edge_ids Optional vector of vertex pair edge id values. | ||
* @param[in] edge_types Optional vector of vertex pair edge type values. | ||
* @param[in] edge_start_times Optional vector of vertex pair edge start time values. | ||
* @param[in] edge_end_times Optional vector of vertex pair edge end time values. | ||
* | ||
* @return Tuple of vectors storing shuffled major vertices, minor vertices and optional weights, | ||
* edge ids and edge types | ||
*/ | ||
template <typename vertex_t, typename edge_t, typename weight_t, typename edge_type_id_t> | ||
template <typename vertex_t, | ||
typename edge_t, | ||
typename weight_t, | ||
typename edge_type_t, | ||
typename edge_time_t> | ||
std::tuple<rmm::device_uvector<vertex_t>, | ||
rmm::device_uvector<vertex_t>, | ||
std::optional<rmm::device_uvector<weight_t>>, | ||
std::optional<rmm::device_uvector<edge_t>>, | ||
std::optional<rmm::device_uvector<edge_type_id_t>>, | ||
std::optional<rmm::device_uvector<edge_type_t>>, | ||
std::optional<rmm::device_uvector<edge_time_t>>, | ||
std::optional<rmm::device_uvector<edge_time_t>>, | ||
std::vector<size_t>> | ||
shuffle_ext_vertex_pairs_with_values_to_local_gpu_by_edge_partitioning( | ||
raft::handle_t const& handle, | ||
rmm::device_uvector<vertex_t>&& majors, | ||
rmm::device_uvector<vertex_t>&& minors, | ||
std::optional<rmm::device_uvector<weight_t>>&& weights, | ||
std::optional<rmm::device_uvector<edge_t>>&& edge_ids, | ||
std::optional<rmm::device_uvector<edge_type_id_t>>&& edge_types); | ||
std::optional<rmm::device_uvector<edge_type_t>>&& edge_types, | ||
std::optional<rmm::device_uvector<edge_time_t>>&& edge_start_times, | ||
std::optional<rmm::device_uvector<edge_time_t>>&& edge_end_times); | ||
|
||
/** | ||
* @brief Shuffle internal (i.e. renumbered) vertex pairs (which can be edge end points) to their | ||
|
@@ -71,6 +85,7 @@ shuffle_ext_vertex_pairs_with_values_to_local_gpu_by_edge_partitioning( | |
* @tparam edge_t Type of edge identifiers. Needs to be an integral type. | ||
* @tparam weight_t Type of edge weights. Needs to be a floating point type. | ||
* @tparam edge_type_t Type of edge type identifiers. Needs to be an integral type. | ||
* @tparam edge_time_t Type of edge time. Needs to be an integral type. | ||
* | ||
* @param[in] handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, | ||
* and handles to various CUDA libraries) to run graph algorithms. | ||
|
@@ -82,27 +97,37 @@ shuffle_ext_vertex_pairs_with_values_to_local_gpu_by_edge_partitioning( | |
* @param[in] weights Optional vector of vertex pair weight values. | ||
* @param[in] edge_ids Optional vector of vertex pair edge id values. | ||
* @param[in] edge_types Optional vector of vertex pair edge type values. | ||
* @param[in] edge_start_times Optional vector of vertex pair start time values. | ||
* @param[in] edge_end_times Optional vector of vertex pair end time values. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Inconsistent with the documentation above.
Should this better be "vetex pair edge start/end time values'' for consistency? |
||
* | ||
* @param[in] vertex_partition_range_lasts Vector of each GPU's vertex partition range's last | ||
* (exclusive) vertex ID. | ||
* | ||
* @return Tuple of vectors storing shuffled major vertices, minor vertices and optional weights, | ||
* edge ids and edge types and rx counts | ||
*/ | ||
template <typename vertex_t, typename edge_t, typename weight_t, typename edge_type_id_t> | ||
template <typename vertex_t, | ||
typename edge_t, | ||
typename weight_t, | ||
typename edge_type_t, | ||
typename edge_time_t> | ||
std::tuple<rmm::device_uvector<vertex_t>, | ||
rmm::device_uvector<vertex_t>, | ||
std::optional<rmm::device_uvector<weight_t>>, | ||
std::optional<rmm::device_uvector<edge_t>>, | ||
std::optional<rmm::device_uvector<edge_type_id_t>>, | ||
std::optional<rmm::device_uvector<edge_type_t>>, | ||
std::optional<rmm::device_uvector<edge_time_t>>, | ||
std::optional<rmm::device_uvector<edge_time_t>>, | ||
std::vector<size_t>> | ||
shuffle_int_vertex_pairs_with_values_to_local_gpu_by_edge_partitioning( | ||
raft::handle_t const& handle, | ||
rmm::device_uvector<vertex_t>&& majors, | ||
rmm::device_uvector<vertex_t>&& minors, | ||
std::optional<rmm::device_uvector<weight_t>>&& weights, | ||
std::optional<rmm::device_uvector<edge_t>>&& edge_ids, | ||
std::optional<rmm::device_uvector<edge_type_id_t>>&& edge_types, | ||
std::optional<rmm::device_uvector<edge_type_t>>&& edge_types, | ||
std::optional<rmm::device_uvector<edge_time_t>>&& edge_start_times, | ||
std::optional<rmm::device_uvector<edge_time_t>>&& edge_end_times, | ||
std::vector<vertex_t> const& vertex_partition_range_lasts); | ||
|
||
/** | ||
|
@@ -220,7 +245,10 @@ shuffle_int_vertex_value_pairs_to_local_gpu_by_vertex_partitioning( | |
* @param[in,out] d_edgelist_minors Vertex IDs for destinations (if we are internally storing edges | ||
* in the sparse 2D matrix using sources as major indices) or sources (otherwise) | ||
* @param[in,out] d_edgelist_weights Optional edge weights | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Documentation missing for edge_t, edge_type_t & edge_time_t. |
||
* @param[in,out] d_edgelist_id_type_pairs Optional edge (ID, type) pairs | ||
* @param[in,out] d_edgelist_ids Optional edge ids | ||
* @param[in,out] d_edgelist_types Optional edge types | ||
* @param[in,out] d_edgelist_start_times Optional edge start times | ||
* @param[in,out] d_edgelist_end_times Optional edge end times | ||
* @param[in] groupby_and_count_local_partition_by_minor If set to true, groupby and count edges | ||
* based on (local partition ID, GPU ID) pairs (where GPU IDs are computed by applying the | ||
* compute_gpu_id_from_vertex_t function to the minor vertex ID). If set to false, groupby and count | ||
|
@@ -230,14 +258,20 @@ shuffle_int_vertex_value_pairs_to_local_gpu_by_vertex_partitioning( | |
* groupby_and_count_local_partition is false) or in each segment with the same (local partition ID, | ||
* GPU ID) pair. | ||
*/ | ||
template <typename vertex_t, typename edge_t, typename weight_t, typename edge_type_t> | ||
template <typename vertex_t, | ||
typename edge_t, | ||
typename weight_t, | ||
typename edge_type_t, | ||
typename edge_time_t> | ||
rmm::device_uvector<size_t> groupby_and_count_edgelist_by_local_partition_id( | ||
raft::handle_t const& handle, | ||
rmm::device_uvector<vertex_t>& d_edgelist_majors, | ||
rmm::device_uvector<vertex_t>& d_edgelist_minors, | ||
std::optional<rmm::device_uvector<weight_t>>& d_edgelist_weights, | ||
std::optional<rmm::device_uvector<edge_t>>& d_edgelist_edge_ids, | ||
std::optional<rmm::device_uvector<edge_type_t>>& d_edgelist_edge_types, | ||
std::optional<rmm::device_uvector<edge_time_t>>& d_edgelist_edge_start_times, | ||
std::optional<rmm::device_uvector<edge_time_t>>& d_edgelist_edge_end_times, | ||
bool groupby_and_count_local_partition_by_minor = false); | ||
|
||
/** | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent with the documentation below.
@tparam edge_time_t Type of edge time. Needs to be an integral type.
Should this be the integral type as well?