Python中flash_attn安装报错解决方案指南

pip install https://github.com/Dao-AILab/flash-attention/releases/download/v2.7.4.post1/flash_attn-2.7.4.post1+cu12torch2.2cxx11abiTRUE-cp310-cp310-linux_x86_64.whl

直接使用 pypi 安装会安装最新版本,不一定适配本地环境,所以需要直接从 release 中选择合适的版本安装。
官方包只有 Linux 系统:
https://github.com/Dao-AILab/flash-attention/releases

Windows 系统可以使用大佬编译的包:
https://github.com/bdashore3/flash-attention/releases(非官方)

作者:阿斯顿零空间

物联沃分享整理
物联沃-IOTWORD物联网 » Python中flash_attn安装报错解决方案指南

发表回复