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

[REVIEW] Fix for bug in SCC on self-loops #1475

Merged
merged 16 commits into from
Mar 23, 2021

Conversation

aschaffer
Copy link
Collaborator

@aschaffer aschaffer commented Mar 21, 2021

This provides fixes for strongly connected components on graphs with self-loops: #1471.

closes #1471

@aschaffer aschaffer requested a review from a team as a code owner March 21, 2021 01:32
@codecov-io
Copy link

codecov-io commented Mar 21, 2021

Codecov Report

Merging #1475 (7190800) into branch-0.19 (ab4b77b) will increase coverage by 0.02%.
The diff coverage is n/a.

❗ Current head 7190800 differs from pull request most recent head 191e8d2. Consider uploading reports for the commit 191e8d2 to get more accurate results
Impacted file tree graph

@@               Coverage Diff               @@
##           branch-0.19    #1475      +/-   ##
===============================================
+ Coverage        59.04%   59.06%   +0.02%     
===============================================
  Files               70       70              
  Lines             3223     3225       +2     
===============================================
+ Hits              1903     1905       +2     
  Misses            1320     1320              
Impacted Files Coverage Δ
python/cugraph/_version.py 44.80% <0.00%> (+0.39%) ⬆️

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 ab4b77b...191e8d2. Read the comment docs.

@BradReesWork BradReesWork added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Mar 22, 2021
@BradReesWork BradReesWork added this to the 0.19 milestone Mar 22, 2021
@BradReesWork
Copy link
Member

rerun tests

Copy link
Contributor

@rlratzel rlratzel left a comment

Choose a reason for hiding this comment

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

I have two minor comments that need not hold up approval if they don't get addressed.

@@ -78,7 +78,7 @@ std::enable_if_t<std::is_signed<VT>::value> connected_components_impl(
stream);
} else {
SCC_Data<ByteT, VT> sccd(nrows, graph.offsets, graph.indices);
sccd.run_scc(labels);
auto num_iters = sccd.run_scc(labels);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this an unused variable, and if so should it be removed? I don't see it anywhere else in the diff.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's useful for debugging and harmless. If you build debug and put a breakpoint there, you immediately get the num_iters, as opposed to having to re-build to provide it. It's not for immediate consumption, but for debugging needs. Does not trigger a warning, so I'd leave it there.

Comment on lines +288 to +289
std::vector<IndexT> cooRowInd{0, 0, 1, 1, 2, 2, 3, 3, 4};
std::vector<IndexT> cooColInd{0, 1, 0, 1, 0, 2, 1, 3, 4};
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for adding the additional tests. I think a FIXME could be added to change these new tests to be parameterized, with input parameters being nrows, the COO col and row indices, and the expected labels and number of components. That would reduce a lot of redundant code and make adding new graphs to test easier.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm not sure what is the desired course of action here. A FIXME saying what? Remember this code path is to be retired (soon). So there's a way bigger FIXME looming here. This would add confusion, I think.

@BradReesWork
Copy link
Member

@gpucibot merge

@rapids-bot rapids-bot bot merged commit 7256f32 into rapidsai:branch-0.19 Mar 23, 2021
@aschaffer aschaffer deleted the bug_ext_scc_loops branch May 6, 2021 15:33
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
Development

Successfully merging this pull request may close these issues.

[BUG] SCC results for graph with loops seems incorrect and does not match Nx nor SciPy
4 participants