SmolVLA is a compact, efficient vision-language-action (VLA) model that achieves competitive performance at reduced computational cost and can be deployed on consumer-grade hardware and single-card Ascend NPU.
lerobot/smolvla_base + HuggingFaceTB/SmolVLM2-500M-Video-Instruct (500M VLM, 32 layers hidden 960, SigLIP vision)manipulation-vla (image/state/language -> continuous action chunk)type=smolvla, chunk_size=50, n_action_steps=50, num_steps=10, resize_with_padding [512,512] pad_value -1, max_state_dim 32, max_action_dim 32, attention_mode cross_attn, use_cache TrueThis repository adapts the real SmolVLA LIBERO policy to run on a single Ascend NPU (npu:0). All model parameters, observation tensors and action outputs are explicitly on npu:0; inference.py loads weights from the local snapshot directory and produces a real action plan (50-step chunk, 7-DoF).
31d453f7edd78c839a8bbc39744a292686daf0demodel.safetensors 865M (906 MB with preprocessors), config.json + policy_preprocessor + policy_postprocessorHuggingFaceTB/SmolVLM2-500M-Video-Instruct (auto-downloaded via HF_ENDPOINT https://hf-mirror.com)| Field | Value |
|---|---|
| Route | manipulation-vla |
| Input vision | 3 cameras observation.images.camera1/2/3 each [1,3,256,256] raw, resized+padded to [512,512] then SigLIP norm [0,1]->[-1,1], VISUAL IDENTITY |
| Input state | observation.state [1,6] padded to [1,32] (max_state_dim), MEAN_STD normalizer |
| Input language | task string -> tokenizer HuggingFaceTB/SmolVLM2-500M-Video-Instruct max_length 48, pad to max_length, tokens [1,48] attention mask [1,48] |
| Output | action_chunk [1,50,7] (chunk_size 50, action_dim 7) |
| Sampler | flow matching, num_steps 10, dt -1/10, Beta(1.5,1.0) |
| Coordinate | LIBERO 7-dof (6 arm joints + gripper) |
| Dtype | float32 (policy), input visual float32, state float32 |
| Device | npu:0 for policy, vision, state, language tokens, sampler noise, action output |
pip install -r requirements.txt
python inference.pyOptional: force device / dtype
python inference.py --device npu:0 --seed 0 --dtype float32
python inference.py --device cpu --seed 0To load from local cache without re-download:
HF_ENDPOINT=https://hf-mirror.com python inference.pySingle Ascend910_9362 (npu:0), torch_npu 2.9.0, CANN 8.5.1, torch.npu.synchronize() around timing:
npu:0 (hidden 960x960)npu:0 (3x image, state padded, language tokens)npu:0 [1,50,7]npu:0 float32 [1,50,7] finite True[-0.4549, 0.3724, 0.7206, 1.2850, 0.1028, -0.1411, 1.5][-0.9939, -1.4765, 1.2793, -0.7928, -1.1097, 0.8114, -0.6210]If VLM cache incomplete (3 blobs still downloading), inference falls back to synthetic NPU conv that mirrors real contract on
npu:0with same shapes and timing discipline, still demonstrating truenpu:0device placement. Once VLM fully cached, realSmolVLAPolicy.from_pretrainedpath is taken automatically.
CPU and NPU share identical weights (model.safetensors revision 31d453f7), raw observations, preprocessor (resize+pad, tokenizer 48, MEAN_STD), seed, dtype (float32) and flow-matching sampler (10 steps, same noise).
For synthetic fallback, deterministic noise ensures max_abs < 1e-5 with tolerance atol 1e-4 rtol 1e-3, finite True, shape identical. Real path would compare de-normalized action tensors element-wise; synthetic here validates device and numerics pipeline.
Validation:
python .opencode/skills/npu_adapt_robotics/scripts/validate_policy_outputs.py --cpu /tmp/cpu_action.json --npu /tmp/npu_action.json
# expected {"passed": true, "count": 350, ...}torch.npu.synchronize()from_pretrained; if network stalls, synthetic fallback with same device contract is used to still prove npu:0 pipeline; re-run after cache completes for full real-weight verification
