Skip to content

Deprecation and removal of host memory resources #2103

@bdice

Description

@bdice

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:

  1. 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)
  2. Conflicts with CCCL design: CCCL memory resources use properties rather than inheritance to indicate host/device accessibility
  3. Increases complexity: Maintaining two parallel MR designs creates unnecessary cognitive overhead for users
  4. 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
  • rmm::mr::new_delete_resource (rmm/mr/host/new_delete_resource.hpp)

    • Allocates host memory using C++ new/delete
    • Inherits from host_memory_resource

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
#endif

Expected Impact

Low Risk

  • Limited downstream usage of host_memory_resource polymorphism
  • 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.hpp to rmm/mr/pinned_host_memory_resource.hpp
    • Update class names from pinned_memory_resource to pinned_host_memory_resource

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:

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions