Repository navigation
Conversation
The reduced draft-vocabulary head (DFlashDrafter._sub_head) sliced the lane-tiled target lm_head but did not keep its group size, and candidate_logits called lane_matmul without group=, so a head quantized in groups of 32 (oMLX oQ4e keeps lm_head at its 4-bit/32 base) was read with the group-64 kernel. Draft logits were wrong, replies stayed exact (verification passes the group), and DFlash2 accepted 0.1-1% of drafts. - _sub_head keeps the head's group size; candidate_logits passes group=. - A one-time check on the first draft compares the reduced head with the full head on the same rows and falls back to the full head, with a log line, when they differ. - tests/test_dflash_draft_vocab.py: a 4-bit group-32 head (fails before this change). Qwen3.8-27B-oQ4e-mtp + z-lab/Qwen3.8-27B-DFlash2 on an M5 Ultra: accepted 46-56% (was 0.1-1%), 131-160 tok/s single stream (was 33), N=4 314-322 (was 114); replies byte-identical to 0.5.0's.
ashhart
added a commit
that referenced
this pull request
Sep 30, 2026
Owner
|
Thanks for finding this. On an M5 Ultra the draft head was reading a group-32 target head at group 64, so with DFlash2 the acceptance fell to 0.1-1%. The 27B oQ4e went from 33 tok/s to 131-160, and the replies were identical. The head now reads at its own group size. This is in 0.6.0, out tonight. |
BlivionIaG
pushed a commit
to BlivionIaG/TensorFold
that referenced
this pull request
Oct 20, 2026
…l within 120 columns
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.
Problem
On the M5 lane path, DFlash2's reduced draft-vocabulary head reads the target
lm_headwith the wrong group size when the head is quantized in groups of 32.DFlashDrafter._sub_headslices the lane-tiled head but doesn't keep its group size.candidate_logitsthen callslane_matmul(hidden, weight, sbt, tiled=True, nt=nt)withoutgroup=, so the call defaults to 64.oMLX's oQ4e checkpoints keep
lm_headat their 4-bit/32 base. For them:The model just looks slow. The M1–M4 path (
_plain_sub_head) already records the group, so only the M5 is affected.Change
_sub_headkeeps the head'sgroup_size, andcandidate_logitspassesgroup=tolane_matmul.tests/test_dflash_draft_vocab.py: a 4-bit group-32 head. It fails before this change and passes after.lane_fuse._projecthas the same default, but its stacks are built from group-64 members only, so it's correct today. Left as is.Checks
tests/test_dflash_draft_vocab.py8 passed (the new g32 case fails onmain). Drafting, lane, loading and quantization suites: 594 passed, 2 skipped.Qwen3.8-27B-oQ4e-mtp(text-only oQ4e) +z-lab/Qwen3.8-27B-DFlash2,--parallel auto --reasoning-effort medium, greedy, 512-token replies:mainmain's, drafted and concurrentmainmain's (the M1–M4 path was already right)The first-draft check stayed silent on both chips.
TF_DRAFT_VOCAB=fullonmaingives the same acceptance as this branch, which confirms the reduced head was the cause.🤖 Generated with Claude Code