[Python] Pip install flash-attn --no-build-isolation throwing error

Discussão em 'Python' iniciado por Stack, Maio 4, 2025.

  1. Stack

    Stack Membro Participativo

    I am currently trying to install Apple's Ferret computer vision model and following the documentation provided here on its github page. When running pip install flash-attn --no-build-isolation I am thrown this error:

    Collecting flash-attn
    Using cached flash_attn-2.5.0.tar.gz (2.5 MB)
    Preparing metadata (setup.py) ... error
    error: subprocess-exited-with-error

    × python setup.py egg_info did not run successfully.
    │ exit code: 1
    ╰─> [22 lines of output]
    fatal: not a git repository (or any of the parent directories): .git
    /private/var/folders/q4/6n8875qj00l8ct6c5ms6y7dw0000gn/T/pip-install-cbzesfg4/flash-attn_07733c481d0948b3a44285f30d59fa03/setup.py:78: UserWarning: flash_attn was requested, but nvcc was not found. Are you sure your environment has nvcc available? If you're installing within a container from https://hub.docker.com/r/pytorch/pytorch, only images whose names contain 'devel' will provide nvcc.
    warnings.warn(
    Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "/private/var/folders/q4/6n8875qj00l8ct6c5ms6y7dw0000gn/T/pip-install-cbzesfg4/flash-attn_07733c481d0948b3a44285f30d59fa03/setup.py", line 133, in <module>
    CUDAExtension(
    File "/usr/local/anaconda3/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 1076, in CUDAExtension
    library_dirs += library_paths(cuda=True)
    ^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/local/anaconda3/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 1203, in library_paths
    if (not os.path.exists(_join_cuda_home(lib_dir)) and
    ^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/local/anaconda3/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 2416, in _join_cuda_home
    raise OSError('CUDA_HOME environment variable is not set. '
    OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.


    torch.__version__ = 2.1.2


    [end of output]

    note: This error originates from a subprocess, and is likely not a problem with pip.
    error: metadata-generation-failed

    × Encountered error while generating package metadata.
    ╰─> See above for output.

    note: This is an issue with the package mentioned above, not pip.
    hint: See above for details.


    Is it an issue with my anaconda environment i have set up for ferret? I tried running this using the MAX_JOBS==1 flag to mitigate run issues but that only produced the same result. Also tried running it with a specified version of flash-attn but it produced the same result as before. If my computer's specs are an issue I am running this on a Macbook Pro 2016 with an Intel Iris Graphics 550 1536 MB GPU and 2.9 GHz Dual-Core Intel Core i5 CPU with 8Gb of RAM using MacOS.

    Any help or suggestions are appreciated!

    Continue reading...

Compartilhe esta Página