waylong/X-VLA-Pt-NPU
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

X-VLA-Pt NPU Adapted (Ascend 910B)

Source Model: 2toINF/X-VLA-Pt (X-VLA 0.9B Foundation Edition) Task: manipulation-vla (vision-language to action chunk) Hardware: Ascend 910B (npu:0, 910_9391), tested with torch_npu and Ascend910_9362 Model Weight URL: https://huggingface.co/2toINF/X-VLA-Pt

Model Task, Observation & Action Contract

ComponentDetails
ArchitectureFlorence2 encoder (DaViT vision + BART encoder) + SoftPromptedTransformer (flow-matching denoiser) + ee6d ActionHub
Input Observation3-view RGB images image_input [B,3,3,224,224] + image_mask [B,3] + tokenized instruction input_ids [B,50] + proprio proprio [B,20] + domain domain_id [B]
Outputaction_chunk [B,30,20] continuous control: ee6d = dual-arm xyz (3+3) + 6D rotation (6+6) + gripper (1+1)
SamplingFlow-matching iterative denoising: x_t = t*x1 + (1-t)*x0, 10 steps, deterministic with seed 123
ProcessorXVLAProcessor (AutoProcessor with trust_remote_code=True) handles image resize(224)/normalize and text tokenization (max 50)
Action postprocessSigmoid on gripper indices (9,19)

Real Results (CPU vs NPU)

Validated on Ascend 910B npu:0 with identical weights, inputs, seed=123, steps=10, dtype=float32.

  • NPU Device Evidence: torch.npu.is_available()=True, device_count=2, device_name=Ascend910_9362 (see npu_device_call.png)
  • Device Proof: model param npu:0, image_input npu:0, proprio npu:0, output npu:0 (synchronized, no CPU fallback)
  • CPU-NPU Consistency: max_abs=0.002210, mean_abs=0.000441, tolerance 0.0387 (atol=0.01, rtol=0.05 for FP32 VLA), PASS via validate_policy_outputs.py
  • Finite & Shape: CPU and NPU outputs shape [1,30,20], all finite, horizon=30, dim=20, gripper in (0,1) after sigmoid
  • Attn Fix: Patched _check_and_adjust_attn_implementation to return eager for Florence2 compatibility on transformers 4.57

Performance (Synchronized)

Measured with torch.npu.synchronize() before/after each iteration (warmup 3, measured 10).

  • Avg latency: 145.42 ms / chunk (10 denoising steps)
  • Min/Max/P50/P90/P95: 143.52 / 147.38 / 145.63 / 147.38 / 147.38 ms
  • Throughput: 206.3 actions/s (30*1000/145.42), 6.88 chunks/s (1000/145.42)
  • Batch: 1, views 3, resolution 224x224, horizon 30, steps 10, dtype float32, includes image/text preprocess excluded from timed region? Timed region is generate_actions only.

See model_result.png for default python inference.py output.

Environment Limits

  • Requires Ascend NPU with torch_npu, transformers>=4.40, timm, einops
  • Weight not bundled; loaded from local /tmp/XVLA_PT_FINAL or Hugging Face 2toINF/X-VLA-Pt with trust_remote_code=True
  • Single-card fits ~0.9B (3.3GB safetensors) on 64GB HBM; FP32 peak ~7GB
  • Fixed attn_implementation="eager"; SDPA/Flash not used to avoid Florence2 _supports_sdpa issue on newer transformers
  • Deterministic sampling only; random search not compared

Usage

pip install -r requirements.txt
python inference.py

Evidence

  • assets/agent_workflow.png – full workflow logs (recon, NPU check, load, CPU/NPU inference, consistency, perf)
  • assets/npu_device_call.png – NPU availability & device proof logs
  • assets/model_result.png – default python inference.py action & timing & PASS logs