liveBook · Manning

Execution provider

As explained in Domain-Specific Small Language Models

An ONNX Runtime backend that assigns graph nodes to a specific hardware/runtime implementation such as CPU, CUDA, or ROCm.

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

How Domain-Specific Small Language Models covers it

How deep it goes
Explains node assignment, provider ordering, provider-specific optimization, data transfers, and profiling, but defers backend implementation internals.
Examples
Uses CUDA with CPU fallback, GPU-bound tensor addition, GPT optimization, and CPU profiling of a linear regression graph.
What it assumes
Assumes familiarity with ONNX models, computation graphs, inference sessions, and target hardware environments.
What you can do after
Configure provider order, bind data to an accelerator, and diagnose operator performance with ONNX Runtime profiling.
How it connects
Connects ONNX Runtime with ONNX graphs, graph optimization, IOBinding, GPU acceleration, and performance profiling.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Domain-Specific Small Language Models. The section links point to the parts of the book it draws on.