Ascend-SACT/Qwen-Image-Bench
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

Qwen-Image-Bench

Qwen-Image-Bench(Q-Judger)在 910B3 上的部署指南


一、模型介绍

Qwen-Image-Bench 是阿里通义千问团队推出的文生图模型评测基准,核心是一个微调过的 Qwen3.6-27B 裁判模型(Q-Judger)。给它看任意文生图模型生成的图片,它会按 质量、美学、对齐、真实世界保真、创意生成 五个大维度、23 项子能力、56 个细粒度刻面打分,最后聚合成总成绩。

项目说明
模型名称Qwen-Image-Bench(Q-Judger)
基座模型Qwen3.6-27B(微调)
权重精度BF16,约 54.7 GB
评测维度5 个一级维度 / 23 项二级子能力 / 56 个三级细项
开源协议Apache-2.0
ModelScopehttps://www.modelscope.cn/models/Qwen/Qwen-Image-Bench
HuggingFacehttps://huggingface.co/Qwen/Qwen-Image-Bench
GitHubhttps://github.com/QwenLM/Qwen-Image-Bench

二、环境版本

组件版本
硬件单卡 Ascend 910B3,64 GB HBM
镜像quay.nju.edu.cn/ascend/vllm-omni:v0.28.0
推理框架vLLM 0.28.0
容器名qwen-image-bench
模型路径/mnt/sfs/weight
服务端口8092

三、部署流程

步骤 1:拉取镜像

docker pull quay.nju.edu.cn/ascend/vllm-omni:v0.28.0

步骤 2:下载模型权重

# 从 ModelScope 下载 Q-Judger BF16 权重(约 54.7 GB)
modelscope download --model Qwen/Qwen-Image-Bench --local_dir /mnt/sfs/weight

下载完成后,权重文件直接放在 /mnt/sfs/weight 根目录下。

步骤 3:启动容器

docker run -d --name qwen-image-bench \
  --net=host --shm-size=500g --privileged=true \
  --restart unless-stopped \
  --device=/dev/davinci_manager \
  --device=/dev/hisi_hdc \
  --device=/dev/devmm_svm \
  --device=/dev/davinci0 \
  -v /usr/local/Ascend/driver:/usr/local/Ascend/driver:ro \
  -v /usr/local/sbin:/usr/local/sbin:ro \
  -v /usr/local/Ascend/add-ons/:/usr/local/Ascend/add-ons \
  -v /var/log/npu/slog/:/var/log/npu/slog/ \
  -v /mnt/sfs/weight:/mnt/sfs/weight \
  -v /root/.cache:/root/.cache \
  -e HF_HUB_OFFLINE=1 \
  -e TRANSFORMERS_OFFLINE=1 \
  -e VLLM_WORKER_MULTIPROC_METHOD=spawn \
  -e ASCEND_RT_VISIBLE_DEVICES=0 \
  quay.nju.edu.cn/ascend/vllm-omni:v0.28.0 \
  tail -f /dev/null

容器参数说明:

参数说明
--net=host使用宿主机网络,简化端口映射
--shm-size=500g共享内存 500 GB,满足大模型推理需求
--privileged=true特权模式,确保 NPU 设备访问权限
--device=/dev/davinci0挂载 0 号 NPU 设备
HF_HUB_OFFLINE=1离线模式,不访问 HuggingFace Hub
TRANSFORMERS_OFFLINE=1transformers 离线模式
VLLM_WORKER_MULTIPROC_METHOD=spawn多进程启动方式
ASCEND_RT_VISIBLE_DEVICES=0仅使用 0 号 NPU

步骤 4:拉起推理服务

进入容器后执行:

# 进入容器
docker exec -it qwen-image-bench bash

# 设置环境变量
export HF_HUB_OFFLINE=1
export TRANSFORMERS_OFFLINE=1
export VLLM_WORKER_MULTIPROC_METHOD=spawn
export ASCEND_RT_VISIBLE_DEVICES=0

# 后台启动 vLLM 服务
LOG_FILE=/mnt/sfs/weight/qwen-image-bench.log

nohup vllm serve /mnt/sfs/weight \
  --served-model-name qwen-image-bench \
  --port 8092 \
  --trust-remote-code \
  --gpu-memory-utilization 0.95 \
  --enforce-eager \
  --block-size 768 \
  --max-model-len 4096 \
  > "$LOG_FILE" 2>&1 &

echo "后台启动,PID: $!"

启动参数说明:

参数说明
--served-model-name qwen-image-bench对外服务名
--port 8092服务端口
--trust-remote-code信任远程代码
--gpu-memory-utilization 0.95显存利用率 95%
--enforce-eager禁用 CUDA Graph,使用 eager 模式
--block-size 768KV Cache block 大小
--max-model-len 4096最大上下文长度

查看启动日志:

tail -f /mnt/sfs/weight/qwen-image-bench.log

步骤 5:验证服务

发送测试请求1:

curl -s http://127.0.0.1:8092/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen-image-bench",
    "messages": [{"role": "user", "content": "用一句话解释什么是文生图评测。"}],
    "max_tokens": 128,
    "temperature": 0.1
  }' | python3 -m json.tool

预期返回:

{
    "id": "chatcmpl-b761b4255522ab53",
    "object": "chat.completion",
    "created": 1793527187,
    "model": "qwen-image-bench",
    "choices": [
        {
            "index": 0,
            "message": {
                "role": "assistant",
                "content": "Here's a thinking process:\n\n1.  **Analyze User Input:**\n   - **Topic:** 文生图评测 (Text-to-Image Evaluation/Benchmarking)\n   - **Requirement:** 用一句话解释 (Explain in one sentence)\n   - **Language:** Chinese\n\n2.  **Deconstruct the Topic (文生图评测):**\n   - What is it? It's the process/method of evaluating text-to-image AI models.\n   - What does it measure? Quality, accuracy, alignment with text prompts, creativity, diversity, etc.\n   - How is it done? Through",
                "refusal": null,
                "annotations": null,
                "audio": null,
                "function_call": null,
                "reasoning": null
            },
            "logprobs": null,
            "finish_reason": "length",
            "stop_reason": null,
            "token_ids": null,
            "routed_experts": null
        }
    ],
    "service_tier": null,
    "system_fingerprint": "vllm-0.28.0-3c82bca8",
    "usage": {
        "prompt_tokens": 19,
        "total_tokens": 147,
        "completion_tokens": 128,
        "prompt_tokens_details": null,
        "completion_tokens_details": null
    },
    "prompt_logprobs": null,
    "prompt_token_ids": null,
    "prompt_text": null,
    "kv_transfer_params": null,
    "ec_transfer_params": null,
    "metrics": null
}

服务返回正常,finish_reason 为 length(因 max_tokens=128 截断),模型推理链路验证通过。


五、参考链接

  • ModelScope 模型页面
  • HuggingFace 模型页面
  • HuggingFace 数据集
  • GitHub 仓库
  • 论文:Qwen-Image-Bench: From Generation to Creation in Text-to-Image Evaluation