You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The official implementation of flash attention is in CUDA, so in AMD GPUs, users cannot easily use flash attention on transformers to training LLM. With the supports, we can unlock many exciting use cases on AMD. The code is already there at https://triton-lang.org/main/getting-started/tutorials/06-fused-attention.html.
Another option is to use flex-attn from PyTorch team, which uses torch.compile to optimize on top of existing handwritten triton kernels
Alternatives
No response
Additional context
No response
The text was updated successfully, but these errors were encountered:
ByronHsu
changed the title
Implement Flash Attention in Triton to enable transformers to run with Flash Attention on AMD GPUs.
[AMD] Implement Flash Attention in Triton to enable transformers to run with Flash Attention on AMD GPUs.
Aug 27, 2024
The FA provided by https://github.com/Dao-AILab/flash-attention has only MI200 or MI300 GPUs. With Trition 3.0, the kernel can work on a much broad range of AMD GPUs. Tested kernels on AMD 7000 series working great.
To resolve this issue using a triton kernel, I opened this PR: #275
While FlexAttention is still in the nightly releases only, this seems the only way to add FA monkey-patching without adding a dependancy to pytorch-nightly.
🚀 The feature, motivation and pitch
The official implementation of flash attention is in CUDA, so in AMD GPUs, users cannot easily use flash attention on transformers to training LLM. With the supports, we can unlock many exciting use cases on AMD. The code is already there at https://triton-lang.org/main/getting-started/tutorials/06-fused-attention.html.
Another option is to use flex-attn from PyTorch team, which uses torch.compile to optimize on top of existing handwritten triton kernels
Alternatives
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: