XenonStack

Data Science

XenonStack Blog What Is ONNX? Model Format, Runtime and Enterprise Fit

and | Published | Updated

Key takeaway

  • What is ONNX? The open model format, how IR versions and opsets work, which ONNX Runtime execution provider fits your hardware, and when to skip it.

ONNX (Open Neural Network Exchange) is an open format for representing machine learning models. It gives every model the same building blocks: a computation graph, a shared set of operators and standard data types. That lets a team train in one framework, such as PyTorch, and run the same model in a different runtime, compiler or hardware accelerator without rewriting it.

For enterprise leaders, ONNX is a portability and deployment decision rather than a modelling one. It separates the choice of training framework from the choice of inference hardware, which matters when the same model has to run in a cloud GPU cluster, on a factory edge device and inside a browser. This guide covers what ONNX is in 2026, how versions and opsets work, which ONNX Runtime execution provider fits which hardware, and when ONNX is the wrong choice.

What is ONNX and what problem does it solve?

According to onnx.ai, ONNX is "an open format built to represent machine learning models". It defines a common set of operators and a common file format so models can move between frameworks, tools, runtimes and compilers. The LF AI and Data Foundation describes it as a community project created by Facebook and Microsoft, and onnx.ai lists it as an LF AI graduate project. The onnx package is released under the Apache-2.0 licence.

The problem it solves is lock-in between training and serving. Without a shared format, every pairing of framework and runtime needs its own converter, and every new accelerator needs support for every framework. ONNX puts one exchange format in the middle. If you are new to the underlying models, our guide to artificial neural network applications and algorithms explains the networks that ONNX graphs describe.

Part of ONNXWhat it isWhy it matters to you
Computation graphNodes (operators) connected by tensors, with declared inputs and outputsAny compliant tool can read and execute the same model
Operator set (opset)A versioned library of operators such as Conv, MatMul and AttentionDecides which models a runtime can load
IR versionThe rules for how the graph, inputs, outputs and metadata are storedChanges only when the file format changes
Data typesStandard tensor types, now including low-precision float and integer typesEnables quantised models for cheaper inference

What has changed in the ONNX ecosystem since it launched?

Much of the early ONNX tooling has moved on. If your team is following an older tutorial, check it against this table before starting.

ItemOlder guidanceStatus in 2026 (source)
Apache MXNet as a source frameworkInstall ONNX support through onnx-mxnetMXNet retired in September 2023 and moved to the Apache Attic (Apache Attic)
ONNX Model ZooDownload pre-trained models from the onnx/models repositoryDeprecated and kept for historical purposes; models moved to Hugging Face, LFS downloads ended 1 July 2025 (onnx/models)
PyTorch exportTorchScript based torch.onnx.exportSince PyTorch 2.9 the dynamo option is True by default, using the torch.export based exporter (PyTorch docs)
Transformer and LLM operatorsComposed from many primitive operatorsONNX 1.18 added Attention, RMSNormalization and RotaryEmbedding; 1.23 added SwiGLU (ONNX releases)
Latest releaseOpset numbers in the low teensONNX 1.23.2 (6 October 2026); ONNX 1.23 uses IR version 14 and opset 28
Generative AI on ONNX RuntimeNot availableonnxruntime-genai provides the generation loop and KV cache management; the API is marked preview (ONNX Runtime docs)

The supported tools list on onnx.ai now includes PyTorch, TensorFlow (through tensorflow-onnx), Keras, scikit-learn (through onnxmltools), XGBoost, CatBoost, MATLAB, PaddlePaddle and Hugging Face Optimum on the build side, and runtimes and compilers including ONNX Runtime, NVIDIA TensorRT, OpenVINO, TVM, onnx-mlir and Windows ML on the deploy side.

How do ONNX versions, IR versions and opsets fit together?

The ONNX versioning documentation separates two numbers. The IR version describes the file format, and it changes only when the format changes in a way existing readers cannot handle. The opset version describes the operator library, and it changes when operators are added, removed or have their behaviour altered. Each model declares the opset it relies on, and a runtime must support that opset to load the model.

ONNX releaseIR versionDefault ai.onnx opsetNotable additions (from release notes)
1.18.01123Attention, RMSNormalization and RotaryEmbedding operators
1.19.01224FLOAT8E8M0 type, Swish operator, Attention updates for in-place KV cache
1.20.01325Python 3.14 stable ABI support, 2-bit data type
1.21.01326BitCast operator, Attention specification changes
1.22.01327LinearAttention and CausalConvWithState operators
1.23.01428SwiGLU operator, FLOAT6E2M3 and FLOAT6E3M2 types

