Skip to content

Conversation

bdice
Copy link
Contributor

@bdice bdice commented Oct 14, 2025

Description

This is the next step in #2011. This PR makes the current (soon to be legacy) memory resource interface configurable. If the CMake option RMM_ENABLE_LEGACY_MR_INTERFACE is disabled, then legacy methods will not be exposed. This will allow us to incrementally update RAPIDS until everything builds with the legacy interface disabled.

Currently my plan is:

  • Complete this PR's implementation. RMM should build and pass tests with RMM_ENABLE_LEGACY_MR_INTERFACE on or off.
  • The legacy MR interface will remain enabled in 25.12.
  • Start refactoring RAPIDS to use the new CCCL MR interface.
  • Once RAPIDS is building with only the new CCCL MR interface enabled, we can add deprecation warnings to the legacy interface.
  • Remove the deprecated MR interface in the release following deprecation.

This PR will cover step (2) and allow us to move on to step (3) of the proposed plan for CCCL MR adoption. See #2011 (comment).

The only breaking change is that RMM no longer supports CCCL versions before 3.1.0. Everything else in this PR is non-breaking.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

Copy link

copy-pr-bot bot commented Oct 14, 2025

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.

@bdice
Copy link
Contributor Author

bdice commented Oct 14, 2025

/ok to test

@bdice bdice added breaking Breaking change non-breaking Non-breaking change labels Oct 14, 2025
@bdice bdice self-assigned this Oct 14, 2025
@bdice bdice added feature request New feature or request and removed non-breaking Non-breaking change labels Oct 14, 2025
@bdice bdice marked this pull request as ready for review October 14, 2025 17:09
@bdice bdice requested review from a team as code owners October 14, 2025 17:09
@bdice bdice requested review from harrism and rongou October 14, 2025 17:09
@bdice bdice changed the title Add CMake options for making legacy MR interface configurable Add CMake option for disabling legacy MR interface Oct 14, 2025
@bdice bdice added the DO NOT MERGE Hold off on merging; see PR for details label Oct 14, 2025
@bdice
Copy link
Contributor Author

bdice commented Oct 14, 2025

Marked as DO NOT MERGE. I would like to build all of RAPIDS with this PR before merging, to verify there are no API breaks.

@bdice bdice removed the DO NOT MERGE Hold off on merging; see PR for details label Oct 16, 2025
@bdice
Copy link
Contributor Author

bdice commented Oct 16, 2025

I verified that all of RAPIDS builds with this set of changes. ✅ Removing the DO NOT MERGE flag.

I'll merge this late in the day to ensure we get a fresh set of nightly builds.

Copy link
Contributor

@wence- wence- left a comment

Choose a reason for hiding this comment

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

I think this makes sense with one question about what the concrete migration idea is.

std::size_t alignment = rmm::RMM_DEFAULT_HOST_ALIGNMENT) noexcept
{
return deallocate_async(ptr, bytes, alignment, stream);
RMM_FUNC_RANGE();
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this worthwhile given that deallocate_sync also has RMM_FUNC_RANGE?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will be refactoring this MR implementation separately as part of #2090. Punting on this.

return this->deallocate_sync(ptr, bytes, alignment);
}
#endif // RMM_ENABLE_LEGACY_MR_INTERFACE

Copy link
Contributor

Choose a reason for hiding this comment

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

OK so the idea is that the cccl_resource_ref models our old setup where allocate -> synchronous and allocate_async -> stream-ordered.

Whereas async_cccl_resource_ref is allocate_sync -> synchronous and allocate -> stream-ordered.

Since currently we assume allocate is synchronous we need to adapt everyone to that first. And the way to do that is to migrate everyone using allocate to use allocate_sync. Then we can move them onto the async_cccl_resource_ref concept and then we can move sync allocations that could be async back to allocate?

Copy link
Contributor Author

@bdice bdice Oct 16, 2025

Choose a reason for hiding this comment

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

Generally that's the right direction.

The migration here is actually a little easier than stated above, because the signature for allocate changed too (in addition to changing sync-to-async). Disabling the "legacy" interface will cause a compile error anywhere the old interface was being used, allowing us to migrate to the new API names and new parameter order in each RAPIDS repository. I am starting that migration now. :)

Once that migration is complete, I will deprecate the "legacy" interface (at which point RAPIDS should not be using the legacy interface at all), then remove it in the subsequent release.

@bdice bdice requested a review from a team as a code owner October 16, 2025 18:51
@bdice bdice added the DO NOT MERGE Hold off on merging; see PR for details label Oct 16, 2025
@bdice
Copy link
Contributor Author

bdice commented Oct 16, 2025

I forgot that I need to do a bit more internal refactoring before this is ready to merge. I would like for this PR to build with the legacy interface enabled or disabled, and I will need to try rebuilding all of RAPIDS again (only with the legacy interface enabled) once I finish that refactoring. Then I can start working on refactoring downstream libraries to use the new interface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Breaking change DO NOT MERGE Hold off on merging; see PR for details feature request New feature or request

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

4 participants