环境安装 #
直接 pip install flash-atten 的编译时间会非常长,如果网络不好还会出更多问题/
方法一,ninja加速(同时使用清华镜像):
python -m pip install ninja -i https://pypi.tuna.tsinghua.edu.cn/simple
MAX_JOBS=4 pip install flash-attn --use-pep517 --no-build-isolation -i https://pypi.tuna.tsinghua.edu.cn/simple
方法二,直接下载编译好的 releases:
https://github.com/Dao-AILab/flash-attention/releases
找到符合自己的 torch 和 cuda 版本下载即可。
论文阅读 #