A practical point for architects: the format and the runtime move at different speeds. The ONNX Runtime 1.31.0 release notes state that its ONNX dependency stays at 1.22.0 after the ONNX 1.23 integration was reverted. Export to the opset your production runtime supports, not the newest opset your exporter can write.

What does ONNX Runtime add, and which execution provider fits your hardware?

ONNX Runtime is a cross-platform engine for running ONNX models. Its site says it runs on Linux, Windows, Mac, iOS, Android and in web browsers, with APIs for Python, C#, C++, Java, JavaScript and Rust, and that it powers AI in Windows, Office, Azure Cognitive Services and Bing. The latest release at the time of writing is 1.31.1 (26 October 2026), which requires Python 3.11 or later.

Two-column diagram mapping target hardware (NVIDIA GPU, Intel, Windows and Snapdragon, mobile and browser) to ONNX Runtime execution providers (CUDA, TensorRT, OpenVINO, DNNL, DirectML, QNN, CoreML, WebGPU)

Hardware acceleration comes through execution providers (EPs). ONNX Runtime hands the nodes or sub-graphs a provider supports to that provider, so one API can target CPUs, GPUs, FPGAs and NPUs.

Target hardwareExecution providerWhen it fitsStatus on onnxruntime.ai
NVIDIA GPU (data centre or workstation)CUDA, TensorRTHigh-throughput inference; TensorRT for maximum NVIDIA-specific optimisationListed
Intel CPU, GPU or edge deviceOpenVINO, Intel DNNL (CPU)Intel servers and edge devicesListed
AMD GPUMIGraphXAMD GPU deploymentsListed; ROCm EP deprecated
Windows devicesDirectMLWindows applications across GPU vendorsListed
Qualcomm SnapdragonQNNOn-device inference on Snapdragon NPUsListed
Mobile and embeddedNNAPI (Android), CoreML (Apple), XNNPACKPhones, tablets and low-power Arm devicesCoreML in preview
BrowserWebGPUClient-side inference without a server round tripListed
Arm LinuxArm Compute Library, Arm NNArm edge devicesPreview; ACL EP deprecated in 1.31.0

Where does ONNX fit in an enterprise AI stack?

In our own architecture work, ONNX usually sits between training and serving. A common pattern is to train priority or risk prediction models in PyTorch, export them to ONNX and serve them as a lightweight model service. For edge and computer vision deployments, our solution designs compare ONNX Runtime, TensorRT, OpenVINO and native PyTorch as the model runtime, and pick quantised ONNX or TFLite models when inference has to stay on the device. Our guide to computer vision on edge covers that deployment pattern in more detail.

The value is that the serving layer no longer depends on the training framework. A data science team can change frameworks, and an operations team can change hardware, without both having to move at once. Where those models run across plants, vehicles and data centres, NexaStack is an agentic operating platform for physical AI that runs across on-premises, cloud and hybrid environments.

What are the governance, security and cost questions?

Governance. An ONNX file is a deployable artefact, so treat it like one: version it, record the source model, the exporter version, the opset and the validation results, and approve it before promotion. When ONNX models feed decisions made by AI agents, ElixirData Context OS keeps governed context, versioned policy and decision traces in one decision layer above AI agents, and AgentGRC keeps autonomous agent actions inside policy, with the audit trail risk teams need.

Security. A runtime parses model files, so a model from an untrusted source is an input to secure. Recent ONNX Runtime patch releases (1.28.3 and 1.30.1) list memory-safety and model-validation fixes in their release notes. Load models only from controlled registries and keep the runtime patched.

Cost. Quantisation is the main cost lever. The ONNX Runtime quantisation guide supports 8-bit static and dynamic quantisation and 4-bit block-wise weight-only quantisation for MatMul and Gather. It suggests dynamic quantisation for RNNs and transformers and static quantisation for CNNs, and it warns that quantisation is not a loss-less transformation and that older hardware may see no gain. Our overview of energy-efficient computer vision models explains how compression and quantisation trade accuracy for efficiency.

