[GH-ISSUE #3728] [Engine] Per-pack MTP draft head (or q8/q4 MTP expert runtime) for non-Q2_0 packs #1560

Closed
opened 2026-11-04 01:52:14 +07:00 by bsakaguchi · 4 comments
Owner

Originally created by @dduckpal on GitHub (Oct 22, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3728

Area

[Engine] (speed, kernels, models, the server and API)

What do you want to do?

Support an MTP draft head that matches the main pack's quantization instead of forcing every install through the single shared mtp-q2_0.gguf head — either:

  • (A) per-pack MTP head, e.g. mtp-iq3_xxs.gguf, selected by setup/the engine to match the installed pack, or
  • (B) q8_0/q4_0 MTP expert runtime support, so a head packed with mtp_pack.py --experts q8_0 (or q4_0) can actually load and run.

Who needs it: anyone running a non-Q2_0 pack (i-quants such as IQ3_XXS) with MTP speculative decoding on. The draft head's experts are always Q2_0 while the verifier model is not, and measured draft acceptance on long-context decode is modest (numbers below).

What do you do today instead?

Use the shared mtp-q2_0.gguf head for every pack. setup.py hardcodes it in both the streaming path (mtp/mtp-q2_0.gguf, --experts q2_0) and the standard path (mtp_pack.py --experts q2_0 + mtp_rt.py), so there is no way to get a matching head through setup. mtp_pack.py already can emit --experts q4_0/q8_0 packs ("acceptance comparison arm"), but tools/mtp_rt.py:blob_of() assumes the Q2_0 block layout (reshape(..., H // 64, 18), 18 bytes per 64-value block) with no format check — feeding it a q4_0/q8_0 pack would silently mis-relayout the experts rather than erroring (unconfirmed static analysis; I did not run it). Related history: #2504 (Metal + Q4_0 MTP experts stopped at the first request, missing moe_gu kernel) and #1867 (Q4 draft-head size mismatch on an IQ2_XS pack) — both closed, neither delivers a supported non-Q2_0 MTP path today.

Measured evidence (PR #3611 artifacts, computed from the committed files)

Environment: Mac Studio M5 Ultra 96 GB, macOS 27.2, engine 0.1.47-metal (source build at 011c9e6), Qwen3.8-Flash-Next IQ3_XXS, 262144-token context, MTP on (--spec 2 vs --spec 3 runs, strata-qwen38-thinking-v1-draft.1).

  • Decode medians: short 133.8 → 142.3 tok/s (spec2 → spec3); 16k-prompt decode 121.8 → 110.7 tok/s.
  • Draft acceptance, summed over draft_n/draft_n_accepted in the committed outputs.jsonl: spec2 run 2659/3609 = 73.7% overall (73.6% excl. warmup); spec3 run 3213/5291 = 60.7%. By request class: short 81.5% / 72.1%, 4K+16K perf prompts 67.8% / 52.5% (spec2 / spec3).

So on the long-context decode this workload actually cares about, roughly a third to a half of drafted tokens are rejected while the draft head (Q2_0 experts) disagrees in format with the verifier (IQ3_XXS). Reporter's estimate (not measured): +10 pp acceptance would put XXS decode near ~130 tok/s. The format mismatch is my hypothesis for the gap, not a proven cause — the request is to make the matching-head experiment possible so it can be tested.

Reproduction status: figures above recomputed locally from #3611's committed results.json/outputs.jsonl (open PR); no engine changes made.

Originally created by @dduckpal on GitHub (Oct 22, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/3728 ### Area [Engine] (speed, kernels, models, the server and API) ### What do you want to do? Support an MTP draft head that matches the main pack's quantization instead of forcing every install through the single shared `mtp-q2_0.gguf` head — either: - **(A) per-pack MTP head**, e.g. `mtp-iq3_xxs.gguf`, selected by setup/the engine to match the installed pack, or - **(B) q8_0/q4_0 MTP expert runtime support**, so a head packed with `mtp_pack.py --experts q8_0` (or `q4_0`) can actually load and run. Who needs it: anyone running a non-Q2_0 pack (i-quants such as IQ3_XXS) with MTP speculative decoding on. The draft head's experts are always Q2_0 while the verifier model is not, and measured draft acceptance on long-context decode is modest (numbers below). ### What do you do today instead? Use the shared `mtp-q2_0.gguf` head for every pack. `setup.py` hardcodes it in both the streaming path (`mtp/mtp-q2_0.gguf`, `--experts q2_0`) and the standard path (`mtp_pack.py --experts q2_0` + `mtp_rt.py`), so there is no way to get a matching head through setup. `mtp_pack.py` already *can* emit `--experts q4_0`/`q8_0` packs ("acceptance comparison arm"), but `tools/mtp_rt.py:blob_of()` assumes the Q2_0 block layout (`reshape(..., H // 64, 18)`, 18 bytes per 64-value block) with no format check — feeding it a q4_0/q8_0 pack would silently mis-relayout the experts rather than erroring (unconfirmed static analysis; I did not run it). Related history: #2504 (Metal + Q4_0 MTP experts stopped at the first request, missing `moe_gu` kernel) and #1867 (Q4 draft-head size mismatch on an IQ2_XS pack) — both closed, neither delivers a supported non-Q2_0 MTP path today. ### Measured evidence (PR #3611 artifacts, computed from the committed files) Environment: Mac Studio M5 Ultra 96 GB, macOS 27.2, engine 0.1.47-metal (source build at `011c9e6`), Qwen3.8-Flash-Next IQ3_XXS, 262144-token context, MTP on (`--spec 2` vs `--spec 3` runs, `strata-qwen38-thinking-v1-draft.1`). - Decode medians: short 133.8 → 142.3 tok/s (spec2 → spec3); 16k-prompt decode 121.8 → 110.7 tok/s. - Draft acceptance, summed over `draft_n`/`draft_n_accepted` in the committed `outputs.jsonl`: spec2 run 2659/3609 = **73.7%** overall (73.6% excl. warmup); spec3 run 3213/5291 = **60.7%**. By request class: short 81.5% / 72.1%, 4K+16K perf prompts **67.8% / 52.5%** (spec2 / spec3). So on the long-context decode this workload actually cares about, roughly a third to a half of drafted tokens are rejected while the draft head (Q2_0 experts) disagrees in format with the verifier (IQ3_XXS). Reporter's estimate (not measured): +10 pp acceptance would put XXS decode near ~130 tok/s. The format mismatch is my hypothesis for the gap, not a proven cause — the request is to make the matching-head experiment possible so it can be tested. Reproduction status: figures above recomputed locally from #3611's committed `results.json`/`outputs.jsonl` (open PR); no engine changes made.
Author
Owner

@github-actions[bot] commented on GitHub (Oct 22, 2026):

Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:

  • Fill in "Area".

Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment /reopen.

Details: CONTRIBUTING.md

<!-- gh-comment-id:6342259963 --> @github-actions[bot] commented on GitHub (Oct 22, 2026): Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing: - [ ] Fill in "Area". Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment `/reopen`. Details: [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md)
Author
Owner

@github-actions[bot] commented on GitHub (Oct 24, 2026):

Thanks, this follows the format now.

<!-- gh-comment-id:6379737506 --> @github-actions[bot] commented on GitHub (Oct 24, 2026): Thanks, this follows the format now.
Author
Owner

@ruaibot42 commented on GitHub (Oct 26, 2026):

+1 for option (B), with a second use case: people who run only >= 4-bit files on purpose.

We run Unsloth UD-Q6_K_XL on a Radeon AI PRO R9700 (Linux, HIP) with every expert in RAM, and we keep a hard rule of
nothing below 4-bit anywhere in the stack, draft layers included. Today that means we run with no draft layer at all,
because the runtime drafter only takes the Q2_0 experts.bin (mtp.cpp sizes it as n_expert x kernels::cpu::BLOB, and
BLOB is the Q2_0 layout from kernels/cpu/expert.hpp; mtp_rt.py's blob_of() also assumes 18-byte/64-weight blocks).
mtp_pack.py --experts q8_0 already writes a ~2.67 GB head, so the missing piece is the runtime side.

It also matters for two cards: per MULTI_GPU.md, pipeline windows (the RDNA4 default on a split, +21% decode on
2 R9700s in your table) need the draft layer, so without a >= 4-bit head a split loses that too.

Happy to run an acceptance A/B (Q2_0 vs Q8_0 head against a UD-Q6 verifier) on 1 and 2 R9700s if a branch appears.

<!-- gh-comment-id:6426900879 --> @ruaibot42 commented on GitHub (Oct 26, 2026): +1 for option (B), with a second use case: people who run only >= 4-bit files on purpose. We run Unsloth UD-Q6_K_XL on a Radeon AI PRO R9700 (Linux, HIP) with every expert in RAM, and we keep a hard rule of nothing below 4-bit anywhere in the stack, draft layers included. Today that means we run with no draft layer at all, because the runtime drafter only takes the Q2_0 experts.bin (mtp.cpp sizes it as n_expert x kernels::cpu::BLOB, and BLOB is the Q2_0 layout from kernels/cpu/expert.hpp; mtp_rt.py's blob_of() also assumes 18-byte/64-weight blocks). `mtp_pack.py --experts q8_0` already writes a ~2.67 GB head, so the missing piece is the runtime side. It also matters for two cards: per MULTI_GPU.md, pipeline windows (the RDNA4 default on a split, +21% decode on 2 R9700s in your table) need the draft layer, so without a >= 4-bit head a split loses that too. Happy to run an acceptance A/B (Q2_0 vs Q8_0 head against a UD-Q6 verifier) on 1 and 2 R9700s if a branch appears.
Author
Owner

@Niko1221 commented on GitHub (Nov 5, 2026):

Thanks for taking the time to report this.

Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected.

To reopen it takes about two minutes:

  1. Re-test on 0.2.11. It may already be fixed. Write down what you see.
  2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other].
  3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system.
  4. Comment /reopen. A check runs and either reopens the issue or lists what is still missing.

The rules are in CONTRIBUTING.md.

<!-- gh-comment-id:6659668318 --> @Niko1221 commented on GitHub (Nov 5, 2026): Thanks for taking the time to report this. Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected. To reopen it takes about two minutes: 1. Re-test on 0.2.11. It may already be fixed. Write down what you see. 2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other]. 3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system. 4. Comment `/reopen`. A check runs and either reopens the issue or lists what is still missing. The rules are in [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#1560
No description provided.