Skip to content

Add Metal (MPS) backend for neighborhood attention on Apple Silicon#312

Open
imperatormk wants to merge 1 commit into
SHI-Labs:mainfrom
imperatormk:main
Open

Add Metal (MPS) backend for neighborhood attention on Apple Silicon#312
imperatormk wants to merge 1 commit into
SHI-Labs:mainfrom
imperatormk:main

Conversation

@imperatormk

Copy link
Copy Markdown

Adds a Metal backend for NA1D/2D/3D on Apple Silicon (MPS devices).

Tiled flash-attention forward and backward kernels supporting FP32/FP16/BF16, GQA, causal masking, stride, dilation, and additional KV tokens.

Backend is auto-selected when tensors are on MPS

Tiled flash-attention forward/backward kernels with KV bounding box optimization for NA1D/2D/3D.
@alihassanijr

Copy link
Copy Markdown
Collaborator

Thank you for your contribution.
Having native metal kernels in natten is very exciting.

Please give us some time to review.

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