christianengel/smolvla-jetson-onnx)PyTorch-free static ONNX export and zero-copy I/O-Binding runtime for lerobot/smolvla_base (8 batches, B=1, 3 cameras 512x512, 10 Euler steps, RTX 3090). Mixed FP16 ONNX achieves 78.17 ms latency (639.6 actions/s): 3.11x faster than PyTorch FP32 CUDA (243.05 ms), 2.55x faster than PyTorch BF16 CUDA (199.41 ms), 3.12–3.86 GB lower peak RSS (4,848.49 / 5,590.92 MB -> 1,730.90 MB), and 0.999983 action cosine vs FP32 (PyTorch BF16: 0.999975).
Variants from lerobot/smolvla_base@5e8d12a6 (Apache-2.0):
| Variant | Path | Disk Size | Recommended Target | 10-Step Action Cosine |
|---|---|---|---|---|
| FP16 (default) | fp16/ |
751.57 MB | Jetson / CUDA GPU (SmolVLAOnnxRunner) |
0.999983 |
| INT8 (W8A32) | int8/ |
538.52 MB | Low-footprint CPU / CUDA (MatMulNBits) |
0.999727 (CUDA) / 0.999268 (CPU) |
| FP32 (reference) | fp32/ |
1,501.61 MB | Exact FP32 parity & trtexec --fp16 input |
1.000000 |
Code, harness, tests: protortyp/smolvla-jetson-onnx.
Host: Ryzen 9 5950X + RTX 3090 (shared host). Harness: 8 batches (seeds=[11, 23, 37, 41, 53, 111, 123, 137], B=1, 10 Euler steps; 5/20 GPU, 1/3 CPU warmup/timed). FP32 refs: allow_tf32=False, NVIDIA_TF32_OVERRIDE=0.
| Backend / Variant | Mean (ms) | p50 (ms) | p95 (ms) | Vision (ms) | Prefix (ms) | Expert 10x (ms) | Chunks/s | Act/s | Peak GPU (MB) | Peak RSS (MB) | Est. Jetson Total (MB) | Disk (MB) | Record |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
pytorch_fp32_cuda |
243.05 | 244.27 | 251.23 | 80.61 | 18.86 | 143.58 | 4.11 | 205.7 | 1950.5 alloc (2388 NVML) | 4848.49 | — | 864.71 | baseline |
pytorch_bf16_cuda |
199.41 | 200.16 | 204.54 | 23.13 | 17.06 | 159.22 | 5.02 | 250.8 | 1034.3 alloc (1412 NVML) | 5590.92 | — | 864.71 | baseline |
pytorch_fp32_cpu |
1979.85 | 1981.06 | 2021.18 | 1207.60 | 157.97 | 614.28 | 0.51 | 25.3 | 0.0 | 5947.50 | — | 864.71 | baseline |
onnx_fp32_cuda |
146.44 | 135.49 | 189.23 | 64.29 | 10.87 | 71.28 | 6.83 | 341.5 | 2882.0 | 1638.61 | 2734.11 | 1501.61 | fp32 cuda |
onnx_fp32_cuda_iobind |
132.92 | 125.71 | 155.82 | 62.67 | 9.58 | 60.68 | 7.52 | 376.2 | 3138.0 | 1655.88 | 2798.11 | 1501.61 | fp32 iobind |
infer_iobind_fp32_cuda (PyTorch-free) |
130.78 | 130.45 | 132.77 | 65.63 | 9.51 | 54.49 | 7.65 | 382.3 | — | — | — | 1501.61 | runner fp32 |
onnx_fp16_cuda |
85.98 | 86.09 | 89.56 | 35.11 | 5.26 | 45.61 | 11.63 | 581.5 | 2126.0 | 1698.50 | 1795.07 | 751.57 | fp16 cuda |
onnx_fp16_cuda_iobind |
79.85 | 80.06 | 81.86 | 36.38 | 4.22 | 39.26 | 12.52 | 626.2 | 2344.0 | 1730.90 | 1849.57 | 751.57 | fp16 iobind |
infer_iobind_fp16_cuda (PyTorch-free) |
78.17 | 78.22 | 79.73 | 35.63 | 4.10 | 37.36 | 12.79 | 639.6 | — | — | — | 751.57 | runner fp16 |
onnx_int8_cuda_iobind (W8A32) |
102.79 | 102.58 | 105.37 | 45.25 | 6.87 | 50.68 | 9.73 | 486.4 | 2334.0 | 1513.15 | 1634.02 | 538.52 | int8 iobind |
onnx_int8_cpu (W8A32) |
2689.45 | 3013.86 | 3121.58 | 1736.76 | 540.72 | 411.97 | 0.37 | 18.6 | 0.0 | 2126.59 | 1408.67 | 538.52 | int8 cpu |
onnx_fp32_cpu |
3790.80 | 4280.23 | 4382.89 | 2444.40 | 337.22 | 1009.18 | 0.26 | 13.2 | 0.0 | 3184.72 | 2636.22 | 1501.61 | fp32 cpu |
infer_iobind_fp16_cuda compute-only (excl. 1.024 ms H2D, 0.047 ms D2H): 77.10 ms mean (p50=77.12 ms, p95=78.75 ms, min=74.84 ms). Jetson Orin Nano 8 GB estimates stay below 6,144.0 MB (8,192.0 MB LPDDR5 minus OS/camera headroom).
prefix_pad_masks_exact_match=true. Gates: FP32 MaxAbsErr < 1e-4 & Cos >= 0.99999, FP16 Cos >= 0.999, INT8 Cos >= 0.995.
| Variant | Subgraph Output | MaxAbsErr | MAE | Cosine Sim | Status |
|---|---|---|---|---|---|
pytorch_bf16_cuda |
vision_image_embeddings |
22.510 | 1.080 | 0.999941 | Baseline |
pytorch_bf16_cuda |
prefix_past_keys |
0.3675 | 0.0101 | 0.999967 | Baseline |
pytorch_bf16_cuda |
prefix_past_values |
0.1206 | 0.00641 | 0.999910 | Baseline |
pytorch_bf16_cuda |
expert_single_step_v_t |
0.04416 | 0.00413 | 0.999987 | Baseline |
pytorch_bf16_cuda |
actions_10step |
0.04519 | 0.00111 | 0.999975 | Baseline |
onnx_fp32_cuda_iobind |
vision_image_embeddings |
5.249e-03 | 2.249e-04 | 1.000000 | Pass |
onnx_fp32_cuda_iobind |
prefix_past_keys |
8.011e-05 | 1.512e-06 | 1.000000 | Pass |
onnx_fp32_cuda_iobind |
prefix_past_values |
3.517e-05 | 1.038e-06 | 1.000000 | Pass |
onnx_fp32_cuda_iobind |
expert_single_step_v_t |
1.907e-06 | 2.887e-07 | 1.000000 | Pass |
onnx_fp32_cuda_iobind |
actions_10step |
3.742e-06 | 1.077e-07 | 1.000000 | Pass |
onnx_fp32_cpu |
vision_image_embeddings |
5.829e-03 | 2.377e-04 | 1.000000 | Pass |
onnx_fp32_cpu |
prefix_past_keys |
5.317e-05 | 1.655e-06 | 1.000000 | Pass |
onnx_fp32_cpu |
prefix_past_values |
2.694e-05 | 1.104e-06 | 1.000000 | Pass |
onnx_fp32_cpu |
expert_single_step_v_t |
2.772e-06 | 3.833e-07 | 1.000000 | Pass |
onnx_fp32_cpu |
actions_10step |
4.284e-06 | 1.515e-07 | 1.000000 | Pass |
onnx_fp16_cuda_iobind |
vision_image_embeddings |
3.671 | 0.1723 | 0.999998 | Pass |
onnx_fp16_cuda_iobind |
prefix_past_keys |
0.1878 | 0.00330 | 0.999991 | Pass |
onnx_fp16_cuda_iobind |
prefix_past_values |
0.02818 | 0.000959 | 0.999998 | Pass |
onnx_fp16_cuda_iobind |
expert_single_step_v_t |
0.009778 | 0.00136 | 0.999999 | Pass |
onnx_fp16_cuda_iobind |
actions_10step |
0.04392 | 0.000532 | 0.999983 | Pass |
onnx_int8_cuda_iobind |
vision_image_embeddings |
36.107 | 2.237 | 0.999763 | Pass |
onnx_int8_cuda_iobind |
prefix_past_keys |
0.3328 | 0.01645 | 0.999917 | Pass |
onnx_int8_cuda_iobind |
prefix_past_values |
0.2128 | 0.01154 | 0.999690 | Pass |
onnx_int8_cuda_iobind |
expert_single_step_v_t |
0.01934 | 0.00429 | 0.999986 | Pass |
onnx_int8_cuda_iobind |
actions_10step |
0.07411 | 0.00288 | 0.999727 | Pass |
onnx_int8_cpu |
vision_image_embeddings |
75.481 | 4.071 | 0.999198 | Pass |
onnx_int8_cpu |
prefix_past_keys |
0.8958 | 0.03155 | 0.999695 | Pass |
onnx_int8_cpu |
prefix_past_values |
0.4718 | 0.02217 | 0.998768 | Pass |
onnx_int8_cpu |
expert_single_step_v_t |
0.06408 | 0.00898 | 0.999937 | Pass |
onnx_int8_cpu |
actions_10step |
0.1210 | 0.00506 | 0.999268 | Pass |
onnx_int8_dynamic_w8a8_cpu |
vision_image_embeddings |
229.301 | 14.716 | 0.989682 | Fail (discarded) |
onnx_int8_dynamic_w8a8_cpu |
actions_10step |
0.5315 | 0.01733 | 0.987607 | Fail (min=0.956 < 0.995) |
All snippets fetch config.json alongside weights.
huggingface_hub + SmolVLAOnnxRunner (FP16)PyTorch-free (numpy, onnxruntime-gpu or onnxruntime, onnx, huggingface_hub):
pip install numpy onnx onnxruntime-gpu huggingface_hub
from pathlib import Path
import numpy as np
from huggingface_hub import hf_hub_download, snapshot_download
repo_id = "christianengel/smolvla-jetson-onnx"
# Fetch root config.json + runner script + fp16 subgraphs
hf_hub_download(repo_id=repo_id, filename="config.json", local_dir="./smolvla_hf")
hf_hub_download(repo_id=repo_id, filename="infer_io_binding.py", local_dir="./smolvla_hf")
snapshot_download(
repo_id=repo_id,
allow_patterns=["config.json", "fp16/*"],
local_dir="./smolvla_hf",
)
import sys
sys.path.insert(0, "./smolvla_hf")
from infer_io_binding import SmolVLAOnnxRunner
runner = SmolVLAOnnxRunner(Path("./smolvla_hf/fp16"), device="cuda")
actions, timings = runner.predict_action_chunk(
pixel_values=np.zeros((3, 3, 512, 512), dtype=np.float32), # 3 cams in [-1, 1]
img_masks=np.ones((1, 3), dtype=np.bool_),
lang_tokens=np.ones((1, 48), dtype=np.int64),
lang_masks=np.ones((1, 48), dtype=np.bool_),
state=np.zeros((1, 32), dtype=np.float32),
return_timings=True,
)
print(actions.shape, timings) # (1, 50, 32)
onnxruntime CPU/CUDA W8A32 (int8/)import numpy as np
import onnxruntime as ort
from huggingface_hub import hf_hub_download
repo_id = "christianengel/smolvla-jetson-onnx"
hf_hub_download(repo_id=repo_id, filename="config.json", local_dir="./smolvla_int8")
vis_path = hf_hub_download(repo_id=repo_id, filename="int8/smolvla_vision_encoder.onnx", local_dir="./smolvla_int8")
pref_path = hf_hub_download(repo_id=repo_id, filename="int8/smolvla_vlm_prefix.onnx", local_dir="./smolvla_int8")
exp_path = hf_hub_download(repo_id=repo_id, filename="int8/smolvla_action_expert_step.onnx", local_dir="./smolvla_int8")
providers = ["CPUExecutionProvider"] # or ["CUDAExecutionProvider", "CPUExecutionProvider"]
sess_vis = ort.InferenceSession(vis_path, providers=providers)
sess_pref = ort.InferenceSession(pref_path, providers=providers)
sess_exp = ort.InferenceSession(exp_path, providers=providers)
img_emb = sess_vis.run(None, {"pixel_values": np.zeros((3, 3, 512, 512), dtype=np.float32)})[0]
past_k, past_v, pad_masks = sess_pref.run(
None,
{
"image_embeddings": img_emb.reshape(1, 192, 960),
"img_masks": np.ones((1, 3), dtype=np.bool_),
"lang_tokens": np.ones((1, 48), dtype=np.int64),
"lang_masks": np.ones((1, 48), dtype=np.bool_),
"state": np.zeros((1, 32), dtype=np.float32),
},
)
x_t = np.random.default_rng(0).standard_normal((1, 50, 32)).astype(np.float32)
dt = -0.1
for step in range(10):
t = np.array([1.0 + step * dt], dtype=np.float32)
v_t = sess_exp.run(
None,
{"x_t": x_t, "timestep": t, "past_keys": past_k, "past_values": past_v, "prefix_pad_masks": pad_masks},
)[0]
x_t = x_t + dt * v_t
print("actions:", x_t.shape) # (1, 50, 32)
Fetches config.json, fp16/, build_tensorrt_jetson.sh; compiles TensorRT 10.x engines with FP32 norms/softmax/RoPE/masks (--include "fp32/*" + --onnx-dir ./smolvla_jetson/fp32 for FP32->FP16):
hf download christianengel/smolvla-jetson-onnx \
--include "config.json" "fp16/*" "build_tensorrt_jetson.sh" \
--local-dir ./smolvla_jetson
chmod +x ./smolvla_jetson/build_tensorrt_jetson.sh
sudo nvpmodel -m 0 && sudo jetson_clocks
./smolvla_jetson/build_tensorrt_jetson.sh \
--onnx-dir ./smolvla_jetson/fp16 \
--out-dir ./smolvla_jetson/trt_orin_nano \
--profile orin-nano-8gb # or: orin-nx-16gb | thor
Upstream lerobot/smolvla_base: 450,046,176 params (864.71 MB safetensors). Pruned vlm.lm_head (47,308,800), text_model.norm, layer-15 tail (~9.2M) -> 393,560,671 elements across 3 opset-17 graphs:
smolvla_vision_encoder.onnx: SigLIP ViT + 4x4 pixel-shuffle + sqrt(960) scale; static [1, 1024, 768] pos-emb replaces torch.bucketize + scatter. pixel_values [3, 3, 512, 512] -> image_embeddings [3, 64, 960] FLOAT.smolvla_vlm_prefix.onnx: Text emb (sqrt(960)) + state_proj + 16 Llama layers (post-RoPE KV cache, no DynamicCache). image_embeddings [1, 192, 960], img_masks [1, 3] BOOL, lang_tokens [1, 48] INT64, lang_masks [1, 48] BOOL, state [1, 32] -> past_keys/past_values [16, 1, 5, 241, 64], prefix_pad_masks [1, 241] BOOL.smolvla_action_expert_step.onnx: Action proj + timestep MLP + 16 alternating self/cross-attn blocks + action_out_proj; -1.0e9 mask fill avoids FP16/TRT -inf -> NaN. x_t [1, 50, 32], timestep [1], past_keys/past_values [16, 1, 5, 241, 64], prefix_pad_masks [1, 241] -> v_t [1, 50, 32] FLOAT.FP16 RMSNorm: convert_float_to_float16 overflows RMSNorm squares (~5e6 > 65504) to +inf. fp16/ pins LayerNormalization, RMSNorm (Pow/ReduceMean/Sqrt/Div + Add/Mul), Softmax, Sin, Cos, Where, CumSum, ReduceSum, and I/O to FP32, collapsing Cast(FP32->FP16->FP32).
Zero-copy Euler: infer_io_binding.py uses persistent CUDA OrtValue buffers + 2-node Euler graph (x_next = x_t + dt * v_t) across 10 steps (one upload + one 6.4 KB [1, 50, 32] download).
B=1, 3 cams 512x512, lang_max_len=48, max_state_dim=32, max_action_dim=32, chunk_size=50 (prefix_len=241).lerobot/smolvla_base post-preprocessor / pre-postprocessor tensors (pixel_values [-1.0, 1.0], MEAN_STD per policy_preprocessor.json / policy_postprocessor.json).quantize_dynamic W8A8 fails >= 0.995 cosine due to SigLIP outliers (vision_image_embeddings cos 0.989682, MaxAbsErr=229.30; actions_10step cos 0.987607, min 0.955954; discarded record). Use W8A32 MatMulNBits (bits=8, block_size=128) in int8/.build_tensorrt_jetson.sh --dry-run only; x86_64 host lacks libnvinfer.so/trtexec and Jetson hardware.MaxAbsErr=3.742e-06) set allow_tf32=False, NVIDIA_TF32_OVERRIDE=0.Apache-2.0 (LICENSE, NOTICE). Derived from:
lerobot/smolvla_base @ 5e8d12a6e2975b0e5e5fce7c8caf47c371d257b6 (Apache-2.0).HuggingFaceTB/SmolVLM2-500M-Video-Instruct @ 4cde9d208e19519c36917aa170fffc7e381aa0ad (Apache-2.0).@article{shukor2025smolvla,
title={SmolVLA: A Vision-Language-Action Model for Affordable and Efficient Robotics},
author={Shukor, Mustafa and Aubakirova, Dana and Capuano, Francesco and Kooijmans, Pepijn and Palma, Steven and Zouitine, Adil and Aractingi, Michel and Pascal, Caroline and Russi, Martino and Marafioti, Andres and Alibert, Simon and Cord, Matthieu and Wolf, Thomas and Cadene, Remi},
journal={arXiv preprint arXiv:2506.01844},
year={2025}
}
@misc{engel2026smolvlajetsononnx,
title={smolvla-jetson-onnx: Static-Shape ONNX Export and Zero-Copy I/O-Binding Runtime for SmolVLA},
author={Engel, Christian},
year={2026},
howpublished={\url{https://huggingface.co/christianengel/smolvla-jetson-onnx}}
}
fp32/smolvla_vlm_prefix.onnx 746 MiBfp32/smolvla_action_expert_step.onnx 381 MiBfp32/smolvla_vision_encoder.onnx 375 MiBfp16/smolvla_vlm_prefix.onnx 373 MiBint8/smolvla_vlm_prefix.onnx 334 MiBfp16/smolvla_action_expert_step.onnx 191 MiBfp16/smolvla_vision_encoder.onnx 188 MiBint8/smolvla_action_expert_step.onnx 104 MiBint8/smolvla_vision_encoder.onnx 101 MiBlerobot/smolvla_base