Repository navigation
Add LeRobot ACT - #38
Open
ravediamond wants to merge 5 commits into
Open
ravediamond wants to merge 5 commits into
ravediamond wants to merge 5 commits into
Conversation
Collaborator
|
Thanks for this, it's a clean port that already follows our model conventions closely. I checked it against LeRobot's PyTorch ACT on I pushed four commits on top:
RTX 3060, 640x480, min ms:
CPU (i5-12400F) is unchanged at about 173 ms. About 18 ms of that is ggml's max-pool on the CPU backend, which runs on one thread; that's an upstream ggml fix. Action items for you:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds LeRobot's ACT policy, as discussed in #37.
scripts/convert_act_to_gguf.pyconverts a LeRobotpretrained_modeldirectory. It folds the ResNet's frozen batch norms into the convs, drops the VAE encoder (the latent is zero at inference) and stores the normalizer stats, sopredict()takes raw state and pixels and returns actions in robot units. Older checkpoints that keep the stats in model.safetensors work too. Camera count, image size, state and action widths all come from the checkpoint config.src/models/act.cppruns the ResNet on each view at the camera's own size (the graph is cached per size), then the encoder and decoder. It prints the camera order at load, since views have to arrive in training order.A few small changes outside the model: vla-server accepts a request with no language tokens when the model takes none (ACT reports n_lang 0),
vla-bench --heightandVLA_IMG_Hinvla_predict_checkallow non square inputs like 640x480, and there is a converter remap test.Checked with
vla_predict_checkagainst LeRobot's PyTorch ACTPolicy on the same synthetic inputs, at 640x480, onlerobot/act_aloha_sim_transfer_cube_human(1 camera, 14 dims) and on my SO-101 checkpoint (2 cameras, 6 dims). For SO-101 the reference goes through LeRobot's own pre and post processors.Aloha actions span about 1.4 and SO-101 about 100 (degrees), so the GPU differences are matmul precision, the CPU build matches to float precision.
Speed on the Orin NX 16 GB (MAXN_SUPER), 2 cameras at 640x480, 100 action chunk:
--flash-attn--weight-dtype f16 --flash-attnSo on a Jetson it is slower than PyTorch for now. Most of the time goes to im2col in the ResNet convs (cuDNN does better there), and I'd rather look at that in a follow up. The point here is running ACT without PyTorch, which matters most on CPU only boards.
I haven't run it on the real arm yet. The
--arch actclient change for the LeRobot fork is ready and I'll open it there.