Skip to content

fix(core): MLX affine dequant reads any code width from 2 to 8 bits, across words, as the reference does - #810

Merged
ashhart merged 1 commit into
ashhart:mainfrom
BlivionIaG:fn3/a-core-dequant-width
Oct 16, 2026
Merged

ashhart merged 1 commit into
ashhart:mainfrom
BlivionIaG:fn3/a-core-dequant-width

Conversation

@BlivionIaG

Copy link
Copy Markdown
Contributor

Slice A of the Flash Next HIP proposal on #491. On main; no other PR needed.

What this changes

  • core/quant/mlx.zig dequant: any code width from 2 to 8 bits. A 3-, 5-, 6- or 7-bit code may run into the next word, so the word pair is read.
  • Test: 3- and 6-bit rows of 32 codes against reference.

Tests

  • Failing before: the new test fails on main with error.UnsupportedQuantization.
  • macOS zig build test -Dcpu=apple_m1: one failure, core.checkpoint_metal's split-checkpoint test, which logs the same error on main;
  • Linux zig build test passes;
  • zig fmt --check is clean; lean_check.py 538, the same as main (1.0.9).

@BlivionIaG
BlivionIaG marked this pull request as ready for review October 14, 2026 03:37
@ashhart
ashhart merged commit 3e63184 into ashhart:main Oct 16, 2026
4 checks passed
ashhart added a commit that referenced this pull request Oct 16, 2026
ashhart added a commit that referenced this pull request Oct 16, 2026
Its two commits are in: #810's dequant whole on the candidate, the experts' core file on the candidate and its Qwen3.5 side above. The head's other commits are the HIP series landed above. This keeps the PR's head in the history with no change to the tree.
@ashhart

ashhart commented Oct 16, 2026

Copy link
Copy Markdown
Owner

Thank you, @BlivionIaG. Reading the word pair the way reference already did makes the host dequantizer agree with it at every width from 2 to 8 bits, and your 3- and 6-bit test pins the codes that cross a word.

It ships in TensorFold 1.0.12 under your name (b84e32e36). Our ef2eb3577 wraps the second word's read at 120 columns, and your head is merged after it with no change to the tree (3e63184fa), so this pull request shows as merged.

The new test passes in the macOS and Linux host suites. Nothing served calls dequant yet, and the Mac and CUDA servers' code is the same with and without the change; Nemotron 3.5 Lightning on a GB10 gave the same tokens as before, drafted, with "draft": false and concurrent.

Posted by Ash's AI Assistant Synthena

BlivionIaG pushed a commit to BlivionIaG/TensorFold that referenced this pull request Oct 20, 2026
BlivionIaG pushed a commit to BlivionIaG/TensorFold that referenced this pull request Oct 20, 2026
BlivionIaG pushed a commit to BlivionIaG/TensorFold that referenced this pull request Oct 20, 2026
BlivionIaG pushed a commit to BlivionIaG/TensorFold that referenced this pull request Oct 20, 2026
Its two commits are in: ashhart#810's dequant whole on the candidate, the experts' core file on the candidate and its Qwen3.5 side above. The head's other commits are the HIP series landed above. This keeps the PR's head in the history with no change to the tree.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants