liuhongwei-2026/Embodied-R1.5
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

Embodied-R1.5 on Ascend NPU

1. 简介

  • 模型来源: IffYuan/Embodied-R1.5(镜像: hf_mirrors/IffYuan/Embodied-R1.5)
  • 模型类型: 多模态视觉-语言模型(Embodied Foundation Model)
  • 基座模型: Qwen3-VL-8B-Instruct,强化学习(RL)多任务平衡训练
  • 参数量: 8,767,123,696(≈8.77B)
  • 权重大小: ~17.5 GB(bf16,4 个 safetensors 分片)
  • 能力: 空间认知与推理、长程任务规划与纠错、Embodied 指向与定位(referring grounding / affordance grounding / trace 生成)
  • 架构: Qwen3VLForConditionalGeneration(qwen3_vl)
  • 适配方式: vLLM-Ascend 服务化推理(OpenAI 兼容 API)
  • 适配状态: ✅ SUCCESS(2026-08-22,见 §6 验证结果)

该模型为视觉-语言大模型(RL 微调),非轻量 CNN 类模型,因此走 vLLM-Ascend 服务化推理 路线,而不是单算子/transformers 直推路线。

2. 验证环境

组件版本
torch2.9.0
torch-npu2.9.0.post1
vllm0.18.0
vllm-ascend0.18.0
transformers4.57.6
CANN8.5.1
NPUAscend 910(64GB HBM × 2)
Python3.11

3. 模型权重获取

无 git-lfs 时,经 Git LFS batch API 从镜像仓库拉取(约 17.5 GB,4 个 safetensors 分片):

git clone https://atomgit.com/hf_mirrors/IffYuan/Embodied-R1.5.git /tmp/Embodied-R1.5-weights
# 进入目录后用 LFS batch API 下载 5 个 LFS 对象(4×safetensors + tokenizer.json)

或使用 ModelScope:

python3 -c "from modelscope import snapshot_download; print(snapshot_download('IffYuan/Embodied-R1.5'))"

4. 部署步骤

4.1 安装依赖

pip install -r requirements.txt

4.2 启动 vLLM-Ascend 服务

export VLLM_TARGET_DEVICE=ascend
export ASCEND_VISIBLE_DEVICES=0
vllm serve /tmp/Embodied-R1.5-weights \
    --served-model-name Embodied-R1.5 \
    --port 8000 \
    --max-model-len 16384 \
    --gpu-memory-utilization 0.9 \
    --trust-remote-code

或直接运行仓库内脚本:

bash serve.sh            # 默认 NPU:0、端口 8000

部署要点:vLLM/TRITON/transformers 的缓存默认写入 $HOME/.cache。若工作目录所在文件系统存在磁盘配额(如本环境 /opt/atomgit 配额已满),会报 Disk quota exceeded 导致服务启动失败。serve.sh 已通过 VLLM_CACHE_ROOT、TRITON_CACHE_DIR、HF_HOME 等环境变量将全部缓存重定向到 /tmp。

4.3 服务化推理(OpenAI 兼容 API)

# 文本推理(任务规划)
python3 inference.py

# 图文输入(空间指向/定位),需要真实场景图
python3 inference.py --image scene.jpg --prompt "Locate the red cup. Output the point inside <answer> tags."

也可用 curl:

curl http://127.0.0.1:8000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "Embodied-R1.5",
    "messages": [{"role": "user", "content": [{"type": "text", "text": "Embodied 任务规划问题"}]}],
    "max_tokens": 1024
  }'

5. 模型输出约定

模型按 Qwen3-VL 对话格式在 <answer>...</answer> 标签内输出结构化答案:

任务类型答案格式(<answer> 内)
多选A
数值3.14
开放问答自由文本
数学$$-\dfrac{3}{2}$$
空间定位{"boxes": [35, 227, 437, 932]}
点指向[{"point_2d": [230, 138]}]
轨迹[{"point_2d": [624, 469]}, ...]
3D 轨迹[{"point_2d": [463, 599], "depth": 1.08}, ...]

坐标统一归一化到 [0, 1000];depth 单位为米。

6. 验证结果

  • 适配状态: ✅ SUCCESS
  • 环境: Ascend 910(64GB HBM)/ CANN 8.5.1 / vLLM 0.18.0 + vllm-ascend 0.18.0
  • 服务化推理: 通过 vllm serve + OpenAI 兼容 API 正常服务
测试项输入模型输出(<answer>)
长程任务规划文本:"grasp the red cup and place it on the plate, then push the apple closer"7 步有序计划
空间指向格式文本:"Point to the red cup on the table"[[465, 297]]
图文定位(视觉编码)合成场景图 + "Point to the red cup"[[471, 641]](命中杯中区域)

性能

指标数值
平均延迟~1.30 s(约 60 输出 token)
生成吞吐~49 tokens/s
HBM 占用~56.7 GB / 64 GB(权重 17.5GB + KV cache + ACL 图工作区)
KV cache35.27 GiB / 256,768 tokens
服务初始化36.3 s(含 torch.compile + 图 warmup)

图文输入示例见 assets/example_scene.png,可用 python3 inference.py --image assets/example_scene.png --prompt "..." 复现。

7. 截图

截图说明
agent_workflow部署/服务化推理整体流程
npu_device_callNPU 设备调用(torch_npu / ascend)
model_result模型推理结果示例

8. 复现步骤

# 1. 拉取权重(LFS batch API 或 ModelScope)
# 2. 安装依赖
pip install -r requirements.txt
# 3. 启动服务(后台)
bash serve.sh &
# 4. 客户端推理
python3 inference.py

贡献者: liuhongwei-2026 | 赛道: 模型适配赛道