Skip to content

[CUDA] Heuristics for Hopper QMM - #3173

Merged
zcbenz merged 1 commit into
ml-explore:mainfrom
zcbenz:qmm-sm90-dispatch
Feb 27, 2026
Merged

[CUDA] Heuristics for Hopper QMM#3173
zcbenz merged 1 commit into
ml-explore:mainfrom
zcbenz:qmm-sm90-dispatch

Conversation

@zcbenz

@zcbenz zcbenz commented Feb 26, 2026

Copy link
Copy Markdown
Member

Refs #2536, #3160.

Add simple heuristics for QMM by dispatching to different tile shapes depending on the M. This does not change anything for small M problems and intends to fix bad performance for large M.

M N K CUTE (TFLOP/s) CUBLAS (TFLOP/s) Speedup (x)
16 16384 16384 96.8 45.4 2.13
32 16384 16384 177.4 84.4 2.10
64 16384 16384 302.8 170.5 1.78
128 16384 16384 537.5 339.4 1.58

Also I realized that it is not possible to implement fp quantizations with the cutlass kernel because minimum group size is 64, so I simplified the checks in qmm_sm90.

@angeloskath angeloskath left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏

@zcbenz
zcbenz force-pushed the qmm-sm90-dispatch branch 6 times, most recently from 1f49732 to 9c7b35f Compare February 26, 2026 23:18
@zcbenz
zcbenz merged commit 0c8107c into ml-explore:main Feb 27, 2026
16 checks passed
@zcbenz
zcbenz deleted the qmm-sm90-dispatch branch February 27, 2026 00:22
jzdziarski pushed a commit to jzdziarski/mlx that referenced this pull request Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants