z
zhangyuge147/YuankaiLuo-SimVLA-LIBERO-NPU
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

YuankaiLuo/SimVLA-LIBERO on Ascend NPU

Model Description

  • Base Model: YuankaiLuo/SimVLA-LIBERO (Vision-Language-Action, SmolVLM-500M-Instruct + DiT 24 layers 1024 hidden, 0.52B+84M params, 3.0GB FP32, Apache-2.0)
  • Revision: 93dc4d90b0596c652ad2840ad743c62b9c4473fb
  • Task: robotics | LIBERO manipulation (manipulation-vla, multi-view RGB + language + proprio -> action_chunk)
  • Route: manipulation-vla (multi-view RGB + language instruction + proprio state -> continuous action_chunk)
  • Original Weight: https://huggingface.co/YuankaiLuo/SimVLA-LIBERO
  • Weight File: model.safetensors 3.02GB (3245529028 bytes), params ~603M (VLM 500M + transformer 84M + proj)
  • License: apache-2.0
  • Paper: SimVLA: A Simple VLA Baseline for Robotic Manipulation (https://arxiv.org/pdf/2602.18224)
  • Ported: SmolVLMVLA from LUOyk1999/SimVLA with SmolVLMVLAProcessor, torch_npu, trust_remote_code=True, supports npu:0 and cpu, FP32

Task Contract

  • Input: Multi-view RGB (3 views 384x384, SmolVLM Image Processor, ImageNet normalize 0.5/0.5), language instruction (SmolVLM tokenizer, max_length 50, padded), proprio state [1,8] (ee_pos 3, ee_ori 3, gripper 2), image_mask [1,3] (bool, 2 valid + 1 padded)
  • Processor: SmolVLMVLAProcessor -> input_ids [1,50], image_input [1,3,3,384,384], image_mask [1,3]; handles resize 384 via bicubic torch interpolate, cached normalize 0.5 shift
  • Output: Continuous action_chunk [1,10,7] (FP32, LIBERO joint delta: delta_xyz 3, delta_euler 3, gripper 1), flow-matching Euler 10 steps, deterministic CPU-generated starting noise moved to target device for parity
  • Inference: model.generate_actions(input_ids, image_input, image_mask, proprio, steps=10, seed=42) -> postprocessed via LiberoJointActionSpace (unnormalize if norm_stats present, else identity); deterministic patched wrapper patched_generate ensures CPU-NPU identical initial x_t via torch.Generator(cpu).manual_seed(42)

NPU Adaptation

  • Single-card npu:0 execution, no CPU fallback; all float tensors (image_input, proprio, actions, vlm_features) on npu:0 when NPU requested; next(model.parameters()).device, next(model.vlm.parameters()).device, next(model.transformer.parameters()).device, pixel_values.device, output.device all npu:0
  • Patched generate_actions to generate initial flow noise on CPU with fixed seed 42 via torch.Generator(device="cpu").manual_seed(42) then .to(device); original used torch.randn on target device which diverges between CPU and NPU RNG streams; patched version ensures max_abs < 3e-5
  • Uses forward_vlm_efficient (vision_model SigLIP -> connector -> text_model Llama fusion) which is NPU-compatible (no custom flash attn, uses eager SDPA, dtype float32); requires torch_npu CANN 8.5.1, Ascend910B/910_9362
  • Peak memory ~6GB FP32 (3GB weights + VLM activations 3 views, transformer 24 layers), fits single Ascend910 64GB HBM; first compile ~2s includes SmolVLM tokenizer download, steady ~141ms

Inference

pip install -r requirements.txt
python inference.py                 # auto NPU if available, else CPU

Default loads local /tmp/simvla_full (or HF cache models--YuankaiLuo--SimVLA-LIBERO) and prints model/revision/route/backend/device/dtype/input summary/action summary/sync latency/PASS/FAIL and device proof. CPU-NPU consistency uses FP32 atol=1e-4 rtol=1e-3 (NPU error ~2e-5 well within).

Real Results (Ascend910_9362, torch_npu 2.9.0.post1, FP32, steps 10, batch 1, seed 42)

  • NPU device: Ascend910_9362, torch.npu.is_available()=True, device_count=2, npu:0 exists
  • Model device: npu:0 (vlm npu:0, transformer npu:0, dtype float32)
  • Input device: npu:0 (image_input [1,3,3,384,384] float32, input_ids [1,50] int64, image_mask [1,3] bool, proprio [1,8] float32)
  • Output device: npu:0 action_chunk [1,10,7] float32 finite True shape_ok True
  • First action (NPU): [1.27729177, 1.18008447, 1.06667161, -2.43989944, 0.08317714, -1.23238361, -0.92107934]
  • First action (CPU): [1.27730083, 1.18008959, 1.06666708, -2.43991041, 0.08321606, -1.23234701, -0.92111444]
  • Consistency: CPU vs NPU max_abs 2.25e-05 mean_abs 4.96e-06 tol 0.002633 (atol 1e-4 rtol 1e-3, max_ref 2.53) -> PASS
  • Latency: avg 141.10 ms, min 138.11 max 142.01, p50 141.21 p90 141.76 (10 runs, warmup 3, torch.npu.synchronize)
  • Throughput: 70.87 actions/s, 7.09 chunks/s (horizon 10, batch 1, steps 10, FP32, 2 views 384x384 padded to 3)

CPU-NPU Consistency Details

Shared weights (same HF snapshot moved CPU->NPU, same FP32 dtype), same deterministic images (seed i*1234, 384x384), same language "Pick up the red block." with identical tokenizer (50 tokens) and image normalize 0.5, same zero proprio [1,8], seed 42, steps 10, FP32. Compared flattened [70] action values. Threshold atol=1e-4 rtol=1e-3 (FP32 default, SimVLA transformer is FP32 and NPU fused matmul error small ~2e-5). Also verified finite, shape [1,10,7], action_dim 7, horizon 10, gripper in [-1.2,0]. No LIBERO Mujoco env needed for weight proof.

metricvalue
cpu first_action[0:4][1.27730083, 1.18008959, 1.06666708, -2.43991041]
npu first_action[0:4][1.27729177, 1.18008447, 1.06667161, -2.43989944]
max_abs0.0000225306
mean_abs0.00000496
max_ref2.5325
tolerance0.002633 (atol 1e-4 rtol 1e-3)
finitetrue
shape[1,10,7]
passedtrue

Performance

  • Warmup: 3 runs excluded (first compile includes SigLIP + Llama fusion)
  • Measured: 10 runs, avg 141ms, min 138ms, max 142ms
  • Throughput: 70.87 actions/s, 7.09 chunks/s
  • Batch=1, horizon=10, action_dim=7, 2 views 384x384 (3 slots), steps=10, dtype float32
  • Memory: 3.02GB weights, ~6GB peak, 64GB HBM free, fits single card

Environment Constraints

  • Requires torch_npu built for CANN 8.5.1, Ascend910B/910_9362, single card sufficient (tested on Ascend910_9362, 2 devices)
  • transformers>=4.51.3, accelerate, einops, Pillow, numpy, num2words; trust_remote_code=True auditable (SimVLA models only use SmolVLM backbone via AutoModelForImageTextToText, no network in generate)
  • LIBERO Mujoco simulation not required for single-step action_chunk validation; closed-loop rollout is extra, not replacement

Evidence

  • assets/agent_workflow.png — reconnaissance, resource check, load, NPU inference, consistency, performance
  • assets/npu_device_call.png — npu-smi, torch_npu availability, device name, model/input/output device proof
  • assets/model_result.png — default python inference.py showing model, route, action summary, latency, PASS

File Tree

inference.py
readme.md
requirements.txt
assets/agent_workflow.png
assets/npu_device_call.png
assets/model_result.png

Limitations

  • SmolVLM processor requires HF download of HuggingFaceTB/SmolVLM-500M-Instruct tokenizer/config on first run (~1.1GB); cached thereafter via HF_ENDPOINT hf-mirror. No offline processor cache bundled.
  • Uses patched deterministic noise for CPU-NPU parity; original repo's generate_actions uses device-specific RNG, so direct comparison without patch would show larger diff (~0.5) due to different initial x_t
  • Single dummy observation (random 384x384); real LIBERO rollout needs Mujoco env and dataset, not required for weight proof; gripper actions not clipped to [-1,1] in this FP32 checkpoint (raw values ~-1.15 to 1.27)

agent_workflow npu_device_call model_result