去flash attention官网下载安装包, 注意需要根据自己的torch版本,cuda版本(可以选择低于自己cuda版本的) 和python版本进行选择。
- 如果whl文件名上包含参数
abiTRUE
,则会报错。需要安装包含abiFALSE
的whl文件。
卸载:卸载原先报错的flash-attn
bash
pip uninstall flash-attn
下载:选择abiFALSE
版本.!!!!!!!!!!
bash
wget https://github.com/Dao-AILab/flash-attention/releases/download/v2.7.0.post2/flash_attn-2.7.0.post2+cu12torch2.2cxx11abiFALSE-cp39-cp39-linux_x86_64.whl
安装: 注意加 --no-build-isolation
bash
pip install flash_attn-2.7.0.post2+cu12torch2.2cxx11abiFALSE-cp39-cp39-linux_x86_64.whl --no-build-isolation