当前位置:   article > 正文

flash-attn安装报错ERROR: Could not build wheels for flash-attn, which is required to install pyproject

error: could not build wheels for flash-attn, which is required to install p

安装flash-attn时build报错,或者即使安装成功,但却import不进来,可能是你安装的flash版本不一致!导致flash-attn安装错误。

可在下面的网页上下载对应版本的离线包再安装:

https://github.com/Dao-AILab/flash-attention/releases/

  • 报错1

我build时的报错信息如下:

Failed to build flash-attn 
ERROR: Could not build wheels for flash-attn, which is required to install pyproject.toml-based projects

  • 报错2

以及我换了其他不合适的版本即使安装成功后,在import的过程中报错:

ImportError: libcudart.so.11.0: cannot open shared object file: No such file or directory

网上找了一圈,怀疑可能是安装的版本不对。

上面贴的网页里面releases了很多版本,找到与自己环境匹配的版本下载,比如我的环境是:

  • python3.10

  • cuda_11.7

  • torch 2.0

下载的版本为:flash_attn-2.3.5+cu117torch2.0cxx11abiFALSE-cp310-cp310-linux_x86_64.whl

注意:cxx有True和False两个版本,可以都试一下。我用的是cxxFALSE版本。

下载完之后,使用以下命令进行安装:

pip install flash_attn-2.3.5+cu117torch2.0cxx11abiFALSE-cp310-cp310-linux_x86_64.whl --no-build-isolation

问题解决!

Reference:

https://github.com/Dao-AILab/flash-attention/issues/224

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/weixin_40725706/article/detail/270332
推荐阅读
相关标签
  

闽ICP备14008679号