Qwen4-35B-A3B on vLLM: Day-0 Support
Qwen4-35B-A3B on vLLM: Day-0 Support
Qwen releases the open-source model Qwen4-35B-A3B, and vLLM achieves Day-0 support on NVIDIA Blackwell, Hopper, AMD MI350X/MI355X, and Alibaba T-Head Zhenwu PPUs.

Qwen released Qwen4-35B-A3B today, the first open model of the Qwen4 series, and vLLM supports it on day 0 on NVIDIA Blackwell and Hopper, AMD MI350X and MI355X, and Alibaba T-Head Zhenwu PPUs. It is a multimodal MoE with 35B total and 3B active parameters, plus 20B of N-gram embeddings and a 2B MTP module, with a native 1M-token context. On one B300, the FP8 checkpoint generates 514 tokens/s for a single request on SPEED-Bench prompts with the recommended sampling settings.
TL;DR
- 1M context on one GPU. vLLM keeps the 20B N-gram table in host memory, so the model and a full 1M-token context fit on one GPU.
- 8 GiB of NVFP4 cache per 1M-token context. Only the 10 Qwen Sparse Attention (QSA) layers keep a KV cache, in NVFP4, which the model is trained for; the 30 Gated DeltaNet layers keep a fixed-size state. With BF16 full attention in all 40 layers, the same context would need 80 GiB.
- A small model exposes overhead. At 3B active parameters, CPU work, kernel launches and sampling are a large share of each decode step. vLLM replays the later MTP draft steps as one CUDA graph, spreads top-k/top-p masking across SMs, and overlaps dependent kernels with PDL.
We provide Docker images with Qwen4 support: vllm/vllm-openai:qwen4 for NVIDIA and vllm/vllm-openai-rocm:qwen4 for AMD. On NVIDIA:
docker run --gpus all --ipc=host -p 8000:8000 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
-e VLLM_USE_RUST_FRONTEND=1 \
vllm/vllm-openai:qwen4 Qwen/Qwen4-35B-A3B-FP8 \
--trust-remote-code --enable-prefix-caching --max-model-len auto --disable-flashinfer-autotune \
--kv-cache-dtype nvfp4 --attention-config.indexer_kv_dtype fp8 \
--enable-auto-tool-choice --tool-call-parser qwen4 --reasoning-parser qwen4 \
--speculative-config '{"method":"mtp","num_speculative_tokens":3,"index_share_for_mtp_iteration":true}'On AMD MI350X and MI355X, this command serves the BF16 checkpoint with AITER kernels and uses --quantization mxfp4 to quantize the routed experts to MXFP4 at load:
docker run --device=/dev/kfd --device=/dev/dri --group-add video --ipc=host -p 8000:8000 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
-e VLLM_USE_RUST_FRONTEND=1 -e VLLM_ROCM_USE_AITER=1 \
vllm/vllm-openai-rocm:qwen4 Qwen/Qwen4-35B-A3B \
--trust-remote-code --enable-prefix-caching --max-model-len auto --monokernel \
--quantization mxfp4 --quantization-config '{"linear":{"activation":null,"weight":null}}' \
--enable-auto-tool-choice --tool-call-parser qwen4 --reasoning-parser qwen4 \
--speculative-config '{"method":"mtp","num_speculative_tokens":3,"index_share_for_mtp_iteration":true,"draft_lm_head_quantization":"fp8"}'The FP8 checkpoint has a 39.7 GB model and a 20.5 GB N-gram table; the BF16 checkpoint has 72.7 GB and 41 GB. Commands for other hardware are in the recipe.
Model Architecture
Qwen4-35B-A3B uses the architecture of Qwen3.8-Flash-Next, which vLLM has supported since August (#53896).
Figure 1. Qwen4-35B-A3B. Left: the whole model. Right: one of its 10 blocks.
Three linear layers, then one sparse layer. The 40 layers form 10 blocks of three Gated DeltaNet layers and one QSA layer, each followed by an MoE with 256 routed experts (top-8) plus 1 shared expert. Gated DeltaNet compresses the context into a fixed-size state, so only the QSA layers need a KV cache.
Qwen Sparse Attention. An indexer (4 query heads, 1 key head) scores the context in blocks of 4 tokens. Each query then attends to the top 512 blocks (2,048 tokens) plus the current partial block, with 16 query and 2 KV heads of dimension 256. The model is trained for an NVFP4 KV cache.
N-gram embeddings. At layer 2, the model looks up hashed bigrams and trigrams in a 20B-parameter table, and a gated projection and short convolution fold the result into the residual. Each token reads only a few rows.
Gated residuals. The residual is 4 streams wide. Around every attention and MoE sublayer, a rank-256 gate mixes the streams into the input and writes the output back.
MTP. One MTP layer, trained for multiple steps, proposes 3 draft tokens per decode step for the main model to verify.
Serving Qwen4 in vLLM
NVFP4 sparse attention. Qwen4 is trained for an NVFP4 KV cache, 3.6x smaller than BF16, and vLLM serves it in NVFP4 on SM89, SM90, SM10x and SM12x. Together with Gated DeltaNet, this brings a 1M-token context down to 8 GiB. The kernels come from FlashInfer: on SM10x (datacenter Blackwell), small-batch decode runs on CAKE tcgen05 kernels and everything else on PrimTS; SM89 and SM90 (Ada and Hopper) use FlashInfer's sparse paged attention, and SM12x (RTX Pro Blackwell) uses CAKE.
N-gram table in host memory. In the FP8 checkpoint, the table would take 20.5 GB of GPU memory. vLLM keeps it in pinned host memory instead. Each token reads only a few rows, and on NVIDIA, vLLM gathers them over a side stream while the layer before the N-gram layer runs.
AMD MI350X and MI355X. QSA and prefill run on AITER and FlyDSL kernels, and --monokernel runs small decode steps as persistent kernel launches.
Alibaba T-Head Zhenwu. The T-Head team supports Qwen4-35B-A3B on the Zhenwu PPU through the vllm-sail plugin: one M890 (TP1) or two 810E (TP2 with expert parallelism). Commands are in the recipe.
Small Model, Exposed Overhead
At 3B active parameters, a decode step is short: for one request on a B300, the main model verifies 4 positions and the MTP layer drafts 3 tokens in about 4 ms. At that scale, everything around the model's math shows up in latency: CPU work between steps, launch gaps between kernels, and sampling. Most of our work went into cutting that overhead.
MTP drafts in one CUDA graph. The first draft step runs the MTP layer's indexer and drafts token 1. Steps 2 and 3 reuse that token selection but still need fresh indexer metadata. vLLM used to rebuild it on the CPU between steps, so the GPU idled and each step was a separate graph launch. vLLM now updates the metadata in place on the GPU (#58449), so steps 2 and 3 replay as one CUDA graph.
Figure 2. MTP draft steps 2 and 3, before and after the in-place metadata update.
Parallel sampling masks. For a model this small, sampling is a real share of the step. Qwen4 samples with top-k 20 and top-p 0.95, and MTP verification must apply both masks exactly before rejection sampling. The old kernel launched one program per token, so a 4-position verify step could use at most 4 of a B300's 148 SMs. The new kernel splits each token's vocabulary across programs and keeps the result exact (#66792).
PDL. Decode is a chain of short, dependent kernels, so vLLM overlaps them with programmatic dependent launch. Each kernel in these chains moves everything that doesn't depend on its predecessor in front of griddepcontrol.wait, and calls griddepcontrol.launch_dependents as early as it safely can.
- Gated residuals. Before every sublayer, the 4 streams go through combine and RMSNorm, down-projection with SiLU, and up-projection with the gate mix; before an MoE, the next kernel is the router GEMM. Combine-and-norm signals right after its own wait, so the down-projection launches and sets up while it runs. The up-projection loads its weights, signals, and only then waits for the down-projection, while the router GEMM prefetches its weights before its own wait. Three kernels of the chain are resident at once: the down-projection finishing, the up-projection waiting on it, and the router loading weights.
- Gated DeltaNet. The chain is projection, convolution, recurrence and output projection. The convolution loads its weights, bias and state history before waiting, and signals only after its stores, so the recurrence's blocks don't take SMs it still needs. The recurrence reads its metadata before waiting and, depending on the state layout, stages part of the recurrent state too.
Figure 3. PDL on the gated-residual chain before an MoE layer, in a 4-token verify step.
On one B300 with the FP8 checkpoint and the command above:
| Concurrent requests | Output tokens/s per request | P50 TPOT | P50 TTFT |
|---|---|---|---|
| 1 | 514 | 1.91 ms | 46 ms |
| 4 | 336 | 2.81 ms | 62 ms |
SPEED-Bench qualitative prompts, temperature 1.0, top-p 0.95, top-k 20. MTP proposes 3 tokens per step; at 1 request, 2.25 tokens are accepted per step on average.
Usage
Qwen4 thinks by default. Set reasoning_effort (xhigh, high or low) in chat_template_kwargs, or turn thinking off with enable_thinking: false:
from openai import OpenAI
client = OpenAI(base_url="http://localhost:8000/v1", api_key="EMPTY")
resp = client.chat.completions.create(
model=client.models.list().data[0].id,
messages=[{"role": "user", "content": "Give me three primes above 100."}],
temperature=1.0,
top_p=0.95,
extra_body={"top_k": 20, "chat_template_kwargs": {"reasoning_effort": "high"}},
)
print(resp.choices[0].message.content)Acknowledgements
Thanks to the Qwen team for releasing Qwen4-35B-A3B and working with us on day-0 support; to AMD for the AITER and FlyDSL kernels behind MI350X and MI355X support; to Alibaba T-Head for Zhenwu PPU support; to the FlashInfer team for the NVFP4 sparse attention kernels; and to the vLLM community for the upstream work these optimizations build on.
Source: vLLM Blog · vllm.ai