Skip to content

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

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

Migrate stream APIs from rmm::cuda_stream_view to cuda::stream_ref#23929
bdice wants to merge 5 commits into
NVIDIA:mainfrom
bdice:cuda-stream-ref

Conversation

@bdice

@bdice bdice commented Sep 1, 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 cuDF C++ and Cython stream accessors, building on the default-stream work merged in #23770. It continues work from #23636.

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

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@copy-pr-bot

copy-pr-bot Bot commented Sep 1, 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.

@github-actions github-actions Bot added libcudf Affects libcudf (C++/CUDA) code. Python Affects Python cuDF API. Java Affects Java cuDF API. pylibcudf Issues specific to the pylibcudf package labels Sep 1, 2026
@bdice bdice changed the title Adapt stream accessors 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
@coderabbitai

coderabbitai Bot commented Sep 2, 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: 2549b354-172b-4b71-b571-64d84d7967cb

📥 Commits

Reviewing files that changed from the base of the PR and between cfba37b and bb9fc22.

📒 Files selected for processing (3)
  • cpp/libcudf_streaming/src/bloom_filter.cpp
  • cpp/tests/scalar/scalar_test.cpp
  • python/pylibcudf/pylibcudf/io/parquet_io_utils.pyx

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


📝 Summary

Summary by CodeRabbit

  • Bug Fixes
    • Updated CUDA stream handling across GPU-accelerated operations, including joins, sorting, aggregation, text processing, string operations, and file I/O.
    • Improved compatibility with current CUDA stream interfaces across C++, Python, and Java integrations.
    • Preserved existing public APIs, validation, processing behavior, and results while improving stream interoperability.

Walkthrough

Changes

The pull request replaces deprecated CUDA stream headers and accessors across C++, Java native code, and Python Cython bindings. It also passes stream views directly in streaming helpers and updates Parquet remapping to use cuda::stream_ref.

CUDA stream migration

Layer / File(s) Summary
Native stream contracts
cpp/include/cudf/..., cpp/src/..., cpp/tests/..., java/src/main/native/...
CUDA stream includes now use <cuda/stream>. The Parquet dictionary remapping function now accepts cuda::stream_ref.
Python stream access
python/cudf_streaming/..., python/pylibcudf/...
Cython bindings replace .value() with .get() and pass stream views directly where supported. Operation behavior and public signatures remain unchanged.

Estimated code review effort: 2 (Simple) | ~15 minutes

Merge Risk: ⚪ Minimal · up to bb9fc

This update completes stream-reference API compatibility at the affected native, test, and Parquet binding call sites without changing intended stream behavior. No concrete merge-blocking risk remains.

Possibly related PRs

Suggested labels: improvement, non-breaking

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 15 files. (1 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 summarizes the primary change: migrating stream APIs from rmm::cuda_stream_view to cuda::stream_ref.
Description check ✅ Passed The description directly explains the stream API migration and covers the updated C++ and Cython call sites shown in the changeset.
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 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 15 files. (1 skipped: 1 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 requested a review from a team as a code owner September 3, 2026 02:30
@bdice bdice added breaking Breaking change improvement Improvement / enhancement to an existing function labels Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Breaking change improvement Improvement / enhancement to an existing function Java Affects Java cuDF API. libcudf Affects libcudf (C++/CUDA) code. pylibcudf Issues specific to the pylibcudf package Python Affects Python cuDF API.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

3 participants