Skip to content

Fix CI: gpu-metal crashes on master since #30003 - #30208

Closed
ServeurpersoCom wants to merge 1 commit into
ggml-org:masterfrom
ServeurpersoCom:ci-metal-fa-head-pairs
Closed

ServeurpersoCom wants to merge 1 commit into
ggml-org:masterfrom
ServeurpersoCom:ci-metal-fa-head-pairs

Conversation

@ServeurpersoCom

@ServeurpersoCom ServeurpersoCom commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Overview

#30003 adds flash attention tests where the K and V heads have different sizes: K = 128, V = 96. Metal said it could run them, but it only has kernels when K and V are the same size, plus two special pairs, 320/256 and 576/512. So it went looking for a 128/96 kernel that doesn't exist, and test-backend-ops crashed.

Metal now only accepts the head size pairs it really has a kernel for. Anything else falls back to another backend instead of crashing. This also replaces two older partial checks with a single complete one.

Beyond the CI, this was a real Metal bug: any graph using flash attention with one of these head pairs crashed the process, it now falls back to the CPU for that op. -> Native Metal kernels for more pairs could come in a follow-up if a model needs them.

Additional information

Tested on an M5 Max: test-backend-ops -o FLASH_ATTN_EXT passes 4675/4675 on Metal with no crash, the 128/96 cases now show as not supported, and the 320/256 and 576/512 pairs still run on Metal.

Follow-up #30003

Requirements

@ServeurpersoCom
ServeurpersoCom requested a review from a team as a code owner October 9, 2026 06:49
@ggerganov

Copy link
Copy Markdown
Member

We can add instantiations for these head sizes.

@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
@ServeurpersoCom

Copy link
Copy Markdown
Contributor Author

That's what I was thinking; I'm checking to see if any of our models use it, if not, no big deal, it'll just be done ahead of time!

@ServeurpersoCom

Copy link
Copy Markdown
Contributor Author

Superseded by #30209, which adds the 128/96 kernels instead of rejecting the pair, and accepts every pair Metal compiles

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants