模型: 2toINF/X-VLA-Libero
Revision: 129e71460678b7236cee6fc9707f09d9fa0c3590
任务: manipulation-vla — 多视角图像 + 语言指令 + 本体感知 → 连续动作块
硬件: Ascend 910 (npu:0) + CPU 对比
精度: FP32
X-VLA 是基于 Florence-2 的 Vision-Language-Action 模型,采用 Soft Prompted Transformer 与 Flow Matching 去噪,输出 ee6d 20 维连续动作。
manipulation-vlainput_ids (B=1, L=50, BartTokenizer), proprio (1×20), domain_id (0/30)action_chunk shape [1, 30, 20] — horizon 30, dim 20 (ee6d: xyz 6D rot + gripper)在 npu:0 上加载真实权重 model.safetensors (3.35 GB) 并执行 generate_actions(steps=5) 迭代去噪:
npu:0, float32npu:0npu:0torch.npu.synchronize()model_name: 2toINF/X-VLA-Libero
revision: 129e71460678b7236cee6fc9707f09d9fa0c3590
route: manipulation-vla
backend: transformers AutoModel XVLA
device: npu:0
dtype: torch.float32, steps: 5
action shape: (1, 30, 20)
horizon 30 action_dim 20
sync_latency: ~95 ms (steady), ~450 ms (first compile)
status: PASS保持权重、预处理、采样算法、seed、dtype、steps 完全一致,同一输入在 CPU 与 NPU 上对比:
[1,30,20]max_abs, MAE, 有限值, shapeatol=5e-3, rtol=5e-2 (实际 max_abs=0.000697, mae=0.000179, tol~0.033, PASS)torch.npu.synchronize() 包围,预热 1 次,正式 10 次:
输入
| 字段 | 类型 | shape | 设备 |
|---|---|---|---|
input_ids | LongTensor | [1,50] | npu:0 |
image_input | FloatTensor | [1,3,3,224,224] | npu:0 |
image_mask | BoolTensor | [1,3] | npu:0 |
proprio | FloatTensor | [1,20] | npu:0 |
domain_id | LongTensor | [1] | npu:0 |
输出
| 字段 | 类型 | shape | 设备 |
|---|---|---|---|
action_chunk | FloatTensor | [1,30,20] | npu:0 |
torch.npu.is_available()=True, device_count=2trust_remote_code=True, 需审查本地 modeling_*.py 无网络/子进程/CPU fallbackassets/agent_workflow.png — 侦察、加载、NPU推理、一致性与性能assets/npu_device_call.png — npu-smi 与 device 证明assets/model_result.png — python inference.py 真实输出

pip install -r requirements.txt
# 若 timm 未命中 PyPI,可 git clone https://github.com/huggingface/pytorch-image-models.git /tmp/pytorch-image-models
PYTHONPATH=/tmp/pytorch-image-models:$PYTHONPATH python inference.py