Praxis-1 (27B) export to ExecuTorch with TensorRT: how to reproduce from source
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 12/100
- Tipo di issue
- Documentazione
- Chiarezza
- Da chiarire
- Stato di attività
- Attiva
- Stack tecnologico
- python
- Ambito
- documentation, machine-learning
Direzione di ricerca
This is a build-and-run guide, not a bug report, and it names no single change to make. The entry points it mentions are toolchains/ci_workspaces/MODULE.bazel.tmpl, setup.py in the Torch-TensorRT branch, and the lerobot-export and lerobot-rollout commands. Start by checking whether the pinned commits and PyPI versions it lists still resolve. Done would mean the four steps run on a clean machine, or a specific wrong step is identified.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Runway's Praxis-1 (a 27B mixture-of-experts robot policy), exported with ExecuTorch and Torch-TensorRT, runs faster than Runway's reference implementation, runwayml/praxis-1-oss, on every GPU tested. It also uses less GPU memory. It keeps about the same accuracy and loads without PyTorch. Below are the numbers, measured the same way for both, and how to reproduce them.
Results
Time per action chunk, batch 1:
| GPU | Precision | ExecuTorch + TensorRT | Runway reference | Time saved | GPU memory, GiB (ExecuTorch + TensorRT / Runway reference) |
|---|---|---|---|---|---|
| H100 | bfloat16 | 214 ms | 296 ms | 28% | 53.6 / 68.2 |
| A100 | bfloat16 | 466 ms | 784 ms | 40% | 53.4 / 67.1 |
| Jetson AGX Thor | bfloat16 | 1376 ms | 1596 ms | 14% | 52.5 / 67.5 |
| Jetson AGX Thor | NVFP4 experts | 1301 ms | 1352 ms | 4% | 19.7 / 32.1 |
| DGX Spark | bfloat16 | 1510 ms | 1863 ms | 19% | 52.6 / 67.7 |
| DGX Spark | FP8 experts (ExecuTorch + TensorRT) vs bfloat16 (Runway reference) | 1268 ms | 1862 ms | 32% | 28.8 / 67.7 |
How it was measured: both ran on the same GPU, with the same real DROID camera frames, the same timer and the same sampler settings (from the reference's serve config). The Runway reference is praxis-1-oss at afef2e1. The two alternate, each run in a fresh process. Each number is the median of 3 or more runs of 30 chunks. The Runway reference with the frames resized ahead of time, as its client does, is still slower: 262 ms on H100, 749 on A100, 1669 on Thor and 1852 on Spark.
Accuracy, as the max / mean error per action value over 32 real chunks against a float32 reference:
- bfloat16: ExecuTorch + TensorRT 0.85 / 0.062 (H100), 1.03 / 0.062 (A100), 0.98 / 0.062 (Thor), 1.04 / 0.065 (Spark); Runway reference 0.85 / 0.068 (H100).
- NVFP4 on Thor: ExecuTorch + TensorRT 1.11 / 0.080, Runway reference 1.75 / 0.072. An NVFP4 export of the LeRobot branch on H100, with the same pull requests on the earlier builds, measured 1.58 / 0.081.
- FP8 on Spark: ExecuTorch + TensorRT 1.73 / 0.065. The max is one moment in one chunk where the gripper starts to close: with this noise the FP8 bundle keeps it open. FP8 makes that moment unstable: with a second noise seed, both this and an earlier FP8 build move it by about 0.7 against bfloat16, in opposite directions. The mean error matches bfloat16.
Notes:
- The Runway reference's NVFP4 path refuses DGX Spark (it accepts compute capability 12.0, and GB10 is 12.1). So on Spark, ExecuTorch + TensorRT in FP8 is compared with the reference in bfloat16. On Spark, the reference runs its paired expert GEMM with 3 pipeline stages, since its default needs more shared memory than GB10 has.
- Both NVFP4 runs quantize the same layers (the routed experts) of the bfloat16 checkpoint, with the same scale rule. Runway's separately trained NVFP4 checkpoint was not used. It runs the same kernels, so the timing holds, but its accuracy may differ.
- The H100, A100 and DGX Spark rows ran on the exact branches below. The Thor rows did not use Torch-TensorRT or ExecuTorch wheels built from them: they used earlier builds with the same pull requests' changes added, at earlier revisions. The branches add test, documentation and safety fixes; no speed change is intended.
- LeRobot: both Thor rows ran on earlier code, before its last review fixes and one model change (cross attention without a dense mask), and for NVFP4 also before its last speed-up.
What it needs on top of the releases
One build covers every GPU (the branches below carry all of these). Not every row needs every change:
ExecuTorch 1.6.0, plus:
- #24321
from_host(..., dtype=...)(already on main). Every row: the bundle hands its weights to the engines when it loads. - #25098 pass float8 tensors through DLPack (already on main). Only the quantized rows (Thor NVFP4 and Spark FP8).
- #25099 let
savemove file-backed data into the output instead of copying it. Not needed for any timing; it lowers the
disk used during the export.
Torch-TensorRT 2.15.0, plus, on every GPU:
- pytorch/TensorRT#5015 release weights before serializing the engine
- pytorch/TensorRT#5016 decline kernels above the 48 KiB shared memory limit and accept kernels that use tensor memory. The build has an earlier version of this pull request, which also gives
triton_opkernels Triton's pointer alignment hint. The pull request has since dropped that. - pytorch/TensorRT#5019 keep a select of a uint8 tensor and a cast to uint8 inside the engine
- pytorch/TensorRT#5020 convert stable sort of index tensors
- pytorch/TensorRT#5021 leave large
aten._grouped_mmto PyTorch, and run the others with a grouped GEMM kernel (on Jetson AGX Thor, with tcgen05) - pytorch/TensorRT#5023 compute antialiased resize weights like PyTorch; the build also converts antialiased bilinear resize by default, from the closed pytorch/TensorRT#5024
- pytorch/TensorRT#5044 (now part of pytorch/TensorRT#5075, already on main) under CUDA graphs, copy only the inputs that move (the weights are engine inputs on every GPU)
And for some rows only:
- pytorch/TensorRT#5045 move engines into the program instead of copying them. Not needed for any timing; with #25099 it
lowers the disk used during the export.
LeRobot. The lerobot-export command and the Praxis-1 recipe, on branch praxis-repro of github.com/shoumikhin/lerobot.
It will go upstream as pull requests.
How to reproduce
Everything is on public branches, with versions of the pull requests above applied (pinned by commit; some differ from the
current pull request heads). Use the same three on every GPU:
| Project | Branch | Commit |
|---|---|---|
| Torch-TensorRT | praxis-repro-2.15-edge |
9e42bb033e |
| ExecuTorch | praxis-repro-1.6 |
6e666eed44 |
| LeRobot | praxis-repro |
c32f41a561 |
The Torch-TensorRT and ExecuTorch branches are on github.com/shoumikhin/TensorRT and github.com/shoumikhin/executorch.
1. Build Torch-TensorRT. On x86_64, inside pytorch/manylinux2_28-builder:cuda13.2 with bazel 8.4.2:
git clone https://github.com/shoumikhin/TensorRT -b praxis-repro-2.15-edge && cd TensorRT && git checkout 9e42bb033e
export PATH=/opt/python/cp312-cp312/bin:/usr/local/cuda-13.2/bin:$PATH CUDA_HOME=/usr/local/cuda-13.2
pip install torch==2.15.0 setuptools wheel ninja pyyaml packaging numpy "pybind11==2.6.2" cffi
export TORCH_INSTALL_PATH=$(python -c 'import torch,os;print(os.path.dirname(torch.__file__))')
export CU_VERSION=cu132 CHANNEL=test BUILD_VERSION=2.15.0+praxis.edge \
TENSORRT_CUDA_VERSION_UPPER_BOUND=13.4 TENSORRT_RTX_CUDA_VERSION_UPPER_BOUND=13.4
envsubst < toolchains/ci_workspaces/MODULE.bazel.tmpl > MODULE.bazel
export CI_BUILD=1 RELEASE=1 TORCH_TENSORRT_EXECUTORCH_RUNTIME_VERSION=0.2.1 TORCH_TENSORRT_EXECUTORCH_RUNTIME_CHANNEL=pypi
python setup.py bdist_wheel --release
pip install dist/torch_tensorrt-*.whl tensorrt-cu13==11.4.0.106 executorch==1.6.0 patchelf
pip wheel --no-build-isolation --no-deps -w dist py/torch-tensorrt-executorch-runtime
For Jetson AGX Thor and DGX Spark (aarch64), run the same commands inside quay.io/pypa/manylinux_2_39_aarch64, with the
CUDA 13.2 sbsa toolkit and bazel 8.4.2 for arm64 installed. TensorRT 11.4 for aarch64 needs glibc 2.34 or newer. If the
link stops on missing CUDA, cuDNN or NVPL libraries, add their pip folders with build --linkopt=-Wl,-rpath-link,<dirs> in a
.bazelrc.user.
2. Build ExecuTorch, with the CUDA 13.2 toolkit in CUDA_HOME and its nvcc on PATH (the checkout folder must be named
executorch):
git clone --recurse-submodules --shallow-submodules https://github.com/shoumikhin/executorch -b praxis-repro-1.6 executorch
pip install torch==2.15.0 numpy "cmake>=3.29,<4.0" pyyaml setuptools wheel ninja pybind11 zstd tomli packaging ruamel.yaml patchelf certifi flatbuffers
CMAKE_ARGS="-DEXECUTORCH_BUILD_CUDA=ON" TORCH_CUDA_ARCH_LIST="8.0;9.0" BUILD_VERSION=1.6.0+praxis \
pip wheel ./executorch --no-build-isolation --no-deps -w dist
# Jetson AGX Thor and DGX Spark: build on the board with TORCH_CUDA_ARCH_LIST="11.0;12.1"
3. Install, export and run. Use Python 3.12. The export needs nvcc (CUDA 12.8 or newer) on PATH, downloads more than
50 GB, needs up to about 87 GiB of host memory and about 52 GiB of free disk for the bundle besides the download, and takes 17 to 85 minutes.
pip install torch==2.15.0 "dist/torch_tensorrt-2.15.0+praxis.edge-<platform>.whl[executorch]" \
dist/torch_tensorrt_executorch_runtime-0.2.1-*.whl dist/executorch-1.6.0+praxis-*.whl
pip install "lerobot[praxis,export,dataset] @ git+https://github.com/shoumikhin/lerobot@c32f41a56159c7986cc7ee46088fb563bb5f4d47"
lerobot-export --policy.path=runwayml/praxis-1-droid-lerobot --backend.type=executorch_tensorrt \
--output_dir=praxis_bundle --task="pick up the red cube" --weights_as_inputs=true
# quantized rows add --quantize=nvfp4 --tolerance=1 (Thor) or --quantize=fp8 --tolerance=1 (Spark)
lerobot-rollout --bundle.path=praxis_bundle --robot.type=<your robot> --fps=15 # no PyTorch needed
4. Time it against the Runway reference. Clone the LeRobot branch at c32f41a561 and run the scripts from benchmarks/praxis_compare. Its README explains the setup:
python make_sequence.py seq.npz # real DROID frames; make it on x86_64 and copy it to the board
bash run_ab.sh 0 praxis_bundle seq.npz out 3 # 3 alternating rounds on GPU 0
# Thor NVFP4: prefix with SIDES="bundle runway_nv" (the reference's NVFP4 experts)
# DGX Spark: prefix with RUNWAY_PAIR_GEMM_STAGES=3
Questions, and results on other GPUs, are welcome here.
- Lingua principale
- Python
- Stelle
- 5.2k
- Fork
- 1.3k
- Merge medio
- 1g 7h
- PR unite (30g)
- 644
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di pytorch/executorch
-
to_edge_transform_and_lower ignores some ops_to_not_decompose requests: multi-output ops, and non-core ops without a decompositionForse già presa @Eureka-Zhang l’ha presa 7 giorni fa. Apertamodule: exir
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
pytorch/executorch#25620 ·
I maintainer di solito rispondono entro 1 giorno
-
Qualcomm AI Engine Direct - fp16a8w quantization crashes on layer_normForse già presa @psiddh l’ha presa 21 giorni fa. Apertabug module: qnn partner: qualcomm
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
pytorch/executorch#24434 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement triaged
Difficoltà 2/5 Mezza giornata Idoneità per principianti 68/100
pytorch/executorch#21640 ·
I maintainer di solito rispondono entro 1 giorno
-
quantize_per_channel and dequantize_per_tensor.tensor abort the process on a float32 scaleForse già presa @AxelNoun l’ha presa oggi. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
pytorch/executorch#25873 ·
I maintainer di solito rispondono entro 1 giorno
-
XNNPACK INT4 linear returns incorrect per-channel outputs and fails groupwise FP16 on Apple M4 MaxForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertabug module: quantization module: xnnpack
Difficoltà 4/5 3-5 giorni Idoneità per principianti 43/100
pytorch/executorch#25854 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di pytorch/executorch
Issue simili
-
Container fails to start when GitHub Releases is unavailable: uv run re-downloads the tvl wheelAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
trezor/trezor-user-env#421 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 91/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
tangentcode/tangentswarm#167 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno