下面是我看过最好的手稿之一,非常有利于理解Flash Attention。

courses.cs.washington.edu

对应该手稿最好的讲解如下:

Block-Sparse Flash Attention

我现在不想讲FA,直接上代码。

工程实现:Triton手写