Performance gains
TensorRT delivers significant speedups across all GPU platforms:Prerequisites
Installation
Install TensorRT dependencies:- ONNX export tools
- TensorRT Python bindings
- Additional optimization libraries
Hardware requirements
- CUDA-enabled GPU with 8GB+ VRAM (recommended)
- Compatible CUDA version (12.4 recommended, 11.8 also supported)
- Sufficient disk space (~2GB for engine cache)
Complete workflow
ONNX export options
Theexport_onnx_n1d6.py script supports these arguments:
Example: Export for custom embodiment
TensorRT engine build options
Thebuild_tensorrt_engine.py script provides fine-grained control:
Precision modes
BF16 (recommended)
Best balance of speed and accuracy:FP16
Higher numerical precision:FP32
Full precision (slowest):FP8
Maximum speed (requires Ada Lovelace or newer):Workspace size
Increase workspace for complex models or reduce for memory-constrained environments:Inference script arguments
Key arguments forstandalone_inference_script.py:
Performance tuning
Denoising steps
Fewer denoising steps = faster inference, but may reduce action quality:Benchmark engine performance
Measure TensorRT speedup on your hardware:Platform-specific notes
Jetson platforms (Thor, Orin)
Experiments on Thor used CUDA 13, PyTorch 2.9 from Jetson AI Lab cu130 index. Orin used CUDA 12.6, PyTorch 2.8 from Jetson AI Lab cu126 index.
RTX 5090
RTX 5090 tested with CUDA 12.8, flash-attn==2.8.0.post2, pytorch-cu128. Requires uv v0.8.4+.
Troubleshooting
Engine build fails
Symptoms: Build crashes or fails during optimization Solutions:-
Reduce workspace size:
-
Verify GPU memory:
-
Check TensorRT version matches CUDA:
ONNX export issues
Symptoms: Export fails with shape mismatch errors Solutions:-
Verify model loads in PyTorch:
-
Check dataset path contains valid trajectories:
Engine not portable between GPUs
Solution: Build separate engines for each GPU architecture:Slow first inference
Symptoms: First inference takes much longer than subsequent ones Expected behavior: TensorRT engines have warmup overhead Solution: Add warmup iterations:Out of memory during build
Symptoms: CUDA out of memory error during engine compilation Solutions:-
Reduce workspace:
-
Close other GPU processes:
-
Use FP32 instead of FP16/BF16 (uses less memory during build):