You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
flash-attn Detection Logic Fails for flash-attn #1555
When using unsloth, I noticed an issue with the flash-attn detection logic. Specifically, unsloth checks for the presence of flash-attn using the following code:
However, in latest flash-attn(mine is 2.7.3), the flash_attn_cuda module has been removed and replaced with flash_attn_gpu (see this commit). As a result, unsloth's detection logic fails for flash-attn, incorrectly concluding that flash-attn is not installed or is broken, and falls back to xformers.
Expected Behavior
unsloth should correctly detect the presence of flash-attn regardless of whether the installed version uses flash_attn_cuda or flash_attn_gpu.
Actual Behavior
When flash-attn is installed, unsloth fails to detect it and falls back to xformers, even though flash-attn is properly installed and functional.
This should be fixed now - sorry on the delay - please update with uv pip install --upgrade unsloth unsloth_zoo --force-reinstall --no-cache-dir - if it's not fixed yet, it'll be in the next pip / PyPI release - if it's still not working after that, please open another issue - appreciate it again!
Activity
[-]flash-attn Detection Logic Fails for flash-attn>=2.7.3[/-][+]flash-attn Detection Logic Fails for flash-attn[/+]danielhanchen commentedon Jan 19, 2025
Appreciate the fix!
danielhanchen commentedon Jan 20, 2025
Just pushed it in - hopefully
flash-attnworks as expected now! For local machines, please update Unsloth via:chaxjli commentedon Jan 20, 2025
This is an awesome issue. It has been of great help to me.
danielhanchen commentedon Jun 19, 2026
This should be fixed now - sorry on the delay - please update with
uv pip install --upgrade unsloth unsloth_zoo --force-reinstall --no-cache-dir- if it's not fixed yet, it'll be in the next pip / PyPI release - if it's still not working after that, please open another issue - appreciate it again!