Model: 2toINF/X-VLA-WidowX (revision 8d7ea1aaa948665d44129a3ff488629b955fc0f9, 0.9B, 3.52 GB safetensors)
Task: Vision-Language-Action (VLA) for WidowX robot (Simpler-Env)
Route: manipulation-vla — image / proprio / language → continuous action chunk
Backend: XVLA (Florence-2 large encoder + SoftPromptedTransformer, flow-matching)
Device: npu:0 Ascend 910B (910_9362), torch.float32, single card, torch.npu.synchronize() timed
Repository Type: model (public, tags: npu, Ascend, vla, robotics)
输入 (Processor XVLAProcessor):
images: list of 1–3 RGB PIL images (processor pads to num_views=3, size 224x224, CLIP normalize mean 0.485/0.456/0.406 std 0.229/0.224/0.225, pad zeros for missing views)language_instruction: str (tokenized to input_ids [1, 50], max length 50, Bart tokenizer 51289)image_input: [B, 3, 3, 224, 224] float, image_mask: [B, 3] bool (valid view mask)proprio: [1, 20] float32 (end-effector state, ee6d space)domain_id: [1] long (WidowX embodiment id 0 of 30)输出 (ActionPlan):
action_chunk: [1, 30, 20] float32, horizon 30, dim 20 (ee6d: xyz 6D rotation gripper, dual-arm 2x10, gripper indices 9,19 sigmoid)steps=10, linear schedule t=i/steps, fixed seed 42 with shared noise tensor for CPU/NPU comparability (torch.randn patched to return same fixed_noise on both devices)action_space.postprocess (gripper sigmoid)npu:0示例:
from transformers import AutoProcessor, AutoModel
proc = AutoProcessor.from_pretrained("2toINF/X-VLA-WidowX", trust_remote_code=True)
model = AutoModel.from_pretrained("2toINF/X-VLA-WidowX", trust_remote_code=True).to("npu:0").eval()
images = [Image.fromarray(np.random.randint(0,255,(224,224,3),dtype=np.uint8)) for _ in range(3)]
inputs = proc(images=images, language_instruction="put the spoon on the towel")
action = model.generate_actions(**inputs, proprio=torch.zeros(1,20).to("npu:0"), domain_id=torch.tensor([0]).to("npu:0"), steps=10) # [1,30,20]单步推理 (batch 1, 3 views 224², horizon 30, steps 10, float32):
[0.0280, -0.00818, 0.00571, 0.2898, -0.0371] last [0.3066, 0.0936, 0.0465, 0.9040, -0.3334][0.0279, -0.00821, 0.00569, 0.2895, -0.0367] (same fixed noise, torch.npu.synchronize timed)model.first_param npu:0, input_ids npu:0, image_input npu:0, proprio npu:0, action npu:0 (无 CPU fallback, 无 .cpu() 隐式路径)True, NPU Truepersist_models/X-VLA-WidowX-full 本地目录, 同一 model.safetensors (SHA 需本地校验)processor 配置, 同一 proprio zeros, 同一 domain_id 0, 同一 dtype float32fixed_noise [1,30,20] (seed 42), 同一 steps 10, 同一 sampler 线性去噪, 无 guidancemax_abs 0.002171, mae 0.000119, tolerance FP16 0.054421 (atol 5e-3 + rtol 5e-2*max), strict FP32 0.001088 — PASS (FP16 阈值内, 接近 FP32)torch.randn 与 CPU RNG 不同, 若不固定噪声则 max_abs ~0.92; 本验证通过补丁共享噪声使比较有意义, 覆盖真实 NPU 前向与设备绑定~485-493 ms (含 Florence2 编码 + 10 步流匹配)torch.npu.synchronize 包围):
avg 140-149 ms, min ~140 ms, max ~150 ms, p50 ~140 ms, p90 ~141 ms, p95 ~141 msactions/s ~201-213, chunks/s ~6.7-7.1 (horizon 30, batch 1, float32, steps 10, 3 views)torch 2.9.0+cpu, torch_npu 2.9.0.post1, CANN 8.5.1, Ascend910_9362 (2 cards, 使用 npu:0)npu:0 显存峰值约 ~3.7 GB (0.93B 参数 + Florence2) < 32 GB, 无需切塔timm 需提供 DropPath, trunc_normal_ (本仓通过 shim 兼容, 亦可 pip 安装 timm)trust_remote_code=True (XVLA 自定义代码), 已审查 modeling_xvla.py, modeling_florence2.py 无网络/子进程/CPU 隐式路径Florence2ForConditionalGeneration 在新 transformers 下需 _supports_sdpa 补丁 (已内置于 inference.py 与本地建模文件)vlm.language_model.model.encoder.embed_tokens.weight (checkpoint 缺失, 随机初始化, CPU/NPU 同步通过 model.to("npu:0") 保证一致)npu:0 单卡验证, 不支持多卡并行或量化, 图片分辨率固定 224, 指令长度 ≤50assets/agent_workflow.png: 侦察、资源、加载、NPU 推理、一致性、性能assets/npu_device_call.png: npu-smi, check_npu, 设备名、模型/输入/输出 deviceassets/model_result.png: 默认 python inference.py 的模型、route、真实 ActionPlan、同步耗时与 PASS/FAIL
