w
gcw_uQ09W7jl/Xiaomi-Robotics-0-LIBERO-NPU
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

XiaomiRobotics/Xiaomi-Robotics-0-LIBERO on Ascend NPU #NPU

Model Introduction

Model Name: XiaomiRobotics/Xiaomi-Robotics-0-LIBERO
Revision: fc04bbdcc53e498695cfad95d1199091396ef55b (main)
Model Weight URL: https://huggingface.co/XiaomiRobotics/Xiaomi-Robotics-0-LIBERO
Model Type: Vision-Language-Action (VLA)
Task Type: reinforcement-learning / manipulation-vla (multi-view image + proprio + language → continuous action_chunk)
Architecture Family: MiBoTForActionGeneration – Qwen3VL-4B (vision 24 layers, hidden 1024, text 36 layers, hidden 2560) + DiT 16 layers (hidden 1024, head 128) + MLP projectors + sink token, flow-matching denoising
Pipeline Tag: robotics
Weights: model-00001-of-00002.safetensors (4.99 GB) + model-00002-of-00002.safetensors (4.44 GB) total 9.43 GB, 5.1B params, dtype bfloat16 / float32
License: Apache-2.0
Paper: Xiaomi-Robotics-0: An Open-Sourced Vision-Language-Action Model with Real-Time Execution (https://huggingface.co/papers/2602.12684) – Repository https://github.com/XiaomiRobotics/Xiaomi-Robotics-0

Xiaomi-Robotics-0-LIBERO is the LIBERO embodiment fine-tune of Xiaomi-Robotics-0 (4.7B VLA) for LIBERO simulation. Real-time optimized with asynchronous execution, trained on large-scale cross-embodiment trajectories. Input: 2-view RGB (Base + Left-Wrist), proprio state (32-dim), language instruction. Output: 10-step continuous action chunk [B,10,32] with flow-matching DiT denoising (5 steps). LIBERO uses 7 effective DoF (first 7 dims active, rest padded), normalized via processor mean/std (libero_all).

Data Contract

FieldValue
Input Formattext (chat template with vision placeholders) + images (2× RGB 224×224) + state [B,1,32] bfloat16 + action_mask [B,10,32] bfloat16 + seed int
VisionQwen3VL image_grid_thw [[1,14,14],[1,14,14]] (224/16 merged 2 → 14 tokens per view), pixel_values [392,1536] float32
LanguageInstruction Pick up the red block and place it in the bowl. wrapped in <|im_start|>user ... <|vision_start|><|image_pad|><|vision_end|> ... /no_cot<|im_end|><|im_start|>assistant<cot></cot><|im_end|> (161 tokens)
Stateproprio [1,1,32] bf16, random ~ N(0,0.1), sample [-0.0810,-0.1533,0.0405]
Action Maskprocessor.get_action_mask("libero_all") → [1,10,32] bf16, 7 active dims (std >1e-5), others masked 1e-6
Outputactions [B,10,32] bf16 raw normalized, then processor.decode_action → unnormalized [1,10,32] with mean/std
Horizon / Chunk10 (libero_all), action_dim 32 (7 active)
SamplerFlow-matching DiT, 5 diffusion steps, dt 0.2, noise generated on CPU with Generator(seed=42) then moved to device for deterministic CPU/NPU consistency (patched modeling_mibot.py to fix NPU RNG divergence)
Dtypebfloat16 (model weights bf16, compute bf16, pixel_values float32 cast internally)
Batch1 (demo)
PreprocessingProcessor handles image resize/normalize (mean 0.5 std 0.5, longest_edge 90000, shortest 1024) and token placeholder expansion (392 tokens for 2 views)

No simulation environment needed for forward; synthetic deterministic images ensure reproducible action chunk.

Environment

  • Python 3.11.14
  • torch 2.9.0+cpu, torch_npu 2.9.0.post1+gitee7ba04, transformers 4.57.1
  • huggingface_hub 0.34.4, numpy 1.26.4, Pillow 11.x, Accelerate
  • Ascend CANN 8.5.1, torch.npu.is_available()==True, device Ascend910_9362, device_count 2, target npu:0
  • Validated with npu-smi info and scripts/check_npu.py

Installation

pip install -r requirements.txt

Model weights: auto-loaded from /opt/atomgit/adapt-npu-agent/working/models/Xiaomi-Robotics-0-LIBERO if present, else from https://huggingface.co/XiaomiRobotics/Xiaomi-Robotics-0-LIBERO via snapshot_download (uses HF_ENDPOINT mirror). Needs 9.4 GB download.

Patched modeling_mibot.py to generate diffusion noise on CPU with isolated Generator for NPU determinism (original used torch.randn_like on device which diverged CPU vs NPU by 3.7 max_abs).

NPU Inference

Default command (runs synthetic demo with NPU):

python inference.py

Expected output includes:

  • model_name, revision, route manipulation-vla, backend MiBoT
  • local_dir, npu_available True, device_name Ascend910_9362, dtype bfloat16
  • input_ids [1,161], pixel_values [392,1536], image_grid_thw [[1,14,14],[1,14,14]], state [1,1,32], action_mask [1,10,32]
  • CPU baseline: action shape [1,10,32], sample, finite, decoded
  • first_param device: npu:0, npu input ... device: npu:0, NPU action shape [1,10,32] device: npu:0
  • first run (compile) latency with torch.npu.synchronize() and stable avg
  • Benchmark p50/p90/p95 and throughput
  • Consistency max_abs 0.027 mae 0.0025 tolerance 0.200 PASS
  • Final PASS

Real Results (Verified NPU)

Run: python inference.py (batch 1, 2 views 224x224, horizon 10, dim 32, bf16, npu:0, seed 42, steps 5)

Input:

  • input_ids [1,161], pixel_values [392,1536], image_grid_thw [[1,14,14],[1,14,14]]
  • state [1,1,32] sample [-0.0810,-0.1533,0.0405], action_mask [1,10,32] (7 active)

Output:

  • CPU actions [1,10,32] sample first [ -0.2656, -0.3476, 1.1171, -0.0751, 0.1098 ] last [-0.4316,0.1503,-0.7929,0.3710,-0.0263] mean 0.0688
  • NPU actions [1,10,32] sample first [ -0.2675, -0.3476, 1.125, -0.0800, 0.1123 ] last [-0.4375,0.1445,-0.8046,0.3808,-0.0278] mean 0.0686
  • Decoded first [-0.0263,-0.0447,0.4064,-0.0024,0.0125]
  • finite True, shape verified, horizon 10, dim 32

Timing (npu:0, synchronized):

  • First run (compile): 783.99 ms
  • Stable avg: 212.35 ms (warmup 3, test 10, min 208.12 max 217.75 p50 215.67 p90 217.75)
  • Throughput: 47.09 actions/s, 4.71 chunks/s

No CPU fallback; all tensors on npu:0, model on npu:0.

Consistency Verification

Saved CPU/NPU raw actions to .json and compared:

python .opencode/skills/npu_adapt_robotics/scripts/validate_policy_outputs.py --cpu /tmp/cpu_mibot.json --npu /tmp/npu_mibot.json --atol 5e-3 --rtol 5e-2

Result: count 320 passed True finite True max_abs 0.027344 mae 0.002507 tolerance 0.200313 (bf16 atol=5e-3). Shape [1,10,32] verified, horizon/dim correct, finite. Original unpatched max_abs was 3.73 (RNG divergence) – patched to deterministic CPU-generator approach passes.

Benchmark via benchmark_policy.py logic: avg 212.35 ms, 4.71 chunks/s.

Performance

Warmup 3, test 10, synchronized:

  • compile/first_run 783.99 ms, avg 212.35 ms, min 208.12 ms, max 217.75 ms, p50 215.67 ms, p90 217.75 ms, p95 217.75 ms
  • batch 1, horizon 10, act_dim 32, dtype bfloat16, steps 5, device npu:0
  • throughput 47.09 actions/s (10 per chunk), 4.71 chunks/s
  • Includes Qwen3VL encoding + DiT denoising (5 steps) + projectors

Evidence

Three PNGs generated by xterm.js from real logs (render_xterm_evidence.mjs --style raw):

  • assets/agent_workflow.png – workflow (inspect, download, NPU check, inference, consistency, benchmark)
  • assets/npu_device_call.png – npu-smi + torch.npu availability + model param device + input/output device
  • assets/model_result.png – full python inference.py output

Images rendered from UTF-8 stdout/stderr, prompt atomgit@pod-a94f8701860f4700b161b00e290de466:~$ is display label only.

agent workflow npu device call model result

Limitations

  • Only libero_all robot type tested (horizon 10, 7 active DoF); other embodiments not validated.
  • Synthetic observations (deterministic gradient images) – not real LIBERO env rollout; closed-loop success not evaluated per skill rule 6.
  • Flow-matching only with fixed seed 42 and 5 steps; stochastic sampling with different seeds not compared.
  • bfloat16 only; float32 not tested.
  • Requires patched modeling_mibot.py for deterministic noise (upstream uses device RNG which diverges NPU vs CPU).
  • No video input tested (only 2-view images).