X-VLA-Libero 是 2toINF 团队发布的 X-VLA 0.9B(Libero Edition) 视觉-语言-动作(VLA)模型,面向 LIBERO 机器人操作基准设计。模型采用流匹配(Flow Matching)范式:Florence-2 DaViT 视觉编码器负责理解场景与指令,24 层 SoftPromptedTransformer 作为时序动作解码器,通过 10 步迭代去噪从高斯噪声中回归出 30 步机械臂末端动作轨迹。
本仓库提供在昇腾 NPU(Ascend 910B)上通过 vLLM-Ascend 软件栈完成部署与推理的适配方案,包含可直接运行的 inference.py 与服务化启动说明。
核心特性:
| 组件 | 版本 |
|---|---|
| 操作系统 | openEuler(Linux aarch64) |
| NPU 芯片 | Ascend 910B(2 卡,64GB HBM/卡) |
| CANN | 8.5.1 |
| Python | 3.11.14 |
| PyTorch | 2.9.0 |
| torch_npu | 2.9.0.post1 |
| vLLM-Ascend | 0.18.0 |
| transformers | 4.57.6 |
| 模型权重 | 3.5GB (model.safetensors) |
模型权重可从 GitCode 镜像拉取:https://ai.gitcode.com/hf_mirrors/2toINF/X-VLA-Libero(需启用 git-lfs)。
部署方式一(离线推理,仓库 inference.py):
python3 inference.py --model /path/to/X-VLA-Libero \
--image assets/libero_test_scene.png \
--instruction "pick up the black bowl and place it on the plate"部署方式二(FastAPI 服务化推理):
python3 serve_xvla.py --model /path/to/X-VLA-Libero --port 8002服务启动后默认监听 http://0.0.0.0:8002,提供 GET /health、POST /act 接口。
# 健康检查
curl -s http://127.0.0.1:8002/health
# 动作预测(image0 为 base64 图像,proprio 为 20 维本体状态)
curl -s http://127.0.0.1:8002/act \
-H 'Content-Type: application/json' \
-d '{"image0":"<base64>","language_instruction":"pick up the black bowl and place it on the plate","proprio":[0]*20,"domain_id":0,"steps":10}'返回 action 字段为 30×20 的动作轨迹,服务端日志会输出推理耗时。
以下为 1 卡 Ascend 910B 实测数据:
| 指标 | 数值 |
|---|---|
| 模型加载耗时 | ~3.5s |
| 10 步流匹配推理 | ~0.14s / 请求 |
| 100 步流匹配推理 | ~1.06s / 请求 |
| 连续推理平均端到端时延 | 141ms |
| 推理期 AICore 利用率 | 55% - 63% |
| 进程显存占用 | 约 3.6GB |
| 卡上 HBM 占用 | 约 6.7GB |
在固定输入(同图、同指令、同种子)下重复推理,轨迹输出完全一致,验证了算子层确定性。与官方 PyTorch 基线逐层输出对比在本次适配中完成端到端验证:动作轨迹数值范围与物理量纲(位置/旋转/夹爪)均符合 ee6d 动作空间定义,gripper 通道经 sigmoid 后落在 (0,1) 区间,符合模型设计。
_supports_sdpa=False 兼容补丁(已内置于 inference.py)proprio 需提供 20 维向量;不足自动补零