Repository navigation
qwen4exp MTP: refuse a draft vocabulary whose d2t ids are out of range or repeated - #57
Merged
bong-water-water-bong merged 1 commit intoOct 1, 2026
Conversation
…e or repeated The reduced draft head scatters its K logits into a full-vocabulary row with set_rows at the d2t ids, which trusts them: an id < 0 or >= n_vocab writes outside the row, and a repeated id silently drops a row. The loader now reads the K int64 ids from the file (before any graph uses them) and fails with the offending index and id. Review follow-up to #56. Co-Authored-By: Claude Opus 5.5 <[email protected]>
bong-water-water-bong
merged commit Oct 1, 2026
8a5e8d8
into
1bit/vulkan-upstream
8 of 11 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Review follow-up to #56.
The reduced draft head scatters its K logits into a full-vocabulary row with
ggml_set_rowsat thed2tids, andset_rowstrusts those ids:#56 checked only
d2t's type, rank and length. Nowqwen4exp_draft_vocab_rowsreads the K int64 ids from the file, before any graph uses them, and fails the load naming the offending index and id. The change is in our ownqwen4exp-draft-vocab.{h,cpp}only.Tested on strixhalo (CPU build of this branch,
llama-cli -m <draft> --spec-type draft-mtp):mtp-Qwen3.8-Flash-Next-shared-Q4_K_M-dv65k.gguf(65,536 ids, max 248,076)d2t[5] = 10000000error loading model: QWEN4EXP MTP: d2t[5] = 10000000 is outside the 248320-token vocabularyd2t[5] = d2t[4]error loading model: QWEN4EXP MTP: d2t repeats token id 4Cost: one K x 8 byte read (512 KiB at K = 65,536) and an n_vocab-bit table at load.
🤖 Generated with Claude Code