Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allocator Interface #1131

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open

Allocator Interface #1131

wants to merge 7 commits into from

Conversation

MrBurmark
Copy link
Member

@MrBurmark MrBurmark commented Oct 13, 2021

Add Allocator Interface that exposes more options and state to users.

Refactor our existing internal allocators to use an Allocator interface.
Add ability to set allocators with user defined Allocators.
Add ability to get individual allocators or all allocators in use.
Add ability to query allocator sizes.

Design review

On some date, we'll review this PR. We may discuss the design ideas:

  1. Make allocators more standard
  2. Make allocators replaceable by users
  3. Make internal pool sizes queryable by users
  4. Use a std allocator interface
  5. Multiple Resource Safety
  6. Multiple Device Support.

This PR implements 1. 2. and 3. It leaves out 4. 5. 6. for the following reasons

  • 4 Not sure how to make sizes user queryable
  • 5, 6 Keep Scope manageable for next release

@artv3
Copy link
Member

artv3 commented Oct 13, 2021

This looks great! Can we get example of how to use under the example folder?

@trws
Copy link
Member

trws commented Oct 13, 2021

When you say you want the sizes to be user queryable, do you mean something like a pool size or what? Your fourth point should be possible, but querying size will likely either work only for a pool-like allocator or give a non-useful answer (for a lot of reasons, have a look at the docs on jemalloc usage functions for details).

@MrBurmark
Copy link
Member Author

MrBurmark commented Oct 13, 2021

I agree, I think I'll drop the ability to query the size. Then expose something for only the internal RAJA pool allocators that supports querying the size in a similar manner to umpire pools. The user will be responsible for tracking the sizes of any user-provided allocators.

@trws
Copy link
Member

trws commented Oct 13, 2021

That makes sense. Especially if you document the concept used to query the size so a user can implement it if they want to.

Add an Allocator abstraction that looks similar to umpire.
Use this abstraction in the cuda/hip backends.
Refactor basic_mempool into AllocatorPool as the default
cuda/hip Allocators.
Add support for users to set new Allocators for cuda/hip.
This is a layer under Allocator that can provide stats.
The idea is to allow users to expose stats for their
allocators or not.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can not query RAJA internal memory pools size
3 participants