Repository navigation
feat(core): a kernel registry that picks a product's tile by tuned cost, one family of bits at every row count - #613
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.
…st, one family of bits at every row count core/registry selects, for a format, op (product, group, routed plan, routed with activation) and path (decode or prompt), the cheapest entry the GPU, the run's switches and the shape allow, by a per-GPU tuning table read at build time (core/tuning), so every rank picks alike. Its family rule checks that one (op, path) keeps one family of entries at every row count from 1 to 256 for each width and group: a row's bits never depend on how many rows share its launch. The rule's test fails when a tuning table lets another family take some rows.
This was referenced Oct 10, 2026
Owner
|
Thank you, @BlivionIaG. The kernel registry is merged into main (9fd141b) on top of #612, your commit as it was, and it ships in 1.0.6. The family rule is the part we like most: a row's bits can't depend on how many rows share its launch, checked at every row count from 1 to 256, and it is the same contract our lane kernels keep. Picking only from a build-time tuning table, so every rank picks the same entry, fits the tensor-parallel case. Gates as in #612. |
8 tasks done
8 tasks done
This was referenced Oct 10, 2026
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
…'s tile by tuned cost, one family of bits at every row count 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/registry.zigandzig/src/core/tuning.zig: a kernel registry, the registry shared-code slice tracked in #491. Backend-neutral; no backend calls it yet (the HIP kernels slice is its first user).selecttakes the cheapest allowed entry by a per-GPU tuning table read at build time from.zon; nothing is autotuned, so every rank picks the same entry.verify) checks that each (op, path) keeps one family of entries, entries that write the same bits for any row, at every row count from 1 to 256, for widths 2 to 8 and groups 32, 64 and 128. A row's bits then never depend on how many rows share its launch.Stacks on #612 (its commit is included here until it lands); review the last commit.
Receipt
mainat c37d0a4 (+ feat(core): weight formats behind one interface, MLX affine 2- to 8-bit and dense, with tensor-parallel cuts #612), head fde39a1. Zig 0.17.0, macOS on Apple silicon and Linux 7.1.7.zig build test test-golden -Dcpu=apple_m1133/133 steps; Linuxzig build test31/31 steps, 310/310 tests.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; the family rule is what keeps concurrent equal to solo once a backend uses it.)