openfold icon indicating copy to clipboard operation
openfold copied to clipboard

installation fails with newer flash-attn version

Open jotech opened this issue 9 months ago • 1 comments

Installation of openfold didn't work for me with cuda 12.4 and latest flash-attention:

Failed to build flash-attn

Pip subprocess error:
  Running command git clone --filter=blob:none --quiet https://github.com/NVIDIA/dllogger.git /tmp/pip-req-build-zrt57w23
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [250 lines of output]
      
      
      torch.__version__  = 2.1.2
    ./.conda/envs/openfold-env/lib/python3.10/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
        warnings.warn(
      running bdist_wheel
      Guessing wheel URL:  https://github.com/Dao-AILab/flash-attention/releases/download/v2.7.4.post1/flash_attn-2.7.4.post1+cu12torch2.1cxx11abiFALSE-cp310-cp310-linux_x86_64.whl
      Precompiled wheel not found. Building from source...

The problem is most probably that torch 2.1.2 support was dropped https://github.com/Dao-AILab/flash-attention/commit/5231d95fe13733fb534c01895f7ea88c6a6c7793

When I changed the flash-attention version back to 2.6.3 the problem could be avoided: https://github.com/aqlaboratory/openfold/blob/pl_upgrades/environment.yml

  - pip:
      - deepspeed==0.12.4
      - dm-tree==0.1.6
      - git+https://github.com/NVIDIA/dllogger.git
      - flash-attn==2.6.3

jotech avatar Feb 10 '25 13:02 jotech

My installation also failed with the same error. I applied this fix and it worked. Open environment.yml file and add "==2.6.3" as indicated.

BjoernZiehr avatar May 22 '25 16:05 BjoernZiehr