windows安装flash-attn记录
1. 确保torch的cuda环境与本地cuda大版本一致
检查命令
nvcc -V
nvidia-smi
import torch
print(torch.version.cuda) # 11.8
print(torch.cuda.is_available()) # True
2.官网提供flash-attn需要本地编译才可以通过,且是linux版本,会遇到报错
https://github.com/Dao-AILab/flash-attention/releases
exmy_base.h(404): error: type name is not allowedstatic_assert(cutlass::platform::is_unsigned_v<Storage>, "Use an unsigned integer for StorageType");
3.最好直接下载符合本机的torch/python/cuda版本的windows版本
,附上链接
https://github.com/bdashore3/flash-attention/releases
直接安装对于的whl安装包,一键安装,解决了我困惑很久的问题,很有用。
4.附一张安装成功的截图
。
希望对大家有用!