Skip to content

Deprecate set_current_device_resource pointer-based API - #21018

Closed
bdice wants to merge 8 commits into
NVIDIA:mainfrom
bdice:deprecate-set-current-device-resource
Closed

bdice wants to merge 8 commits into
NVIDIA:mainfrom
bdice:deprecate-set-current-device-resource

Conversation

@bdice

@bdice bdice commented Jan 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Deprecate the pointer-based set_current_device_resource(device_memory_resource*) wrapper with [[deprecated]] attribute
  • Update all call sites to use set_current_device_resource_ref() instead

This is part of the RMM CCCL 3.2 migration to use type-erased any_resource and resource_ref types instead of raw pointers. See rapidsai/rmm#2011 for tracking.

@bdice
bdice requested review from a team as code owners January 12, 2026 23:10
@bdice
bdice requested review from devavret and mhaseeb123 January 12, 2026 23:10
@github-actions github-actions Bot added libcudf Affects libcudf (C++/CUDA) code. Java Affects Java cuDF API. labels Jan 12, 2026
bdice added 2 commits January 13, 2026 07:11
Deprecate the pointer-based `set_current_device_resource(device_memory_resource*)`
wrapper and update all call sites to use `set_current_device_resource_ref()` instead.

This is part of the RMM CCCL 3.2 migration to use type-erased `any_resource` and
`resource_ref` types instead of raw pointers. See rapidsai/rmm#2011 for details.

Updated files:
- Benchmarks: nvbench_fixture.hpp
- Examples: 11 example files across basic, billion_rows, hybrid_scan_io,
  nested_types, parquet_inspect, parquet_io, string_transforms, and strings
- Tests: testing_main.hpp, large_strings_fixture.cpp
- JNI: RmmJni.cpp

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR deprecates the pointer-based set_current_device_resource(device_memory_resource*) API in favor of the reference-based set_current_device_resource_ref() API. This is part of the RMM CCCL 3.2 migration to use type-erased any_resource and resource_ref types instead of raw pointers.

Changes:

  • Added deprecation attribute to the pointer-based set_current_device_resource() wrapper function
  • Updated get_current_device_resource_ref() to call RMM's ref-based implementation
  • Migrated all call sites across Java JNI, tests, examples, and benchmarks to use the new ref-based API
  • Updated member variables in chunked_parquet_reader to use cuda::mr::any_resource<cuda::mr::device_accessible> instead of rmm::device_async_resource_ref

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated no comments.

Show a summary per file
File Description
cpp/include/cudf/utilities/memory_resource.hpp Added deprecation attribute to pointer-based API, updated get function to use RMM's ref implementation, added pragma directives to suppress deprecation warnings
cpp/include/cudf/io/experimental/deletion_vectors.hpp Updated member variables to use cuda::mr::any_resource type, added include for cuda/memory_resource
java/src/main/native/src/RmmJni.cpp Updated JNI call to use ref-based API
cpp/include/cudf_test/testing_main.hpp Updated test infrastructure to use ref-based API
cpp/tests/large_strings/large_strings_fixture.cpp Updated test fixture to use ref-based API
cpp/examples/strings/common.hpp Updated example to use ref-based API
cpp/examples/string_transforms/common.hpp Updated example to use ref-based API
cpp/examples/parquet_io/parquet_io_multithreaded.cpp Updated example to use ref-based API with cudf namespace
cpp/examples/parquet_io/parquet_io.cpp Updated example to use ref-based API
cpp/examples/parquet_inspect/parquet_inspect.cpp Updated example to use ref-based API
cpp/examples/nested_types/deduplication.cpp Updated example to use ref-based API
cpp/examples/hybrid_scan_io/hybrid_scan_io.cpp Updated example to use ref-based API with cudf namespace
cpp/examples/billion_rows/brc_pipeline.cpp Updated example to use ref-based API with cudf namespace
cpp/examples/billion_rows/brc_chunks.cpp Updated example to use ref-based API with cudf namespace
cpp/examples/billion_rows/brc.cpp Updated example to use ref-based API with cudf namespace
cpp/examples/basic/src/process_csv.cpp Updated example to use ref-based API
cpp/benchmarks/fixture/nvbench_fixture.hpp Updated benchmark fixture to use ref-based API

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ttnghia ttnghia removed their assignment Jan 20, 2026
@vyasr vyasr added breaking Breaking change improvement Improvement / enhancement to an existing function labels Jan 24, 2026
@ttnghia ttnghia removed their assignment Mar 10, 2026
@ttnghia

ttnghia commented Mar 10, 2026 •

Copy link
Copy Markdown
Contributor

There seems more work todo:

## SHOULD FIX

1. Three files were missed (the sibling `hybrid_scan_io.cpp` WAS updated):                              
                                                                                                       
  - `cpp/examples/hybrid_scan_io/hybrid_scan_pipeline.cpp:365`
  - `cpp/examples/hybrid_scan_io/hybrid_scan_multifile_single_step.cpp:151`
  - `cpp/examples/hybrid_scan_io/hybrid_scan_multifile_two_step.cpp:157`

  All should be changed to `cudf::set_current_device_resource_ref(&stats_mr);`

2. `read_parquet` free function in `deletion_vectors.hpp:181` uses                      
  `rmm::mr::get_current_device_resource_ref()`

@bdice bdice mentioned this pull request Apr 2, 2026
3 tasks done
@bdice

bdice commented Apr 3, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #22008, which removes set_current_device_resource entirely and completes the full migration to the CCCL-native memory resource interface.

@bdice bdice closed this Apr 3, 2026
rapids-bot Bot pushed a commit that referenced this pull request Apr 20, 2026
Remove unused `#include <rmm/mr/device_memory_resource.hpp>` from 34 files that never reference the `device_memory_resource` type. Where a file uses `rmm::device_async_resource_ref` without an explicit include of `<rmm/resource_ref.hpp>`, add it. Also removes an unused forward declaration of `rmm::mr::device_memory_resource` in `optimized_unbounded_window.hpp`.

These are the non-breaking portions of the `rmm-cccl-migration` branch (#21018) extracted to reduce the diff when the breaking RMM 26.06 changes land. The `device_memory_resource` base class is being removed upstream (rapidsai/rmm#2011), and these files were including its header unnecessarily.

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

Approvers:
  - Nghia Truong (https://github.com/ttnghia)
  - David Wendt (https://github.com/davidwendt)
  - Muhammad Haseeb (https://github.com/mhaseeb123)

URL: #22187
shrshi pushed a commit to shrshi/cudf that referenced this pull request May 12, 2026
Remove unused `#include <rmm/mr/device_memory_resource.hpp>` from 34 files that never reference the `device_memory_resource` type. Where a file uses `rmm::device_async_resource_ref` without an explicit include of `<rmm/resource_ref.hpp>`, add it. Also removes an unused forward declaration of `rmm::mr::device_memory_resource` in `optimized_unbounded_window.hpp`.

These are the non-breaking portions of the `rmm-cccl-migration` branch (NVIDIA#21018) extracted to reduce the diff when the breaking RMM 26.06 changes land. The `device_memory_resource` base class is being removed upstream (rapidsai/rmm#2011), and these files were including its header unnecessarily.

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

Approvers:
  - Nghia Truong (https://github.com/ttnghia)
  - David Wendt (https://github.com/davidwendt)
  - Muhammad Haseeb (https://github.com/mhaseeb123)

URL: NVIDIA#22187
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants