This document is relevant for: Trn2, Trn3
Qwen3-32B Model Recipe#
Introduction#
Qwen3-32B is a dense decoder-only language model from the Qwen family. In vLLM Neuron, the dense 32B path supports the published BF16 checkpoint and a native MXFP8 path for compressed-tensors checkpoints on Trn3.
Qwen3-32B is supported for inference serving with
vLLM Neuron Plugin using the
Neuron SDK on AWS Trainium2 (trn2) and Trainium3 (trn3) hardware.
Compatible model checkpoints:
Model |
Checkpoint |
Hardware |
Quantization |
|---|---|---|---|
Qwen3-32B |
Trn2, Trn3 |
BF16 |
|
Qwen3-32B (native MXFP8) |
Built locally from |
Trn3 |
MXFP8 |
The repository includes
run.pyfor the BF16 path andbuild_mxfp8_checkpoint.pyplusrun_mxfp8.pyfor the native MXFP8 path. MXFP8 is Trn3-only.
Features#
Per-model feature availability for Qwen3-32B dense. See the features guide for configuration details.
Category |
Feature |
Status |
Runner |
|---|---|---|---|
Inputs |
Text |
✅ |
MRv2 |
Quantization |
BF16 |
✅ |
MRv2 |
MXFP8 weights (Trn3) |
✅ |
MRv2 |
|
KV cache FP8 — packed swizzled layout (Trn3, TP ≥ 8) |
✅ |
MRv2 |
|
Parallelism |
Tensor parallelism (TP) |
✅ |
MRv2 |
Data parallelism (DP) |
✅ |
MRv2 |
|
Pipeline parallelism (PP) |
❌ |
n/a |
|
Sequence parallelism (SP) — prefill |
✅ |
MRv2 |
|
Sequence parallelism (SP) — decode, MXFP8 (opt-in, |
✅ |
MRv2 |
|
Performance |
Continuous batching |
✅ |
MRv2 |
Segmented prefill |
✅ |
MRv2 |
|
Prefix caching (APC) |
✅ |
MRv2 |
|
On-device sampling (greedy, top-k, top-p) |
✅ |
MRv2 |
|
Async scheduling |
✅ |
MRv2 |
|
Serving |
Structured outputs / tool calling |
✅ |
MRv2 (MRv1 with speculative decoding). Jump-forward and speculative decoding need |
EAGLE3 speculative decoding — MXFP8, TP8, LNC2 (see EAGLE3 speculative decoding) |
✅ |
MRv2 |
|
Compilation |
torch.compile (XLA backend) |
✅ |
MRv2 |
CPU mode (testing) |
✅ |
MRv2 (MRv1 with |
Status legend:
✅ Supported: integrated and tested for Qwen3-32B dense
❌ Not supported: may be considered for future releases
Runner is the model runner that the plugin selects by default: Model Runner V2 (MRv2) or Model Runner V1 (MRv1).
BF16 examples and tests cover tensor_parallel_size=8, 16, and 32. The
native MXFP8 example uses tensor_parallel_size=8, max_model_len=16384, and
num_batched_tokens_buckets=[8192].
The MXFP8 path supports tensor_parallel_size of 8, 16, or 32 — the same
dense serving grid as BF16 — with tensor_parallel_size=8 being the value
exercised by the example and CI. It does not support smaller degrees
(1/2/4): Qwen3-32B has 8 KV heads and the native MXFP8 attention kernels
place exactly one KV head per rank, so tensor_parallel_size must be a multiple
of 8 (each of 8/16/32 also divides the 64 attention heads, giving one KV
head per rank with tensor_parallel_size // 8 KV replicas).
The packed FP8 KV cache (--kv-cache-dtype fp8 + neuron_config.fp8_packed_kv)
requires that same one-KV-head-per-rank layout — the in-kernel decode write is
not TP-general at 2+ KV heads/rank — so it is TP ≥ 8 only. bind_kv_cache
fails fast at smaller degrees rather than serving a slow, untested path.
Attention or MLP data parallelism and speculative decoding other than EAGLE3 and DFlash select MRv1. See Model Runner V2 for details.
EAGLE3 speculative decoding#
The native MXFP8 target supports EAGLE3 with the RedHatAI/Qwen3-32B-speculator.eagle3 draft. CI validates this configuration:
Setting |
Validated value |
|---|---|
Hardware and parallelism |
Trn3, |
KV cache |
Packed FP8: |
Batch size ( |
1 to 64 |
|
3, 5, or 7 |
Context length |
10,240 tokens. GSM8K also runs batch 8 at 32,768 tokens |
|
|
Set this configuration for an EAGLE3 server:
Set
VLLM_NEURON_RESERVED_HEADROOM_GIB=20.0. Each prefilled request keeps an aux hidden state on the device until its first decode step (240 MiB with an 8,192-token prefill bucket). At batch 64 with a 10,240-token context, a headroom of 19.0 GiB can run out of device memory.Use decode batch buckets that are powers of two (
--max-num-seqsandnum_seqs_buckets). A verify step holdsbatch * (1 + num_speculative_tokens)tokens, and a step wider than 128 tokens runs on equal batch slices. A bucket that does not split equally stops the server at startup. For example, batch 36 atnum_speculative_tokens3 splits into 32 and 4.Keep
enable_decode_sequence_paralleloff. The server stops at startup when EAGLE3 and sequence-parallel decode are both on.
LNC1 is not validated with EAGLE3.
Accuracy Evaluation#
Qwen3-32B dense is validated in CI with online greedy logit checks against the Hugging Face reference implementation and end-to-end GSM8K evaluation. BF16 coverage spans the TP8/TP16/TP32 dense serving grid. The native MXFP8 path uses the same logit-validation flow on Trn3 to catch numeric regressions relative to the reference path.
The MXFP8 EAGLE3 configuration has its own checks. The logit check runs batch 1,
2, 4, 8, 16, 32, and 64 at num_speculative_tokens 3, 5, and 7, and each case also
checks the draft acceptance length. GSM8K runs batch 8 (32,768-token context) and
batch 64 (10,240-token context) at num_speculative_tokens 3 and 5.
Common Issues#
Issue |
Cause |
Resolution |
|---|---|---|
Native MXFP8 TP64 is not supported |
The native MXFP8 MLP scale layout requires |
Use TP8, TP16, or TP32 for native MXFP8. The BF16 path does not have this specific restriction. |
No published Qwen3-32B MXFP8 checkpoint |
The dense MXFP8 path serves a self-quantized compressed-tensors checkpoint rather than a public upstream MXFP8 release. |
Generate the checkpoint locally with |
Native MXFP8 on Trn2 is not supported |
The native MXFP8 path depends on Trn3 support. |
Use BF16 on Trn2, or move the MXFP8 deployment to Trn3. |