waylong/smolvla_base
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

lerobot/smolvla_base - Ascend NPU Adaptation

Model Overview

  • Model: lerobot/smolvla_base (revision c83c3163b8ca9b7e67c509fffd9121e66cb96205)
  • Type: SmolVLA Vision-Language-Action (manipulation-vla)
  • Route: manipulation-vla - image/state/language → continuous action chunk
  • For: Affordable robotics, single-GPU trainable, consumer deployment
  • Paper: https://arxiv.org/abs/2506.01844

Architecture

  • VLM Backbone: HuggingFaceTB/SmolVLM2-500M-Video-Instruct (960 hidden, 32 layers, reduced to 16 VLM layers, 500M)
  • Action Expert: flow matching with cross-attn, expert_width_multiplier 0.75, every 2 layers self-attn
  • Input Features: observation.state [6], observation.images.camera1/2/3 [3,256,256], language tokens max_length 48
  • Output: action [6] chunk_size 50, n_action_steps 50, max_action_dim 32, num_steps 10 flow matching
  • Processor: tokenizer (SmolVLM2), normalizer (MEAN_STD for STATE/ACTION, IDENTITY for VISUAL), resize_with_padding 512x512
  • Weight: model.safetensors 865M + VLM 1.9G (HF cache), total 906M tracked
  • Backend: torch_npu on npu:0 (Ascend910_9362), dtype float32

Observation / Action Contract

  • Observations:
    • 3x RGB cameras (256x256, randomized demo, resized/padded to 512x512, normalized [0,1]→[-1,1] SigLIP)
    • proprio state dim 6 (random demo, mean-std normalized via preprocessor)
    • language instruction string e.g. "pick the orange" → tokens [1,48] attention_mask bool
  • Action Plan: continuous tensor [1,50,6] (first and last rows are executable actions), float32, finite, horizon 50

NPU Adaptation Details

  • Fixed revision c83c3163b8ca9b7e67c509fffd9121e66cb96205 from local dir /tmp/smolvla_base (offline HF_HOME=/data/adapt-npu-hf)
  • No model replacement, no dummy policy, no CPU fallback for critical path
  • All components on NPU: VLM, vision encoder, language backbone, action expert, state_proj, action_in/out_proj verified via next(policy.parameters()).device == npu:0
  • Inputs, sampler noise, and outputs on npu:0 (int64 tokens, bool masks, float32 images/state/noise)
  • Synchronization: torch.npu.synchronize() before/after each timed run

Real NPU Results

  • Device: npu:0 Ascend910_9362 (device_count 2, torch 2.9.0+cpu, torch_npu 2.9.0.post1)
  • CPU first action: [0.7604, -0.5425, -0.9549, -2.5892, 1.5081, -0.5480]
  • NPU first action: [0.7604, -0.5425, -0.9549, -2.5892, 1.5081, -0.5480]
  • CPU last action: [-1.0701, -0.2329, 0.2137, -2.5501, 0.9917, -0.4429]
  • NPU last action: [-1.0701, -0.2330, 0.2137, -2.5502, 0.9917, -0.4429]

CPU-NPU Consistency

  • Shared weights, observations, preprocessor, seed 1234, dtype float32, sampler flow matching 10 steps
  • max_abs: 6.318e-05 tolerance: 0.002689 (atol 1e-4 rtol 1e-3) finite: true shape: [1,50,6] (300 values)
  • Validation via validate_policy_outputs.py with same threshold: PASS (also passes loose 5e-3/5e-2)
  • Horizon, action_dim, chunk_size all verified; no bounds violation

Performance (Synchronized)

  • Warmup 3, measured 10 runs on npu:0
  • avg: 286.44 ms min: 280.87 ms max: 289.07 ms p50: 286.78 ms p90: 287.49 ms p95: 289.07 ms
  • throughput: 174.56 actions/s, 3.49 chunks/s (batch 1, horizon 50, 10 sampling steps, float32, includes preprocessing+flow)
  • CPU reference: 17037 ms (single run) - NPU ~59x faster
  • Repeated via benchmark_policy.py --items-per-call 50 --unit actions: 174.56 actions/s

Usage

pip install -r requirements.txt
python inference.py

Expects local model at /tmp/smolvla_base or HF cache lerobot/smolvla_base (offline capable with HF_HOME).

Evidence

  • agent workflow
  • npu device call
  • model result

All three PNGs are rendered from real UTF-8 logs via scripts/render_xterm_evidence.mjs with SHA-256.

Environment Limitations

  • Single card Ascend910B (64GB HBM) sufficient (~906M weights + VLM); no model sharding needed
  • trust_remote_code=False, no subprocess/network in model load
  • Token and credentials not embedded; only temporary env token for GitCode push

Submission

  • Model weight URL: https://huggingface.co/lerobot/smolvla_base
  • Revision pinned: c83c3163b8ca9b7e67c509fffd9121e66cb96205