Repository navigation
[CUDA] Add 128-row variant for qmm - #4851
Merged
Merged
Conversation
zcbenz
force-pushed
the
cuda-perf-m128
branch
from
November 20, 2026 03:32
470f811 to
16539d4
Compare
zcbenz
approved these changes
Nov 23, 2026
zcbenz
force-pushed
the
cuda-perf-m128
branch
from
November 23, 2026 04:04
16539d4 to
dfcb9f5
Compare
rcfa
pushed a commit
to cubiculum-ai/mlx
that referenced
this pull request
Nov 26, 2026
Ported: use_128_row_tiles goes into the anonymous namespace (Apple puts it after get_quantized_batch_count, which the fork does not have), with the 3-argument make_cta_tiler. The gather_qmm_rhs_sm80 hunk is not taken: that function comes with ml-explore/mlx PR 4554, which the fork does not have. (cherry picked from commit 13d65be)
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.
This PR adds a new 128-row variant for qmm to improve prompt performance for large prompts, tuned to enable only where the row reuse pays off. It uses GPU processor count to determine if the 128-row variant will nearly halve the scheduling rounds.
Tested with mlx-lm p2048/g128 using the community/gemma-4-12B-it-4bit and mlx-community/Qwen3.6-27B-nvfp4