Repository navigation
Add LeRobot ACT - #38
ravediamond wants to merge 6 commits into
Conversation
|
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:
|
|
Thanks a lot for the four commits, the direct convs make a big difference on the Orin NX. I re-ran everything at 640x480. On the Orin NX the SO-101 checkpoint went from 82.3 to 57.7 ms with defaults and to 45.0 ms with Parity still holds: CUDA 2.1e-4 on aloha and 0.022 on SO-101, Metal 2.1e-4 and 0.021 with the batched graph, CPU 2.1e-7 and 3.4e-5. I updated the tables in the description. The client is up in khanhnd61-vr/lerobot#2. I'll come back on the Hub GGUF separately. |
|
The aloha GGUF is up at https://huggingface.co/ravediamond/act-aloha-sim-transfer-cube-gguf and the README row points at it now. I checked the downloaded file against PyTorch again (2e-7 on CPU). |
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 at 640x480, min ms, with the direct convs on CUDA:
--flash-attn--weight-dtype f16 --flash-attn--weight-dtype f32(im2col path)--weight-dtype f16 --flash-attnThe
--arch actclient for the LeRobot fork is in khanhnd61-vr/lerobot#2.I haven't run it on the real arm yet.