Skip to content

Metal backend: Add SDPA head_dim=256 support#18875

Merged
manuelcandales merged 5 commits intomainfrom
gh/manuelcandales/170/head
Apr 20, 2026
Merged

Metal backend: Add SDPA head_dim=256 support#18875
manuelcandales merged 5 commits intomainfrom
gh/manuelcandales/170/head

Conversation

@manuelcandales
Copy link
Copy Markdown
Contributor

Qwen 3.5 MoE uses head_dim=256 for full attention layers. The existing
SDPA Metal kernel only instantiated head_dim 64, 96, 128. At D=256 each
thread handles 8 QK elements (8 x 32 threads = 256 dims); register
pressure and threadgroup memory are well within Apple GPU limits.

Authored with Claude.

[ghstack-poisoned]
[ghstack-poisoned]
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented Apr 14, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/18875

Note: Links to docs will display an error until the docs builds have been completed.

This comment was automatically generated by Dr. CI and updates every 15 minutes.

[ghstack-poisoned]
[ghstack-poisoned]
@manuelcandales manuelcandales requested review from mergennachin and metascroy and removed request for shoumikhin April 15, 2026 15:12
Base automatically changed from gh/manuelcandales/169/head to main April 20, 2026 19:18
[ghstack-poisoned]
@github-actions
Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@manuelcandales manuelcandales merged commit 4898af2 into main Apr 20, 2026
169 of 173 checks passed
@manuelcandales manuelcandales deleted the gh/manuelcandales/170/head branch April 20, 2026 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants