onnx/onnx-tensorrt

ONNX-TensorRT: TensorRT backend for ONNX

What it solves

ONNX is a common file format for storing AI models. TensorRT is NVIDIA's software for running those models extremely fast on their GPUs. This project is the translator (parser) that takes an ONNX model and converts it into a format TensorRT can execute, so developers can get maximum performance out of their AI models on NVIDIA hardware.

How it works

It reads the ONNX model file and converts its operations into TensorRT's internal engine format. It supports dynamic shapes, meaning models can accept different input sizes at runtime. The project provides both C++ and Python interfaces to do this conversion. For quick checks, it works with two official NVIDIA tools: trtexec for C++ users and polygraphy for Python users, which tell you if a model can be successfully converted. It also offers a performance tuning option for a specific operation (InstanceNormalization), letting you choose between two different implementations to see which runs faster on your hardware.

Who it’s for

Developers and engineers who have AI models in the ONNX format and want to deploy them on NVIDIA GPUs with the highest possible speed. It is designed for both C++ programmers (using the libnvonnxparser.so library) and Python programmers (using the onnx_tensorrt.backend module).

Highlights

  • Supports the latest TensorRT 11.5 with full dynamic shape support.
  • Provides both C++ and Python APIs for parsing and running models.
  • Integrates with official NVIDIA tools (trtexec and polygraphy) for quick model validation.
  • Offers a performance tuning option for InstanceNormalization (native vs. plugin implementation).
  • Includes a backend test suite and links to pre-trained models in the ONNX Model Zoo.

Related

  • Project
  • Project
  • Project
  • Project
  • Project