Dao-AILab/flash-attention

module 'flash_attn' has no attribute 'flash_attn_varlen_qkvpacked_func'

william-ngvn opened this issue · 4 comments

Hi TriDao, thanks for the great work.

I'm trying to train the project to apply flash-attention2. But my Graphics Card is RTX 2080 which is not yet supported flash-attention2, so I downloaded and applied flash-attention1 to train it.

•This is the error I received:
File "/mnt/will1tb/work_space/Pointcept/exp/nusecenes/semseg-v3m1-0-base/code /pointcept /models /point_transformer_v3 / point_v3m1_base.py", line 208, in forward
feature = flash_attn.flash_attn_varlen_qkvpacked_func(
AttributeError: module 'flash_attn' has no attribute 'flash_attn_varlen_qkvpacked_func'

•In #745 (comment)
I followed and import from 'flash_attn.flash_attn_interface' but it returned: "SyntaxError: invalid syntax."

•So can you help me to reply some questions, please:
1, How do I change from flash-attention 2 to flash-attention 1 while the project is using flash-attention2?
2, Or could you suggest something to me in this case?

My Setup:
• Graphics Card: 1 x RTX 2080 (11GB V-Ram)
• CUDA: 11.8
• Pytorch: 2.2.0
Thank you so much.

pip install flash-attn==1.0.9

Thank you for your prompt reply. @tridao
In my case, I am using Attention1 (because the Graphics Card is RTX 2080 only with Attention1 supported). But the article I want to test run is using Flash-Attention2.
So I want to ask the author: Is there any way to change the code from Flash-Attention 2 back to Flash-Attention1? Or something like that.
Suppose: Rename from flash_attn_varlen_func -> flash_attn_unpadded_func,...

sure you can try that

I appreciate your help, bro!!!