X-VLA-Libero 是 X-VLA 系列在 LIBERO 机器人操作基准上的发布版(0.9B 参数)。其整体为一个"编码器 + 流匹配动作头"的组合:视觉侧使用 Florence-2 DaViT 主干提取场景特征,文本指令经 tokenizer 编码后与图像特征融合;动作侧由带领域软提示(Soft Prompt)的 24 层 Transformer 完成 10 步迭代去噪,直接回归机械臂轨迹,不需要按 token 自回归生成。
适配要点在于该架构不属于自回归文本生成模型,因此无法直接挂入 vLLM 的 token 解码链路。本仓库将其在 vLLM-Ascend 软件栈(torch_npu 后端 + CANN 8.5.1)上以动作服务方式落地,兼顾了 NPU 算力利用与部署简洁性。
以下为本次实测通过的软硬件组合(aarch64 平台):
| 项目 | 配置 |
|---|---|
| NPU 形态 | Atlas 800 A2 / Ascend 910B,单卡 64GB HBM |
| 驱动/固件 | npu-smi 25.5.5 |
| 推理栈 | vLLM-Ascend 0.18.0 + torch_npu 2.9.0.post1 |
| 加速库 | CANN 8.5.1 |
| 语言运行时 | Python 3.11.14 / PyTorch 2.9.0 |
| 模型解析 | transformers 4.57.6(remote code) |
| 权重形态 | 单文件 model.safetensors,3.5GB fp32 |
权重获取(GitCode 镜像,git-lfs 拉取):
git lfs install
git clone https://gitcode.com/hf_mirrors/2toINF/X-VLA-Libero.git离线推理(仓库脚本):
python inference.py --weights ./ --scene ./assets/libero_test_scene.png \
--cmd "pick up the black bowl and place it on the plate"服务化启动(FastAPI /act 接口):
python serve_xvla.py --model ./ --port 8002服务就绪后依次验证:
curl -s http://127.0.0.1:8002/health
curl -s http://127.0.0.1:8002/v1/models构造动作请求(image0 传 base64 图像;proprio 传 20 维本体向量;domain_id 取 0-29):
curl -s http://127.0.0.1:8002/act \
-H 'Content-Type: application/json' \
-d '{"image0":"...","language_instruction":"put the pink mug on the plate","proprio":[0]*20,"domain_id":0,"steps":10}'响应中的 action 为 30×20 二维数组,infer_time_s 为纯推理耗时。
使用 npu-smi 在推理过程中周期采样(间隔 1-2s),得到如下观测值:
该模型单请求计算量小,连续请求下 NPU 保持中高利用率,适合批处理式调度。
同一输入重复执行 20 次,轨迹输出逐元素一致,确认 NPU 上算子执行具有确定性。动作数值量纲符合 ee6d 定义:前三通道为位置、3-8 通道为 6D 旋转、第 9/19 通道为夹爪(sigmoid 后落在 0.4 附近开合状态),验证模型在昇腾平台上输出语义正确。
pip install einops timm