Repository navigation
[Metal] Prefer qmm_nax over legacy split-k on NAX devices - #4793
Closed
arian262785-cell wants to merge 1 commit into
Closed
arian262785-cell wants to merge 1 commit into
arian262785-cell wants to merge 1 commit into
Conversation
On NAX-capable Apple Silicon hardware, qmm_splitk previously fell back to the legacy non-NAX 32x32 split-K kernel whenever weights lacked linear biases, cutting memory throughput on projections such as down and q/o. Route aligned quantized matrix-matrix multiplications to qmm (which invokes qmm_nax) when NAX is available, both in qmm_splitk and for mid-size rows in QuantizedMatmul::eval_gpu.
arian262785-cell
force-pushed
the
fix-nax-splitk-heuristic
branch
from
October 30, 2026 13:07
a257c95 to
d4dce61
Compare
1 task
Member
|
I'm closing this in favor of #4781 which solves the issue by finishing missing kernels. |
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.
Fixes #4720.
In
qmm_splitk: When NAX is available andN, Kare 64-aligned, routes toqmm(which invokesqmm_nax) instead of falling back to the legacy non-NAX split-K kernel when weights lack biases.In
QuantizedMatmul::eval_gpu: Routes mid-size rows (M >= 8,M < vector_limit,M * N >= 16384) throughqmm_splitkwhen NAX is available and aligned so unbiased projections reachqmm_nax.Retains existing split-K logic on pre-NAX devices (M1/M2/M3) and unaligned shapes.
Adds test coverage in
python/tests/test_quantized.py(test_qmm_nax_unbiased_shapes).☑️ I understand it is strictly prohibited to use AI to write PR description
AI usage disclosure: None