资料支撑
xformers中可以使用Flashv2
https://github.com/facebookresearch/xformers/issues/795
https://github.com/vllm-project/vllm/issues/485
https://github.com/facebookresearch/xformers/issues/832
PyTorch 支持 Flash Attention 2。
Flash Attention 2 是 Flash Attention 的改进版本,它提供了更高的性能和更好的并行性。它于 2023 年 11 月发布,并被集成到 PyTorch 2.2 中。
PyTorch 2.2 于 2024 年 2 月发布,它包含以下与 Flash Attention 2 相关的更新:
- 将 Flash Attention 内核更新到 v2 版本
- 支持 aarch64 平台上的 Flash Attention 2
- 修复了 Flash Attention 2 中的一些已知问题
要使用 Flash Attention 2,您需要安装 PyTorch 2.2 或更高版本。您还可以使用 torch.nn.functional.flash_attn() 函数显式调用 Flash Attention 2。
以下是一些有关如何使用 Flash Attention 2 的资源: - PyTorch 文