Map inference operators to CPU, GPU and NPU roles, follow ONNX Runtime execution-provider partitioning, and plan around static shapes, quantization and host-to-device copies.
Who this is for
AI engineers, developers deploying local models, and edge systems architects.
Learning objectives
- Map preprocessing, GEMM-heavy layers and always-on vision or audio kernels to CPU, GPU and NPU strengths.
- Explain how ONNX Runtime partitions graphs across execution providers and where CPU fallback appears.
- Identify OpenVINO NPU static-shape requirements and the cost of cross-device tensor copies.
- Separate cold-start load latency from steady-state throughput when comparing accelerators.
- Write a one-page hardware selection checklist before buying silicon for a local inference service.
Start with device roles: CPU, GPU and NPU specializations
Local inference rarely belongs on a single universal compute engine. A durable pipeline assigns distinct phases to three silicon classes: the central processing unit (CPU), the graphics processing unit (GPU), and the neural processing unit (NPU). Treat the assignment as an engineering contract, not a marketing slogan: each device has a different memory model, operator coverage and power envelope.
The CPU remains the control plane. It owns tokenization, branching, I/O orchestration, scheduling, and any operator the accelerator cannot claim. Its general-purpose cores and deep caches handle irregular control flow well, but they lose to wide matrix engines on dense GEMM and convolution kernels. If your pipeline spends most of its wall time on the CPU after “accelerating” a model, the graph is fragmented or the operator set never left the host.
The GPU is still the default high-throughput engine for large language model decode, batched vision models and dense linear algebra. Thousands of parallel arithmetic units and wide device-memory buses favor sustained GEMM. The trade-off is power, thermals and the need to keep tensors resident in device memory long enough to amortize host-to-device copies.
The NPU strips away general graphics pipelines to focus on tensor convolutions and fused multiply-accumulate work at low wattage. It shines on continuous, always-on workloads—camera background segmentation, wake-word spotting, audio denoise—where a discrete GPU would be thermally and economically wasteful. NPU value collapses when the model needs dynamic shapes, exotic operators or frequent fallback to the CPU.
Inventory every execution-provider string your host can load and record the driver or plugin version that unlocks it. Marketing claims of an NPU do not count until a runtime query returns a usable device.
Follow the graph: execution providers and partitioning
Modern runtimes do not compile an entire network to one device by default. They treat the model as a computational graph of operators and ask each backend which subgraphs it can accelerate. ONNX Runtime implements this through its execution provider (EP) architecture: CUDA, DirectML, OpenVINO, QNN and the CPU provider each advertise capabilities and claim supported nodes.
When a session starts, ONNX Runtime queries registered providers in priority order. Each provider inspects the graph—typically via capability queries such as GetCapability()—and takes the operators it can run natively. Unsupported nodes fall back to the CPU provider. This design maximizes compatibility, but every EP boundary is a potential memory copy between host RAM and accelerator memory.
Partition quality is therefore a first-class performance variable. A model that oscillates between GPU kernels and unsupported CPU ops will spend more time copying activations than computing them. Before declaring a device “too slow,” export the assigned EP map, count partition boundaries, and measure copy time separately from kernel time. Fixing operator coverage or simplifying the export graph often beats buying a larger accelerator.
Provider order and session options matter as much as silicon. Placing an NPU or OpenVINO provider ahead of CUDA does not magically accelerate unsupported ops; it only changes which backend wins the first claim. Document the exact ORT version, EP list and model opset in your deployment manifest so regression tests catch silent repartitions after upgrades.
Keep a one-model repro that prints operator-to-EP assignment and store it beside the model hash so upgrades become diffs instead of latency mysteries.
Respect silicon constraints: static shapes and quantization
Accelerators impose compile-time contracts that flexible CPU paths hide. OpenVINO’s 2025 NPU device documentation is explicit: the NPU plugin expects static model input shapes. Dynamic batch sizes or variable sequence lengths that work on CPU or GPU may fail to compile, or force costly reshape/pad paths, when dispatched to that NPU plugin.
Treat static shapes as a deployment requirement, not a quirk. For vision models, pad to a fixed tensor geometry and record the padding policy in the acceptance test. For text models, decide whether the NPU path is even appropriate; many generative workloads remain GPU- or CPU-bound precisely because sequence length varies. Never generalize one vendor’s NPU static-shape rule to every NPU on the market—cite the exact plugin and version under test.
Quantization decides whether weights fit in local bandwidth budgets. Moving from FP32 to FP16, INT8 or INT4 reduces footprint and can raise arithmetic throughput, but only if the runtime and device support the chosen precision end to end. Measure accuracy on a held-out set at the same quantization you intend to ship; a TOPS brochure number without an accuracy gate is not an engineering decision.
Separate cold-start metrics from steady-state metrics. Time-to-first-token or first successful inference includes model load, compilation and warmup. Tokens per second or frames per second after warmup describe sustained service behavior. Mixing the two produces false hardware rankings and broken capacity plans.
Share padding and truncation helpers between export notebooks and production so static-shape NPU paths do not silently diverge from evaluation.
Account for transfers: PCIe copies and residency
Even a perfectly assigned subgraph loses if intermediate tensors bounce across the PCIe bus. Each EP boundary may force an activation copy between system RAM and device memory. High-frequency ping-pong between CPU fallback nodes and an accelerator erases the arithmetic advantage of the accelerator.
Design for residency. Prefer exporting graphs that keep long-running kernels on one device, fuse preprocessing into device-friendly ops when the SDK allows it, and avoid unnecessary host round-trips for per-token or per-frame bookkeeping. If the runtime must return tensors to the host for post-processing, batch that work and measure the copy explicitly.
Unified-memory platforms (certain SoCs and APUs) change the copy story but not the operator story. Shared physical memory can reduce explicit DMA, yet unsupported operators still serialize on CPU cores and still break NPU compile assumptions. Always verify with a profile that attributes time to kernels, copies and host fallback—not with a single end-to-end stopwatch alone.
Prefer headless images for appliance hosts; display servers compete for shared memory on iGPU and NPU parts under sustained load.
Build a hardware selection checklist before you buy
Translate the chapter into a one-page checklist tied to a concrete workload. Name the model family, precision, maximum batch or sequence length, latency budget, power ceiling and whether the decision must remain on-device during network loss. Only then map candidates to CPU-only, iGPU, discrete GPU or NPU paths.
For each candidate, record: supported runtimes and EP list, confirmed operator coverage for your exported graph, shape constraints, quantization path, idle and sustained wall power, thermal envelope, and software support lifetime. Reject any option that cannot state an EP assignment and an accuracy check for your exact model artifact.
Use this series next chapters to deepen the checklist: inference memory budgeting, precision trade-offs, model formats and runtimes, benchmark metric definitions, and final accelerator selection under cost and power constraints. Chapter 1’s job is narrower—stop treating “AI PC” as a synonym for one chip class, and start treating inference as a partitioned graph with measurable copy and shape contracts.
Treat missing operator-limitation matrices from vendors as procurement rejects, equal in weight to missing power figures.
Worked example: local vision classifier vs local LLM decode
Consider a fixed-resolution image classifier that must run continuously at under five watts. After exporting to ONNX with static HxW inputs, an NPU or low-power OpenVINO path can claim the convolutions while the CPU handles capture bookkeeping. The acceptance test pads frames to the compiled shape, records INT8 accuracy against a golden set, and fails the build if CPU fallback nodes appear inside the hot loop.
Contrast that with an 8B-parameter chat model decoding token by token. Sequence length is dynamic, attention patterns stress memory bandwidth, and NPU static-shape assumptions rarely fit. A dual-channel Mini PC CPU/iGPU path or a discrete GPU with resident weights is the honest baseline. Here the checklist emphasizes KV-cache RAM, sustained tokens per second after warmup, and EP maps that keep matmul kernels off the CPU.
The same organization may run both workloads. That is not a reason to buy one “universal” accelerator without evidence. It is a reason to maintain two manifests, two accuracy gates and two power budgets—and to let the graph, not the brochure, choose the silicon.
When product mix shifts from classifiers to LLM assistants, update the hardware checklist instead of forcing one chassis to serve two incompatible contracts.
Technical Glossary
- SODIMM
- Small Outline Dual In-Line Memory Module — compact modular RAM form factor used in laptops and most socketed Mini PCs.
- NPU
- Neural Processing Unit — dedicated silicon block optimized for low-power, fixed-precision AI inference.
- UCFF
- Ultra-Compact Form Factor — roughly 4x4 inch (10x10 cm) Mini PC motherboard and chassis class (typically 0.5–1.5 L).
- PCIe lane
- A point-to-point serial data link (Tx/Rx pair) connecting the CPU to NVMe SSDs, NICs, or expansion cards.
- ECC
- Error-Correcting Code memory — detects and corrects single-bit memory errors for unattended server stability.
- UEFI
- Unified Extensible Firmware Interface — modern system firmware controlling boot, power limits, fan curves, and auto power-on.
- NAND
- Non-volatile flash memory cells used inside SSDs; endurance and sustained write behavior depend on controller and cache.
Sources
- ONNX Runtime Execution Providers Documentation
Overview of execution provider architecture and graph assignment
- OpenVINO 2025 NPU Device Documentation
NPU requirements, compiler plugins, and input shape constraints
Claim-to-source map
- ONNX Runtime partitions computational graphs and assigns supported operators to execution providers like CUDA, OpenVINO or CPU.
Direct sources: ONNX Runtime Execution Providers Documentation (citation) - OpenVINO 2025 documentation specifies that the NPU plugin requires static model input shapes for inference execution.
Direct sources: OpenVINO 2025 NPU Device Documentation (citation)
