Execution Providers
Execution Providers (EPs) enable ONNX Runtime to execute models on different hardware accelerators including CPUs, GPUs, NPUs, and specialized AI chips. Each provider optimizes inference for specific hardware.Available Providers
Getting Provider Information
Common Execution Providers
string
Default CPU execution provider. Always available. Optimized for x86 and ARM CPUs.
string
NVIDIA GPU acceleration via CUDA. Requires CUDA installation.
string
NVIDIA TensorRT for optimized GPU inference. Requires TensorRT installation.
string
AMD GPU acceleration via ROCm.
string
Intel hardware acceleration (CPU, GPU, VPU).
string
Apple Neural Engine and GPU acceleration on macOS/iOS.
string
DirectML acceleration for Windows (AMD, Intel, NVIDIA GPUs).
string
Qualcomm NPU acceleration for mobile and edge devices.
Configuring Providers
Basic Provider Selection
Provider Options
CUDA Provider Options
int
GPU device ID to use. Default is 0.
int
Maximum GPU memory in bytes. Default is max available.
str
Memory allocation strategy: “kNextPowerOfTwo” or “kSameAsRequested”.
str
Convolution algorithm search: “EXHAUSTIVE”, “HEURISTIC”, or “DEFAULT”.
bool
Use default CUDA stream for copies. Default is True.
bool
Allow cuDNN to use maximum workspace size.
bool
Enable CUDA graphs for faster execution with fixed input shapes.
CUDA Provider Example
TensorRT Provider Options
int
GPU device ID. Default is 0.
int
Maximum TensorRT workspace size in bytes. Default is 1GB.
bool
Enable FP16 precision. Default is False.
bool
Enable INT8 quantization. Default is False.
str
Path to INT8 calibration table.
bool
Enable TensorRT engine caching. Default is False.
str
Directory to store cached engines.
TensorRT Provider Example
Dynamic Provider Management
Query Current Providers
Change Providers at Runtime
Dynamic Provider Options
Provider Fallback
Multi-GPU Inference
Provider-Specific Features
CUDA Graphs
TensorRT Engine Caching
Provider Selection Best Practices
Related APIs
- InferenceSession - Create sessions with providers
- SessionOptions - Session configuration
- IOBinding - Device memory management