Skip to content

Conversation

@AndreyOrb
Copy link
Contributor

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

@tianleiwu
Copy link
Contributor

/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
Copy link

Azure Pipelines successfully started running 4 pipeline(s).

Copy link
Contributor

Copilot AI left a 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 CreateCudaPinnedAllocator method across the CUDA provider interface hierarchy with arena configuration parameters
  • Updated the allocator creation logic in environment.cc to 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.

@tianleiwu
Copy link
Contributor

/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
Copy link

Azure Pipelines successfully started running 4 pipeline(s).

@tianleiwu tianleiwu requested a review from yuslepukhin January 9, 2026 04:46
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.

3 participants