Skip to content

[CUDA] Faster grouped mm#3011

Merged
zcbenz merged 1 commit into
ml-explore:mainfrom
zcbenz:cuda-grouped-mm-faster
Jan 21, 2026
Merged

[CUDA] Faster grouped mm#3011
zcbenz merged 1 commit into
ml-explore:mainfrom
zcbenz:cuda-grouped-mm-faster

Conversation

@zcbenz

@zcbenz zcbenz commented Jan 18, 2026

Copy link
Copy Markdown
Collaborator

Make grouped mm faster that it now takes 4x time than equivalent matmul. It is still too slow but a lot better than original #2902.

Tricks used:

  • Use tensor cores for sm80 and later.
  • Set alignment for output.
  • Encode the kernel function to CUDA graph directly instead of capturing.

We can keep improving this kernel by tuning block sizes, but what we really need to do is pad the data to get higher alignment so we can make use of hardware features like TMA.

@awni awni 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.

Looks great!

@zcbenz zcbenz merged commit 8017d43 into ml-explore:main Jan 21, 2026
15 checks passed
@zcbenz zcbenz deleted the cuda-grouped-mm-faster branch January 21, 2026 00:30
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