Repository navigation
fix(qwen3.6): a Mac checks the row decoder's quantization rule, not the CUDA engine's 4-bit/64 rule - #344
Closed
gilby wants to merge 1 commit into
Closed
fix(qwen3.6): a Mac checks the row decoder's quantization rule, not the CUDA engine's 4-bit/64 rule#344gilby wants to merge 1 commit into
gilby wants to merge 1 commit into
Conversation
…he CUDA engine's 4-bit/64 rule check() refused every checkpoint but MLX 4-bit in groups of 64 on every host. On a Mac the family decodes through the dense family's row decoder, which reads per-module affine widths and groups, so oQ-style mixed checkpoints were refused although they load and decode exactly. On a Mac the check is now the row decoder's own refusal; CUDA keeps its 4-bit/64 rule.
This was referenced Oct 4, 2026
Owner
|
Thank you, @gilby. Making the Mac's startup check the row decoder's own quantization rule, rather than the CUDA engine's, let oQ mixed-width checkpoints load, and the exactness and speed receipts on both M5 Ultra and M3 Ultra are thorough. The Python engine is frozen (#286) and new work goes into the Zig engine, so this PR won't merge. Qwen3.6 MoE isn't on the Zig engine yet. The principle carries over. A family's startup check should be exactly the rule its decoder reads, no looser and no stricter, and we will hold the Zig families to it. |
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.
What this changes
qwen3_5_moe.check()refused every checkpoint but MLX 4-bit in groups of 64 on every host, although on a Mac thisfamily decodes through the dense family's row decoder, which reads per-module affine widths and groups. On a Mac the
check is now that row decoder's own refusal, so oQ-style mixed-width checkpoints load; CUDA keeps its 4-bit/64 rule.
Overlaps #272 (in review), which edits the same
check()to admit unquantized bf16 checkpoints on a Mac. Whichever lands second rebases; the merge is a few lines in the darwin branch.Receipt
branch on 0.6.4, now rebased on 0.6.5 (609ca41) as 1c7fa68, cleanly; its tests pass there, and 0.6.5 still
refuses this checkpoint on a Mac (its
check()keeps the 4-bit/64 rule), so the fix still applies. M5 Ultra; an oQ4e conversion ofornith-ai/Ornith-1.5-35B-A3B(qwen3_5_moe, 4-bit g32base with 360 wider layers) with
ornith-ai/Ornith-1.5-35B-A3B-DFlash@ 942d20f (4-bit). Server:tensorfold serve <checkpoint> --drafter <drafter> --port 8391 --name ornith. Startup: "windows of up to 128 rowsreproduce one-row steps here".
tools/bench_concurrent.py --alone --serialortoken_shaagainst"draft": false: N=4, code andchat, temperature 1.0 and 0: 0 failed, alone 12/12 in every cell, serial (
"draft": false) 4/4 sampled and 1/1greedy, 0 unequal. Resumed == fresh (M5 Ultra, same checkpoint and drafter): the same
7,337-token prompt twice on one server (greedy), the second served 7,332 tokens from the prompt cache;
token_sha0742ef375c69 both times.
tools/bench_openai.py: before is a refusal at load on 0.6.4 ("Qwen3.6 MoE'sCUDA engine reads MLX 4-bit weights in groups of 64 ...; this checkpoint has MLX 4-bit, groups of 32"). After, two
runs, median tok/s: fibonacci-raw greedy 246.7 / 248.5, sampled 317.8 / 323.1; gpu-chat greedy 232.6 / 233.0,
sampled 201.8 / 197.7. Concurrent aggregate (N=4, greedy): code 435.4, chat 385.1.
tools/prefill_cold.py: after, 3 reps, median: 2k 8,369 tok/s, 8k 8,129,16k 7,137, 32k 5,532, 64k 3,662. No before (refused).
test_glm5_prompt_kernels::test_fused_index_scores_are_the_three_ops, fails on v0.6.5 too.failure,
test_glm5_prompt_kernels::test_fused_index_scores_are_the_three_ops, fails on 0.6.4 too). Newtests/test_qwen36_moe_check.pyagainst 0.6.4's source: 1 failed, 3 passed;tests/test_qwen36_family.pyagainst0.6.4's source: 1 failed, 8 passed; both pass here.
the same checkpoint and drafter and the same server command: v0.6.5 refuses at load ("Qwen3.6 MoE's CUDA engine reads
MLX 4-bit weights in groups of 64 ...; this checkpoint has MLX 4-bit, groups of 32"). This branch serves it:
token_shadrafted =="draft": false== 653724bdd6f0; at--parallel 4,--levels 2,4 --alone --serial0 failedand 0 unequal in all 8 cells;
tools/bench_openai.py --tokens 256 --reps 5, medians: fibonacci-raw greedy 187.6,sampled 199.9; gpu-chat greedy 156.2, sampled 148.5 tok/s. Concurrent aggregate (N=2 / N=4, greedy): code
253.2 / 327.6, chat 227.0 / 279.3. The mixed-width layers load without the fp16-scale failure Mixed-width oQ checkpoint (oQ3.5e) fails at startup: MLX JIT kernel-build error in the row decoder (thread bfloat vs device float16_t) #279 describes (this
checkpoint's scales are bf16).
tools/prefill_cold.py(2k / 8k / 16k, 3 reps, median tok/s, alternated with v0.6.5, two runs each) onVontra/Qwen3.6-35B-A3B-MLX-4bit-MTP(MLX 4-bit in groups of 64), which v0.6.5 serves: v0.6.5 8,689 / 8,384 / 7,303 and 8,649 / 8,330 / 7,314; this branch 8,671 / 8,373 / 7,316 and 8,704 / 8,372 / 7,310.check()is the oldrule) and was not re-run.
Checklist
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo.Vontra/Qwen3.6-35B-A3B-MLX-4bit-MTP, which v0.6.5 serves, M5 Ultra: +0.1 to +0.2% against v0.6.5; see the v0.6.5 check.)