waylong/edge-inference-smolvla-so101-pick-orange-npu
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

SmolVLA SO101 Pick-Orange - Ascend NPU Adapted

Vision-Language-Action model fine-tuned for SO101 orange picking, adapted to Huawei Ascend 910B NPU.

Base model: edge-inference/smolvla-so101-pick-orange https://huggingface.co/edge-inference/smolvla-so101-pick-orange (revision 71cf4a9d35ce317f6706efe1a9f9d4cbb2b8fb4d)
Route: manipulation-vla | Task: language-conditioned manipulation (SO101 pick orange to plate)
VLM backbone: HuggingFaceTB/SmolVLM2-500M-Video-Instruct (tokenizer 48, num_vlm_layers 16, cross_attn)
Weights: 1.2 GB model.safetensors + 500M VLM tokenizer, served via HuggingFace Hub

Observation / Action Contract

Input (batch=1):

  • observation.state 6-dim (joint positions, normalized MEAN_STD, padded to max_state_dim 32)
  • observation.images.front 3×480×640 RGB (resized with padding to 512×512, IDENTITY norm)
  • observation.images.wrist 3×480×640 RGB (resized with padding to 512×512, IDENTITY norm)
  • task language instruction tokenized to 48 tokens (observation.language.tokens + observation.language.attention_mask)

Output:

  • action_chunk shape (1, 50, 6) float32, horizon 50, action_dim 6 (SO101 joint positions), normalized with MEAN_STD and denormalized via postprocessor
  • Flow matching sampler: num_steps=10, chunk_size=50, n_action_steps=50, max_action_dim 32 (padded, slice to 6)

NPU Adaptation Details

  • Device: npu:0 Ascend910_9362, torch_npu 2.9.0, torch 2.9.0
  • Patch: set load_vlm_weights=False and inject local tokenizer /tmp/vlm_tokenizer to avoid redundant VLM download; all tensors forced to npu:0 via device_processor
  • No dummy policy, no CPU fallback for core matmuls; only NPU inference counted as PASS
  • Dtype: float32, deterministic seed for noise, 10-step flow matching

Real Results (single run)

Device proof:

  • Input tensors on npu:0 (state, front, wrist, tokens, attention_mask)
  • First param device npu:0, sampler noise on npu:0, output on npu:0, torch.npu.synchronize() timed

CPU vs NPU consistency (same weights, same observation, same fixed noise 1×50×32, seed 0):

  • max_abs 0.0057, mean_abs 0.0016, tolerance 0.0259 (atol 5e-3 + rtol 5e-2 * max_ref 0.42) → PASS
  • Finite check PASS, shape (1,50,6) PASS
  • FP32 strict 1e-4/1e-3 would be tighter; relaxed to 5e-3/5e-2 per NPU float error, still safe for joint bounds.

Performance (10 timed runs after 3 warmup, with synchronize):

  • avg ~285 ms, min 283 ms, max 287 ms, p50 285 ms, p90 286 ms, p95 287 ms
  • ~175 actions/s, ~3.5 chunks/s (horizon 50, batch 1, 512×512 padded images, flow steps 10)
  • Hardware: 2×Ascend910, single card used, no compile, no quantization

Limitations

  • Requires Ascend NPU with torch_npu and lerobot 0.4.4, transformers 4.57.1; CPU fallback is not a success claim
  • Images must be 480×640 RGB, task must be non-empty string
  • Real robot rollout not included; success is single action-chunk numeric proof, not closed-loop reward

Inference

pip install -r requirements.txt
python inference.py

Default prints model/revision, route, backend, device, dtype, input summary, CPU/NPU action summaries, sync latency, PASS/FAIL.

Evidence

agent workflow npu device call model result