Skip to content

[codex] Use cuGraph for Leiden clustering#7

Draft
maarten-devries wants to merge 1 commit into
mainfrom
codex/gpu-leiden-backend
Draft

[codex] Use cuGraph for Leiden clustering#7
maarten-devries wants to merge 1 commit into
mainfrom
codex/gpu-leiden-backend

Conversation

@maarten-devries

Copy link
Copy Markdown
Owner

Summary

  • Replace the CPU igraph Leiden implementation with a cuGraph-backed GPU implementation.
  • Convert sparse neighbor connectivities into a cuDF edge list and run cugraph.leiden with the existing resolution and seed parameters.
  • Add CUDA 12 RAPIDS graph dependencies and update docs/tests for the backend change.

Notes

The old n_jobs resolution sweep used CPU joblib workers. The GPU backend now runs the resolution sweep sequentially and warns when n_jobs is set, avoiding multiple Python workers competing for the same GPU.

Validation

  • uvx ruff format --check src/scib_rapids/metrics/_nmi_ari.py tests/test_metrics.py tests/test_cross_validate.py
  • uvx ruff check src/scib_rapids/metrics/_nmi_ari.py tests/test_metrics.py tests/test_cross_validate.py
  • git diff --check
  • python3 -m py_compile src/scib_rapids/metrics/_nmi_ari.py tests/test_metrics.py tests/test_cross_validate.py

Targeted pytest could not run on this local machine because the local Python environment does not have CUDA RAPIDS packages installed (cupy, cudf, and cugraph were unavailable).

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