-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Allow choosing memory type for CudaPinned allocator #26892
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
base: main
Are you sure you want to change the base?
Allow choosing memory type for CudaPinned allocator #26892
Conversation
2) Added missing override stub function in tests
|
/azp run Linux QNN CI Pipeline, Win_TRT_Minimal_CUDA_Test_CI, Windows ARM64 QNN CI Pipeline, Windows GPU Doc Gen CI Pipeline |
|
Azure Pipelines successfully started running 4 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR enables the CudaPinned allocator to use configurable memory types (DeviceAllocator or ArenaAllocator) instead of being hardcoded to DeviceAllocator, addressing issue #26887.
Key Changes:
- Added a new
CreateCudaPinnedAllocatormethod across the CUDA provider interface hierarchy with arena configuration parameters - Updated the allocator creation logic in
environment.ccto pass arena configuration to the new method - Implemented the actual allocator creation logic in
CUDAExecutionProvider
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| onnxruntime/core/providers/cuda/cuda_provider_factory.h | Adds interface declaration for CreateCudaPinnedAllocator with arena configuration parameters |
| onnxruntime/core/providers/cuda/cuda_provider_factory.cc | Implements the factory method to delegate to CUDAExecutionProvider::CreateCudaPinnedAllocator |
| onnxruntime/core/providers/cuda/cuda_execution_provider.h | Declares static method CreateCudaPinnedAllocator in the execution provider |
| onnxruntime/core/providers/cuda/cuda_execution_provider.cc | Implements the allocator creation with arena configuration support |
| onnxruntime/core/session/environment.cc | Updates call site to use new method name and pass arena configuration |
| onnxruntime/test/providers/cuda/test_cases/cuda_test_provider.cc | Adds stub implementation for test provider interface |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
…ateCudaPinnedAllocator
|
/azp run Linux QNN CI Pipeline, Win_TRT_Minimal_CUDA_Test_CI, Windows ARM64 QNN CI Pipeline, Windows GPU Doc Gen CI Pipeline |
|
Azure Pipelines successfully started running 4 pipeline(s). |
Description
CudaPinned allocator uses hardcoded to DeviceAllocator memory type.
The PR comes to allow choosing memory type for CudaPinned allocator between DeviceAllocator and ArenaAllocator.
Motivation and Context
Fixed issue #26887