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

[REVIEW] Add CUDA Managed Memory (Unified Memory) Allocation Mode #2

Merged
merged 13 commits into from
Jan 10, 2019

Conversation

harrism
Copy link
Member

@harrism harrism commented Dec 21, 2018

This PR adds an option to rmmInitialize to use cudaMallocManaged (+ cudaMemPrefetchAsync) as the base allocator for RMM rather than cudaMalloc.

rmmAllocationMode_t mode = CudaManagedMemory | PoolAllocation;
rmmOptions_t options {mode, 0, false};
rmmInitialize(&options);

The code above will initialize RMM with a managed memory pool. Removing PoolAllocation will cause it to allocate without a pool by calling directly to cudaMallocManaged().

Tests are also expanded to run all tests with all allocation modes (gtests and pytests).

Note this depends on new functionality I added to cnmem with this PR (already merged): NVIDIA/cnmem#7

This PR is an improved version of a (never merged) cuDF PR rapidsai/cudf#422.

Support for multiple simultaneous pools with different modes is future work.

@harrism harrism changed the base branch from master to branch-0.5 December 21, 2018 04:07
@harrism harrism requested a review from jrhemstad December 21, 2018 04:07
@harrism harrism changed the title Add CUDA Managed Memory (Unified Memory) Allocation Mode [REVIEW] Add CUDA Managed Memory (Unified Memory) Allocation Mode Dec 21, 2018
@harrism harrism added feature request New feature or request 3 - Ready for review Ready for review by team labels Dec 21, 2018
Copy link
Contributor

@jrhemstad jrhemstad left a comment

Choose a reason for hiding this comment

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

Only major change is that rmm::alloc needs to be updated to use cudaMallocManaged if CudaManagedMemory is enabled, but PoolAllocation is not.

Copy link
Contributor

@jrhemstad jrhemstad left a comment

Choose a reason for hiding this comment

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

Good to go after these changes.

Co-Authored-By: harrism <mharris@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Ready for review Ready for review by team feature request New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants