Skip to content

Adopt CUDA stream compatibility accessors - #3136

Open
bdice wants to merge 7 commits into
NVIDIA:mainfrom
bdice:cuda-stream-ref-prep
Open

Adopt CUDA stream compatibility accessors#3136
bdice wants to merge 7 commits into
NVIDIA:mainfrom
bdice:cuda-stream-ref-prep

Conversation

@bdice

@bdice bdice commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Use the get() and sync() compatibility aliases added in RMM #2537. These spellings are shared by rmm::cuda_stream_view and cuda::stream_ref.

This preserves existing stream types and public APIs while extracting mechanical accessor updates from the broader stream migration. It is independently buildable without RMM #2372 and leaves the migration PR focused on actual type and signature changes.

This updates raw CUDA, library, kernel-launch, and legacy API boundaries throughout RAFT and uses the CUDA stream umbrella header where stream definitions are required. Existing rmm::cuda_stream_view return types remain unchanged; their migration stays in RAFT #3129.

@copy-pr-bot

copy-pr-bot Bot commented Sep 5, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@bdice
bdice force-pushed the cuda-stream-ref-prep branch from 72b7fbd to 5fbe443 Compare September 5, 2026 02:43
@bdice

bdice commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

Validated this preparation branch against RMM upstream/main: the local -j0 build completed and focused select-k tests passed. The dependent migration PR #3129 has been rebased onto this branch.

@bdice
bdice marked this pull request as ready for review September 5, 2026 20:02
@bdice
bdice requested a review from a team as a code owner September 5, 2026 20:02
@bdice bdice added the improvement Improvement / enhancement to an existing function label Sep 5, 2026
@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: a6d7403b-509b-4b7c-bce7-3d506caaf1c8

📥 Commits

Reviewing files that changed from the base of the PR and between f356e94 and 51a2375.

📒 Files selected for processing (3)
  • cpp/include/raft/comms/detail/mpi_comms.hpp
  • cpp/include/raft/linalg/strided_reduction.cuh
  • cpp/include/raft/solver/linear_assignment.cuh

Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review.


📝 Summary

Summary by CodeRabbit

  • Bug Fixes

    • Improved CUDA stream interoperability across communication, linear algebra, matrix, random, sparse, spectral, and statistics operations.
    • Ensured asynchronous GPU operations consistently receive valid native stream handles.
    • Updated stream synchronization behavior for more reliable CUDA execution.
  • Chores

    • Replaced deprecated CUDA stream header usage with the current stream interface.
    • Updated GPU operation validation coverage without changing public APIs or numerical behavior.

Walkthrough

Changes

CUDA stream handle migration

Layer / File(s) Summary
Production stream handle conversion
cpp/include/raft/**, cpp/src/**
Production code now passes raw cudaStream_t values from stream wrappers through .get(). Deprecated cuda/stream_ref includes and .value() access are replaced.
Test and benchmark stream conversion
cpp/tests/**, cpp/bench/**
Tests and benchmarks now pass raw CUDA stream handles to CUDA, RAFT, RMM, and library APIs. Updated synchronization calls use sync().

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 51a23

This updates CUDA stream compatibility accessors while preserving existing stream behavior and public interfaces; no actionable merge risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 26.73% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 101 functions across 66 files. (2 skipped… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adopting CUDA stream compatibility accessors across RAFT.
Description check ✅ Passed The description directly explains the compatibility accessor updates, preserved APIs, affected boundaries, and migration scope.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 26.73% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 101 functions across 66 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@bdice bdice added the non-breaking Non-breaking change label Sep 5, 2026
@bdice

bdice commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

CI exposed benchmark targets that the default local build did not compile. The preparation branch now adds the missing raw-stream accessors at those benchmark boundaries (f356e946). Validation:

  • build-raft -j0 passes against the current RMM dependency
  • all primitive benchmark targets pass with ninja -C cpp/build -j0 after configuring bench-prims against RMM main
  • focused pre-commit hooks pass with copyright-only churn excluded

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.

1 participant