Skip to content

Remove custom MemoryAvailable functions - #1061

Merged
rapids-bot[bot] merged 1 commit into
rapidsai:mainfrom
madsbk:remove-memory-availability-functions
May 27, 2026
Merged

Remove custom MemoryAvailable functions#1061
rapids-bot[bot] merged 1 commit into
rapidsai:mainfrom
madsbk:remove-memory-availability-functions

Conversation

@madsbk

@madsbk madsbk commented May 26, 2026

Copy link
Copy Markdown
Member

As part of the upcoming work for #641, RmmResourceAdaptor will be merged into BufferResource, which removes most of the motivation for supporting a generic memory-availability callback.

This PR simplifies the API to match how it is actually used. Today, BufferResource accepts an arbitrary std::function<std::int64_t()> per MemoryType, but every real caller simply wraps LimitAvailableMemory(adaptor, limit), which reduces to a straightforward limit - current_allocated() computation.

This PR replaces the callback map with a plain integer limit, defaulting to std::numeric_limits<std::int64_t>::max() to represent "unlimited".

To further simplify the API, BufferResource now constructs the RmmResourceAdaptor internally, so users no longer need to interact with RmmResourceAdaptor directly.

@madsbk madsbk self-assigned this May 26, 2026
@madsbk madsbk added breaking Introduces a breaking change improvement Improves an existing functionality labels May 26, 2026

@wence- wence- left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Small suggestions

Comment thread cpp/include/rapidsmpf/memory/buffer_resource.hpp Outdated
Comment thread cpp/tests/test_shuffler.cpp Outdated
Comment thread python/rapidsmpf/rapidsmpf/memory/buffer_resource.pyx Outdated
Comment thread cpp/include/rapidsmpf/memory/buffer_resource.hpp
@madsbk
madsbk force-pushed the remove-memory-availability-functions branch 3 times, most recently from bfe495f to b69d9cb Compare May 26, 2026 18:39
Comment thread cpp/include/rapidsmpf/memory/buffer_resource.hpp
Comment thread cpp/src/memory/buffer_resource.cpp Outdated
@madsbk
madsbk force-pushed the remove-memory-availability-functions branch from b69d9cb to fccfe1d Compare May 26, 2026 18:52
@madsbk
madsbk force-pushed the remove-memory-availability-functions branch from fccfe1d to 8f7590f Compare May 26, 2026 19:14
@madsbk
madsbk marked this pull request as ready for review May 26, 2026 19:57
@madsbk
madsbk requested review from a team as code owners May 26, 2026 19:57
@madsbk
madsbk requested review from nirandaperera and wence- May 26, 2026 19:57
@rapidsai rapidsai deleted a comment from copy-pr-bot Bot May 26, 2026
@madsbk

madsbk commented May 27, 2026

Copy link
Copy Markdown
Member Author

/merge

@rapids-bot
rapids-bot Bot merged commit 743803b into rapidsai:main May 27, 2026
66 checks passed
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.

3 participants