Qwen4-35B-A3B on AMD Instinct GPUs: Day 0 support and optimization
Dec 04, 2026
TL;DR
- Qwen4-35B-A3B is the first open model of the Qwen4 series: a multimodal MoE with 3B active parameters, N-gram embeddings, built-in MTP and a 1M-token context. It serves on a single AMD Instinct™ MI350X or MI355X GPU with vLLM and ATOM on day 0, from both the BF16 and the FP8 checkpoint.
- Both checkpoints run their routed experts on AITER’s MXFP4 fused MoE, quantized at load with one vLLM flag. At 64 concurrent requests, MXFP4 experts give 54% more output throughput than BF16 experts.
- vLLM: at 3B active parameters, a decode step on the generic ROCm path was about 1,000 small kernel launches. The new --monokernel mode runs the 40 layers as 12 persistent FlyDSL launches for steps of up to 16 rows, cutting per-token decode latency by 30% at one request and 33% at four.
- vLLM: MTP with 3 draft tokens follows the target’s quantization overrides and uses an FP8 draft lm_head. Model-specific FlyDSL kernels for hyper-connections, sparse attention and linear attention make 128k-token prefill 1.37x faster.
- vLLM, net: the published recipe delivers 1.47x the day-0 output throughput at one request and 1.72x at four, and the full 1M-token context fits on one GPU.
- ATOM: MTP with 3 draft tokens keeps one recurrent state per request and BF16 draft caches beside the FP8 KV cache. It gives 1.55x the output throughput at one request and 1.80x at four over decoding without it.
- ATOM: the fused hyper-connection kernels now cover this model's geometry, for 1.16x output throughput at one request and 1.18x at two without speculative decoding.
- Serving commands for both engines and both checkpoints are given in each engine’s section.
Introduction
We are excited to announce Day-0 support for Qwen4-35B-A3B on AMD Instinct MI350 Series GPUs across the AMD inference software stack: the ROCm™ build of vLLM and ATOM, the AMD inference engine, both running on ROCm with AITER and FlyDSL kernels. Qwen4-35B-A3B is the first open model of Qwen’s Qwen4 series: a natively multimodal Mixture-of-Experts model with 35B total and 3B active parameters, plus a 20B-parameter N-gram embedding table and a 2B Multi-Token Prediction (MTP) module. It has a native 1M-token context, built-in reasoning with selectable effort, and native tool calling.
A model this size is built for one GPU. One MI350X or MI355X, with 288 GB of HBM3E, holds the BF16 checkpoint, the MTP module, the vision encoder and a full 1M-token KV cache. Running it well is a different problem from running a frontier-sized MoE. With 3B active parameters per token, each decode step does very little arithmetic, and the model reaches that arithmetic through many small operations:
- linear-attention recurrences;
- a sparse-attention indexer;
- a 256-expert router;
- four-stream gated residuals around every sublayer
This post covers:
- how each part of the architecture maps onto MI350 Series kernels;
- MXFP4 experts quantized at load;
- the
--monokernelpersistent decode path in vLLM; - MTP fixes and model-specific prefill kernels in vLLM;
- the ATOM integration;
- serving recipes for both engines and both checkpoints.
Qwen4-35B-A3B at a glance
Qwen4-35B-A3B uses the Qwen4 architecture introduced with Qwen3.8-Flash-Next. For inference, five properties matter:
- Three linear layers, then one sparse layer. The 40 layers form 10 blocks of three Gated DeltaNet (GDN) layers and one Qwen Sparse Attention (QSA) layer. GDN compresses the context into a fixed-size recurrent state, so only the 10 QSA layers keep a KV cache.
- Qwen Sparse Attention. An indexer scores the context in 4-token blocks. Each query then attends to its top 512 blocks plus the current partial block, with 16 query and 2 KV heads of dimension 256. Attention reads a fixed budget of about 2,050 positions, so decode cost barely moves with context length.
- MoE in every layer. 256 routed experts with 8 active per token (intermediate size 512), plus a gated shared expert.
- Gated residuals. The residual is 4 streams wide (hyper-connections). Around every attention and MoE sublayer, a rank-256 gate mixes the streams into the input and writes the output back. A decode step passes through 78 of these sites.
- N-gram embeddings and MTP. At layer 2 the model looks up hashed bigrams and trigrams in a 20B-parameter table that is kept in host memory. One MTP layer proposes 3 draft tokens per step for the main model to verify.
Day 0 support for AMD Instinct GPUs
Qwen4-35B-A3B is supported on AMD Instinct MI350 Series GPUs in both inference engines from day 0: vLLM and ATOM. Both can serve the model on a single MI350X GPU.
Supported checkpoints
Checkpoint | Routed experts | Everything else |
Qwen4-35B-A3B (BF16) | BF16 in the file, quantized to OCP MXFP4 at load (vLLM: | BF16, served as is |
Qwen4-35B-A3B-FP8 | Block-FP8 in the file, re-quantized to OCP MXFP4 at load (vLLM: | Block-FP8, served as is |
Both checkpoints carry the MTP module, and both load the vision encoder by default. The FP8 checkpoint also runs with its experts as shipped; the MXFP4 conversion is what the recipes use, for the reason in the next section.
Serving with vLLM
What we optimized
MXFP4 routed experts. At low concurrency the expert format barely matters: the step is launch-bound and the experts are a small part of it. From 16 concurrent requests up, the fused MoE reads most of the 256 experts every step (64 tokens touch 222 of them) and becomes bandwidth-bound, so the weight format sets the throughput.
MXFP4 experts give +54% output throughput at 64 requests over BF16 experts and +31% over the block-FP8 checkpoint as shipped. Tuning the BF16 and block-FP8 MoE tables cannot close that gap, because the BF16 kernels already run close to the GPU’s memory bandwidth. So the recipe quantizes the routed experts of both checkpoints to MXFP4 at load and leaves attention and every other linear layer in the checkpoint’s precision.
Fused hyper-connection sites. Unfused, each of the 78 gated-residual sites in a step is three small kernels and two BF16 GEMMs. New FlyDSL kernels fuse a site into two launches for steps of up to 16 rows and four launches up to 256 rows. At one row, a site takes 36% less time.
Sparse attention on FlyDSL. QSA decode reads the selected KV blocks in place from vLLM’s paged cache. A FlyDSL kernel runs it 2.1x faster than Triton for a single request’s 4-row MTP verify step at 128k context. The indexer scores keys on AITER’s MFMA scorer.
--monokernel: 12 launches for 40 layers. For a step that is a pure decode or a pure MTP verify of at most 16 rows, --monokernel runs whole runs of consecutive layers as one persistent FlyDSL launch. Each launch uses 256 workgroups, one per compute unit, and covers everything in those layers:
- the GDN projections and the in-place recurrent-state update;
- the gated-residual sites;
- the router and the MXFP4 MoE with its shared expert;
- for each QSA layer, its output projection and MoE half.
The 40 layers become 12 launches. Between them vLLM keeps only the QSA projections, the indexer and the sparse attention. The embedding, the final stream mix and the MTP draft also stay in vLLM, all inside the same full CUDA graph. Wider steps, mixed steps and prefill take the standard compiled path automatically, so the flag stays on for every workload.
Median TPOT with –monokernel relative to the stock path at 1, 4, 8 and 16 requests
With MTP, --monokernel cuts the verify step at one request by 27%. The same launches serve the FP8 checkpoint once its experts are MXFP4, and they stay engaged with the vision encoder loaded: with images enabled, the speculative step at one request is 22% shorter than on the stock path.
MTP. MTP with 3 draft tokens is the largest single decode win, and two changes made it larger:
- The draft follows the target’s quantization overrides. Before the fix, the draft inherited --quantization mxfp4 but not the per-layer override that limits it to the routed experts, so it quantized its own projections to 4-bit weights and activations. With the fix, the draft’s acceptance length on real text rose by 6%, and output throughput rose 6% at one request and 15% at sixteen. The bug was not ROCm-specific: any MTP model served with a per-layer quantization override had it.
- FP8 draft lm_head. The 248,320-row lm_head runs four times in a speculative step (three drafts and one verify). With draft_lm_head_quantization: fp8 in the speculative config, each draft call takes half the time, and the speculative step at one request is 5% shorter, with no change in acceptance length.
Prefill. At 8,192-token chunks the same operators are real compute, and model-specific kernels pay directly. Three changes replaced the generic path:
- BF16 QSA sparse prefill, which reads K and V in place over the union of each tile’s selected blocks: 3.1x to 5.7x faster than Triton per call, depending on prefix length;
- a fused GDN chunked prefill: one launch per layer that updates the state in place, with no staging copies;
- AITER’s FlyDSL scorer for the indexer.
On 64 prompts of 128k tokens at 16 concurrent requests on one MI355X, the benchmark ran 1.37x faster, and mean time to first token fell 27%. With prefix caching on, as in the recipe, the fused GDN kernel now also runs when a step exports a prefix-cache state. That cuts time to first token on cold 8k-token prompts by 9%.
How to run
The commands below run inside the ROCm vLLM container on one MI350X or MI355X. The upstream vLLM recipe is at vLLM recipes: Qwen4-35B-A3B; the container that ships the Qwen4 work is vllm/vllm-openai-rocm:qwen4.
docker pull vllm/vllm-openai-rocm:qwen4
docker run -it --device /dev/dri --device /dev/kfd \
--network host --ipc host --group-add video \
--cap-add=SYS_PTRACE --security-opt seccomp=unconfined \
--shm-size=64G -v /models:/models \
--entrypoint bash vllm/vllm-openai-rocm:qwen4
Recipe 1: BF16 checkpoint. The routed experts are quantized to MXFP4 at load; the --quantization-config line keeps every other linear layer in BF16, and the MTP draft follows it.
VLLM_ROCM_USE_AITER=1 \
vllm serve /models/Qwen4-35B-A3B \
--trust-remote-code --enable-prefix-caching \
--tensor-parallel-size 1 --max-model-len auto \
--quantization mxfp4 --quantization-config '{"linear":{"activation":null,"weight":null}}' \
--speculative-config '{"method":"mtp","num_speculative_tokens":3,"index_share_for_mtp_iteration":true,"draft_lm_head_quantization":"fp8"}' \
--monokernel \
--enable-auto-tool-choice --tool-call-parser qwen4 --reasoning-parser qwen4
Recipe 2: FP8 checkpoint. It is the same command with the FP8 checkpoint path. The only other change is that the two quantization flags become one override, which re-quantizes the block-FP8 experts to MXFP4 and keeps the other layers FP8 as shipped:
VLLM_ROCM_USE_AITER=1 \
vllm serve /models/Qwen4-35B-A3B-FP8 \
--trust-remote-code --enable-prefix-caching \
--tensor-parallel-size 1 --max-model-len auto \
--quantization-config '{"moe":"mxfp4"}' \
--speculative-config '{"method":"mtp","num_speculative_tokens":3,"index_share_for_mtp_iteration":true,"draft_lm_head_quantization":"fp8"}' \
--monokernel \
--enable-auto-tool-choice --tool-call-parser qwen4 --reasoning-parser qwen4
Notes:
-
--monokernelserves steps of up to 16 rows: 4 requests with MTP-3, or 16 without. Wider steps fall back to the standard path on their own, so keep it on at any concurrency. It refuses to start, with the reasons listed, on configurations it does not cover: GPUs other than the MI350 Series, other tensor-parallel sizes, or experts that are not MXFP4 or BF16. --max-model-len autouses the full 1M-token window when the KV cache allows, and logs the length it chose. Pass an explicit value to pin a limit.- For text-only workloads, add
--language-model-onlyto skip the vision encoder and leave more memory for KV cache. --kv-cache-dtype fp8holds 47% more tokens than the default BF16 cache, at 1-10% lower speed at 1k-8k context. Use it only when you need the capacity.
Quick check:
curl http://localhost:8000/v1/chat/completions -H "Content-Type: application/json" -d '{
"model": "/models/Qwen4-35B-A3B",
"messages": [{"role": "user", "content": "What is 17*23? Answer briefly."}],
"max_tokens": 2000, "temperature": 0}'
The reasoning is returned in reasoning_content, and the answer, 391, in content. Thinking is on by default. Set reasoning_effort to xhigh, high (default) or low, or to none to turn it off.
Serving with ATOM
ATOM serves both released checkpoints, Qwen4-35B-A3B (BF16) and Qwen4-35B-A3B-FP8 (block FP8), with text and image input, tool calls, structured output and MTP. By default it loads a checkpoint in the precision it ships in: the FP8 checkpoint keeps its block-FP8 weights, routed experts included, and the layers that checkpoint leaves unquantized stay BF16. With --online_quant_config, ATOM re-quantizes at load instead: the routed experts and the shared expert become MXFP4, the GDN and attention projections become per-token FP8, and the hyper-connections, the indexer, the n-gram memory, the vision encoder, the output head and the MTP draft stay BF16.
How to run
The commands below run inside the ATOM container on one MI355X GPU.
docker pull rocm/atom-dev:qwen4-35b-a3b-20261204
docker run -it --device /dev/dri --device /dev/kfd \
--network host --ipc host --group-add video \
--cap-add=SYS_PTRACE --security-opt seccomp=unconfined \
--shm-size=64G -v /models:/models \
rocm/atom-dev:qwen4-35b-a3b-20261204
Recipe 1: FP8 checkpoint. The weights are served as shipped, with the FP8 KV cache and MTP.
python -m atom.entrypoints.openai_server \
--model /models/Qwen4-35B-A3B-FP8 \
--trust-remote-code -tp 1 \
--kv_cache_dtype fp8 --index-cache-dtype bf16 --block-size 64 \
--method mtp --num-speculative-tokens 3
Recipe 2: BF16 checkpoint. It is the same command with the BF16 checkpoint path. Add this flag to quantize the experts to MXFP4 and the GDN and attention projections to per-token FP8 at load:
python -m atom.entrypoints.openai_server \
--model /models/Qwen4-35B-A3B \
--trust-remote-code -tp 1 \
--kv_cache_dtype fp8 --index-cache-dtype bf16 --block-size 64 \
--method mtp --num-speculative-tokens 3 \
--online_quant_config '{"global_quant_config":"ptpc_fp8","layer_quant_config":{"*mlp.experts*":"mxfp4","*mlp.shared_expert*":"mxfp4"},"exclude_layer":["lm_head","*mlp.gate","*shared_expert_gate","*hyper_connection*","*indexer*","*.ple.*","model.visual.*","mtp.*"]}'
Quick check:
curl http://localhost:8000/v1/chat/completions -H "Content-Type: application/json" -d '{
"model": "/models/Qwen4-35B-A3B-FP8",
"messages": [{"role": "user", "content": "What is 17*23? Answer briefly."}],
"max_tokens": 2000, "temperature": 0}'
Footnotes
Test configuration and Disclaimer
vLLM results were measured on one GPU of an 8x AMD Instinct MI350X node with ROCm 10.0, PyTorch 2.13, Triton 3.8, AITER 0.1.29 and FlyDSL 0.5.0, running a ROCm vLLM build with the Qwen4-35B-A3B work described here, in December 2026. The vLLM 128k prefill results were measured on one GPU of an 8x AMD Instinct MI355X node with the same software stack. ATOM results were measured on one GPU of an 8x AMD Instinct MI355X node with ROCm 7.2.4, PyTorch 2.10, Triton 3.9, FlyDSL 0.5.5 and an AITER main build after v0.1.30, running the ATOM image rocm/atom-dev:qwen4-35b-a3b-20261204, in December 2026. The hyper-connection kernel, KV cache and GSM8K results were measured on the same node with the ATOM nightly image of November 30 (Triton 3.8, FlyDSL 0.5.3). Serving ratios come from vLLM’s serving benchmark with random prompts of exact length; kernel ratios from CUDA-graph replay on the same GPUs. Results on other hardware, software versions, settings or workloads will differ; these figures are for illustration and are not a performance guarantee.
Appendix: vLLM flags and environment variables
Flag or variable
Set to
Description
VLLM_ROCM_USE_AITER
1
AITER kernels for the fused MoE, GEMMs, the indexer scorer and GDN prefill
--quantization mxfp4 + --quantization-config '{"linear":{"activation":null,"weight":null}}'
BF16 checkpoint
Quantize only the routed experts to MXFP4 at load
--quantization-config '{"moe":"mxfp4"}'
FP8 checkpoint
Re-quantize the block-FP8 routed experts to MXFP4 at load
--monokernel
on
Persistent FlyDSL decode launches for steps of up to 16 rows; other steps fall back
draft_lm_head_quantization (in --speculative-config)
fp8
FP8 weights for the MTP draft’s lm_head
index_share_for_mtp_iteration (in --speculative-config)
true
MTP draft steps reuse the first step’s indexer selection
--max-model-len
auto
Full 1M-token window if the KV cache allows, otherwise the largest that fits
Test configuration and Disclaimer
vLLM results were measured on one GPU of an 8x AMD Instinct MI350X node with ROCm 10.0, PyTorch 2.13, Triton 3.8, AITER 0.1.29 and FlyDSL 0.5.0, running a ROCm vLLM build with the Qwen4-35B-A3B work described here, in December 2026. The vLLM 128k prefill results were measured on one GPU of an 8x AMD Instinct MI355X node with the same software stack. ATOM results were measured on one GPU of an 8x AMD Instinct MI355X node with ROCm 7.2.4, PyTorch 2.10, Triton 3.9, FlyDSL 0.5.5 and an AITER main build after v0.1.30, running the ATOM image rocm/atom-dev:qwen4-35b-a3b-20261204, in December 2026. The hyper-connection kernel, KV cache and GSM8K results were measured on the same node with the ATOM nightly image of November 30 (Triton 3.8, FlyDSL 0.5.3). Serving ratios come from vLLM’s serving benchmark with random prompts of exact length; kernel ratios from CUDA-graph replay on the same GPUs. Results on other hardware, software versions, settings or workloads will differ; these figures are for illustration and are not a performance guarantee.
Appendix: vLLM flags and environment variables
Flag or variable | Set to | Description |
| 1 | AITER kernels for the fused MoE, GEMMs, the indexer scorer and GDN prefill |
| BF16 checkpoint | Quantize only the routed experts to MXFP4 at load |
| FP8 checkpoint | Re-quantize the block-FP8 routed experts to MXFP4 at load |
| on | Persistent FlyDSL decode launches for steps of up to 16 rows; other steps fall back |
| fp8 | FP8 weights for the MTP draft’s lm_head |
| true | MTP draft steps reuse the first step’s indexer selection |
| auto | Full 1M-token window if the KV cache allows, otherwise the largest that fits |