Live data from Hacker News

Show HN: Flash Attention in ~100 lines of CUDA

github.com

41–44 of 44 posts

Re: Show HN: Flash Attention in ~100 lines of CUDA

#41

Fantastic work! Extremely neat and clear implementation! Interesting note on the backward pass - what do you think are the main blockers for a backward pass?

Thanks Daniel. The main blocker is me not able to fully grasp the backward pass. (trying to understand Appendix B.2 in the original paper)

I need to get more comfortable with matrix derivatives before I can confidently reimplement it in the same minimal way as I did with the forward pass.

Re: Show HN: Flash Attention in ~100 lines of CUDA

#42
post #40
post #30

Earlier quoted context omitted.

It was written with cutlass? No wonder Peter Kim found it valuable and worthwhile to de-obfuscate. Adopting a new programming language invented by OpenAI doesn't sound like a much better alternative. I'd be shocked if either of them were able to build code for AMD GPUs, where it's easy to adapt CUDA code, but not if it's buried in tens of thousands of lines of frameworks. I like open source code to have clarity so I…

Triton has an AMD backend, although work is still ongoing.

You will also be able to use Triton to target Ryzen AI.

Re: Show HN: Flash Attention in ~100 lines of CUDA

#43

Fantastic work! Extremely neat and clear implementation! Interesting note on the backward pass - what do you think are the main blockers for a backward pass?

Thanks Daniel. The main blocker is me not able to fully grasp the backward pass. (trying to understand Appendix B.2 in the original paper) I need to get more comfortable with matrix derivatives before I can confidently reimplement it in the same minimal way as I did with the forward pass.

Oh ok! Ye the backwards passes are always much more difficult due to the derivatives!
Post reply on HN