Making Qwen3.8 Flash-Next fast on RDNA4: nine refutations and a 4.6x day
A 180B MoE went from 10.4 tok/s to 102.2 single-stream (437.8 at c8) on 4x R9700 - 47.96 from an in-house engine, then a community MXFP4 checkpoint doubled it. The decomposition refuted the artisan-kernel theory: speculation 1.67x, TunableOp 3.8x, hand-written GDN kernels 0.3%. Every verdict carries a receipt.

Qwen3.8 Flash-Next is a 180B-parameter MoE with ~6B active per token. On a 4× AMD R9700 box (2.55 TB/s aggregate bandwidth) it decoded at 10.4 tok/s when this work started. An in-house engine raised that to 47.96 with no measured quality loss, and a single M2 Ultra reached 62.3 on code. A community MXFP4 checkpoint and runtime then doubled the AMD result to 102.2 tok/s single-stream, 437.8 aggregate at eight concurrent. Decomposing that final 2× refuted the most flattering explanation for it. Most of the effort went into testing plausible ideas against measurements, and the refutations are what located the wins.
Transcript
Qwen3.8 Flash-Next is a 180B-parameter mixture-of-experts model: each token uses about 6B of those parameters. On four AMD R9700 cards it decoded at 10.4 tokens per second. It ended at 102.2.
But active parameters are not bytes. Each token reads about 5.4 GiB, and only 1.1 GiB of that is the ten routed experts. The other 4.3 GiB is the always-on dense stack.
An in-house engine took decode from 10.4 to 47.96, with no measured quality loss. The biggest step was moving 36 tensors of 384 bytes each onto the cards that use them.
Nine plausible ideas were refuted on the way. One: requantizing the dense stack bought 4.3 percent speed for 15 percent worse perplexity.
Then a community MXFP4 checkpoint and runtime doubled it: 102.2 tokens per second for one stream, and 437.8 in total across eight concurrent streams.
Why? Not hand-written kernels. Speculative decoding gave 1.67 times. TunableOp, which tunes the matrix multiplies, gave 3.8 times without speculation. Hand-written kernels: 0.3 percent, which is noise.
So the speed came from speculation and tuned matrix multiplies, not artisan kernels. The full write-up is at boracode.ai.
Per-token bytes
"Active 6B" counts parameters, not bytes. Each decoded token puts ~5.4 GiB of compulsory reads on the memory bus at 4-bit, and only 1.1 GiB of that is the ten routed experts. The other 4.3 GiB is the always-on dense stack: 36 gated-DeltaNet linear-attention layers, 12 full-attention layers, hyper-connection projections, a shared expert, and a 636M-parameter LM head that is read in full every token. The model also carries a 51 GB n-gram embedding table (PLE), which adds a ~2.5 KB gather per token and so costs capacity but almost no bandwidth, and an in-checkpoint MTP head for speculative decoding.
The 80/20 split explains most of the results below. Expert-parallelism speeds up only the 20%. Tensor-parallelism targets the 80% and loses to the model's own shape. Speculation divides the cost of the whole token by its acceptance rate.
Nine refuted ideas
A rule from earlier incidents applies throughout: a negative verdict has to be earned by decomposing the cost, not declared from one slow run. Each entry below has an artifact behind it.
What the in-house engine earned: 10.4 to 47.96
The gains were individually modest and additive, on a lean custom engine ported from its qwen35 backend. Graph parity was checked element-wise against the reference, because comparing sums hid 20% element errors behind residual-stream cancellation.
4x R9700, end-to-end single stream, same box, same GGUF
vLLM (eager, host PLE) 10.4 tok/s
llama.cpp Vulkan 25.7
engine port, 4-card pipeline 18.9 <- 58 graph splits
+ place 36 tiny gate tensors right 30.5 <- 58 -> 4 splits (+62%)
(they are 384 bytes each)
honest end-to-end accounting 26.3 <- compute-span != token span
+ step-invariant decode graph 28.4
+ HIP graph capture (now replayable) 30.6 <- break-even at 24 tokens
+ device-side argmax 31.7
+ MTP speculation, K=2, quality-gated 47.96 <- accept 2.6, HumanEval
19/20 on BOTH armsThe largest single jump, 18.9 to 30.5, came from moving thirty-six 384-byte tensors onto the cards that consume them. Each tensor left on the wrong device cost two graph splits per layer. Speculation was the second-largest gain, and its acceptance profile was confirmed three independent ways before the number was trusted: 2.6 mean accept on this engine, 2.58 on an SGLang stack, and 77–82% draft acceptance on code on an Apple-silicon engine. In every engine that runs it, this architecture accepts ~2.6 drafts on code and meaningfully fewer on prose.
The Apple result
Meanwhile a Zig+Metal engine (mlx-serve) shipped day-one support for this model, with the n-gram table mmapped directly from the SSD. The byte math had argued for that placement from the start, since the gather is only kilobytes. On an M2 Ultra it reaches 50.0 tok/s serial, ahead of a purpose-built MTP competitor's speculative arm, from a 66 GB resident set. Its MTP support was already wired in behind a measurement gate that its author had left closed ("the bar for adding an arch here is a measurement"). Running the measurement settled it. Code workloads pass (62.3 tok/s, 1.25×), prose regresses in every context cell, and the adaptive controller never disengages at low acceptance. The gate therefore stays closed, the flag is enabled per request for code traffic, and the finding went back upstream instead of a gate-flip PR.
Community checkpoint: 102.2
The last step came off the shelf. tcclaviger published an R9700-native MXFP4/FP8 quant of the model (Qwen3.8-Flash-Next-MXFP4-FP8: 131 shards, 125,870,567,905 bytes — MXFP4 experts 64.2 GB, FP8 n-gram table 51.3 GB, FP8 attention and MTP head 2.7 GB each) plus the only runtime that can load it, the image tcclaviger/vllm:DevQwenNextFlash. On this 4× R9700 box at TP4 it decodes a single stream at 102.2 tok/s median and aggregates 437.8 tok/s at c8. That is within 2% of the author's own TP4 table (100.3 / 440), on different hardware, and it was measured before seeing his numbers for c16.
Concurrency past c8 is negative: c16 aggregates 256.3 tok/s, below c8's 437.8. The recurrent-state memory pressure of 36 DeltaNet layers inverts the usual throughput curve, and the inversion reproduced independently on both boxes. MTP acceptance runs 2.65–2.73 tokens per 4-token chunk. Greedy beats temperature 0.7 (2.73/43.2% vs 2.42/35.6%), so the gap to the author's 3.3 lies on the checkpoint side, not in sampling.
The model card's docker run example floors at ~15 tok/s, a 7× gap that comes entirely from the environment. The author's published PDF was measured against port 8078, which belongs to his docker-compose.yml, not the README. The compose file adds the TunableOp environment (hipBLASLt's heuristic drops LLM-shaped GEMMs without it), the R4D_QSA kernel toggle, and different scheduler limits. A published stack should not be benchmarked from its README example; find the configuration the published numbers were measured on and diff the environments first.
Decomposing the 15-to-102 gap
Before running this stack, I wrote a postmortem attributing the speed gap to a missing "kernel lane": months of hand-written HIP kernels this fleet never invested in. Ablating the stack one factor at a time refuted that postmortem:
The speed comes from MTP speculation, TunableOp-tuned GEMMs, and the MXFP4 format, whose dequant happens in-register inside the WMMA path. Hand-written kernels contribute essentially nothing here. The kernel-lane gap is real for engines without a speculation-plus-tuned-GEMM path (it is why the in-house engine pays 11.7 ms/token of GDN glue), but on this stack the gains are mostly automated and architectural. The one remaining real deficit is prefill: 0.69–0.77× of the author's reference, insensitive to environment, with a two-shot all-reduce kernel at 42.7% of prefill GPU time, which is 3.0× the cost of the entire MXFP4 MoE GEMM. A profiler trace is the next step.
A second retraction settled the topology question. I inferred from the device list in the author's PDF that his prefill reference used TP2, and recommended a two-replica TP2 production shape. The memory wall disproves that. With the 51.3 GB n-gram table offloaded to host, 69.4 GiB of weights stay VRAM-resident, and 34.7 GiB per rank does not fit a 31.86 GiB card at any utilization setting. TP2 cannot load this checkpoint on 32 GB parts, so TP4 is the only feasible topology, for him and for this box.
Four-bit float formats
Every 4-bit float family stores the same E2M1 value grid of sixteen representable numbers. The accuracy differences lie almost entirely in the scale: its numeric format and how many values share one.
MXFP4 (the OCP Microscaling format this checkpoint uses) shares one E8M0 scale, a bare power of two, across 32 values. That is 4.25 bits per weight, and the RDNA4 WMMA dequant path here is built around it. NVFP4 halves the block to 16 and upgrades the scale to E4M3, which gives fractional scale precision at 4.5 bpw, but its decode is native to Blackwell tensor cores, not RDNA. The lucebox ROCMFP4 family sits between them for AMD: E2M1 values with UE4M3 scales, either dual per-16 half-block scales at ~4.5 bpw or a single per-32 "fast" variant at 4.25 bpw. It has imatrix-aware quantizers in-tree, kernels dispatch-gated to gfx1151/gfx12xx, and a P4MIX mode that mixes precision per expert across the 512 experts. Refutation 5 already showed that bit width is what costs perplexity on the dense stack. Two options remain: an in-house GPTQ/AWQ requant from the BF16 checkpoint (the acceptance gap is checkpoint-side) and a ROCMFP4 artifact that serves natively on the in-house engine.
Reproduction
Settings
podman run -d --network=host --ipc=host \
--device /dev/kfd --device /dev/dri --group-add keep-groups \
-e ROCR_VISIBLE_DEVICES=0,1,2,3 -e VLLM_PLE_CPU_OFFLOAD=1 \
-e PYTORCH_TUNABLEOP_ENABLED=1 -e PYTORCH_TUNABLEOP_TUNING=0 \
-e CLAV_TUNABLEOP_SWEEP=1 -e R4D_QSA=1 -e CLAV_ATTN_AUTOTUNE=1 \
-e CLAV_GDN=0 -e VLLM_ROCM_USE_AITER=0 -e GPU_MAX_HW_QUEUES=1 \
-e HSA_ENABLE_INTERRUPT=1 -e HSA_ENABLE_MWAITX=1 -e OMP_NUM_THREADS=8 \
-v /path/to/Qwen3.8-Flash-Next-MXFP4-FP8:/app/models \
-v /path/to/tunableop:/tunableop \
docker.io/tcclaviger/vllm:DevQwenNextFlash \
/app/models --tensor-parallel-size 4 \
--speculative-config '{"method": "mtp", "num_speculative_tokens": 4}' \
--kv-cache-dtype fp8 --enable-prefix-caching --enable-chunked-prefill \
--max-num-batched-tokens 4096 --max-num-seqs 32 \
--gpu-memory-utilization 0.95 --max-model-len 524288 \
--compilation-config '{"cudagraph_capture_sizes": [5,10,15,20,25,30,35,40],
"max_cudagraph_capture_size": 40}' \
--host 0.0.0.0 --port 8000 --served-model-name Qwen3.8-Flash-Next
# health: curl http://YOUR_HOST:8000/health (200 when ready)Load-bearing flags: the TunableOp environment is the 3.8× no-spec factor (hipBLASLt's heuristic path drops LLM-shaped GEMMs without it); K=4 is one of only two legal speculation depths; the PLE offload is what lets the weights fit at all; --max-model-len is a per-request cap, not a reservation (KV is only 12 KB/token, since only 12 of 48 layers carry KV).
Speed
single-stream (c1) decode 102.2 tok/s median (min 95.8, max 108.6)
c8 aggregate 437.8 tok/s <- the saturation point
c16 / c24 aggregate 256.3 / 382.2 <- past c8 is NEGATIVE
TTFT p50 267-290 ms
MTP acceptance 2.65-2.73 tok per 4-token chunk (greedy;
temp 0.7 is WORSE: 2.42)
prefill 0.69-0.77x of author's reference (open)All numbers are warm floors, never first-run pairs: an OpenAI-compatible decode bench run in 3 rounds per workload across 4 committed workloads at fixed max-tokens, repeated until consecutive rounds stop falling. The config was re-verified three separate times in one session (99.0 / 98.9 / 98.0 on code) and once more on a fresh container at session end (99.0, accept 2.71). Measured 2026-08-28.
Quality
The in-house engine's 47.96 tok/s carries the full quality gate: HumanEval N=20 run on both arms of the same binary. Serial scored 19/20 at 31.16 tok/s and speculative K=2 scored 19/20 at 49.59 (1.59×), with byte-identical completions on 14/20 tasks and the same pass/fail verdict on 20/20. That is a same-harness baseline with zero measured quality loss. The MXFP4 production stack's speed numbers above are final, but its quality bench on the same harness is still in flight. Until it lands, 102.2 is a throughput claim only, not a quality-gated one.
Lessons
Prior art this work leaned on: the upstream model-support and PLE-offload pull requests in vLLM (#53896, #53899), llama.cpp's qwen4exp PRs, ddalcu's mlx-serve, jundot's oMLX, tcclaviger's MXFP4-FP8 checkpoint and DevQwenNextFlash runtime, the vLLM-Radiance and libr4d kernel work by StillDeadcode, and jpezzulli's frozen SGLang trees for the RTX Pro 6000. These are the reference stacks used here. Where unlicensed code was read, only interface shapes and constants were taken.
Open items: the production quality bench on the MXFP4 stack, an in-house GPTQ/AWQ requant from the held BF16 checkpoint to chase the acceptance gap (2.73 vs 3.3), a ROCMFP4 lucebox artifact, and a profiler trace of the prefill all-reduce. Two of my own conclusions in this write-up, the kernel-lane postmortem and the TP2 inference, were refuted by later measurements.