How should an enterprise adopt ONNX?

  1. Pick one model and one target. Choose a model already in production and the hardware you most want to serve it on.
  2. Fix the opset. Check which opset your production runtime supports and export to that, not the newest available.
  3. Export and validate. Export with the current exporter (for PyTorch, torch.onnx.export with the default dynamo option) and compare outputs against the original model on a held-out data set.
  4. Choose the execution provider. Benchmark the default CPU provider against the hardware-specific EP on real traffic shapes, including batch size and input length.
  5. Quantise only with evidence. Apply static or dynamic quantisation, then measure accuracy and latency again before accepting the change.
  6. Register and govern. Store the ONNX file with its lineage, opset, validation report and approval, and patch the runtime on a schedule.

When should you not use ONNX?

SituationWhy ONNX may not fitWhat to do instead
Model relies on custom operators or heavy dynamic control flowExport may fail or need custom operator work in every runtimeServe in the native framework until the operators are covered
Serving only on one vendor's stackA vendor-native path may already give the best optimisationUse the vendor runtime directly, and keep ONNX as an exchange option
Large language model serving at scaleonnxruntime-genai is marked preview and subject to changeCompare it with dedicated LLM serving engines before committing
Frequent architecture experimentsEvery change needs re-export and re-validationAdopt ONNX once the model is stable enough to deploy

To map one model deployment decision your agents depend on, and the context and policy around it, book a Context Workshop. See what happens in the workshop.

Frequently asked questions about ONNX

What is ONNX in simple terms?

ONNX (Open Neural Network Exchange) is an open file format for machine learning models. It defines a computation graph, a shared set of operators and standard data types, so a model trained in one framework can be run by another tool, runtime or compiler.

Is ONNX the same as ONNX Runtime?

No. ONNX is the model format and specification, maintained as an LF AI and Data graduate project. ONNX Runtime is a separate open source engine that loads ONNX models and runs them for inference and training on Linux, Windows, Mac, iOS, Android and in web browsers.

What is the difference between an ONNX IR version and an opset?

The IR version describes the file format itself, such as how the graph and metadata are serialised. The opset version describes the library of operators a model can use. ONNX 1.23 uses IR version 14 and opset 28.

How do I convert a PyTorch model to ONNX?

Use torch.onnx.export. Since PyTorch 2.9 the dynamo option is True by default, so export goes through the torch.export based exporter rather than TorchScript. Validate the exported model against the original outputs before deployment.

Does quantising an ONNX model always make it faster?

No. ONNX Runtime documentation states that quantisation is not a loss-less transformation, and gains depend on hardware. Older hardware may see no benefit, and int8 GPU speed-ups need Tensor Core int8 support.

Follow XenonStack on LinkedIn: XenonStack on LinkedIn for new guides on agentic AI, data and platform engineering.

Ready to put AI agents to work? Explore ElixirClaw, the agentic OS platform to build, orchestrate and govern AI agents.

Table of Contents

navdeep-singh-gill

Navdeep Singh Gill

Global CEO and Founder of XenonStack

LinkedIn profile

Navdeep Singh Gill is serving as Chief Executive Officer and Product Architect at XenonStack. He holds expertise in building SaaS Platform for Decentralised Big Data management and Governance, AI Marketplace for Operationalising and Scaling. His incredible experience in AI Technologies and Big Data Engineering thrills him to write about different use cases and its approach to solutions.

Get the latest articles in your inbox

Subscribe Now

Interested in Solving your Challenges with XenonStack Team
Get Started

Get Started with your requirements and primary focus, that will help us to make your solution

Please Select your Industry
Banking
Fintech
Payment Providers
Wealth Management
Discrete Manufacturing
Semiconductor
Machinery Manufacturing / Automation
Appliances / Electrical / Electronics
Elevator Manufacturing
Defense & Space Manufacturing
Computers & Electronics / Industrial Machinery
Motor Vehicle Manufacturing
Food and Beverages
Distillery & Wines
Beverages
Shipping
Logistics
Mobility (EV / Public Transport)
Energy & Utilities
Hospitality
Digital Gaming Platforms
SportsTech with AI
Public Safety - Explosives
Public Safety - Firefighting
Public Safety - Surveillance
Public Safety - Others
Media Platforms
City Operations
Airlines & Aviation
Defense Warfare & Drones
Robotics Engineering
Drones Manufacturing
AI Labs for Colleges
AI MSP / Quantum / AGI Institutes
Retail Apparel and Fashion

Proceed Next