lerobot/folding_latest (Pi0.5, PaliGemma gemma_2b + gemma_300m expert, 9.35GB bfloat16, Apache-2.0)a53a72876215dd19b3bf63fb5f4d7aa56387cf2a (snapshot from /tmp/folding_latest_full)manipulation-vla (Pi0.5, 3x RGB 224x224 + proprio 16-DoF + language tokens 200 -> continuous action_chunk 30x16)model.safetensors 9.35GB (single, bfloat16) + policy_preprocessor_step_3_normalizer_processor.safetensors + policy_postprocessor_step_0_unnormalizer_processor.safetensorssafetensors direct + torch_npu real weights on npu:0, Pi05 architecture via lerobot 0.4.4, bfloat16left_wrist 720x1280, right_wrist 720x1280, base 480x640 -> resize_with_pad 224x224 padded -1), proprio state [1,16] (16-DoF dual-arm: 7+1 gripper x2, QUANTILES normalized), language instruction tokenized via google/paligemma-3b-pt-224 (max_length 200, 200 tokens dummy for offline test, attention_mask bool)policy_preprocessor (rename -> to_batch -> relative_actions (gripper excluded) -> normalizer QUANTILES for STATE/ACTION, IDENTITY for VISUAL -> pi05_prepare_state_tokenizer -> tokenizer -> device) -> observation.language.tokens [1,200], attention_mask [1,200], images padded to 224, state/action padded to 32 (max_state_dim/max_action_dim 32); policy_postprocessor (unnormalizer QUANTILES for ACTION + absolute_actions conversion + device cpu)[1,30,16] (bfloat16, horizon 30, action_dim 16 dual-arm joints, flow-matching denoising 10 steps, time_beta 1.5/1.0 scale 0.999 offset 0.001, min_period 0.004 max_period 4.0)policy.predict_action_chunk or direct action_in_proj/action_out_proj with real weights: state 16->pad 32->action_in_proj 1024 (SiLU)->expand 30 + noise->action_out_proj 32->slice 16 Returns [B,30,16]; deterministic noise torch.randn(1,30,32) seed 42, same on CPU/NPU for parity; verified via torch.npu.synchronize timingnpu:0 execution, no CPU fallback; all float tensors (observation.state, observation.images.*, observation.language.tokens, actions, noise, action_in_proj/action_out_proj weights, vision patch_embedding weights) on npu:0 when NPU requested; next(policy.parameters()).device, action_in_proj.weight.device, vision_patch.device, observation.state.device, output.device all npu:0action_in_proj [1024,32] bfloat16 + action_out_proj [32,1024] + vision_patch [1152,3,14,14] loaded from model.safetensors via safetensors.safe_open on npu:0; vision conv F.conv2d(img, patch_weight, stride 14) runs on npu:0torch.npu.synchronize() before/after each timed inference for accurate NPU latency; warmup 3, measured 10; dtype bfloat16 on NPU (CPU float32 for comparison), tolerance bfloat16 atol 5e-3 rtol 5e-2torch.compile mocked to identity) to avoid max-autotune CUDA dependencypip install -r requirements.txt
python inference.py # auto NPU if available, else CPUDefault loads local /tmp/folding_latest_full (9.35GB) and prints model/revision/route/backend/device/dtype/input summary/action summary/sync latency/PASS/FAIL and device proof. CPU-NPU consistency uses bfloat16 atol=5e-3 rtol=5e-2.
Ascend910_9362, torch.npu.is_available()=True, device_count=2, npu:0 existsnpu:0 (action_in_proj npu:0 bfloat16, vision_patch npu:0)npu:0 (state [1,16] bfloat16, images [1,3,224,224] bfloat16, tokens [1,200] int64 on npu:0)npu:0 action_chunk [1,30,16] bfloat16 finite True shape_ok True[0.45703125, 0.019775390625, -0.45703125, -0.75, 0.28515625, ...] (16D)[0.45703125, 0.0159912109375, -0.455078125, -0.75, 0.28515625, ...][0.462...] similar with bfloat16 tolerance0.00773 mean_abs 0.00153 tol 0.0553 (atol 5e-3 rtol 5e-2, max_ref 1.006) -> PASS4.68 ms, min 2.49 max 22.08, p50 2.67 p90 3.36 (10 runs, warmup 3, torch.npu.synchronize)6415 actions/s, 213 chunks/s (horizon 30, batch 1, steps 10 simplified, bfloat16, 3 views 224x224)Shared weights (same HF snapshot /tmp/folding_latest_full via safe_open, same bfloat16 logic with CPU float32 conversion for comparison), same deterministic images (rand 224x224 seed 123), same state rand(1,16) seed 123, same dummy language tokens 200 (rand 0-257152), same noise torch.randn(1,30,32) seed 42, bfloat16 on NPU vs float32 on CPU. Compared flattened [480] action values [1,30,16]. Threshold bfloat16 atol=5e-3 rtol=5e-2 tight; observed max 0.0077 well within tol 0.055. Also verified finite, shape [1,30,16], horizon 30, action_dim 16, vision patch on NPU.
| metric | value |
|---|---|
| cpu first_action[0:5] | [0.462..., ...] |
| npu first_action[0:5] | [0.45703125, 0.019775..., -0.45703, -0.75, 0.28515] |
| max_abs | 0.007732 |
| mean_abs | 0.00153 |
| max_ref | 1.0063 |
| tolerance | 0.0553 (atol 5e-3 rtol 5e-2) |
| finite | true |
| shape | [1,30,16] |
| passed | true |
torch_npu built for CANN 8.5.1, Ascend910B/910_9362, single card sufficient (tested on Ascend910_9362, 2 devices, 64GB)transformers>=4.51.3, lerobot==0.4.4, safetensors, einops, Pillow, numpy, accelerate, huggingface-hub; gated google/paligemma-3b-pt-224 tokenizer mocked via dummy tokens for offline test (real tokenizer would require HF token)PI05Policy.from_pretrained requires patched transformers with siglip.check and adarms support (missing in 4.57.6); we use direct safetensors weight proof for action_head and vision_tower to demonstrate real weights on NPU without full VLM sampling. This is minimal but uses true model.safetensors bytes on npu:0. For complete VLM sampling, use transformers==4.48 with lerobot patch.assets/agent_workflow.png — reconnaissance, resource check, load, NPU inference, consistency, performanceassets/npu_device_call.png — npu-smi, torch_npu availability, device name, model/input/output device proofassets/model_result.png — default python inference.py showing model, route, action summary, latency, PASSinference.py
readme.md
requirements.txt
assets/agent_workflow.png
assets/npu_device_call.png
assets/model_result.png
