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

Add support to create temporal graphs #4819

Draft
wants to merge 6 commits into
base: branch-25.02
Choose a base branch
from

Conversation

ChuckHastings
Copy link
Collaborator

@ChuckHastings ChuckHastings commented Dec 9, 2024

Adds two optional edge properties (edge_start_times and edge_end_times) that can be used to represent times when edges are active in the graph. This will support providing views of the graph at a particular time, or using edge times to control traversal in a reasonable time order.

This PR is still awaiting C++ unit tests for temporal graphs, but the logic is fully implemented.

Marked as breaking. Most of the old APIs are still supported, but since I updated all of the tests to use the new APIs, we don't actually test the old APIs.

Copy link

copy-pr-bot bot commented Dec 9, 2024

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@ChuckHastings ChuckHastings self-assigned this Dec 9, 2024
@ChuckHastings ChuckHastings added this to the 25.02 milestone Dec 9, 2024
@ChuckHastings ChuckHastings added the breaking Breaking change label Dec 9, 2024
Copy link
Contributor

@seunghwak seunghwak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation looks reasonable to me.

Commented about documentation & cosmetic issues.

Haven't reviewed the test code yet.

@@ -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
Copy link
Contributor

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?

@@ -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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent with the documentation above.

 * @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.

Should this better be "vetex pair edge start/end time values'' for consistency?

@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation missing for edge_t, edge_type_t & edge_time_t.

@@ -406,14 +406,27 @@ decompress_to_edgelist(
* std::optional<rmm::device_uvector<weight_t>>> Tuple of symmetrized sources, destinations, and
* optional weights (if @p edgelist_weights is valid).
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation needs updates.

* @tparam edge_t Type of edge identifiers. Needs to be an integral type.
* @tparam weight_t Type of edge weight. Needs to be floating point type
* @tparam edge_type_t Type of edge type. Needs to be an integral type, currently only int32_t is
* supported
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation missing for edge_time_t.

static_cast<size_t>(thrust::distance(lower_triangular_last, diagonal_last));
}

if (edgelist_edge_ids) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be else if.

edgelist_weights->begin(),
tmp.begin());

thrust::copy(handle.get_thrust_policy(), tmp.begin(), tmp.end(), edgelist_weights->begin());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

= std::move(tmp);

num_lower_triangular_edges,
reciprocal);
}
if (edgelist_edge_ids) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This cane be else if.

mem_frugal_threshold,
handle.get_stream());
}

if (edge_ids) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be else if.

weights->begin(),
tmp.begin());

thrust::copy(handle.get_thrust_policy(), tmp.begin(), tmp.end(), weights->begin());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

= std::move(tmp);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants