Skip to content

recipes + docs: DFlash2 default, MTP draft cap, NVFP4 and Q2_0 on HRX - #558

Merged
bong-water-water-bong merged 2 commits into
mainfrom
1bit/recipes-dflash-mtp-nvfp4
Oct 25, 2026
Merged

bong-water-water-bong merged 2 commits into
mainfrom
1bit/recipes-dflash-mtp-nvfp4

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

This week's HRX drafter measurements, as engine recipes and doc text. No leaderboard data: no docs/leaderboard/, no CSV/JSON, no per-file table, no generator — per the owner's 23:25 call, that data stays private. Recipes carry only the short measured line the file's entries use.

config/recipes.json — two entries, both qwen35 on hrx

recipe matches adds measured (one line, in the file)
qwen35-dflash-p-min-0 hrx + qwen35 + drafter dflash --spec-draft-p-min 0 56.6 / 30.8 / 20.6 tok/s (code / prose / short) with the Q8_0 drafter; a non-zero threshold cut prose to 22.5–23.3
qwen35-mtp-max-3 hrx + qwen35 + drafter mtp --mtp-max 3 32.6 / 26.9 / 28.0 tok/s against 12.1 / 12.1 / 12.5 undrafted; acceptance 0.17–0.60 past 7 drafts

Both are architecture-scoped, so the existing "the built-in set adds nothing" cases in tests/recipes_route.sh (a plain file and a MoE file, with and without --dflash) still hold unchanged; only that script's header comment needed correcting from "the set is empty" to what it is scoped to.

docs/serve.md

  • DFlash section: replaced the "measured on the removed Vulkan build, not yet re-measured on HRX" block with the 2026-10-24 HRX numbers — 12.1 / 12.1 / 12.5 undrafted, --mtp 32.6 / 26.9 / 28.0, --dflash Q8_0 56.6 / 30.8 / 20.6, Q4_K 58.8 on code — with strict placement on (the drafter's candidate selector runs on HRX, one graph split). States the shape: DFlash2 pays ~1.7× over MTP on code, ties prose, loses a third on short answers, so the default stays MTP for chat and --dflash is for code-heavy serving; and that the block is 8 tokens, not 16.
  • MTP section: draft-cap guidance — --mtp-max 3 is the recipe and the default; do not raise past 7 (--mtp-max 7 --mtp-p-min 0 37.9 / 22.4 / 22.4, --mtp-max 15 33.6 / 14.9 / 13.5 even with 16-token verify kernels).

docs/recipes.md, docs/hrx.md

  • recipes.md: "the built-in recipes: None" → the two entries above with their one-line measurements.
  • hrx.md: NVFP4 (ggml type 40) and Q2_0 (type 42) run on HRX through our HIP kernels with no extra flag, one graph split on a 27B file: pp512 613 / 632, tg128 12.7 / 23.1, KLD against the CPU 0.00144 / 0.00055.

Verification

  • python3 tools/copyright.py --check → rc 0.
  • config/recipes.json checked against the keys app/recipes.cpp accepts (id, match{device,architecture,moe,drafter}, args, env, why, measured, source), each entry has a non-empty measured (serve throws without one), and the two recipes are disjoint so file order does not matter.
  • Every number comes from ~/briefs/TDFLASH-HRX-STATE.md, ~/briefs/TDFLASH-STRICT-STATE.md and ~/briefs/TNVFP4Q20-STATE.md; nothing was run to produce this PR.
  • No private repo names, kernel internals or leaderboard rows in any file.

TODO (PR description only, as instructed): entries for Bonsai (TBONSAI-SWEET) and ZAYA1-8B (TZAYA-HL) follow when those report.

🤖 Generated with Claude Code

…0 on HRX

Two recipes for Qwen3.8-27B (`qwen35`) on `hrx`, both carrying their measurement, from the
2026-10-24 HRX drafter work:

- `qwen35-dflash-p-min-0`: `--spec-draft-p-min 0` whenever a DFlash2 drafter is in use. DFlash2
  proposes and verifies whole 8-token blocks, so a non-zero threshold discards blocks and prose
  pays: 56.6 / 30.8 / 20.6 tok/s (code / prose / short) at 0 against 22.5-23.3 prose at 0.2-0.6.
- `qwen35-mtp-max-3`: `--mtp-max 3` for the file's own MTP head: 32.6 / 26.9 / 28.0 tok/s against
  12.1 / 12.1 / 12.5 without drafting; acceptance falls to 0.17-0.60 past 7 drafts, where a longer
  verify batch costs more than the extra drafts return.

`docs/serve.md` gets the state those recipes come from: the DFlash section now carries the HRX
measurements (strict placement works, the drafter's selector runs on the GPU in one graph split,
56.6 / 30.8 / 20.6 with the Q8_0 drafter and 58.8 on code with Q4_K), says the block is 8 tokens and
not 16, that `--dflash` is the pick for code while the default stays MTP for chat, and the MTP
section gains the draft-cap guidance. `docs/recipes.md` documents the two built-in recipes instead of
"none", and `docs/hrx.md` records that NVFP4 (type 40) and Q2_0 (type 42) 27B files run on HRX with
one graph split, pp512 613 / 632, tg128 12.7 / 23.1, KLD against the CPU 0.00144 / 0.00055.

The recipes are scoped by architecture, so `tests/recipes_route.sh`'s "built-in set adds nothing"
cases (a plain and a MoE file) still hold; its header comment said the set was empty and now says
what it is scoped to.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

PR Reviewer Guide 🔍

(Review updated until commit 221288b)

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Recipe Default Alignment

The new recipes define --spec-draft-p-min 0 for DFlash2 and --mtp-max 3 for MTP on HRX, but these may not align with the default behavior of the underlying llama-server implementation. If the default values in llama-server differ from these pinned values, it could lead to inconsistent performance expectations or unexpected behavior when recipes are applied.

 "args": ["--spec-draft-p-min", "0"],
 "why": "DFlash2 proposes and verifies whole 8-token blocks, so a non-zero draft p-min discards blocks whose first tokens look unlikely and the loss lands on prose; 0 keeps every block whole. The flag is pinned here rather than left to llama-server's default, because the measurement below is what the recipe is for.",
 "measured": "Qwen3.8-27B UD-Q4_K_XL, 1bit serve --dflash with the Q8_0 drafter, greedy 256-token chats, medians of 3, performance mode, 2026-10-24: p-min 0 gives 56.6 / 30.8 / 20.6 tok/s on code / prose / short (acceptance 0.88 / 0.42 / 0.23); p-min 0.2, 0.4 and 0.6 cut prose to 22.5-23.3. The Q4_K drafter reaches 58.8 on code at p-min 0. Strict placement on: the drafter's graphs run on HRX in one graph split.",
 "source": "TDFLASH-HRX / TDFLASH-STRICT"
},
{
 "id": "qwen35-mtp-max-3",
 "match": {"device": ["hrx"], "architecture": ["qwen35"], "drafter": ["mtp"]},
 "args": ["--mtp-max", "3"],
 "why": "The model's own MTP head accepts about two thirds of its three drafts, and acceptance collapses past seven, so a longer verify batch costs more than the extra drafts return. Capping at 3 is what the measurement below is for; do not raise it past 7.",
 "measured": "Qwen3.8-27B UD-Q4_K_XL with its in-file MTP head, greedy 256-token chats, medians of 3, performance mode, 2026-10-24: --mtp-max 3 gives 32.6 / 26.9 / 28.0 tok/s on code / prose / short (12.1 / 12.1 / 12.5 without drafting). --mtp-max 7 --mtp-p-min 0 gives 37.9 / 22.4 / 22.4 and --mtp-max 15 33.6 / 14.9 / 13.5, with 0.17-0.60 acceptance past 8 drafts.",
 "source": "TDFLASH-HRX / TDFLASH-STRICT"
}
Measurement Consistency

The documentation states that the measurements for DFlash2 and MTP on HRX are from 2026-10-24, but it's unclear if these measurements were taken under identical conditions across all scenarios (e.g., same prompt types, same performance mode settings). Inconsistencies in measurement conditions could lead to misleading performance claims.

Measured through `1bit serve` on Strix Halo on 2026-10-24: Qwen3.8-27B UD-Q4_K_XL, the same three
chat prompts as above (code / prose / short, decode tok/s), greedy 256-token answers, medians of
three fresh servers, performance mode, **strict placement on** — the drafter's candidate selector
(its top-k, fill and row-gather nodes) runs on HRX, so the whole drafter graph is on the GPU in one
graph split:

| Drafter | code | prose | short |
|---|---|---|---|
| none | 12.1 | 12.1 | 12.5 |
| `--mtp` (the file's own head, draft length 3) | 32.6 | 26.9 | 28.0 |
| `--dflash` (DFlash2 Q8_0, whole blocks) | **56.6** | **30.8** | 20.6 |
| `--dflash` (DFlash2 Q4_K, whole blocks) | **58.8** | — | — |

DFlash2 is the pick for code (+73% over MTP, 4.7x without drafting) and about level on prose, but a
short answer stops before a block is worth filling, so it loses a third there. **The default stays
MTP for chat; `--dflash` is for code-heavy serving.** Acceptance on the three prompts is 0.88 / 0.42
/ 0.23, and a drafted token is kept only when the model's verify pass agrees, so the output is the
model's own. The Q8_0 drafter is what the numbers above use; a Q8_0 file is also what the drafter's
own README recommends over BF16.

Without `--mtp-max`, `--dflash` drafts the drafter's block minus one (its `dflash.block_size`; 16
when the file does not say). **DFlash2's block is 8 tokens**, not 16: the seven drafts per verify
step are what `1bit serve --dflash` asks for, and they fit the 2-8-token verify kernels.

A non-zero draft threshold throws whole blocks away: on the 27B, `--spec-draft-p-min` 0.2 / 0.4 /
0.6 cut prose from 30.8 to 22.5-23.3 tok/s, so `config/recipes.json` pins `--spec-draft-p-min 0`
for `qwen35` on `hrx` (docs/recipes.md). `--mtp-p-min` sets the same threshold. (The DFlash2
one-server route on the lean ROCm build is gone, above.)

@bong-water-water-bong
bong-water-water-bong enabled auto-merge (squash) October 25, 2026 02:21
@github-actions

Copy link
Copy Markdown

Persistent review updated to latest commit 221288b

@bong-water-water-bong
bong-water-water-bong merged commit 1958a48 into main Oct 25, 2026
8 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the 1bit/recipes-dflash-mtp-nvfp4 branch October 25, 2026 02:26
bong-water-water-bong pushed a commit that referenced this pull request Oct 25, 2026
On llama.cpp pins before fork e91b608cd - this one, and the release candidate built on it - a DFlash2
drafter fails to load with `done_getting_tensors: wrong number of tensors; expected 81, got 58`. The
section otherwise reads as if --dflash works. Fixed by fork #139 + #140, lands with the next pin bump.

One sentence under the heading, after #558 rewrote the section with the 24 Oct HRX numbers. Docs only.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant