欢迎光临
我们一直在努力

[已解决] flash-attn报错flash_attn_2_cuda.cpython-310-x86_64-linux-gnu.so: undefined symbol

报错信息:

ImportError: /home/operationgpt/anaconda3/envs/lyj_py10_torch230/lib/python3.10/site-packages/flash_attn_2_cuda.cpython-310-x86_64-linux-gnu.so: undefined symbol: _ZN3c104cuda9SetDeviceEi

解决方式:重装flash attention

  • 卸载已有的flash-attn, 输入pip uninstall flash-attn, 然后输入y
  • 查看自己对应的torch版本,cuda版本和python版本
  • 查看torch版本

    pip show torch

    返回如下结果,可知torch版本为2.3.1 在这里插入图片描述

    查看cuda版本

    nvcc -V

    在这里插入图片描述 cuda版本为V12.5.40

    查看python版本

    python –version

  • 去flash attention官网下载安装包, 注意需要根据自己的torch版本,cuda版本(可以选择低于自己cuda版本的) 和python版本进行选择. 同时选择abiFALSE.
  • 在这里插入图片描述 右键,复制链接, 在linux中使用wget + 链接进行whl安装包的下载:

    wget https://github.com/Dao-AILab/flash-attention/releases/download/v2.6.3/flash_attn-2.6.3+cu123torch2.3cxx11abiFALSE-cp310-cp310-linux_x86_64.whl

    最后使用pip install whl路径,下载好flash-attn,大功告成!

    赞(0)
    未经允许不得转载:171主机测评 » [已解决] flash-attn报错flash_attn_2_cuda.cpython-310-x86_64-linux-gnu.so: undefined symbol
    分享到: 更多 (0)

    评论 抢沙发

    • 昵称 (必填)
    • 邮箱 (必填)
    • 网址