Svashasan Logo
Simulated data

AI and Machine Learning · Inference runtime

TensorRT

Also known as NVIDIA TensorRT, TRT, trtexec, TensorRT engine, plan file

IntermediateSource-checked · awaiting technical reviewLast reviewed 6 December 2026

TensorRT is NVIDIA's SDK for optimising and running neural-network inference on NVIDIA GPUs. It compiles a network, usually imported from ONNX, into an engine tuned for a specific GPU, precision configuration and TensorRT version.

Explanation

TensorRT works in two phases. In the build phase, a builder takes the network definition, applies optimisations including layer fusion, and selects the fastest available kernel for each layer by timing candidates on the target GPU; the output is a serialised engine, also called a plan file. In the runtime phase, the application deserialises the engine and runs inference through execution contexts.

By default, an engine is only guaranteed to work with the same operating system, CPU architecture, GPU model and TensorRT version used to build it, although version- and hardware-compatibility options exist. Because kernel selection depends on timing, rebuilding can choose different kernels and produce slightly different numerical results, so accuracy should be re-validated after each build. NVIDIA advises deserialising only engines from trusted sources.

TensorRT supports FP32, TF32, FP16 and BF16, and quantised types including INT8, FP8, INT4 and FP4 through explicit quantise/dequantise layers. Its trtexec tool reports throughput, host latency, GPU compute time and latency percentiles, but times network inference only, excluding pre- and post-processing unless they are timed separately.

How it works

A typical flow exports the trained model to ONNX and builds an engine with the ONNX parser and a builder configuration covering precision, a workspace memory limit and optimisation profiles for dynamic shapes. The plan is saved. On the target, the runtime loads the plan, allocates device memory for activations, binds input and output buffers, and enqueues inference on a CUDA stream for each input.

Automotive applications

  • Camera and LiDAR perception on NVIDIA GPU-based ECUs
  • Benchmarking model latency on target GPUs
  • INT8 and FP8 quantised deployment
  • Model serving with Triton Inference Server

Example

A team builds separate engines for its workstation GPU and the vehicle's embedded GPU from the same ONNX file, because a plan built for one GPU model is not guaranteed to run on another. Each engine's outputs are checked against ONNX Runtime reference outputs before release.

An illustrative example: any figures in it are worked numbers, not measurements.

References

  1. How TensorRT Works (opens in a new tab)

    NVIDIA TensorRT documentation · Manufacturer documentation · Build and runtime phases; Engine Deserialization and the Trust Boundary; Determinism; Compatibility · retrieved 6 December 2026

  2. TensorRT Architecture Overview (opens in a new tab)

    NVIDIA TensorRT documentation · Manufacturer documentation · ONNX; Complementary Software · retrieved 6 December 2026

  3. Performance Benchmarking (opens in a new tab)

    NVIDIA TensorRT documentation · Manufacturer documentation · Reported Performance Metrics · retrieved 6 December 2026

Definitions are original summaries. Standards text is not reproduced; follow the links for the official publications.