Skip to content

metal: add the 128/96 flash attention kernels - #30209

Merged
ServeurpersoCom merged 1 commit into
ggml-org:masterfrom
ServeurpersoCom:metal-fa-128-96-kernels
Oct 9, 2026
Merged

ServeurpersoCom merged 1 commit into
ggml-org:masterfrom
ServeurpersoCom:metal-fa-128-96-kernels

Conversation

@ServeurpersoCom

Copy link
Copy Markdown
Contributor

Overview

#30003 added flash attention tests with K = 128 and V = 96, and Metal crashed on them: it said it supported the pair, but had no kernel for it.

Instead of rejecting the pair (#30208), this adds the 128/96 kernels, the same way 96/64 is done (mma and vec, every K/V type Metal handles). supports_op now accepts exactly the pairs that have a kernel: K == V, plus 96/64, 128/96, 192/128, 320/256 and 576/512. The vec tuning baseline and the sparse path list get 128/96 too.

Tested on an M5 Max: test-backend-ops -o FLASH_ATTN_EXT passes 4973/4973 on Metal, the 128/96 cases run on Metal for every K/V type it supports, and 96/64, 192/128, 320/256 and 576/512 keep running on Metal. No model uses 128/96 yet, so the test suite and the CI are the coverage here.

Additional information

Supersedes #30208
Follow-up #30003

Requirements

@ServeurpersoCom
ServeurpersoCom requested a review from a team as a code owner October 9, 2026 07:20
@github-actions github-actions Bot added ggml changes relating to the ggml tensor library for machine learning Apple Metal https://en.wikipedia.org/wiki/Metal_(API) labels Oct 9, 2026
@ggerganov ggerganov added the merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge. label Oct 9, 2026
@ServeurpersoCom
ServeurpersoCom merged commit 1f8fa52 into ggml-org:master Oct 9, 2026
27 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Apple Metal https://en.wikipedia.org/wiki/Metal_(API) ggml changes relating to the ggml tensor library for machine learning merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants