Skip to content

Strongly Connected Components (Find trivial SCCs in components & Intersect reachable sets)#5448

Closed
ngokulakrish wants to merge 39 commits intorapidsai:mainfrom
ngokulakrish:fea_scc2
Closed

Strongly Connected Components (Find trivial SCCs in components & Intersect reachable sets)#5448
ngokulakrish wants to merge 39 commits intorapidsai:mainfrom
ngokulakrish:fea_scc2

Conversation

@ngokulakrish
Copy link
Copy Markdown
Contributor

@ngokulakrish ngokulakrish commented Feb 27, 2026

This is an additional PR for SCC which implements the intersect reachable sets function, to find the unresolved components for the next iteration of FW-BW algorithm. Implementation for optimization to recursively trim trivial SCCs in components before running FW-BW pass.

Should be reviewed/merged after #5442

@ngokulakrish ngokulakrish requested review from a team as code owners February 27, 2026 04:40
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented Feb 27, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@ngokulakrish ngokulakrish changed the title Strongly Connected Components (Find trivial SCCs in components) [WIP] Strongly Connected Components (Find trivial SCCs in components) Feb 27, 2026
@ngokulakrish ngokulakrish requested a review from a team as a code owner February 28, 2026 01:44
Comment thread cpp/src/components/strongly_connected_components_impl.cuh Outdated
Comment thread cpp/src/components/strongly_connected_components_impl.cuh Outdated
Comment thread cpp/src/components/strongly_connected_components_impl.cuh Outdated
@seunghwak
Copy link
Copy Markdown
Contributor

And #5442 updates only 11 files. I see updates in 22 files in this PR. Did you make any updates outside strongly_connected_components_impl.cuh?

Comment thread cpp/src/components/strongly_connected_components_impl.cuh Outdated
Comment thread cpp/src/components/strongly_connected_components_impl.cuh Outdated
bwd_only_vertices.resize(count, handle.get_stream());
}

// 4. FWD_OR_BWD = FWD ∪ BWD (needed to compute REMAINDER)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You may merge 4 and 5. What we need to compute is UC - (FWD U BWD)

Comment thread cpp/src/components/strongly_connected_components_impl.cuh Outdated
Comment thread cpp/src/components/strongly_connected_components_impl.cuh Outdated
Comment thread cpp/src/components/strongly_connected_components_impl.cuh Outdated
Comment thread cpp/src/components/strongly_connected_components_impl.cuh Outdated
Comment thread cpp/src/components/strongly_connected_components_impl.cuh Outdated
Comment thread cpp/src/components/strongly_connected_components_impl.cuh Outdated
Comment thread cpp/src/components/strongly_connected_components_impl.cuh Outdated
component_local_min_vertex_ids.size(),
raft::comms::op_t::MIN,
handle.get_stream());
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Two things to consider here.

  1. FWD only, BWD only, Remaining - (FWD U BWD) become next unresolved component if there size is larger than 1.
    If the size = 1, they are trivial SCCs as well. And some components might have size 0 as well. They should be discarded.

In multi-GPU, we need call device_allreduce to find the total number of vertices in the next unresolved component candidates.

  1. For the next iteration, we need to update new

unresolved_component_offsets
unresolved_component_vertices

pairs. In multi-GPU, unresolved_compoent_offsets.size() = # global number of unresolved components + 1.
And vertices in each GPU should be placed based on this offset array.

I think this function is the best place to achieve this.

We have an array of size # (old) unresolved components * 4 (or 3 if we disregard SCCs). If we create an array of the same size and set the value to 1 if the global size is > 1 (i.e. new unresolved component) and set the value to 0 if the global size <= 1 (i.e. SCC or empty).

Then, we run thrust::exclusive_scan. Then, we can map the position in the above array to the new unresolved component index (which is used to access the new unresolved_component_offsets).

Then, at the end, we can just resize the return value of this function (to exclude the SCCs) and start the next iteration.

rapids-bot Bot pushed a commit that referenced this pull request Mar 16, 2026
SCC implementation Part 1.

Part 2 (trimming & set intersection) is provided in #5448

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

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

URL: #5442
@ngokulakrish ngokulakrish changed the title [WIP] Strongly Connected Components (Find trivial SCCs in components) Strongly Connected Components (Find trivial SCCs in components & Intersect reachable sets) Mar 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants