Qwen3-VL 梳理:模型架构、版本更新与部署要点

梳理 Qwen3-VL 的发布脉络与工程要点:235B-A22B 的 Instruct 与 Thinking 版本、模型架构与在线服务形态,以及 FP8 量化对 H100 及以上显卡与 CUDA 版本的要求。

更新日志

  1. Interleaved-MRoPE:通过稳健的位置嵌入实现时间、宽度和高度的全频率分配,增强长视界视频推理。
  2. DeepStack:融合多级 ViT 功能来捕捉细粒度的细节并锐化图像与文本的对齐。
  3. 文本时间戳对齐:超越 T-RoPE,实现基于时间戳的精确事件定位,从而实现更强大的视频时间建模。

在线服务

  • vLLM 服务器

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    # FP8 requires NVIDIA H100+ and CUDA 12+
    python -m vllm.entrypoints.openai.api_server \
    --model Qwen/Qwen3-VL-235B-A22B-Instruct\
    --served-model-name Qwen/Qwen3-VL-235B-A22B-Instruct \
    --tensor-parallel-size 8 \
    --mm-encoder-tp-mode data \
    --enable-expert-parallel \
    --host 0.0.0.0 \
    --port 22002 \
    --dtype bfloat16 \
    --gpu-memory-utilization 0.70 \
    --quantization fp8 \
    --distributed-executor-backend mp
  • SGLang 服务器:

    1
    2
    3
    4
    5
    6
    7
    python -m sglang.launch_server \
    --model-path Qwen/Qwen3-VL-235B-A22B-Instruct\
    --host 0.0.0.0 \
    --port 22002 \
    --tp 8 \
    --max-num-batched-tokens 8192 \
    --max-num-seqs 256
  • 图像请求示例

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    import time
    from openai import OpenAI

    client = OpenAI(
    api_key="EMPTY",
    base_url="http://127.0.0.1:22002/v1",
    timeout=3600
    )

    messages = [
    {
    "role": "user",
    "content": [
    {
    "type": "image_url",
    "image_url": {
    "url": "https://ofasys-multimodal-wlcb-3-toshanghai.oss-accelerate.aliyuncs.com/wpf272043/keepme/image/receipt.png"
    }
    },
    {
    "type": "text",
    "text": "Read all the text in the image."
    }
    ]
    }
    ]

    start = time.time()
    response = client.chat.completions.create(
    model="Qwen/Qwen3-VL-235B-A22B-Instruct",
    messages=messages,
    max_tokens=2048
    )
    print(f"Response costs: {time.time() - start:.2f}s")
    print(f"Generated text: {response.choices[0].message.content}")
  • 视频请求示例

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    import time
    from openai import OpenAI

    client = OpenAI(
    api_key="EMPTY",
    base_url="http://127.0.0.1:22002/v1",
    timeout=3600
    )

    messages = [
    {
    "role": "user",
    "content": [
    {
    "type": "video_url",
    "video_url": {
    "url": "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen2-VL/space_woaudio.mp4"
    }
    },
    {
    "type": "text",
    "text": "How long is this video?"
    }
    ]
    }
    ]

    start = time.time()
    response = client.chat.completions.create(
    model="Qwen/Qwen3-VL-235B-A22B-Instruct",
    messages=messages,
    max_tokens=2048
    )

    print(f"Response costs: {time.time() - start:.2f}s")
    print(f"Generated text: {response.choices[0].message.content}")
本文结束 感谢您的阅读