-
Notifications
You must be signed in to change notification settings - Fork 242
Description
Summary
RMM is deprecating its legacy host memory resource infrastructure (host_memory_resource, pinned_memory_resource, and new_delete_resource) in favor of CCCL-aligned memory resources. This change simplifies RMM's architecture and aligns with modern CUDA best practices.
Timeline: Deprecated in 25.12, will be removed in 26.02
Deprecation is implemented in #2104.
Motivation
Why This Change Is Necessary
RMM originally designed separate inheritance hierarchies for "device" and "host" memory resources, with distinct base classes and allocation patterns. However, this approach has fundamental limitations:
- Cannot express host-and-device accessibility: The rigid separation makes it difficult to represent memory that is accessible by both host and device (like pinned memory)
- Conflicts with CCCL design: CCCL memory resources use properties rather than inheritance to indicate host/device accessibility
- Increases complexity: Maintaining two parallel MR designs creates unnecessary cognitive overhead for users
- Limits interoperability: Different designs prevent seamless integration with CCCL-based code
The CCCL-Aligned Approach
CCCL memory resources do not use inheritance to distinguish "device" and "host" memory. Instead, each memory resource implementation declares properties that indicate whether it is device-accessible, host-accessible, or both. This design is more flexible (resources can naturally express dual accessibility) and more composable (properties compose better than inheritance hierarchies).
Affected APIs
The following classes are deprecated in 25.12 and will be removed in 26.02:
-
rmm::mr::host_memory_resource(rmm/mr/host/host_memory_resource.hpp)- Legacy polymorphic base class for host memory resources
-
rmm::mr::pinned_memory_resource(rmm/mr/host/pinned_memory_resource.hpp)- Allocates pinned host memory using
cudaMallocHost/cudaFreeHost - Inherits from
host_memory_resource
- Allocates pinned host memory using
-
rmm::mr::new_delete_resource(rmm/mr/host/new_delete_resource.hpp)- Allocates host memory using C++
new/delete - Inherits from
host_memory_resource
- Allocates host memory using C++
Migration Guide
For Users of pinned_memory_resource
The vast majority of host memory resource users are using rmm::mr::pinned_memory_resource. The migration path is straightforward: replace it with rmm::mr::pinned_host_memory_resource. See #2090 for further information. If you compose pinned_memory_resource with other adaptors (e.g., with pool_memory_resource), you can still replace it with pinned_host_memory_resource.
Before (Deprecated):
#include <rmm/mr/host/pinned_memory_resource.hpp>
rmm::mr::pinned_memory_resource mr;
void* ptr = mr.allocate(1024);
mr.deallocate(ptr, 1024);After (Recommended):
#include <rmm/mr/pinned_host_memory_resource.hpp>
rmm::mr::pinned_host_memory_resource mr;
void* ptr = mr.allocate(1024);
mr.deallocate(ptr, 1024);For Users of new_delete_resource
There is no direct replacement for new_delete_resource in the CCCL-aligned design, as there are no known active users of this resource. If you are using new_delete_resource and need assistance migrating, please comment on this issue.
Suppressing Deprecation Warnings
If you need to temporarily suppress deprecation warnings while migrating your code, you can use compiler pragmas:
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
#include <rmm/mr/host/pinned_memory_resource.hpp>
// ... your code using deprecated types ...
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic pop
#endifExpected Impact
Low Risk
- Limited downstream usage of
host_memory_resourcepolymorphism - Clear migration path with API parity
Downstream Projects
Downstream projects in the RAPIDS ecosystem are already migrating or have migrated to pinned_host_memory_resource. If your project depends on RMM and uses the deprecated host memory resources, please plan to migrate before the 26.02 release.
Timeline and Action Items
| Release | Actions |
|---|---|
| 25.12 | Deprecation warnings added; deprecated APIs still functional |
| 26.02 | Deprecated APIs removed; migration required |
For RMM Users
- Review your code for usage of deprecated host memory resources
- For pinned memory resource users:
- Update includes from
rmm/mr/host/pinned_memory_resource.hpptormm/mr/pinned_host_memory_resource.hpp - Update class names from
pinned_memory_resourcetopinned_host_memory_resource
- Update includes from
Additional Context
This deprecation is part of a broader effort to align RMM with CCCL memory resource design principles. In the future, RMM may further simplify its structure by flattening the rmm/mr/device/ and rmm/mr/host/ directory hierarchy, as the distinction is no longer meaningful in the CCCL-aligned design.
For more details on the CCCL memory resource concepts, see #2011.
References:
- Primary tracking issue: [FEA] Remove
rmm::mr::pinned_memory_resourcein favor ofrmm::mr::pinned_host_memory_resource. #2090 - Python bindings for
pinned_host_memory_resource: [FEA] Python bindings forrmm::mr::pinned_host_memory_resource#1429 - CUDA 13 async pinned pools: [FEA] Expose CUDA 13 async pools for managed and pinned memory #2054
Metadata
Metadata
Assignees
Labels
Type
Projects
Status