Repository navigation
[Metal] Add 2, 3, 5 and 6 bits to affine qmv_mma - #4860
Merged
Merged
Conversation
3 of 5 tasks
XXXXRT666
marked this pull request as ready for review
November 10, 2026 14:22
Merged
3 of 4 tasks
…* K = 2^20 on gen 15+
zcbenz
force-pushed
the
metal-affine-qmv-mma-bits
branch
from
November 21, 2026 07:30
326ff27 to
5e56ca9
Compare
zcbenz
approved these changes
Nov 21, 2026
Open
2 of 4 tasks
11 tasks
rcfa
pushed a commit
to cubiculum-ai/mlx
that referenced
this pull request
Nov 26, 2026
osaurus-ai/mlx also keeps the fork's exact F32 q6 rows (exact_q6_f32_rows) on the single-row kernels, whose reduction order they depend on. (cherry picked from commit 6d38ff9)
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.
[Metal] Add 2, 3, 5 and 6 bits to affine qmv_mma
Follow up to #4787.
affine_qmv_mmanow reads 2, 3, 5 and 6 bits, not only 4 and 8. On gen 15+ it is used from N * K = 2^20Performance
Measured on M4, bf16, group size 64. Speedup of
qmv_mmaover the route of main for the same shape, > 1 is faster.N * K below 2^21, geomean over 2, 3, 4, 5, 6 and 8 bits (range over bits):
2^20 is the smallest N * K that is not slower at 4 rows. 2^18 and 2^19 are faster from 6 rows, but slower at 4 and 5 rows.
New bits at large shapes (M = 4 to 6 from 8 rounds, M = 8 to 16 from 3 rounds):