pi0.5 export to ExecuTorch with TensorRT: how to reproduce from source
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 35/100
- issue の種類
- ドキュメント
- 明瞭さ
- 説明が足りない
- 活発さ
- 活発
調査の方向性
Start with benchmarks/pi05_compare/README.md on the LeRobot pi05-repro branch, then follow its install, export, and benchmark commands to reproduce the reported results. The issue describes a reproduction guide and measured results but does not state a specific change needed in ExecuTorch. Done would require a clearer, actionable task; no target file or expected change is identified.
索引モデルが issue の本文から書いたものです。
説明
pi0.5, the open vision-language-action model from Physical Intelligence, compiled with TensorRT through Torch-TensorRT and ExecuTorch (PyTorch's solution for deploying models on devices), runs faster than openpi, Physical Intelligence's reference implementation, on an H100. It uses less GPU memory, its action error stays small (between openpi's own PyTorch and JAX paths), and it runs without loading PyTorch. It needs only the released packages and a LeRobot branch. Below are the numbers, measured the same way for each path, and how to reproduce them.
Results
One H100, batch 1, openpi's pi05_libero weights in bfloat16, 10 denoising steps, 10 actions per chunk:
| Path | Time per chunk | Time saved by ExecuTorch + TensorRT | GPU memory | Max / mean error vs float32 |
|---|---|---|---|---|
| ExecuTorch + TensorRT | 20.5 ms | 5.7 GiB | 0.0058 / 0.0007 | |
openpi PyTorch, torch.compile |
28.1 ms | 27% | 8.0 GiB | 0.0036 / 0.0004 |
| openpi JAX | 36.0 ms | 43% | 8.6 GiB | 0.0063 / 0.0008 |
How it was measured: every path ran on the same GPU, with the same 16 real LIBERO frames, the same prompt, the same starting noise and the same work per chunk (two cameras and a 73-token prompt). For openpi the timer covers the model call, with the inputs already on the GPU. For ExecuTorch it also covers copying the frame to the GPU and the actions back. Every timer waits for the GPU. Each run is a fresh process that times 30 chunks after warm-up, and the runs of the three paths were interleaved. Each time is the median of 3 or more runs. GPU memory is what nvidia-smi reports for the card after the timed chunks, with only that process on it. The error is against openpi's PyTorch model in float32 on the same frames and noise.
Notes:
- openpi is at commit
215abfb, run with two cameras andmax_token_len=73, so that it does the same work as the exported program. As it ships, openpi also fills a third camera with zeros and pads its prompt to 200 tokens, which is more work per chunk. - LeRobot's pi0.5 writes the robot state into its prompt and openpi's
pi05_liberodoes not. So the exported program is compared with a float32 reference that has the state in its prompt, and openpi with one that does not. - openpi's own
infer_msfield does not wait for the GPU, so it reads lower than the real time, most of all for JAX. The timer here waits on every path. - A100 and DGX Spark will follow here, measured on the same branch.
Jetson Orin Nano 8 GB (this branch)
LeRobot's public lerobot/pi05_libero_finetuned_v044 checkpoint in bfloat16, 50 actions per chunk, the default chain (--one_program=true does not fit in 8 GB at export). Timed with lerobot-rollout --bundle.path, which does not load PyTorch: 3 warm-up chunks, then 3 runs of 32, median of the run medians.
| Path | Time per chunk | Memory (CPU and GPU together) |
|---|---|---|
| ExecuTorch + TensorRT, default chain | 423 ms | 5.4 GiB |
| Plain PyTorch | does not fit |
The export took 12 minutes on the board, with a peak of 5.7 GB of host memory.
Jetson AGX Thor (this branch)
LeRobot's public lerobot/pi05_libero_finetuned_v044 checkpoint in bfloat16, 50 actions per chunk. Timed with lerobot-rollout: the ExecuTorch rows with --bundle.path, which does not load PyTorch, and plain PyTorch with --policy.path. 3 warm-up chunks, then 3 runs of about 32 chunks, median of the run medians. The two ExecuTorch rows alternated, and the PyTorch runs followed in the same session.
| Path | Time per chunk | Time saved by ExecuTorch + TensorRT | GPU memory | Memory (CPU and GPU together) |
|---|---|---|---|---|
ExecuTorch + TensorRT, --one_program=true |
80.5 ms | 5.2 GiB | 5.6 GiB | |
| ExecuTorch + TensorRT, default chain | 80.8 ms | 5.3 GiB | 5.6 GiB | |
| Plain PyTorch | 236.0 ms | 66% | 9.4 GiB | 11.3 GiB |
GPU memory is what nvidia-smi reports for the process. The last column is how much the board's used memory grew during the run, since Thor's CPU and GPU share one memory. Both bundles pass the export's own check against the PyTorch policy (largest difference 0.017, tolerance 0.075).
A second session on the same board later that night, with the same bundle settings, gave 77.5 ms for --one_program=true, so times on this board move by a few percent from session to session. The table keeps the first session, where all three paths ran together.
The exports took 7.5 minutes (default chain) and 10 minutes (--one_program=true) on the board, with a peak of 10.6 and 12.1 GiB of host memory.
What it needs on top of the releases
Nothing in ExecuTorch or Torch-TensorRT: the released ExecuTorch 1.6.0 and Torch-TensorRT 2.15.0 are enough.
LeRobot. The lerobot-export command and the pi0.5 recipe, on branch pi05-repro of github.com/shoumikhin/lerobot. Two changes there make pi0.5 faster on the H100 and the DGX Spark:
- The action expert's attention reuses one key/value head across many query heads. The recipe now tells TensorRT so on the H100 and the DGX Spark too, which lets it pick a faster kernel.
--one_program=truecompiles pi0.5 as the fewest programs: one for the images and the prompt, one for the whole language model, one that runs all ten denoising steps, and small ones for the starting noise and the actions. Without it, the export keeps a chain of small programs that builds on an 8 GB board.
The branch pins these and the changes it builds on as they were when it was built. They will go upstream as pull requests.
How to reproduce
| Project | Branch | Commit |
|---|---|---|
| LeRobot | pi05-repro |
434dfad796 |
1. Install, with Python 3.12. The export also needs nvcc from CUDA 12.8 or newer on PATH:
pip install "torch_tensorrt[executorch]"
pip install "lerobot[pi,export] @ git+https://github.com/shoumikhin/lerobot@434dfad796dd2563899d5cdb813a590f727026f5"
2. Get the weights and frames. Follow benchmarks/pi05_compare/README.md on the branch: it downloads openpi's pi05_libero checkpoint, converts it to PyTorch with openpi's own converter, picks the 16 LIBERO frames, and makes a LeRobot policy folder pi05_openpi_libero with openpi's weights.
3. Export and run:
lerobot-export --policy.path=pi05_openpi_libero --backend.type=executorch_tensorrt \
--policy.dtype=bfloat16 --one_program=true --output_dir=bundles/one \
--task="pick up the book and place it in the back compartment of the caddy"
# on a robot, the bundle runs without PyTorch:
lerobot-rollout --bundle.path=<bundle> --robot.type=<your robot>
The export takes about 8 minutes on an H100 and up to about 13 GiB of host memory.
4. Time it against openpi, from benchmarks/pi05_compare (the README there sets up openpi and the variables):
bash run_ab.sh 0 out 1 ref_state ref # float32 references
bash run_ab.sh 0 out 3 jax585 pt585 bundle:one # 3 rounds on GPU 0, the order rotates each round
python compare.py out/ref_state.npz out/one_r1.npz # ExecuTorch error
python compare.py out/ref.npz out/pt585_r1.npz # openpi PyTorch error (jax585_r1.npz for JAX)
Questions, and results on other GPUs, are welcome here.
cc @simpleton
- 主要言語
- Python
- スター
- 5.2k
- フォーク
- 1.3k
- 平均マージ
- 1日 7時間
- マージ済み PR(30日)
- 644
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
pytorch/executorch のほかの issue
-
to_edge_transform_and_lower ignores some ops_to_not_decompose requests: multi-output ops, and non-core ops without a decomposition対応中かも @Eureka-Zhang が 7 日前に担当しました。 オープンmodule: exir
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
pytorch/executorch#25620 ·
メンテナーはふだん 1 日以内に返信
-
Qualcomm AI Engine Direct - fp16a8w quantization crashes on layer_norm対応中かも @psiddh が 21 日前に担当しました。 オープンbug module: qnn partner: qualcomm
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
pytorch/executorch#24434 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
enhancement triaged
難易度 2/5 半日 初心者へのやさしさ 68/100
pytorch/executorch#21640 ·
メンテナーはふだん 1 日以内に返信
-
quantize_per_channel and dequantize_per_tensor.tensor abort the process on a float32 scale対応中かも @AxelNoun が今日担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
pytorch/executorch#25873 ·
メンテナーはふだん 1 日以内に返信
-
XNNPACK INT4 linear returns incorrect per-channel outputs and fails groupwise FP16 on Apple M4 Max対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンbug module: quantization module: xnnpack
難易度 4/5 3〜5日 初心者へのやさしさ 43/100
pytorch/executorch#25854 ·
メンテナーはふだん 1 日以内に返信
pytorch/executorch の issue をすべて見る
似ている issue
-
Container fails to start when GitHub Releases is unavailable: uv run re-downloads the tvl wheelオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
trezor/trezor-user-env#421 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
難易度 1/5 1〜3時間 初心者へのやさしさ 91/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
tangentcode/tangentswarm#167 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信