ONNX Opset Guide#

This reference summarizes ONNX opset support for TensorRT’s ONNX parser and points to exporter settings, operator coverage, and common import failures.

Supported ONNX and Opset Versions#

Values below match the TensorRT Support Matrix and Prerequisites for TensorRT 11.x. Confirm against the matrix for your target release if versions diverge.

Item

TensorRT 11.x

ONNX package version

1.20.0

Maximum opset

25

Minimum opset (official backward support)

9 and above

Operator support list

ONNX-TensorRT operators.md

Where possible, the parser is backward compatible to opset 9. The ONNX Model Opset Version Converter can assist when an exported model uses operators from a newer opset than your deployment target supports.

Export Recommendations#

For most TensorRT deployments:

  1. Export from your training framework to the latest opset your exporter supports, then verify import with TensorRT (trtexec --onnx=... or the ONNX parser API).

  2. Run constant folding with Polygraphy before debugging parser errors; this resolves many shape and constant subgraph issues. Refer to Architecture Overview for the recommended post-export workflow.

  3. If the parser reports unsupported operators, consult operators.md and simplify the graph with ONNX-GraphSurgeon when needed.

The GitHub ONNX-TensorRT project may support later opsets than the parser version bundled with a given TensorRT release. For production, prefer the opset and operator coverage documented for your shipped TensorRT build.

Opset Milestones for Quantization and Low-Precision Types#

Explicit quantization (Q/DQ) and low-precision ONNX types depend on specific opset levels. Details and framework export notes are in Explicit Quantization.

Opset

Relevance to TensorRT

10

QuantizeLinear / DequantizeLinear introduced

13

Quantization axis attribute (required for per-channel Q/DQ); PyTorch 1.8+ export baseline

19

FP8 ONNX types (TensorRT supports E4M3FN); full opset 19 is not fully supported across all operators

21

INT4 data type and block quantization

23

FP4 (FP4E2M1) type

When PyTorch or TransformerEngine cannot export standard FP8 opset-19 Q/DQ nodes, TransformerEngine may emit custom trt domain operators (TRT_FP8 QuantizeLinear, TRT_FP8 DequantizeLinear). TensorRT parses these; other runtimes may not.

Common Import Failures and Fixes#

Symptom

Likely cause

Next step

Unsupported operator

Opset too new, custom op, or missing plugin

Lower opset through Version Converter; check operators.md; add a custom plugin if required

Shape or constant errors

Unfolded constants or dynamic subgraph

Run Polygraphy constant folding; inspect with ONNX-GraphSurgeon

Q/DQ placement rejected

Per-channel axis mismatch (PyTorch vs TensorFlow export)

Refer to Explicit Quantization ONNX Support section

Pre-quantized INT8/FP8 ONNX ops

Legacy quantized operators not supported by TensorRT import

Re-export with Q/DQ pairs instead of native quantized ops (see explicit-quantization warnings)

For parser-level diagnostics, refer to Troubleshooting and the C++ / Python API walkthroughs for ONNX import examples.