Prerequisites
- Model checkpoint (e.g.,
nvidia/GR00T-N1.6-3B) - Dataset in LeRobot format
- CUDA-enabled GPU
Installation
Quick start: PyTorch mode
TensorRT mode (2x faster)
TensorRT provides approximately 2x speedup for the action head (DiT) component.Command-line arguments
standalone_inference_script.py
export_onnx_n1d6.py
build_tensorrt_engine.py
Benchmarks
GR00T-N1.6-3B inference timing with 4 denoising steps:The backbone (Vision Encoder + Language Model) timing is the same across all modes. Only the Action Head (DiT) is optimized with torch.compile or TensorRT.
Component-wise breakdown
| Device | Mode | Data Processing | Backbone | Action Head | E2E | Frequency | |--------|------|-----------------|----------|-------------|-----|-----------|| | RTX 5090 | PyTorch Eager | 2 ms | 18 ms | 38 ms | 58 ms | 17.3 Hz | | RTX 5090 | torch.compile | 2 ms | 18 ms | 16 ms | 37 ms | 27.3 Hz | | RTX 5090 | TensorRT | 2 ms | 18 ms | 11 ms | 31 ms | 32.1 Hz | | H100 | PyTorch Eager | 4 ms | 23 ms | 49 ms | 77 ms | 13.0 Hz | | H100 | torch.compile | 4 ms | 23 ms | 11 ms | 38 ms | 26.3 Hz | | H100 | TensorRT | 4 ms | 22 ms | 10 ms | 36 ms | 27.9 Hz | | RTX 4090 | PyTorch Eager | 2 ms | 25 ms | 55 ms | 82 ms | 12.2 Hz | | RTX 4090 | torch.compile | 2 ms | 25 ms | 17 ms | 44 ms | 22.8 Hz | | RTX 4090 | TensorRT | 2 ms | 24 ms | 16 ms | 43 ms | 23.3 Hz | | Orin | PyTorch Eager | 6 ms | 93 ms | 202 ms | 300 ms | 3.3 Hz | | Orin | torch.compile | 6 ms | 93 ms | 101 ms | 199 ms | 5.0 Hz | | Orin | TensorRT | 6 ms | 95 ms | 72 ms | 173 ms | 5.8 Hz |Speedup vs PyTorch Eager
Architecture
The TensorRT optimization targets the DiT (Diffusion Transformer) component of the action head, which is the main computational bottleneck during inference.Troubleshooting
Engine build fails
- Ensure you have enough GPU memory (8GB+ recommended)
- Try reducing workspace size:
--workspace 4096 - Ensure TensorRT version matches your CUDA version
ONNX export issues
- If export fails, ensure the model loads correctly in PyTorch first
- Check that the dataset path is valid and contains at least one trajectory