-
Notifications
You must be signed in to change notification settings - Fork 31.5k
[bugfix] fix flash_attention_2 unavailable error on Ascend NPU #39844
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
7c8afd8 to
7564291
Compare
7564291 to
9e2224d
Compare
|
Please help me review this, thanks a lot! @ArthurZucker |
|
@ArthurZucker please help me review and merge, thanks ~ |
SunMarc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks ! Sorry for the breaking change
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
|
Very good work. Can Flash Attention 3 also be used on the Ascend NPU? |
Hi, as far as i know, flash-attention-3 is not supported yet on Ascend NPU, see doc |
What does this PR do?
After PR #39474 merged, flash_attention_2 is unavailable on Ascend NPU, because package
flash-attncan not be installed on Ascend NPU :(This PR is committed for solving this problem.
Detail modification:
src/transformers/modeling_flash_attention_utils.pymodule, useget_npu_flash_attn_funcsreturn flash attention related functions for Ascend NPU.flash-attnin func_flash_attn_2_can_dispatchfromsrc/transformers/modeling_utils.pymodule, it is not required for Ascend NPU.Fixes # (issue)
Not related.
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.