GPU getforce RTX 3060Ti 使用 pip install flash-attn --no-build-isolation 一直报错,期间检查了pytorch 版本(2.2.2),cuda版本(12.1和12.2都试了),visual studio版本(2022),确认attn2是否支持win10,都没有问题,然后尝试使用git clone https://github.com/Dao-AILab/flash-attention 源码安装(其实是一回事),也报错,最后查找资料:
不久前Flash-attention 2.3.2 终于支持了 Windows,推荐直接使用大神编译好的whl安装
github.com/bdashore3/flash-attention/releases
stable diffusion webui flash-attention2性能测试
安装环境:
0、flash-attention 2.0 暂时仅支持30系及以上显卡
1、pytorch2.1 + CUDA12.2 *需要单独安装cuda12.2,pytorch官网只有cu12.1
2、Visual Studio 2022 生成工具 使用c++的桌面开发 + 适用于最新v143生成工具的ATL
用开始菜单中的 x64 Native Tools Command Prompt for VS 2022命令行,切换到对应的python venv环境下
命令:*对内存大小有自信的MAX_JOBS可以大一点
git clone https://github.com/Dao-AILab/flash-attention
cd flash-attention
pip install packaging
pip install wheel
set MAX_JOBS=4
python setup.py install 作者:无节操の网管 https://www.bilibili.com/read/cv27137329/ 出处:bilibili
还是使用大神编译好的whl安装成功了