
model.safetensors 3.52GB, 880M 参数, FP32action_chunk [1, 30, 20] (xyz+6D rot+gripper x2 臂), 经 postprocess 对 gripper 通道 sigmoid, 值为有限浮点, 范围约 [-1,1] (gripper [0,1])/opt/atomgit/.cache/huggingface/hub/models--2toINF--X-VLA-WidowX/snapshots/8d7ea1aaa948665d44129a3ff488629b955fc0f9 (已校验 3.5GB safetensors)pip install -r requirements.txt
# torch==2.9.0
# torch_npu==2.9.0.post1
# transformers==4.44.2
# timm==1.0.28
# Pillow==12.2.0
# numpy==1.26.4
# einops safetensors acceleratepython inference.py核心逻辑 (inference.py:1):
AutoProcessor + AutoModel.from_pretrained(..., trust_remote_code=True) → model.to("npu:0"), 验证 next(model.parameters()).device == npu:0torch.npu.synchronize() 前后, 预热 3 次, 正式 10 次执行命令: python inference.py (在 npu:0 真实执行, 权重来自本地快照)
[INFO] Model: 2toINF/X-VLA-WidowX rev 8d7ea1aaa948665d44129a3ff488629b955fc0f9
[INFO] Route: manipulation-vla (ee6d, num_actions=30, dim_action=20)
[INFO] torch_npu_available: True, device_count: 2, device_name: Ascend910_9362
[INFO] Model param device (cpu): cpu -> npu:0, Transformer npu:0, VLM npu:0
[INFO] Input summary: input_ids [1,50] cpu, image_input [1,3,3,224,224] cpu
[RESULT] Action shape: (1, 30, 20), horizon 30, dim 20
[RESULT] First action (5 dims): [0.03093568, -0.00926581, 0.00650926, 0.26996859, 0.01363063]
[RESULT] Last action (5 dims): [0.29028242, 0.10002572, 0.06646484, 0.92894518, -0.23156210]
[RESULT] Finite: True, max_abs: 0.9983
[PERF] avg 140.90 ms, min 140.04, max 142.97, p50 140.53, p90 142.97
[PERF] actions_per_s 212.92, chunks_per_s 7.10, batch=1, 3x224x224, dtype float32
[CONSISTENCY] CPU max_abs 0.001826 vs NPU (atol 2e-3 rtol 1e-3) PASS
[RESULT] PASScpu 与 npu:0 执行 generate_actions, 保存原始动作 .json 后比较python scripts/validate_policy_outputs.py --cpu /tmp/cpu_action.json --npu /tmp/npu_action.json --atol 2e-3 --rtol 1e-3atol 5e-3 rtol 5e-2 也为 true (tolerance 0.054)modeling_xvla.py 中 torch.randn(..., device=proprio.device) 改为 torch.randn(..., device='cpu').to(proprio.device), 使 CPU 与 NPU 使用完全相同初始噪声; 剩余差异 0.0018 来自 Ascend NPU 与 CPU 在 LayerNorm/Attention/MatMul 的累积精度差异, 属于硬件特性, 不影响策略语义 (shape/有限/边界均 PASS)条件: npu:0, float32, batch=1, 3×224×224, horizon 30, steps 10, torch.npu.synchronize() 计时, 预热 3 次, 正式 10 次
{"samples":10, "avg_ms":139.61, "min_ms":138.46, "max_ms":141.35, "p50_ms":139.35, "p90_ms":140.95, "p95_ms":141.35, "actions_per_s":214.89, "chunks_per_s":7.16}manipulation-vla 路由, 不含真实机器人闭环 rollout, 仅单步动作块验证transformers>=4.50 的 _supports_sdpa 兼容性已通过补丁处理 (见 modeling_florence2.py 与 modeling_xvla.py 噪声设备修复)transformers==4.44.2huggingface_hub 按需下载Apache-2.0 (同上游 2toINF/X-VLA)