Repository navigation
Conversation
…ad of refusing it (ashhart#142) oMLX's oQ checkpoints of Qwen3.8 Flash Next store each n-gram table's rows scaled up with one factor in `ngram_embedding.weight_scale` (e.g. Jundot/Qwen3.8-Flash-Next-oQ4e-mtp: 0.000199). 0.5.0 refused any scale other than 1, so those checkpoints did not load (ashhart#142). - sanitize() collects each table's scale by embedding path (still refuses a scale other than 1 when called without the dict, as before). - NGramEmbedding.table_scale and PleTables.scale carry it; embed.ple_lookup and NGramEmbedding's host and resident paths multiply the looked-up bf16 rows by it once (fp32 multiply, one bf16 rounding). The same function of each row on every path and at every row count, so drafted == undrafted and prompt chunking are unaffected; scale 1 is the identity. - tests/test_qwen4_exp_table_scale.py. Jundot/Qwen3.8-Flash-Next-oQ4e-mtp (MTP drafts) on an M5 Ultra: loads (101.1 GiB resident); 437, runnable code and a structured tool call; 122-186 tok/s single stream, N=4 223-249, 3,049 tok/s prefill at 6.9K; MTP accepted 53-64%; concurrent replies equal to serial ones.
ashhart
added a commit
that referenced
this pull request
Sep 30, 2026
… again; smaller cli, server and weights modules; docs - CUDA applies an n-gram table's scale after row dequantization (#148) - The draft head takes image rows only when there are any, so DeepSeek-V4's head drafts again - cli.py, server/app.py and qwen4_exp/cuda/weights.py split below 600 lines, no behavior change - Docs: every serve flag, the prompt cache default, the live line, context_length_exceeded, the vision install
Owner
|
Thank you, @gilby. This landed in 0.6.0, out tonight, as you wrote it: your commit is in with your name on it. On an M3 Ultra, Jundot's oQ4e loaded in 59 s and gave 9/9 drafted replies equal to serial, and 9/9 concurrent replies equal to serial at |
BlivionIaG
pushed a commit
to BlivionIaG/TensorFold
that referenced
this pull request
Oct 20, 2026
…on Macs again; smaller cli, server and weights modules; docs - CUDA applies an n-gram table's scale after row dequantization (ashhart#148) - The draft head takes image rows only when there are any, so DeepSeek-V4's head drafts again - cli.py, server/app.py and qwen4_exp/cuda/weights.py split below 600 lines, no behavior change - Docs: every serve flag, the prompt cache default, the live line, context_length_exceeded, the vision install
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.
Fixes #142.
Problem
oMLX's oQ quantizations of Qwen3.8 Flash Next store each n-gram table scaled up, with one factor kept in
ngram_embedding.weight_scale. For example,Jundot/Qwen3.8-Flash-Next-oQ4e-mtpuses 0.000199.sanitize()refuses any scale other than 1, so these checkpoints don't load:Change
sanitize(weights, table_scales)collects each table's scale by embedding path. Called without the dict, it still refuses a scale other than 1, as before.NGramEmbedding.table_scaleandPleTables.scalecarry the scale.embed.ple_lookup(the fused decode and prefill), plusNGramEmbedding's host and resident fallbacks, multiply the looked-up bf16 rows by it once: an fp32 multiply and a single bf16 rounding (embed.scaled_rows). Each row gets the same function of its own values on every path and at every row count, so drafted == undrafted and prompt chunking are unaffected. A scale of 1 is the identity, so MLX conversions are untouched.tests/test_qwen4_exp_table_scale.pycovering the sanitize collection, the refusal without the dict, and rounding and row-count invariance.Checks
Jundot/Qwen3.8-Flash-Next-oQ4e-mtp, MTP drafts,--parallel auto:main, any MacThe startup log names the applied factor:
n-gram tables scaled by 0.000199318 at lookup (1 tables). Without it, the rows would be about 5,000× too large and the replies would be garbage.🤖 Generated with Claude Code