Skip to content

Migrate stream APIs from rmm::cuda_stream_view to cuda::stream_ref - #1181

Open
bdice wants to merge 3 commits into
rapidsai:mainfrom
bdice:cuda-stream-ref
Open

Migrate stream APIs from rmm::cuda_stream_view to cuda::stream_ref#1181
bdice wants to merge 3 commits into
rapidsai:mainfrom
bdice:cuda-stream-ref

Conversation

@bdice

@bdice bdice commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

Track the coordinated migration of stream APIs and call sites from rmm::cuda_stream_view to CCCL's cuda::stream_ref. This propagates cuda::stream_ref through RMM containers and memory resources, RAFT resource and handle APIs, downstream C++ interfaces, Python/Cython bindings, benchmarks, tests, and documentation.

This updates RapidsMPF C++ and Python/Cython stream handling to preserve references returned by RMM stream pools and extract raw handles only where required.

Depends on rapidsai/rmm#2372.

Tracked in rapidsai/build-planning#318.

Migrations

  • Pass cuda::stream_ref through stream pools, resource accessors, conditionals, and downstream APIs without converting to rmm::cuda_stream_view
  • Use cuda::stream_ref constructions for default/legacy/per-thread streams
    • rmm::cuda_stream_default ➡️ cuda::stream_ref{cudaStream_t{cudaStreamDefault}}
    • rmm::cuda_stream_legacy ➡️ cuda::stream_ref{cudaStreamLegacy}
    • rmm::cuda_stream_per_thread ➡️ cuda::stream_ref{cudaStreamPerThread}
  • Use .get() when calling an API that requires a raw cudaStream_t, including CUDA runtime, library, CUB, and legacy API boundaries (previously rmm::cuda_stream_view used value())
  • Use .sync() when synchronizing a cuda::stream_ref (previously rmm::cuda_stream_view used synchronize())
  • Update Cython declarations and call sites to pass stream references directly where supported

@copy-pr-bot

copy-pr-bot Bot commented Aug 31, 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 changed the title Adapt pooled stream use to cuda::stream_ref Migrate stream APIs from rmm::cuda_stream_view to cuda::stream_ref Sep 2, 2026
@bdice
bdice marked this pull request as ready for review September 2, 2026 22:55
@bdice
bdice requested review from a team as code owners September 2, 2026 22:55

@nirandaperera nirandaperera left a comment

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.

LGTM

@bdice bdice added breaking Introduces a breaking change improvement Improves an existing functionality labels Sep 3, 2026

@pentschev pentschev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could we update the declaration void wait() declaration to void sync() as part of the migration? I don't think it's currently used anywhere and probably exposed only for completeness, regardless, I think it makes sense to update it (or remove it completely) rather than having a stale one declaration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Introduces a breaking change improvement Improves an existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants