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 version selection for GPU under SM_89 (e.g., L20)聽#1338
Hi~
Thanks for your excellent work.
However, I am very confused that the minimum architecture required in flash3 is SM_80 when selecting the version of flash_attn: https://github.com/facebookresearch/xformers/blob/main/xformers/ops/fmha/flash3.py#L597
Actually, flash_attn3 should run on a GPU with Hopper architecture, and the required architecture is SM_90. I am not sure if this is a little bug?
In my practical use, I found that the flash_attn version used in xformers is flash3, which works well on H20 GPU, while there is a CUDA illegal memory access issue on L20 GPU. Further investigation using cuda-gdb revealed that the exception occurred in the flash:: prepare_varlen_num-blocks_kernel, which is exactly one of the kernels in _C.so in xformers. To solve this problem, I changed CUDA_MINIMUM_COMPUTE_CAPABILITY to (9,0) when running on L20, and the program can run normally.
I'm not sure if it's my improper use or if there's a bug in the selection logic here.
To Reproduce
When I change CUDA_MINIMUM_COMPUTE_CAPABILITY to (8, 0), it can be stably reproduced on L20
While it works well if changing CUDA_MINIMUM_COMPUTE_CAPABILITY to (9, 0)
Environment
Python version: 3.10.12
PyTorch version: 2.7.1+cu126
CUDA runtime version: 12.2.91
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration:
GPU 0: NVIDIA L20
GPU 1: NVIDIA L20
GPU 2: NVIDIA L20
GPU 3: NVIDIA L20
torch==2.7.1
transformers==4.54.1
xformers==0.0.31
vllm==0.10.0
Activity