# Qwen/Qwen3-VL-Embedding-2B — vLLM serving recipe

> 2B vision-language embedding model. Single-card pooling verified on Atlas A3 (Ascend 910C) and Atlas 300I DUO (310P) with vLLM Ascend 0.23.0.

Configuration: hardware `ascend_910c` (16× Ascend 910C) · strategy `single_node_tp` (Tensor Parallel) · variant `default` (BF16)

- Interactive page: https://recipes.vllm.ai/Qwen/Qwen3-VL-Embedding-2B
- This configuration as JSON: https://recipes.vllm.ai/Qwen/Qwen3-VL-Embedding-2B.json?hardware=ascend_910c

The commands below were rendered for exactly this configuration and take precedence over any example in the guide.

## Other configurations

Change the query string (the same parameters as the page URL) and fetch this URL again. Unknown or incompatible values fall back to the recipe default, so check the Configuration line.

- `hardware`: `ascend_910c`
- `variant`: `default`
- `strategy`: `single_node_tp` (multi-node strategies also need `nodes=<n>`)

## Install

Requires vLLM >= 0.23.0.

Docker image: `quay.io/ascend/vllm-ascend:v0.23.0-a3`

## Serve

```bash
export PYTORCH_NPU_ALLOC_CONF=expandable_segments:True
vllm serve Qwen/Qwen3-VL-Embedding-2B \
  --runner pooling \
  --max-model-len 32768 \
  --enforce-eager \
  --tensor-parallel-size 1
```

Docker equivalent:

```bash
docker run --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/davinci8 --device /dev/davinci9 --device /dev/davinci10 --device /dev/davinci11 \
  --device /dev/davinci12 --device /dev/davinci13 --device /dev/davinci14 --device /dev/davinci15 \
  --device /dev/davinci_manager --device /dev/hisi_hdc \
  -v /usr/local/Ascend/driver:/usr/local/Ascend/driver \
  -v /etc/ascend_install.info:/etc/ascend_install.info \
  -v /usr/local/dcmi:/usr/local/dcmi \
  -v /usr/local/bin/npu-smi:/usr/local/bin/npu-smi \
  --privileged --net=host --shm-size=16g \
  -v ~/.cache/huggingface:/root/.cache/huggingface \
  -e PYTORCH_NPU_ALLOC_CONF=expandable_segments:True \
  quay.io/ascend/vllm-ascend:v0.23.0-a3 \
  vllm serve Qwen/Qwen3-VL-Embedding-2B \
  --runner pooling \
  --max-model-len 32768 \
  --enforce-eager \
  --tensor-parallel-size 1
```

## Guide

> Background reference. Commands in it are examples and may target another configuration — use the Serve section above.

### Overview

Qwen3-VL-Embedding-2B produces vectors for text and mixed multimodal inputs
(retrieval, clustering, similarity). This Ascend-owned recipe records verified
single-card pooling on Atlas A3 (Ascend 910C) and Atlas 300I DUO (310P) with
vLLM 0.23.0 / vLLM Ascend 0.23.0. Atlas 800I A2 commands from the official
tutorial are included as an untested reference. The recipes renderer has no
dedicated 310P hardware profile yet, so 310P evidence is documented in prose.

### Launching the Server

#### Ascend 910C / Atlas 800 A3 (verified)

On the verified vLLM Ascend 0.23.0 stack, engine init failed during torch.compile
unless `--enforce-eager` is set. Default dtype is bfloat16. The default command
uses `--max-model-len 32768` (model context); lower it for low-memory hosts.

```bash
export ASCEND_RT_VISIBLE_DEVICES=0
export PYTORCH_NPU_ALLOC_CONF=expandable_segments:True

vllm serve Qwen/Qwen3-VL-Embedding-2B \
  --runner pooling \
  --max-model-len 32768 \
  --enforce-eager \
  --port 8000
```

Smoke: HTTP 200, dimension 2048, `prompt_tokens` 39.

Embeddings bench (`vllm bench serve --backend openai-embeddings --dataset-name random
--endpoint /v1/embeddings --random-input 200`, no request-rate limit, 1000 requests):
1000/1000 success, 153.13 req/s, 30626.58 tok/s, mean E2E 4644.98 ms, P99 6426.33 ms.

Accuracy: MTEB `LeCaRDv2` **0.65931** via `VllmEncoderWrapper`
(`revision="norm"`, `dtype="float16"`, `max_model_len=10240`, `enforce_eager=True`,
`enable_chunked_prefill=False`, `batch_size=1`). Default chunked prefill stalled at
151/159 prompts on this host.

#### Atlas 300I DUO / 310P (verified on hardware; no renderer profile yet)

Use a low `--max-model-len` on 310P to avoid oversized attention masks / OOM.

```bash
export ASCEND_RT_VISIBLE_DEVICES=0
export PYTORCH_NPU_ALLOC_CONF=expandable_segments:True

vllm serve Qwen/Qwen3-VL-Embedding-2B \
  --runner pooling \
  --dtype float16 \
  --max-model-len 1024 \
  --compilation-config '{"cudagraph_capture_sizes": [1024,512]}' \
  --additional-config '{"ascend_compilation_config": {"fuse_norm_quant": false}}' \
  --port 8000
```

`--runner pooling` is required. Keep `--max-model-len` explicit. `No module named
'triton'` is expected on 310P. Verified 310P3 smoke: HTTP 200, dimension 2048,
`prompt_tokens` 39, leading values match the tutorial sample.

#### Atlas 800I A2 (tutorial reference, not verified here)

```bash
vllm serve Qwen/Qwen3-VL-Embedding-2B \
  --runner pooling \
  --max-model-len 1024 \
  --port 8000
```

### Client Usage

```bash
curl -sS http://localhost:8000/v1/embeddings \
  -H "Content-Type: application/json" \
  -d '{
    "model": "Qwen/Qwen3-VL-Embedding-2B",
    "input": [
      "The capital of China is Beijing.",
      "Gravity is a force that attracts two bodies towards each other. It gives weight to physical objects and is responsible for the movement of planets around the sun."
    ]
  }'
```

### Troubleshooting

- **Startup OOM:** set `--max-model-len 1024` and `--dtype float16` on 310P.
- **Not an embeddings response:** restart with `--runner pooling`.
- **A3 compile failure:** add `--enforce-eager`.

### References

- Downstream Ascend recipes (merged): https://github.com/vllm-ascend/vllm-ascend-recipes/pull/117
- [Qwen3-VL-Embedding tutorial](https://docs.vllm.ai/projects/ascend/en/latest/tutorials/models/Qwen3-VL-Embedding.html)
- [ModelScope](https://www.modelscope.cn/models/Qwen/Qwen3-VL-Embedding-2B)
