原文
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
原始链接: https://github.com/tspeterkim/flash-attention-minimal
该存储库包含使用 CUDA 和 PyTorch 的 Flash Attention 的最小实现。 该项目的目的是通过提供一个简单且具有教育意义的示例,使学习 CUDA 的过程变得更容易。 目前,该项目仅包含在“flash.cu”中编写的约 100 行的 Flash Attention 前向传递。 用户可以运行基准测试来比较手动注意力和最小闪光注意力的性能。 目标是通过添加反向传递、加速矩阵乘法、动态设置块大小等来改进实现。请注意,存在一些注意事项,例如不支持反向传递、数据类型差异和固定块大小。 对于没有 GPU 的用户,可以使用在线 Colab 演示。
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.