mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2862] [CLOSED] mtp: the draft layer's experts at Q8_0 and BF16, alongside Q2_0 #4300
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#4300
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/2862
Author: @gopinath87607
Created: 10/17/2026
Status: ❌ Closed
Base:
main← Head:mtp-q8-bf16-support📝 Commits (1)
4e73dbemtp: the draft layer's experts at Q8_0 and BF16, alongside Q2_0📊 Changes
6 files changed (+213 additions, -39 deletions)
View changed files
📝
include/strata/core/mtp.hpp(+12 -2)📝
src/core/mtp.cpp(+74 -12)📝
src/kernels/cuda/iq_kernels.cu(+34 -9)📝
src/kernels/iq_multi_parity.cpp(+21 -4)📝
tools/mtp_pack.py(+24 -3)📝
tools/mtp_rt.py(+48 -9)📄 Description
The MTP draft layer's 512 routed experts were Q2_0 only: a format picked by measured draft acceptance, carrying a relative RMS error of 0.42 on the first experts. Higher precision buys better drafts, hence a higher accept rate, hence speed - never a different output, since the verify window decides every emitted token. This adds Q8_0 (2.49 GiB) and BF16 (4.69 GiB) as opt-in arms and leaves Q2_0 the default.
Which arm a run uses is the runtime directory, not a flag:
--mtp rt-q8_0or--mtp rt-bf16. The selection is anexperts.fmtmarker that tools/mtp_rt.py writes beside experts.bin, one line<format> <gu_type> <d_type>. No marker means Q2_0, so everyrt/that exists today keeps taking exactly the path it always did.Engine:
native_expert_supportedasksembed_type_supportedrather thanis_iq, which is the set dq_dispatch implements;is_iqis left alone, so nothing that gates on it moves.tools/mtp_pack.py gains a lossless bf16 arm (the checkpoint's own 16-bit words, no round trip, so its reconstruction error is exactly zero) and tools/mtp_rt.py writes the per-expert native blob: gate_up[e] then down[e]. Whole-tensor order would hand every expert the head of its neighbour.
Measured on the 4-GPU rig (iq3_s, 256 greedy tokens): BF16 does not fit - the draft layer lands entirely on the last stage's 8 GB card and 4.84 GiB of experts leaves too few cache slots for the prompt path. Q8_0 runs at 48.9 tok/s against Q2_0's 49.5-49.9, with an accept rate indistinguishable within the engine's ~8-point run-to-run spread, at a 2007 -> 1134 slot cost on that card. So this is an arm to measure, not a win to claim.
Title
Issue: Resolves #
Summary
What changed
Extra Notes
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.