Svashasan Logo
Simulated data

AI and Machine Learning · Model exchange format

ONNX

Open Neural Network Exchange

Also known as .onnx file, ONNX format, ONNX opset

IntermediateSource-checked · awaiting technical reviewLast reviewed 6 December 2026

ONNX (Open Neural Network Exchange) is an open format for representing machine learning models as a computation graph of standard operators, so that a model trained in one framework can be run by many runtimes, compilers and hardware toolchains.

Explanation

An ONNX model is a graph serialised with Protocol Buffers. Nodes reference operators, graph inputs and outputs are typed tensors, and initialisers hold fixed values such as weights. The core operator set is the ai.onnx domain and classical ML operators are in ai.onnx.ml; custom domains and operators are allowed but reduce portability. ONNX is strongly typed and performs no implicit casts.

Operators are versioned through opsets. Each model declares an opset for every domain it uses, and an operator follows its most recent definition at or below that opset, so the same operator name can behave differently in different opsets. Exporters, converters and runtimes must agree on supported opsets and operators, which is a frequent source of deployment errors.

ONNX is a format, not a runtime: execution is done by engines such as ONNX Runtime or TensorRT, whose ONNX parser is its primary import path. The project uses open governance and is listed as an LF AI graduate project. ONNX itself defines no accuracy or speed; those depend on the runtime, precision and hardware.

How it works

A framework exporter, such as PyTorch's ONNX exporter, captures the model and writes the graph, weights and metadata to a .onnx file at a chosen opset. Tools can then check, simplify or quantise the graph by inserting QuantizeLinear/DequantizeLinear nodes. A runtime loads the file, infers tensor shapes, applies its own graph optimisations and maps nodes to hardware kernels.

Automotive applications

  • Moving models from training frameworks to vehicle runtimes
  • Input to TensorRT and SoC vendor compilers
  • Static INT8 quantisation in QDQ format
  • Model inspection and review in CI pipelines

Example

A perception team exports its PyTorch detector to ONNX at a fixed opset, runs the file in ONNX Runtime on a workstation as a reference, and gives the same file to the SoC vendor's compiler; outputs from both are compared on a regression set before release.

An illustrative example: any figures in it are worked numbers, not measurements.

References

  1. ONNX: Open Neural Network Exchange (opens in a new tab)

    ONNX project (onnx.ai) · Project documentation · retrieved 6 December 2026

    “an open format built to represent machine learning models”
  2. ONNX Concepts (opens in a new tab)

    ONNX project documentation (onnx.ai) · Project documentation · Input, Output, Node, Initializer, Attributes; Serialization with protobuf; Opset version · retrieved 6 December 2026

  3. TensorRT Architecture Overview (opens in a new tab)

    NVIDIA TensorRT documentation · Manufacturer documentation · ONNX · retrieved 6 December 2026

Definitions are original summaries. Standards text is not reproduced; follow the links for the official publications.