ONNX IR¶
ONNX IR is an in-memory IR that supports the full ONNX spec for graph construction, analysis, and transformation.
This docsite is organized for fast onboarding, production usage, and complete API references.
Why ONNX IR¶
Full ONNX model coverage, including a subset of structurally invalid models that still need repair workflows.
Efficient tensor handling, including external data and zero-copy friendly pathways.
Robust graph mutation semantics suitable for compiler and transformation passes.
Pythonic APIs that preserve intuitive mapping to ONNX concepts.
Start here¶
Getting Started
User Guides
- Introduction to the IR
- Constructing models
- Tensor Representation in the IR
- Multi-Device Configurations
- Model I/O and external data workflows
- Graph transformation patterns
- Choose the scopes to transform
- Mutate a graph during iteration
- Replace all downstream uses of a value
- Replace a node block with a new block
- Rename values safely (including initializers)
- Iterate recursively over nested subgraphs
- Analyze implicit captures in subgraphs
- Extract a bounded subgraph
- Preserve invariants and use targeted repair
- Subgraphs and functions
- Writing transformation passes
- Performance and large-model workflows
- Debugging transformations
- Migrating from
onnx.helpertoonnx_irAPIs
API Reference
Reliability and Operations