Repository navigation
[RFC] Qualcomm AI Engine Direct - [VLA] Lerobot-ExecuTorch simulation framework - #24829
DannyYuyang-quic wants to merge 1 commit into
Conversation
This PR needs a
|
|
Thanks @DannyYuyang-quic, @haowhsu-quic and @paul1106. It is great to see SmolVLA finish a LIBERO task on the HTP of a real device, quantized, with videos to check it. Some questions about the overall design first, because they affect most of the files:
Happy to help on the LeRobot side. |
|
@claude review effort=max |
|
Claude finished @shoumikhin's task in 55m 34s —— View job PR Review: #24829Request Changes: the SmolVLA/LIBERO QNN flow hangs whenever either side exits ( Detailed reviewSummaryThis PR adds Problems found:
The first two design questions in the thread (exporting LeRobot's policy, and reusing LeRobot's servers) correspond to two of the design findings below. File names without a directory refer to files this PR adds under Code Quality
Infrastructure
Testing
API Design
Security
Performance
Specific Comments
RecommendationRequest Changes Blocking:
Before polishing the rest, please settle the two design questions in the thread: exporting LeRobot's policy vs. a |
Thanks for sharing the work in progress on these issues.
On the blocking issues: when we first enabled the original
Thanks for the suggestion. Let us share some context from our side. Our TCP server-client has two goals.
As for
No problem. Splitting the work into several smaller PRs is also part of our plan once the design settles.
Good question. Which SoCs to support for robotics is still under discussion on our side. We'll follow up on this topic once a decision is made. |
|
Thanks @DannyYuyang-quic, this helps a lot. Both model changes make sense for quantized HTP. Could they live as passes on the exported graph instead of a rebuilt model? The time embeddings could become a lookup table over the fixed schedule, with the step index as the input. The masked softmax could be a pattern replacement like the one in Please share the list of blockers you hit with the original policy, ideally on #24668. We will fix them in ExecuTorch or in LeRobot. On the environments, what exactly conflicts? If it is the torch pin, #24820 proposes a runtime-only package with no torch requirement, so the runtime can live in LeRobot's environment. You are right that Thanks for planning the split. Starting with the model, export and quantization recipe sounds good. |
|
@shoumikhin Thanks for the feedback! Sure, we'll make these into passes instead of rebuilding the model. #24668 is really helpful. We'll double-check whether it covers all of the cases and share any blockers that are still not covered. Yes, the conflicts is the torch pin, thanks for purpose torch-free runtime package. Having an ExecuTorch path in LeRobot's rollout would let the QNN runner plug in cleanly. We'll keep the harness in the example until the ExecuTorch path in LeRobot's rollout is ready. Quick question: are there plans to also support the |
|
Thanks @DannyYuyang-quic, sounds good. On I can add it once the ExecuTorch path is in. Until then, your harness covers it. |
Summary
This RFC integrates the Lerobot-ExecuTorch simulation framework.
The LeRobot SmolVLA policy is a example to run fully delegated on the Qualcomm HTP through ExecuTorch QNN backend and demonstrates end-to-end closed-loop robot control in the LIBERO benchmark.
Design
LeRobot and ExecuTorch run in separate Python environments and form a closed loop over TCP. Terminal B owns the LIBERO benchmark and sends an observation whenever its action queue is empty. Terminal A runs SmolVLA and returns a 50-action chunk. Terminal B executes the chunk one action per
env.step(), then sends the next observation:Co-authors: @haowhsu-quic † @paul1106 †
† Equal contribution.
Quick Start
Environment Setup
Terminal A (ExecuTorch environment)
Prepare an ExecuTorch environment with the Qualcomm QNN backend successfully built
Terminal B (LeRobot environment):
On a headless Linux host, robosuite renders through EGL. If the system
libEGLis missing,eval.pyfails with'NoneType' object has no attribute 'eglQueryString'. To fix it:Run
Open two terminals and start both processes. Terminal A hosts the ExecuTorch + QNN inference service, while Terminal B runs the LeRobot LIBERO rollout client. The two processes communicate over TCP to form a closed-loop evaluation pipeline.
Start Terminal A first, then launch Terminal B while Terminal A remains running.
Terminal A (ExecuTorch env):
A single run executes the full pipeline: export → FP32 rollout → PTQ calibration → QDQ rollout → lowering → HTP rollout.
python examples/qualcomm/robotics/scripts/smolvla/e2e.py \ --device ${SERIAL_NUM} \ --soc-model SM8750 \ --artifact ./smolvla_qnn \ --build-folder build-androidTip
Add
--pre_gen_pte ./smolvla_qnnto skip export and compilation and run only the HTP rollout.Terminal B (LeRobot env):
python examples/qualcomm/robotics/scripts/smolvla/eval.py \ --rollout-benchmark libero_10 \ --rollout-task-id 9 \ --rollout-episode-seed 0 \ --rollout-max-steps 500 \ --rollout-video-fps 30 \ --connect-timeout-seconds 7200 \ --rollout-output-directory outputs--connect-timeout-secondsmust cover the time Terminal A spends exporting, calibrating and compiling between rollouts.Results
LIBERO-10, task 9: "put the yellow and white mug in the microwave and close it", episode seed 0.
Notes:
Rollout Videos
libero_10_task_09_seed_000_htp_module_rollout.mp4
HTP / SM8750
libero_10_task_09_seed_000_qdq_module_rollout.mp4
QDQ Module
libero_10_task_09_seed_000_exported_module_rollout.mp4
Eager Mode
Quantization Precision for SmolVLA
cc: @psiddh @JacobSzwejbka @shoumikhin @cccclai @shewu-quic @haowhsu-quic @paul1106 @winskuo-quic @harshs-qti