mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #4333] [Engine] --mtp-q4 head/all fails at bind when no draft-head subset is installed #5011
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#5011
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/4333
Author: @xyzzing
Created: 10/27/2026
Status: 🔄 Open
Base:
main← Head:pr/mtpq4-guard📝 Commits (1)
92d33e2mtp: --mtp-q4 head/all fails at bind when no draft head subset is installed📊 Changes
3 files changed (+11 additions, -2 deletions)
View changed files
📝
include/strata/core/mtp.hpp(+2 -1)📝
src/core/mtp.cpp(+6 -0)📝
src/program/generate.cpp(+3 -1)📄 Description
Problem and result
--mtp-q4 head(andall) silently did nothing when no draft-head subset is installed:make_q4_head()was only reachable inside thedraft_vocab.binbranch ofMtpDrafter::bind(), so with nort/draft_vocab.bin(and no--mtp-draft-vocab) the engine kept drafting over the full head, at full cost, with no hint anything was off. Found while A/B-ing the flag on our box: the head-gemv stage timing did not move (0.612 vs 0.616 ms/eval) and no--mtp-q4:load line appeared — a wasted measurement window that looked like a null result for the flag.After:
bind()fails at startup with the fix named — install a subset (tools/draft_vocab.py) or use--mtp-q4 proj. Nothing else changes: without the flag the behavior is byte-identical, and with a subset installed the flag behaves exactly as before (verified on our production lineage: a 5-pair A/B with the guard in place, 10/10 cells clean, the subset arm engaged with its usual load line and gemv).Related discussion
none — searched issues/PRs for
mtp-q4; #3728 covers per-pack draft-head expert formats, not this flag's subset requirement.Approach
One guard in
MtpDrafter::bind()after the subset branch: whenq4_head_was requested anddhead_is still null, error out instead of continuing. It fires for every subset-absent path (file missing, empty file,--mtp-draft-vocabpointing nowhere,STRATA_MTP_FULL_HEAD=1), and correctly stays silent for the shared-drafter path (which already hasdhead_from the shared instance) and for rebinds. Doc surfaces updated so the requirement is stated where the flag is documented: the usage line, the option comment, andset_q4's header comment.Compatibility: none — the flag is opt-in, the default path is untouched, and the failure mode moves from "silently wrong" to "fails at startup with the fix named".
Validation
Passed:
ninja -C build-pr -k 0 -j 6on this branch (HIP, gfx1100, ROCm 10.2 nightly SDK, upstream main5e8a4cca+ this commit): 494/495 targets (495 steps, one warning-only), binary links.--mtp-draft-vocab <0-byte file> --mtp-q4 headexits 1 withmtp: --mtp-q4 head/all requantizes the draft head's subset, but no subset is installed - rt/draft_vocab.bin (or --mtp-draft-vocab FILE) is absent or empty, or STRATA_MTP_FULL_HEAD=1 excludes it; install one (tools/draft_vocab.py) or use --mtp-q4 proj. Log line in the run log.record-dvocab-head-20261027.json).Failed: none observed.
Not run: SYCL and Metal builds — no SYCL toolchain on this AMD-only box and Metal is macOS-only (per-PR CI here builds neither; our fork CI compiles CUDA and HIP in vendor containers, see the run linked in the thread). CUDA is now compile-validated on this branch head (run 40592315497, both containers green).
Limits
None known. The flag's requirement of an installed subset is by design (Q4_0 re-quantization of the borrowed head's rows only makes sense for the gathered subset); what changes is that missing it now names the fix instead of silently drafting over the full head.
2026-11-06: rebased onto main (
9f7d977d2) — force-pushed, applies clean. Version guard re-checked on the new base: the bug is still present (the unguarded bind path sits atsrc/core/mtp.cpp~843 on main). The CUDA compile-validation run cited below was on the previous head; the fork CI re-runs on this push, and the comment thread will carry the new run when it lands.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.