ONNX
Open Neural Network Exchange, an open format for representing machine learning models across different frameworks.
Technical explanation
ONNX (Open Neural Network Exchange) solves a real annoyance in ML workflows. You train a model in PyTorch, but your production environment runs TensorFlow. Or you need to deploy to a mobile device that only supports Core ML. ONNX is an intermediate format that lets you export from one framework and import to another. It's like PDF for machine learning models.
The format defines a common set of operators and data types that most neural networks use. When you export a model to ONNX, you get a file that describes the computational graph in a framework-agnostic way. ONNX Runtime, developed by Microsoft, can execute these files directly with solid performance. Many hardware vendors also support ONNX for their accelerators.
Conversion isn't always painless. Complex models with custom operations sometimes don't export cleanly. You might need to rewrite parts of your model or find workarounds for unsupported operators. But for standard architectures, it usually just works. PyTorch has built-in ONNX export, and most other frameworks have converters available.
Beyond portability, ONNX enables optimizations. ONNX Runtime applies graph-level optimizations that can speed up inference. You can also use tools like ONNX Optimizer to simplify models before deployment. For teams dealing with multiple frameworks or deployment targets, ONNX reduces the friction of getting models into production.