Qwen3-VL-235B-A22B-Instruct#

简介#

阿里云的Qwen-VL(视觉-语言)系列包含一系列强大的大型视觉语言模型(LVLM),专为全面的多模态理解而设计。它们接受图像、文本和边界框作为输入,并输出文本和检测框,从而实现图像检测、多模态对话和多图像推理等高级功能。

本文档将展示该模型的主要验证步骤,包括支持的功能、功能配置、环境准备、NPU部署、精度和性能评估。

本教程使用 vLLM-Ascend v0.11.0rc2 版本进行演示,以 Qwen3-VL-235B-A22B-Instruct 模型为例展示多NPU部署。

支持的功能#

请参考支持的功能以获取模型支持的功能矩阵。

请参考特性指南以获取功能的配置信息。

环境准备#

模型权重#

  • Qwen3-VL-235B-A22B-Instruct(BF16版本):需要1个Atlas 800 A3(64G × 16)节点,2个Atlas 800 A2(64G × 8)节点。下载模型权重

建议将模型权重下载到多个节点的共享目录中,例如 /root/.cache/

验证多节点通信(可选)#

如果您想部署多节点环境,需要根据验证多节点通信环境来验证多节点通信。

安装#

例如,使用镜像 quay.io/ascend/vllm-ascend:v0.11.0rc2(适用于Atlas 800 A2)和 quay.io/ascend/vllm-ascend:v0.11.0rc2-a3(适用于Atlas 800 A3)。

根据您的机器类型选择镜像并在节点上启动Docker镜像,请参考使用Docker

  # Update --device according to your device (Atlas A2: /dev/davinci[0-7] Atlas A3:/dev/davinci[0-15]).
  # Update the vllm-ascend image according to your environment.
  # Note you should download the weight to /root/.cache in advance.
  # Update the vllm-ascend image
  export IMAGE=m.daocloud.io/quay.io/ascend/vllm-ascend:v0.18.0
  export NAME=vllm-ascend

  # Run the container using the defined variables
  # Note: If you are running bridge network with docker, please expose available ports for multiple nodes communication in advance
  docker run --rm \
  --name $NAME \
  --net=host \
  --privileged=true \
  --shm-size=500g \
  --device /dev/davinci0 \
  --device /dev/davinci1 \
  --device /dev/davinci2 \
  --device /dev/davinci3 \
  --device /dev/davinci4 \
  --device /dev/davinci5 \
  --device /dev/davinci6 \
  --device /dev/davinci7 \
  --device /dev/davinci_manager \
  --device /dev/devmm_svm \
  --device /dev/hisi_hdc \
  -v /usr/local/dcmi:/usr/local/dcmi \
  -v /usr/local/Ascend/driver/tools/hccn_tool:/usr/local/Ascend/driver/tools/hccn_tool \
  -v /usr/local/bin/npu-smi:/usr/local/bin/npu-smi \
  -v /usr/local/Ascend/driver/lib64/:/usr/local/Ascend/driver/lib64/ \
  -v /usr/local/Ascend/driver/version.info:/usr/local/Ascend/driver/version.info \
  -v /etc/ascend_install.info:/etc/ascend_install.info \
  -it $IMAGE bash

您可以从源码构建所有组件。

如果您想部署多节点环境,需要在每个节点上设置环境。

部署#

使用Ray进行多节点部署#

预填充-解码解耦#

功能验证#

一旦您的服务器启动,您可以使用输入提示词查询模型:

curl http://<node0_ip>:<port>/v1/chat/completions \
    -H "Content-Type: application/json" \
    -d '{
    "model": "qwen3",
    "messages": [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": [
        {"type": "image_url", "image_url": {"url": "https://modelscope.oss-cn-beijing.aliyuncs.com/resource/qwen.png"}},
        {"type": "text", "text": "What is the text in the illustration?"}
    ]}
    ]
    }'

精度评估#

这里有两种精度评估方法。

使用AISBench#

  1. 详情请参考使用AISBench

  2. 执行后,您可以获得结果,以下是 Qwen3-VL-235B-A22B-Instructvllm-ascend:0.11.0rc2 中的结果,仅供参考。

数据集

版本

指标

模式

vllm-api-general-chat

aime2024

-

准确率

生成

93

性能#

使用AISBench#

详情请参阅使用 AISBench 进行性能评估

使用 vLLM Benchmark#

以运行 Qwen3-VL-235B-A22B-Instruct 的性能评估为例。

更多详情请参阅 vllm benchmark

vllm bench 包含三个子命令:

  • latency:对单批次请求的延迟进行基准测试。

  • serve:对在线服务吞吐量进行基准测试。

  • throughput:对离线推理吞吐量进行基准测试。

serve 为例,按如下方式运行代码。

export VLLM_USE_MODELSCOPE=True
vllm bench serve --model Qwen/Qwen3-VL-235B-A22B-Instruct  --dataset-name random --random-input 200 --num-prompts 200 --request-rate 1 --save-result --result-dir ./

大约几分钟后,您将获得性能评估结果。