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

Use CUDA virtual memory for pinned memory allocator. #10850

Merged
merged 9 commits into from
Sep 27, 2024

Conversation

trivialfis
Copy link
Member

@trivialfis trivialfis commented Sep 25, 2024

This is to avoid obtaining CUDA memory-related global locks (like those used by cudaFree), and to fix #10312 . Only works with cudart>=12.5. The implementation is based on this blog post, with additional support for host numa allocation.

Running MGPU column split tests, haven't been able to observe any hang with the PR. (yet)

  • Add a grow-only virtual memory allocator.
  • Define a driver API wrapper. Split up the runtime API wrapper.

@trivialfis trivialfis force-pushed the virtual-mem branch 3 times, most recently from 468b590 to 3fafe8e Compare September 26, 2024 08:15
- Add a grow-only virtual memory allocator.
- Define a driver API wrapper. Split up the runtime API wrapper.
@trivialfis trivialfis changed the title [WIP] Use CUDA virtual memory for pinned memory allocator. Use CUDA virtual memory for pinned memory allocator. Sep 26, 2024
@trivialfis
Copy link
Member Author

At the moment, this is not being tested on the CI as the feature requires CTK12.5+ to be stable.

@trivialfis trivialfis marked this pull request as ready for review September 26, 2024 20:25
@trivialfis
Copy link
Member Author

trivialfis commented Sep 27, 2024

cc @hcho3 @rongou @RAMitchell .

@@ -118,6 +120,14 @@ std::int32_t OmpGetNumThreads(std::int32_t n_threads) {
return n_threads;
}

[[nodiscard]] bool GetCpuNuma(unsigned int* cpu, unsigned int* numa) {
Copy link
Member Author

Choose a reason for hiding this comment

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

This is not used, I keep it to check the numa node when debugging.

@trivialfis trivialfis merged commit 271f4a8 into dmlc:master Sep 27, 2024
30 checks passed
@trivialfis trivialfis deleted the virtual-mem branch September 27, 2024 20:26
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.

Hang inside NCCL.
2 participants