TensorRT Model Optimizer INT8 quantization causes 2.7x performance regression on Jetson Orin Nano 4GB (ViT-S + DPT architecture)
Environment
- Hardware: Jetson Orin Nano 4GB Developer Kit
- L4T Version: R36.4.3 (Jan 8, 2025)
- JetPack Version: 6.2
- TensorRT Version: 10.3.0
- Model Optimizer Versions Tested: 0.31, 0.35, 0.40
Conversion Pipeline
- Model exported to ONNX from PyTorch on desktop (x86)
- INT8 quantization applied using TensorRT Model Optimizer on desktop
- ONNX transferred to Jetson Orin Nano
- TensorRT engine built on-device using
trtexec
Model Architecture
ViT-S + DPT encoder for dense feature extraction.
Input: 1x1x364x490 (grayscale image, batch of 2 processed together)
Output: Multi-scale feature maps (1x2x32x364x490 for full encoder, or per-layer features for ViT-S only)
Description
When quantizing the ViT-S + DPT encoder to INT8 using NVIDIA TensorRT Model Optimizer, the resulting engine exhibits:
- ~2.7x performance regression compared to FP16 baseline
- Compilation failure on ModelOpt 0.40 (latest version)
- Even with trtexec’s native `–fp16 --int8` flags (bypassing ModelOpt), INT8 shows minimal improvement over FP16 (~5% vs expected 20-50%)Results Summary
Full Encoder (ViT-S + DPT)
| Precision Mode | ModelOpt 0.31 | ModelOpt 0.35 | ModelOpt 0.40 |
|---|---|---|---|
| FP16 only | 41.8 ms | 41.9 ms | 42.7 ms |
| FP16+INT8 (trtexec flags) | 39.7 ms | 39.7 ms | 40.4 ms |
ModelOpt INT8 (--stronglyTyped) |
114.5 ms ❌ | 114.1 ms ❌ | FAILS ❌ |
ViT-S Only (ModelOpt 0.40)
| Precision Mode | Latency | Throughput |
|---|---|---|
| FP16 only | 30.75 ms | 32.1 qps |
| FP16+INT8 (trtexec flags) | 30.80 ms | 32.5 qps |
ModelOpt INT8 (--stronglyTyped) |
30.34 ms | 32.9 qps |
Even the isolated ViT-S shows only ~1.3% improvement with INT8 quantization.
ModelOpt 0.40 Compilation Failure
trtexec \
--onnx=model_backbone_modelopt40_int8.onnx \
--stronglyTyped \
--noDataTransfers \
--useCudaGraph \
--useSpinWait
Error:
[01/16/2026-16:22:07] [E] Error[2]: [weightsPtr.h::values::182] Error Code 2: Internal Error (Assertion type() == expectedDataType<T>() failed. )
[01/16/2026-16:22:07] [E] Engine could not be created from network
[01/16/2026-16:22:07] [E] Building engine failed
[01/16/2026-16:22:07] [E] Failed to create engine from model or file.
[01/16/2026-16:22:07] [E] Engine set up failed
&&&& FAILED TensorRT.trtexec [TensorRT v100300]
Steps to Reproduce
FP16 Baseline
trtexec \
--onnx=model_backbone.onnx \
--fp16 \
--noDataTransfers \
--useCudaGraph \
--useSpinWait
ModelOpt INT8
python3 \
-m modelopt.onnx.quantization \
--onnx_path model_backbone.onnx \
--quantize_mode int8 \
--output_path model_backbone_int8.onnx
trtexec \
--onnx=model_backbone_int8.onnx \
--stronglyTyped \
--noDataTransfers \
--useCudaGraph \
--useSpinWait