Flash-attention 2.3.2 Windows下编译安装
无节操の网管
编辑于 2023年10月18日 20:09

不久前Flash-attention 2.3.2 终于支持了 Windows,推荐直接使用大神编译好的whl安装

github.com/bdashore3/flash-attention/releases 网页链接​

安装环境:

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可以大一点

代码块
Python
自动换行
复制代码
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
复制成功