Skip to content

[FEA] Refactor RMM in terms of cuda::mr::memory_resource #1443

Open
@harrism

Description

@harrism

The <cuda/memory_resource> header provides a standard C++ interface for heterogeneous, stream-ordered memory allocation tailored to the needs of CUDA C++ developers. This design builds off of the success ofRMM and evolves the design based on lessons learned. <cuda/memory_resource> is not intended to replace RMM, but instead moves the definition of the memory allocation interface to a more centralized home in CCCL. RMM will remain as a collection of implementations of the cuda::mr interfaces.

At a high level, the header provides:

See the CCCL documentation for <cuda/memory_resource> for more details.

RMM began refactoring on top of cuda/memory_resource in #1095. A complete transition involves replacing the use of device_memory_resource in all RAPIDS repos (and other dependent libraries) and refactoring all RMM memory resources to implement the cuda::[async_]memory_resource properties rather than deriving from rmm::mr::device_memory_resource and rmm::mr::host_memory_resource.

### Tasks
- [x] Introduce cuda::mr::{async_}resource_ref to RMM and use in place of device_memory_resource pointers. Introduce conversions between rmm::cuda_stream_view and cuda::stream_ref. Done in rapidsai/rmm#1095 (23.12)
- [x] Require explicit initial pool size in pool_memory_resource. This is because it is difficult to automatically size the pool when the memory is not device memory. Done in rapidsai/rmm#1417
- [ ] https://github.com/rapidsai/rmm/issues/1388
- [ ] https://github.com/rapidsai/rmm/issues/1389
- [ ] https://github.com/rapidsai/rmm/issues/1402
- [ ] https://github.com/rapidsai/rmm/issues/1442
- [ ] https://github.com/rapidsai/rmm/issues/1444
- [ ] https://github.com/rapidsai/cudf/issues/15498
- [ ] https://github.com/rapidsai/raft/issues/2261
- [ ] https://github.com/rapidsai/cugraph/issues/4333
- [ ] https://github.com/rapidsai/cuml/issues/5839
- [ ] https://github.com/rapidsai/cuspatial/issues/1371
- [x] Convert any other RAPIDS repos to use `rmm::mr::device_async_resource_ref` instead of `device_memory_resource` pointers
- [ ] https://github.com/rapidsai/rmm/issues/1445

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    To-do

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions