flash-Attention2安装和使用

时间:2025-01-23 07:40:13

去下载whl:/Dao-AILab/flash-attention/releases

  • 我的配置为:
    • cuda:11.6
    • pytorch:1.13
    • python:3.10
  • 那么我要去flash-attn中我能下载的最新版本:2.3.5
  • 下载:flash_attn-2.3.5+cu116torch1.13cxx11abiFalse-cp310-cp310-linux_x86_64.whl,直接点了下就行,命令行为:wget /Dao-AILab/flash-attention/releases/download/v2.3.5/flash_attn-2.3.5+cu116torch1.13cxx11abiFalse-cp310-cp310-linux_x86_64.whl
  • 安装:pip install flash_attn-2.3.5+cu116torch1.13cxx11abiFalse-cp310-cp310-linux_x86_64.whl -i /pypi/simple/,加个镜像提速没毛病
  • **注意:**abiTrue的不行,False的可以,就很奇怪,True的会报错:...-: undefined symbol: _ZN3c104cuda9SetDeviceEi...