Skip to content

Add Python simple_cycles with Dask multi-GPU support - #5695

Draft
alexbarghi-nv wants to merge 1 commit into
mainfrom
add-python-simple-cycles-dask
Draft

alexbarghi-nv wants to merge 1 commit into
mainfrom
add-python-simple-cycles-dask

Conversation

@alexbarghi-nv

Copy link
Copy Markdown
Member

Adds the public cuGraph Python integration for the simple-cycles C API and pylibcugraph binding merged in #5669.

cugraph.simple_cycles(G, length_bound, seed_vertices=None) and cugraph.dask.simple_cycles(G, length_bound, seed_vertices=None) enumerate bounded directed cycles. Both return a DataFrame with one row per vertex occurrence and cycle_id, position, and external vertex IDs. These columns preserve cycle membership and directed order when Python unrenumbering shuffles rows; multi-column vertex IDs use the existing unrenumbering convention.

The Dask implementation runs the collective algorithm on every graph worker, keeps distributed seed partitions off the client, supplies non-NULL empty arrays on workers without seeds, and assigns globally unique cycle IDs without gathering cycle counts. It persists results before releasing intermediate futures and propagates worker errors. An empty global seed set returns an empty result before entering libcugraph, whose expensive checks require a nonempty global seed set.

Validation:

  • Added SG and MG GPU tests comparing complete cycle lists with NetworkX, including duplicate detection, length bounds, self-loops, seed filtering, empty seeds, acyclic graphs, int32/int64 vertex types, string and multi-column renumbering, and input validation. SG tests also cover transposed storage; MG tests include a single distributed seed partition so ranks without seeds participate.
  • Ruff lint and formatting checks and git diff --check passed.
  • A local CPU harness passed 18 checks using the actual wrappers and a real two-worker Dask scheduler, substituting NumPy/pandas device storage and simulated pylibcugraph results. It exercised frame conversion, validation, unrenumbering, empty seeds, worker submission, seed partition handling, and worker-error propagation.
  • CUDA, cuDF, and pylibcugraph are unavailable on the local macOS host. The added GPU tests have not been executed locally and require RAPIDS GPU CI, including MNMG validation.

@alexbarghi-nv
alexbarghi-nv requested a review from a team as a code owner October 5, 2026 23:12
@copy-pr-bot

copy-pr-bot Bot commented Oct 5, 2026

Copy link
Copy Markdown

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.

@alexbarghi-nv
alexbarghi-nv marked this pull request as draft October 6, 2026 06:08
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.

1 participant