Repository navigation
feat(core): weight formats behind one interface, MLX affine 2- to 8-bit and dense, with tensor-parallel cuts - #612
Merged
Conversation
…it and dense, with tensor-parallel cuts core/quant reads a checkpoint's MLX affine projections (bits 2, 3, 4, 5, 6 and 8, any group) or dense ones, detects the format from the tensors, cuts a projection by output rows, by a rank's whole input groups or into its two K halves, splits an expert stack across ranks, and hands a backend the upload. Every cut keeps the codes and group tables byte for byte: a test quantizes with affine4_host and checks each cut dequantizes to the same bits as the rows and columns it covers, and it fails when a cut is off by one group.
This was referenced Oct 10, 2026
Owner
|
Thank you, @BlivionIaG. |
Closed
7 tasks
ashhart
added a commit
that referenced
this pull request
Oct 16, 2026
BlivionIaG
pushed a commit
to BlivionIaG/TensorFold
that referenced
this pull request
Oct 20, 2026
…LX affine 2- to 8-bit and dense, with tensor-parallel cuts Thanks @BlivionIaG.
BlivionIaG
pushed a commit
to BlivionIaG/TensorFold
that referenced
this pull request
Oct 20, 2026
The contributor's affine commit landed above, its lines unchanged on top of ashhart#617 (its other two commits are ashhart#612 and ashhart#613, in main since 1.0.6); this keeps the PR's head in the history with no change to the tree.
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
zig/src/core/quant: weight formats behind one interface, thecore/quantshared-code slice tracked in #491. Backend-neutral; no backend calls it yet (the HIP kernels slice is its first user).Uploader; device addresses areu64.Shapes follow
safetensors.max_rank.Receipt
mainat c37d0a4, head 2f9ba43. Zig 0.17.0, macOS on Apple silicon.quant/exact_test.zigquantizes a random 8 x 512 matrix withaffine4_host.quantizeand checks that every cut (row spans; rank column groups at world 1, 2, 4 and 8; both K halves) dequantizes throughaffine4_host.dequantizeto the same bits as the rows and columns it covers. Shifting a rank's group tables by one group makes it fail.zig build test test-golden -Dcpu=apple_m1133/133 steps; Linuxzig build test31/31 steps, 306/306 tests (the module's 12 included).zig fmt --checkclean.lean_check.py: 544 problems, the same asmain.Checklist
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo. (No engine path touched.)