Skip to content

Add 26.04 to 26.06 migration guide#2344

Draft
bdice wants to merge 5 commits into
rapidsai:mainfrom
bdice:docs/migration-guide-2606
Draft

Add 26.04 to 26.06 migration guide#2344
bdice wants to merge 5 commits into
rapidsai:mainfrom
bdice:docs/migration-guide-2606

Conversation

@bdice
Copy link
Copy Markdown
Collaborator

@bdice bdice commented Apr 2, 2026

Description

Adds a migration guide covering all breaking changes from RMM 26.04 to 26.06, and adds it to the docs toctree.

Closes #2345

The guide covers:

  • Removal of device_memory_resource base class and owning_wrapper
  • De-templating of all resources and adaptors (Upstream parameter removed)
  • CCCL resource concept requirements: async + synchronous interfaces, operator==, get_property friend
  • Copyability requirements for any_resource (wrapping non-copyable state in shared_ptr)
  • get_property friend restriction in function-scoped classes
  • Per-device resource API changes (_ref variants)
  • Downstream Cython migration patterns (.pxd pointer-to-value-type, .pyx get_mr() to c_ref.value())

Written and refined during the cudf migration (rapidsai/cudf#21018).

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 link
Copy Markdown

copy-pr-bot Bot commented Apr 2, 2026

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.

rapids-bot Bot pushed a commit to rapidsai/raft that referenced this pull request Apr 21, 2026
## Summary
- Remove `device_memory_resource` base class usage, de-template all resource and adaptor types, replace pointer-based per-device resource APIs with ref-based equivalents
- Part of rapidsai/rmm#2011. Migration guide: rapidsai/rmm#2344.
- Supersedes #2917 and #2920

Depends on rapidsai/rmm#2361.
Depends on rapidsai/ucxx#636.

## Changes

### Core resource infrastructure
- **`device_memory_resource.hpp`**: Remove `any_resource_bridge` (which inherited from `rmm::mr::device_memory_resource`), remove all `shared_ptr<device_memory_resource>` constructor overloads, consolidate to `any_resource`-only path
- **`device_resources.hpp`**: Remove deprecated constructor taking `shared_ptr<device_memory_resource>`, update `get_workspace_resource()` return type (de-templated `limiting_resource_adaptor`)
- **`device_resources_snmg.hpp`**: Remove stale include, de-template `pool_memory_resource`
- **`handle.hpp`**: Remove deprecated constructors taking `shared_ptr<device_memory_resource>`
- **`device_resources_manager.hpp`**: Retype `workspace_mrs` vector from `shared_ptr<device_memory_resource>` to `raft::mr::device_resource`, update `set_workspace_memory_resource()` signature accordingly, de-template `pool_mr_` to `optional<pool_memory_resource>`, remove `dynamic_cast` for upstream type detection, replace `get/set_current_device_resource()` with `_ref` variants

### Memory tracking
- **`memory_tracking_resources.hpp`**: Remove `device_tracking_bridge` (inherited from `device_memory_resource`), use `set_current_device_resource_ref()` directly

### Call sites using `get_workspace_resource()` → `get_workspace_resource_ref()`
- `select_k-inl.cuh`, `select_radix.cuh`, `select_warpsort.cuh`, `sparse/select_k-inl.cuh`, `bitmap_to_csr.cuh`, `bitset_to_csr.cuh`

### Benchmarks
- **`benchmark.hpp`**: De-template `pool_memory_resource`, use `any_resource` for RAII restore
- **`gather.cu`**, **`subsample.cu`**: Same pattern

### Tests
- **`handle.cpp`**: Dereference `limiting_resource_adaptor*` for `device_buffer` constructor
- **`device_resources_manager.cpp`**: Remove workspace-related test code for removed APIs
- **`mdarray.cu`**: Remove `test_device_resource_bridge_unwrap` (bridge no longer exists)
- **`multi_variable_gaussian.cu`**: `get_current_device_resource()` → `get_current_device_resource_ref()`

Authors:
  - Bradley Dice (https://github.com/bdice)

Approvers:
  - Divye Gala (https://github.com/divyegala)

URL: #2996
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented May 14, 2026

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.

@bdice bdice changed the base branch from staging to main May 14, 2026 20:10
bdice and others added 3 commits May 14, 2026 15:10
Covers the removal of device_memory_resource, de-templating of all
resources/adaptors, CCCL resource concept requirements (including
allocate_sync/deallocate_sync, copyability for any_resource, and
get_property friend restrictions), and downstream Cython migration
patterns for .pxd and .pyx files.
Co-authored-by: Bradley Dice <bdice@bradleydice.com>
@bdice bdice force-pushed the docs/migration-guide-2606 branch from 30f2784 to d0914a6 Compare May 14, 2026 20:10
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 14, 2026

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • Documentation
    • Added a comprehensive migration guide for upgrading to version 26.06, detailing breaking changes in memory resource APIs and Python bindings.
    • Integrated the migration guide into the main user documentation.

Walkthrough

This PR adds a comprehensive migration guide for RMM 26.04 → 26.06, documenting breaking C++ and Python/Cython API changes including resource model de-templating, CCCL concept adoption, ownership model changes, and binding updates. The guide is integrated into Sphinx navigation and includes implementation patterns, constraints, and troubleshooting guidance.

Changes

RMM 26.04 → 26.06 Migration Guide

Layer / File(s) Summary
Guide introduction and documentation navigation
docs/migration_guide_2606.md, docs/user_guide/guide.md
Migration guide is introduced with a high-level breaking-change overview and per-feature migration checklist. Sphinx toctree in the user guide is updated to include a link to the new migration guide.
C++ API model and signature changes
docs/migration_guide_2606.md
Documents removal of device_memory_resource base class, de-templating of resources (removal of Upstream parameter), upstream resources passed as device_async_resource_ref wrapped in cuda::mr::any_resource, allocate/deallocate signature changes (stream reordering, alignment parameter addition), value-semantics ownership via cuda::mr::shared_resource, removal of owning_wrapper, per-device API changes from pointer setters to any_resource setters, device_buffer internal switch to any_resource, resource_ref construction rule changes, failure_callback_t header relocation, compiled resource linking requirements, and rmm::cuda_stream to cuda::stream_ref conversion behavior.
Custom C++ resource implementation and constraints
docs/migration_guide_2606.md
Provides CCCL-style custom resource implementation guide with required interface pairs (async allocate/deallocate and sync variants), operator==, and get_property friends. Documents constraints including copyability requirement for any_resource storage, get_property friend scope limitations, pointer-to-reference conversion patterns, resource_cast usage, const data member assignment restrictions, deprecated cuda::stream_ref{} default constructor handling, and lack of any_resource.get<T>() recovery.
Python and Cython binding changes
docs/migration_guide_2606.md
Covers DeviceMemoryResource internal representation changes, Cython .pxd declaration updates removing device_memory_resource base and Upstream parameter, per-device Python API binding updates, failure_callback_resource_adaptor template parameter change, downstream .pxd/.pyx signature replacements from pointer-based to value/reference CCCL types, and requirement for implementing make_*_resource_ref helpers via cdef extern from * blocks.
Removed headers reference table
docs/migration_guide_2606.md
Reference table listing deprecated headers and their replacement guidance or removal status.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested labels

improvement

Suggested reviewers

  • ttnghia
  • PointKernel
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding a migration guide covering breaking changes from RMM 26.04 to 26.06.
Description check ✅ Passed The description is directly related to the changeset, providing details about the migration guide content, linking to the issue it closes, and listing the key topics covered.
Linked Issues check ✅ Passed The PR implementation fully addresses the objectives outlined in linked issue #2345: it documents C++ breaking changes, custom resource migration patterns, and Python/Cython migration guidance as specified.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the migration guide documentation objective; the two files modified (migration_guide_2606.md and guide.md) only add documentation content without introducing unrelated code changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/migration_guide_2604_to_2606.md`:
- Around line 577-580: The doc currently tells Cython authors to keep using
self.get_mr() in .pyx code, but the migration requires switching to
mr.c_ref.value(); update the migration text (the lines referencing
self.c_obj.get(), self.get_mr(), and device_async_resource_ref) to instruct
authors to replace uses of self.c_obj.get() / self.get_mr() with
mr.c_ref.value() when passing a resource ref from Cython to C++, and adjust
examples and the other affected section (lines ~676-690) to consistently show
mr.c_ref.value() as the correct replacement.
- Around line 209-214: The migration guide currently conflicts: the prose states
`_ref` reset APIs are deprecated-but-still-present in 26.06, but the per-device
table marks reset_per_device_resource_ref and reset_current_device_resource_ref
as removed; update the table rows (and the similar entries at lines referenced
219-220) to explicitly mark those functions as "Deprecated (still available in
26.06; removed in 26.08)" or similar wording, and ensure the surrounding prose
references the exact symbols reset_per_device_resource_ref and
reset_current_device_resource_ref (and `_ref` setters/reset functions) so
readers clearly understand they remain in 26.06 as deprecated compatibility APIs
and will be removed in 26.08.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 8d5fb5c0-d933-4799-b8c8-6d054af9ad04

📥 Commits

Reviewing files that changed from the base of the PR and between d0914a6 and 012c921.

📒 Files selected for processing (1)
  • docs/migration_guide_2604_to_2606.md

Comment thread docs/migration_guide_2604_to_2606.md Outdated
Comment on lines +209 to +214
owning `any_resource` setters instead. The `_ref` setters and reset functions
still exist in 26.06 as deprecated compatibility APIs, but will be removed in
26.08:

| Removed (26.04) | Replacement (26.06) |
|-----------------|---------------------|
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Clarify contradictory _ref reset API status in the per-device table.

The prose says _ref reset APIs still exist in 26.06 (deprecated), but the table marks reset_per_device_resource_ref / reset_current_device_resource_ref as removed. Please make the status explicit (deprecated-but-still-available vs removed) to avoid migration ambiguity.

As per coding guidelines: "Clarity: Flag confusing explanations, missing prerequisites, or unclear examples" and "Consistency: Version numbers, parameter types, and terminology match code".

Also applies to: 219-220

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/migration_guide_2604_to_2606.md` around lines 209 - 214, The migration
guide currently conflicts: the prose states `_ref` reset APIs are
deprecated-but-still-present in 26.06, but the per-device table marks
reset_per_device_resource_ref and reset_current_device_resource_ref as removed;
update the table rows (and the similar entries at lines referenced 219-220) to
explicitly mark those functions as "Deprecated (still available in 26.06;
removed in 26.08)" or similar wording, and ensure the surrounding prose
references the exact symbols reset_per_device_resource_ref and
reset_current_device_resource_ref (and `_ref` setters/reset functions) so
readers clearly understand they remain in 26.06 as deprecated compatibility APIs
and will be removed in 26.08.

Comment on lines +577 to +580
**Cython bindings authors:**
- Replace `self.c_obj.get()` (which returned `device_memory_resource*`) with
`self.get_mr()` (which returns `device_async_resource_ref`).
- Keep using `get_mr()` in `.pyx` code when passing a resource ref to C++.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Fix conflicting Python/Cython migration guidance (get_mr() vs c_ref.value()).

These lines instruct downstreams to keep using get_mr(), but the PR objective explicitly states migration in .pyx should move from mr.get_mr() to mr.c_ref.value(). This mismatch can cause incorrect downstream migrations.

Suggested doc edit
- - Replace `self.c_obj.get()` (which returned `device_memory_resource*`) with
-   `self.get_mr()` (which returns `device_async_resource_ref`).
- - Keep using `get_mr()` in `.pyx` code when passing a resource ref to C++.
+ - Replace `self.c_obj.get()` (which returned `device_memory_resource*`) with
+   `self.c_ref.value()` (which yields `device_async_resource_ref`).
+ - In `.pyx`, use `mr.c_ref.value()` when passing a resource ref to C++.
-In `.pyx` files that call C++ functions, keep using `mr.get_mr()` when the
-target C++ function takes `device_async_resource_ref`. `get_mr()` returns a
-`device_async_resource_ref` and can be used directly inside `with nogil:` blocks:
+In `.pyx` files that call C++ functions, use `mr.c_ref.value()` when the
+target C++ function takes `device_async_resource_ref`. It can be used directly
+inside `with nogil:` blocks:
...
-    result = cpp_my_function(input.view(), mr.get_mr())
+    result = cpp_my_function(input.view(), mr.c_ref.value())
...
-    result = cpp_my_function(input.view(), mr.get_mr())
+    result = cpp_my_function(input.view(), mr.c_ref.value())
...
-    result = cpp_my_function(input.view(), make_any_device_resource(mr.get_mr()))
+    result = cpp_my_function(input.view(), make_any_device_resource(mr.c_ref.value()))

As per coding guidelines: "Accuracy: Verify code examples compile and run correctly" and "Consistency: Version numbers, parameter types, and terminology match code".

Also applies to: 676-690

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/migration_guide_2604_to_2606.md` around lines 577 - 580, The doc
currently tells Cython authors to keep using self.get_mr() in .pyx code, but the
migration requires switching to mr.c_ref.value(); update the migration text (the
lines referencing self.c_obj.get(), self.get_mr(), and
device_async_resource_ref) to instruct authors to replace uses of
self.c_obj.get() / self.get_mr() with mr.c_ref.value() when passing a resource
ref from Cython to C++, and adjust examples and the other affected section
(lines ~676-690) to consistently show mr.c_ref.value() as the correct
replacement.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
docs/migration_guide_2606.md (1)

650-653: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Resolve conflicting .pyx migration guidance (get_mr() vs c_ref.value()).

These sections still instruct downstream .pyx code to use get_mr(), but this conflicts with the stated migration contract to move call sites to mr.c_ref.value(). Please align both prose and examples to a single migration path to avoid incorrect downstream updates.

As per coding guidelines: "Accuracy: Verify code examples compile and run correctly" and "Consistency: Version numbers, parameter types, and terminology match code".

Also applies to: 754-777

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/migration_guide_2606.md` around lines 650 - 653, The migration guide
currently gives conflicting advice for Cython `.pyx` bindings—some places say
replace self.c_obj.get() with self.get_mr() while others instruct moving call
sites to mr.c_ref.value(); pick one consistent migration path and update the
prose and examples accordingly: either (A) change every occurrence and example
that mentions self.get_mr() to instead call mr.c_ref.value() where a raw
device_memory_resource* is required, or (B) change all references that suggest
using mr.c_ref.value() to consistently show using self.get_mr() and how to
extract the underlying pointer from that object; update the paragraphs around
the examples and the example code blocks (references: self.c_obj.get(),
self.get_mr(), mr.c_ref.value(), and any .pyx snippets) so the guide shows one
coherent, compile-able approach throughout.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In `@docs/migration_guide_2606.md`:
- Around line 650-653: The migration guide currently gives conflicting advice
for Cython `.pyx` bindings—some places say replace self.c_obj.get() with
self.get_mr() while others instruct moving call sites to mr.c_ref.value(); pick
one consistent migration path and update the prose and examples accordingly:
either (A) change every occurrence and example that mentions self.get_mr() to
instead call mr.c_ref.value() where a raw device_memory_resource* is required,
or (B) change all references that suggest using mr.c_ref.value() to consistently
show using self.get_mr() and how to extract the underlying pointer from that
object; update the paragraphs around the examples and the example code blocks
(references: self.c_obj.get(), self.get_mr(), mr.c_ref.value(), and any .pyx
snippets) so the guide shows one coherent, compile-able approach throughout.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 0d1895ed-64e4-4608-9d17-d6e8a83c9469

📥 Commits

Reviewing files that changed from the base of the PR and between 012c921 and 8a70542.

📒 Files selected for processing (2)
  • docs/migration_guide_2606.md
  • docs/user_guide/guide.md
✅ Files skipped from review due to trivial changes (1)
  • docs/user_guide/guide.md

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

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Add migration guide for RMM 26.04 → 26.06 breaking changes

2 participants