[Error] ImportError: flash_attn_2_cuda.cpython-39-x86_64-linux-gnu.so: undefined symbol

이슬비·2024년 8월 21일
0

이것저것

목록 보기
2/2

VLM inference 때문에 flash attention package를 사용해야 하는데, import가 안됨 ... ㅎ

해결 방법

cuda, pytorch, flash_attn 모두 각자 environment에 맞는 것을 설치하면 되는데, 만약 아래의 command를 따른다면 각각의 버전을 설치 하는 것을 권장 (근데 아마 안하면 안될 듯)

  1. cuda 11.8 설치: 추후 포스팅
  2. pytorch 2.0.1 설치
pip install torch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 --index-url https://download.pytorch.org/whl/cu118
  1. flash_attn 설치
    : 나랑 비슷한 github 이슈를 보고 내 python, pytorch, cuda 버전에 맞는 abiFALSE tag를 가진 release 버전 설치. abiFALSE가 붙은 걸 설치하라는 문구를 어디서 봤는데 너무 많은 이슈를 봐서 그 레퍼는 못 찾겠다 ...
pip install https://github.com/Dao-AILab/flash-attention/releases/download/v2.5.5/flash_attn-2.5.5+cu118torch2.0cxx11abiFALSE-cp39-cp39-linux_x86_64.whl
profile
정말 알아?

0개의 댓글

관련 채용 정보