ONNX opsets: same layer, different file, different chip
Before deploying to an NPU, you check the vendor’s list of supported operators. The list is written in ONNX names, and which names your model contains is decided earlier, by the exporter and by the opset it targets, the version of the ONNX operator set. Export the same PyTorch model a few years apart and the check can pass for one file and fail for the other.
ONNX opsets, 2017 to 2026
ONNX groups its operators into opsets, numbered versions of the operator set. A release of the onnx package usually defines a new opset, and each version of an operator belongs to the opset that introduced it. A model file does not tag its nodes one by one: it declares one opset per operator domain, and every node in that domain follows that version. The onnx package holds the whole history, so the standard can be counted opset by opset.
Panel A counts the default ai.onnx domain, not the separate machine-learning and training domains, and shows one burst. Between May 2018 and May 2020 the standard went from 95 operators to 160, adding what detection and quantized models needed: Resize, NonMaxSuppression, RoiAlign, gather and scatter, quantize and dequantize. In the six years since, 41 more arrived. Nine of them, the green dots, are whole layers written as one node, mostly from transformers; the rest cover signal processing, bitwise and string operations.
Panel B shows what replaced the burst: revisions. Opset 13 added nothing and revised 79 operators, moving several attributes to inputs, and most opsets since 2024 revise about twenty each. An operator has three versions on average; Pad, Constant and Cast have ten. For a vendor toolchain, a known name with a new signature can fail as surely as an unknown one. For a model, each new opset changes what an exporter can write.
Same layer, different ONNX file
The same PyTorch layer can become different ONNX operators depending on the exporter, the opset it targets and the clean-up passes run afterwards. Below, two layers exported in 2020, with PyTorch’s classic exporter at opset 13, and in 2025, with its newer exporter, dynamo=True, at opset 25.
LayerNorm shows the common direction: once an opset defines a layer as one operator, the export collapses to it. LayerNorm does at opset 17, GELU at 20, GroupNorm at 21, RMSNorm and attention at 23. Softplus goes the other way: the newer exporter adds a guard against large inputs.
The tools change the file as much as the standard does. The newer exporter unrolls a 16-step RNN into 99 nodes where the classic one keeps a single RNN node. The ONNX Simplifier, onnxsim, which many pipelines run just before the vendor’s converter, turns ZeroPad2d’s eight nodes into one Pad. And a new operator is not always used: SiLU stays Sigmoid and Mul although Swish exists since opset 24.
Convolutions, pooling and plain activations export the same everywhere; the differences sit mostly in normalization, attention and recurrent layers. These are single layers exported alone. Inside a full model, the exporter can also fuse across layers.
Same ONNX file, different chips
A smaller graph can be easier for a compiler to recognise, but only if the target toolchain supports the newer operator. Each vendor toolchain rewrites the ONNX graph its own way before deciding what runs on the NPU, and the two translations can cancel each other out.
Each toolchain gives the same node a different shape. RKNN replaces it with exNorm, a normalization operation of its own, and runs it on the NPU as one step. TI’s TIDL splits it into three: a normalization, then the scale and the shift as two element-wise operations. On the i.MX 8M Plus, the model goes through onnx2tf into TensorFlow Lite, which spells the maths out again in ten operations: MobileViT’s 21 LayerNorms become 210, and the compact export does not translate into a simpler implementation on this toolchain.
The newest operators carry the opposite risk. An Attention node at opset 23 replaces eight, but a toolchain that has not implemented it must reject it or send it to the CPU, while the eight-node form might have run on the NPU. We have not yet tested Attention, RMSNormalization or GroupNormalization on an NPU; they are next on our list.
Checklist before deploying
Four habits keep the export from deciding for you:
- Treat the exporter, the opset and the simplifier as dependencies: pin their versions and record them next to every model file.
- Before reading a vendor’s support list, check which opset and which operators your file actually contains, with the snippet below.
- Compare that opset with the range the vendor’s toolchain accepts. A newer opset gives a smaller graph, not necessarily a better-supported one.
- Test the exact file you ship, on the board: the toolchain, not the file, decides whether a node runs as one operation or ten.
import collections, onnx
m = onnx.load("model.onnx", load_external_data=False)
print({o.domain or "ai.onnx": o.version for o in m.opset_import})
print(collections.Counter(n.op_type for n in m.graph.node))
Where we fit
- We export your model the way your pipeline does, and list the ONNX operators the file really contains.
- We run that file through the toolchain of every board on your list and show what each layer becomes: one operation, several, or a fallback to the CPU.
- We measure speed and accuracy on the boards themselves, not from support lists.
- When a layer does not map well, we change the export or the model until it runs on the NPU.
Send us your model and the boards on your list. Talk to us.