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 new primitives: compute_in|out_degrees, compute_in|out_weight_sums to graph_view_t #1394

Merged
merged 10 commits into from
Feb 25, 2021

Conversation

seunghwak
Copy link
Contributor

@seunghwak seunghwak commented Feb 9, 2021

Close #1208

  • add compute_in|out_degrees, compute_in|out_weight_sums
  • replace PageRank's custom code to compute out-weight-sums to use graph_view_t's compute_out_weight_sums
  • add SG C++ tests

@seunghwak
Copy link
Contributor Author

@ChuckHastings FYI, https://github.com/rapidsai/cugraph/blob/branch-0.18/cpp/src/experimental/louvain.cuh#L556 should eventually be replaced with graph_view_t's compute_out_weight_sums(). I am not touching this at this moment assuming you're actively modifying the Louvain code.

@BradReesWork BradReesWork added this to the 0.19 milestone Feb 10, 2021
@BradReesWork BradReesWork added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Feb 10, 2021
@seunghwak seunghwak marked this pull request as ready for review February 12, 2021 05:53
@seunghwak seunghwak requested review from a team as code owners February 12, 2021 05:53
@seunghwak
Copy link
Contributor Author

rerun tests

@seunghwak seunghwak changed the title [skip-ci] Add compute_in|out_degrees, compute_in|out_weight_sums to graph_view_t Add compute_in|out_degrees, compute_in|out_weight_sums to graph_view_t Feb 12, 2021
@seunghwak
Copy link
Contributor Author

rerun tests

@codecov-io
Copy link

codecov-io commented Feb 12, 2021

Codecov Report

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

Impacted file tree graph

@@              Coverage Diff               @@
##             branch-0.19    #1394   +/-   ##
==============================================
  Coverage               ?   60.75%           
==============================================
  Files                  ?       70           
  Lines                  ?     3134           
  Branches               ?        0           
==============================================
  Hits                   ?     1904           
  Misses                 ?     1230           
  Partials               ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 591b5e7...64b0f8c. Read the comment docs.

Copy link
Member

@afender afender left a comment

Choose a reason for hiding this comment

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

We need to create an issue to update the python bindings and delete the legacy version of degree functions.

compute_out_degrees(raft::handle_t const& handle) const
{
if (store_transposed) {
return compute_minor_degrees(handle, *this);
Copy link
Member

@afender afender Feb 18, 2021

Choose a reason for hiding this comment

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

I noticed we have started to use minor/major terminology but seeing this here used concurrently with src/dst and in/out terminology makes me wonder if that's really helping. We should try to stick to the smallest possible set of names that refer to the same thing.
Reconciling this is beyond this PR, we should have a separate issue/PR for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So the origin of minor/major might be from https://github.com/rapidsai/cugraph/blob/branch-0.19/cpp/include/patterns/copy_v_transform_reduce_in_out_nbr.cuh and this terminology has been used since the start of graph primitives.

This was introduced mainly for source code reuse, noting that iterating over incoming edges when the graph adjacency matrix is stored as is (CSR) and iterating over outgoing edges when the graph adjacency matrix stored as transposed (CSC) can be implemented using the same code.

Yeah... we may open a several issue and we may need to go through more intense discussion on terminologies as these are now used all over the graph primitives. If there is a clear benefit to make a switch, yes we should make a switch, but I assume there should be a very strong justification.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And this might be a much bigger discussion, but we may later more intensively investigate the performance benefit of storing graph adjacency matrix as transposed.

This was mainly introduced to avoid atomics, but AFAIK, GPU's performance on atomics has improved drastically in the past some years and if the performance gain is not large enough, we may reconsider this issue. If the performance gain is marginal, dropping this will significantly simplify our codebase.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And this terminology issue will become irrelevant.

Copy link
Member

Choose a reason for hiding this comment

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

Sounds good to me. Thanks for elaborating. Let's open an issue to keep track of this.

@BradReesWork BradReesWork changed the title Add compute_in|out_degrees, compute_in|out_weight_sums to graph_view_t Add new primitives: compute_in|out_degrees, compute_in|out_weight_sums to graph_view_t Feb 25, 2021
@BradReesWork
Copy link
Member

@gpucibot merge

@rapids-bot rapids-bot bot merged commit 5589605 into rapidsai:branch-0.19 Feb 25, 2021
rapids-bot bot pushed a commit that referenced this pull request Mar 30, 2021
…1423)

Implement the `update_by_delta_modularity` method using the new graph primitives and pattern accelerators.

This eliminates all of the custom MNMG implementation originally created for MNMG Louvain a few releases ago and replaces it with the new pattern accelerator and graph primitives that have been added in the last couple of releases.

This depends on the following PRs and should not be merged until after them:
* #1394 
* #1399 

closes #1220

Authors:
  - Chuck Hastings (@ChuckHastings)

Approvers:
  - Andrei Schaffer (@aschaffer)
  - Seunghwa Kang (@seunghwak)
  - Rick Ratzel (@rlratzel)
  - Alex Fender (@afender)

URL: #1423
@seunghwak seunghwak deleted the fea_degree branch June 24, 2021 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement / enhancement to an existing function non-breaking Non-breaking change
Projects
None yet
5 participants