An execution provider is an ONNX Runtime backend that assigns graph nodes or subgraphs to hardware-specific kernels, drivers, and libraries. It lets one ONNX model target CPUs, GPUs, edge devices, or specialized accelerators while using the deployment platform’s compute capabilities. section 5.4
Common provider choices map the model to different hardware and runtime stacks:
- CPUExecutionProvider supplies a vendor-agnostic CPU path. section 5.4
- CUDAExecutionProvider accelerates computation on NVIDIA GPUs; TensorRT provides another supported NVIDIA GPU backend. section 5.4
- ROCm and MIGraphX target AMD GPUs, while DirectML targets Windows GPUs. section 5.4
- OpenVINO, oneDNN, XNNPACK, Android NNAPI, and Qualcomm QNN address other CPU, mobile, edge, and chipset environments; TVM is listed as preview. section 5.4
Provider selection is an operational deployment decision rather than a model-format change. A session can prioritize a GPU provider and include CPU as a fallback. Graph optimizations are provider-aware: extended fusions apply after partitioning to CPU, CUDA, or ROCm-assigned nodes, while layout optimization applies to CPU-assigned nodes. section 5.4 section 5.6.1
CUDA with CPU fallback
Configure an inference session with providers = ['CUDAExecutionProvider', 'CPUExecutionProvider']; ORT attempts the CUDA path first and retains a CPU path for supported fallback behavior. Inspect available backends with rt.get_available_providers().
GPU execution can still lose time to data movement. ORT places ordinary inputs and outputs on the CPU by default, so IOBinding can keep tensors on the execution device and avoid unnecessary CPU–GPU copies. section 5.6.2 section 5.7
Provider choice also affects diagnosis: ORT profiling records per-operator latency and the responsible execution provider, and Ort_perf_view summarizes those measurements for performance analysis. section 10.1
