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

Update vertex_frontier_t to take unsorted (tagged-)vertex list with possible duplicates #2584

Merged
merged 7 commits into from
Aug 24, 2022

Conversation

seunghwak
Copy link
Contributor

@seunghwak seunghwak commented Aug 12, 2022

Partially address #2580

Update vertex_frontier_t to take unsorted input (tagged-)vertex list with possible duplicates.

This will be used to define a selection primitive. The primitive needs to take a (tagged-)vertex list to support Node2Vec style algorithms (tagged with the predecessor vertex ID or some derived property from the current vertex predecessor vertex pairs).

Breaking as primitives API has been changed (vertex_frontier_t and transform_reduce_v_frontier_outgoing_e_by_dst).

@seunghwak seunghwak requested a review from a team as a code owner August 12, 2022 20:35
@seunghwak seunghwak changed the title Enh vertex frontier Update vertex_frontier_t to take unsorted (tagged-)vertex list with possible duplicates Aug 12, 2022
@seunghwak seunghwak self-assigned this Aug 12, 2022
@seunghwak seunghwak added 3 - Ready for Review improvement Improvement / enhancement to an existing function breaking Breaking change labels Aug 12, 2022
@seunghwak seunghwak added this to the 22.10 milestone Aug 12, 2022
@seunghwak seunghwak requested a review from naimnv August 16, 2022 16:28
@seunghwak
Copy link
Contributor Author

rerun tests

@ChuckHastings
Copy link
Collaborator

rerun tests

@codecov-commenter
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (branch-22.10@73e66a1). Click here to learn what that means.
The diff coverage is n/a.

@@               Coverage Diff               @@
##             branch-22.10    #2584   +/-   ##
===============================================
  Coverage                ?   61.11%           
===============================================
  Files                   ?      106           
  Lines                   ?     5634           
  Branches                ?        0           
===============================================
  Hits                    ?     3443           
  Misses                  ?     2191           
  Partials                ?        0           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Contributor

@naimnv naimnv left a comment

Choose a reason for hiding this comment

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

Looks good to me. Had to look into the return type of thrust::unique, otherwise changes are easy to follow.

        merged_vertices.resize(
          thrust::distance(merged_pair_first,
                           thrust::unique(handle_ptr_->get_thrust_policy(),
                                          merged_pair_first,
                                          merged_pair_first + merged_vertices.size())),

@seunghwak
Copy link
Contributor Author

Looks good to me. Had to look into the return type of thrust::unique, otherwise changes are easy to follow.

        merged_vertices.resize(
          thrust::distance(merged_pair_first,
                           thrust::unique(handle_ptr_->get_thrust_policy(),
                                          merged_pair_first,
                                          merged_pair_first + merged_vertices.size())),

You'll soon get very familiar with thrust (as you now already know, cuGraph is basically thrust + primitives).

@ChuckHastings
Copy link
Collaborator

@gpucibot merge

@rapids-bot rapids-bot bot merged commit b0837f7 into rapidsai:branch-22.10 Aug 24, 2022
rapids-bot bot pushed a commit that referenced this pull request Aug 25, 2022
Partially address #2580.

This PR is dependent on #2584.

This PR defines API for two selection primitives, one for the biased sampling/random walk and another for uniform random sampling/random walk.

@ChuckHastings For Node2Vec style random walk,

We can compute intersections for each (previous vertex, current vertex pairs).

We need to first create a non-detail space primitive calling detail::nbr_intersection (https://github.com/rapidsai/cugraph/blob/branch-22.10/cpp/src/prims/detail/nbr_intersection.cuh#L492) for given vertex pairs (this can be used for Jaccard and Overlap coefficients as well).

In MG, each GPU should store neighbor intersection outputs for the relevant source/destination ranges (not sure whether should we create additional utility functions to handle this, or this may not be a recurring pattern, so just leave this task much more as a dark magic for advanced users who understand how the 2D partitioning actually works). May go for the latter till we see this pattern occurring in other places.

Once we have neighbor intersection outputs and previous vertex IDs for the relevant (previous vertex ID, current vertex ID) pairs, we can create `frontier` having tagged-current vertex ID values (tag is an index to access previous vertex ID and neighbor intersection outputs for the perv vertex, current vertex pair).

Then, `e_bias_op` can check whether the outgoing neighbor belongs to the intersection or coincides with the previous vertex to properly set bias values.

Authors:
  - Seunghwa Kang (https://github.com/seunghwak)

Approvers:
  - Chuck Hastings (https://github.com/ChuckHastings)
  - Joseph Nke (https://github.com/jnke2016)

URL: #2586
@seunghwak seunghwak deleted the enh_vertex_frontier branch August 25, 2022 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Breaking change improvement Improvement / enhancement to an existing function
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants