Skip to content

Merge RmmResourceAdaptor into BufferResource as a CCCL resource - #1067

Closed
madsbk wants to merge 1 commit into
rapidsai:mainfrom
madsbk:make-br-a-cccl-mr
Closed

Merge RmmResourceAdaptor into BufferResource as a CCCL resource#1067
madsbk wants to merge 1 commit into
rapidsai:mainfrom
madsbk:make-br-a-cccl-mr

Conversation

@madsbk

@madsbk madsbk commented May 28, 2026

Copy link
Copy Markdown
Member

Closes #641

Merge RmmResourceAdaptor into BufferResource so BufferResource itself becomes a CCCL cuda::mr::resource_with<device_accessible>.

The Python BufferResource now subclasses rmm.pylibrmm.DeviceMemoryResource. This removes a lifetime foot-gun: previously, callers had to pass br.device_mr() (the inner adaptor) to RMM APIs such as rmm.DeviceBuffer(mr=...). That kept the adaptor alive, but not the parent BufferResource, so its stream pool could in principle be destroyed while async work on those streams was still in flight.

Now rmm.DeviceBuffer(mr=br) is the natural call. It keeps a strong reference to the entire BufferResource, ensuring the stream pool stays alive as long as any buffer allocated from it exists.

This will break cudf-polars CI, so we should have a PR ready there before merging.

singleton commit
@madsbk madsbk self-assigned this May 28, 2026
@madsbk madsbk added breaking Introduces a breaking change improvement Improves an existing functionality labels May 28, 2026
@copy-pr-bot

copy-pr-bot Bot commented May 28, 2026

Copy link
Copy Markdown

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.

@madsbk

madsbk commented May 28, 2026

Copy link
Copy Markdown
Member Author

/ok to test

Comment thread cpp/include/rapidsmpf/memory/detail/buffer_resource_impl.hpp
@madsbk

madsbk commented May 29, 2026

Copy link
Copy Markdown
Member Author

Closed in favor of #1069.

@madsbk madsbk closed this May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Introduces a breaking change improvement Improves an existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make BufferResource usable as an rmm device_memory_resource

2 participants