NEW
Also known as: Open Neural Network Exchange
An open standard format for representing machine learning models to enable cross-framework interoperability.
DESCRIPTION
ONNX defines an open, extensible intermediate representation and operator set for machine learning models, enabling portability across frameworks and hardware. It supports conversion from popular training frameworks like PyTorch and TensorFlow and deployment through runtimes such as ONNX Runtime. The format is based on Protocol Buffers and includes versioned opsets to manage compatibility. ONNX accelerates inference by decoupling model training from serving and is widely integrated in optimization toolchains, compilers, and hardware backends. It is governed by the LF AI & Data Foundation and sustained by a broad ecosystem.
ALTERNATIVE DEFINITIONS
ONNX (GitHub)
Open Neural Network Exchange (ONNX) is an open format built to represent machine learning models.
Concise emphasis on open format and model representation.
PyTorch
ONNX is an open format built to represent machine learning models.
Highlights ONNX usage from a major training framework’s perspective.
RELATED TERMS
ONNX Runtime PyTorch TensorFlow TVM OpenVINO Model Serialization Interoperability Protocol Buffers NVIDIA TensorRT
COMPETING TERMS
TorchScript TensorFlow SavedModel
RELATIONS
- Implemented by: Keras NVIDIA TensorRT ONNX Runtime OpenVINO PyTorch Sparsify TensorFlow Lite TensorRT
KNOWLEDGE AREAS
AI MLOps Platform & Tooling Software Engineering
TARGET AUDIENCE
AI Engineer MLOps Engineer Data Scientist Software Developer Data Engineer
EXTERNAL SOURCES
- Wikipedia - Open Neural Network Exchange
- ONNX - Project overview and specification entrypoint
- ONNX Runtime - Runtime docs for deploying ONNX models
TOP QUESTIONS
What problem does ONNX solve?
ONNX provides a common model representation so models trained in one framework can be deployed in another. This reduces lock-in and simplifies multi-framework toolchains.
Category: Overview
How does ONNX relate to ONNX Runtime?
ONNX is the model format, while ONNX Runtime is an inference engine that executes ONNX models efficiently across CPU, GPU, and specialized accelerators.
Category: Relationship
When should I convert a model to ONNX?
Convert when you need cross-framework portability, hardware-accelerated inference, or to integrate with production runtimes and compilers that optimize ONNX graphs.
Category: Practice
What are common pitfalls when exporting to ONNX?
Unsupported operators, dynamic control flow, and custom layers often cause export issues. Verify opset compatibility and use exporter-friendly model patterns.
Category: Mistakes
How is operator support managed in ONNX?
ONNX uses versioned opsets that define operator semantics. Framework exporters and runtimes declare supported opset versions to ensure compatibility.
Category: Standard
Is ONNX suitable for training or only inference?
ONNX primarily targets inference. While there is ONNX-ML and initiatives around training, most production usage focuses on deployment.
Category: Scope
What are alternatives to ONNX?
TorchScript and TensorFlow SavedModel are common alternatives. Compiler stacks like Apache TVM also define their own IRs for optimization.
Category: Alternatives
How do I validate an ONNX model?
Use ONNX checker utilities and run inference parity tests against the source framework. Model shape inference and unit tests help catch mismatches.
Category: Validation
What performance impact does ONNX have?
ONNX itself is a format; performance gains come from runtimes and compilers that optimize ONNX graphs, often enabling FP16/INT8 and kernel fusion.
Category: Performance