安装推理加速插件 FlashAttention-windows
FlashAttention 用于 GPU 推理加速,主要服务于 Linux。Windows 安装 FlashAttention 可以通过如下方式安装。
下载轮子
首先去 此处 下载对应版本的轮子。

例如,我的版本是:
text
python:3.12.8
cuda:12.4
pytorch:2.5.1则下载上图框中所示的版本。下载之后,进行安装即可。
安装
常规命令:
shell
pip install flash_attn-2.7.4.post1+cu124torch2.5.1cxx11abiFALSE-cp312-cp312-win_amd64.whlComfyUI 命令:
shell
.\python_embeded\python.exe -m pip install .\bak\flash_attn-2.7.4.post1+cu124torch2.5.1cxx11abiFALSE-cp312-cp312-win_amd64.whlConda 环境:
shell
激活 Conda 环境
pip install flash_attn-2.7.4.post1+cu124torch2.5.1cxx11abiFALSE-cp312-cp312-win_amd64.whl