test(frank-medium): A/B DFlash2 vs MTP on FP8 — DFlash2 wins on decode

DFlash2 (100.0 t/s decode, 287.1 t/s burst-4) beats MTP self-speculation
(85.9 t/s, 179.7 t/s) despite a lower accept length (4.24 vs 5.66): the
small separate drafter steps faster than the target's own MTP layer applied
autoregressively. DFlash2 is the deployed shape; both swap-script paths now
default to dflash/7. Docs updated.
This commit is contained in:
Frank committed 2026-09-20 22:20:53 -07:00
1 parent 1ae73db084
commit f998a2d9f2
6 files changed
+111 -44

No files matched your search

@@ -84,15 +84,19 @@ The entrypoint (`radiance-entrypoint.sh`) reads `quant_method` and branches:
| `quant_method` | Path | Attention | Speculation | Drafter |
|---|---|---|---|---|
| `fp8` | plain FP8 | `ROCM_AITER_UNIFIED_ATTN` | MTP self-speculation (`--quantization fp8`) | the model's own MTP head (`mtp.layers.0`) |
| `fp8` | plain FP8 | `ROCM_AITER_UNIFIED_ATTN` | **DFlash2 external drafter** (A/B winner) | `/models/Qwen3.8-27B-DFlash2-FP8` |
| `mxfp4` / `quark` / empty | MXFP4 | `R4D` (if `R4D_ATTN=1`) | DFlash2 external drafter | `/models/Qwen3.8-27B-DFlash2-FP8` |
The quadlet `SPEC_METHOD`/`SPEC` the swap script sets must match the path:
`fp8 → mtp/8`, `mxfp4|quark → dflash/7`. The FP8 model carries its own
single-layer MTP head (22 tensors), so MTP self-speculation needs no external
drafter and no `fp8_mtp.py` rewrite. The MXFP4 path applies the
`radiance-vllm-mxfp4` patches at every container start and uses the DFlash2
drafter.
The quadlet `SPEC_METHOD`/`SPEC` the swap script sets: **both paths use
`dflash/7`** (the DFlash2 drafter is quantization-agnostic — it proposes
tokens, the target verifies, so it works with any Qwen3.8-27B target). The
FP8 model also carries its own single-layer MTP head (22 tensors), so MTP
self-speculation (`mtp/8`) is available as an alternative — but A/B tested on
this checkpoint, **DFlash2 wins on decode** (100.0 vs 85.9 t/s geomean, 287.1
vs 179.7 t/s burst-4) despite a lower accept length (4.24 vs 5.66), because
the small separate drafter steps faster than the target's own MTP layer
applied autoregressively. The MXFP4 path additionally applies the
`radiance-vllm-mxfp4` patches at every container start.
**R4D allreduce is independent of the weight quantization.** The FP8 path
uses `ROCM_AITER_UNIFIED_ATTN` (the documented plain-FP8 default); R4D can be
@@ -159,15 +163,23 @@ safetensors) with `SPEC_METHOD=dflash`, `SPEC=7`.
- **Model**: `just1moremodel/Qwen3.8-27B-Uncensored-MXFP4-awq` (MXFP4,
19.37 GiB) → `orcarouter/Qwen3.8-27B-Uncensored-FP8` (FP8 E4M3 block-wise
128×128, dynamic activation quant, 30.9 GB / 7 shards).
- **Serving path**: DFlash2 external drafter → MTP self-speculation
(`SPEC_METHOD=mtp`, `SPEC=8`); `R4D` → `ROCM_AITER_UNIFIED_ATTN`.
- **MTP**: mean acceptance length 5.66/8, 66.2% draft acceptance,
per-position rates 0.89 → 0.41.
- **KV pool**: auto-sized to 461,540 tokens (1.76× full-window) — smaller than
MXFP4's 943,581 because FP8 weights are bigger (30.9 vs 19.4 GiB).
- **Battery** (vs MXFP4 baseline): geomean decode 85.9 vs 92.4 t/s (−7%),
mean TTFT 0.06 vs 0.22 s (3.7× faster), geomean prefill 1097 vs ~1490 t/s
(−27%), burst-4 aggregate 179.7 vs 248.9 t/s (−28%). The trade-off is the
expected one: higher precision (8-bit vs 4-bit weights), decode within 7%,
TTFT much faster, prefill/burst slower (the `ROCM_AITER_UNIFIED_ATTN` path
vs R4D).
- **Serving path**: DFlash2 external drafter → DFlash2 external drafter
(kept; `R4D` → `ROCM_AITER_UNIFIED_ATTN`). After the swap, MTP
self-speculation (`mtp/8`) was A/B tested against the DFlash2 drafter
(`dflash/7`) on the FP8 target.
- **DFlash2 vs MTP A/B** (the deployed shape is DFlash2):
- DFlash2: mean accept 4.24/7, geomean decode **100.0 t/s**, TTFT 0.19 s,
prefill 923.0 t/s, burst-4 **287.1 t/s**, KV pool 384,238 (1.47×).
- MTP: mean accept 5.66/8, geomean decode 85.9 t/s, TTFT 0.06 s, prefill
1096.9 t/s, burst-4 179.7 t/s, KV pool 461,540 (1.76×).
- **DFlash2 wins on decode (+16 %) and burst-4 (+60 %)**; MTP wins on TTFT
and prefill. Accept length is a proxy, not the metric — the small separate
drafter steps faster than the target's own MTP layer applied
autoregressively, and the faster step more than makes up the lower accept
length. FP8 + DFlash2 (100.0 t/s) also beats the original MXFP4 + DFlash2
(92.4 t/s) — the higher-precision FP8 target verifies more of the drafter's
proposals.
- **KV pool**: auto-sized to 384,238 tokens (1.47× full-window) — the
DFlash2 drafter's 2.1 GiB costs the pool vs MTP's 461,540 (1.76×); both
smaller than MXFP4's 943,581 (3.59×) because FP8 weights are bigger (30.9
vs 19.4 GiB).