Skip to content
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

Cambricon MLUs support SDPA and flash_attn #31102

Merged
merged 15 commits into from
Jul 16, 2024
Merged

Conversation

huismiling
Copy link
Contributor

What does this PR do?

add features: MLUs support SDPA and flash_attn.

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

@LysandreJik
Copy link
Member

cc @ArthurZucker @younesbelkada

Copy link
Contributor

@younesbelkada younesbelkada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for this contribution ! Can you point me to the commit on Flash Attention that enables support on Cambricon MLU devices ? 🙏

@huismiling
Copy link
Contributor Author

@younesbelkada Thanks, this is the commit.
Cambricon support SDPA and flash_attn

@younesbelkada
Copy link
Contributor

Hi @huismiling
This is not the commit from Flash Attention library, what I want to see is the commit in flash attention library that enables cambricon support to confirm it is included in the 2.3.3 version, so far I couldn't find it :/

@huismiling
Copy link
Contributor Author

@younesbelkada
Hi, MLU imply private flash attn. It is not included in flash-attention.
MLU's flash attn has not been open-sourced yet.

Copy link
Contributor

@younesbelkada younesbelkada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks !

@HuggingFaceDocBuilderDev

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.

Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since flash attention 2.3.3 is out I think it's fair to merge!

@huismiling
Copy link
Contributor Author

@ArthurZucker @LysandreJik
Hi, is this PR Okay to be merged ? Is there anything I can help?

@huismiling
Copy link
Contributor Author

@ArthurZucker @younesbelkada @LysandreJik
Hi, sorry to disturb. But this PR takes so long time to merge. May someone help this ?
If there is anything needed to fixed, please let me know.

@ArthurZucker ArthurZucker merged commit 03a3bec into huggingface:main Jul 16, 2024
21 checks passed
@ArthurZucker
Copy link
Collaborator

ArthurZucker commented Jul 16, 2024

Sorry I was waiting for the tests and got lost in track!

amyeroberts pushed a commit to amyeroberts/transformers that referenced this pull request Jul 19, 2024
* add Cambricon MLUs support

* fix mlu device rng state

* up for quality check

* up mlu to support fp16

* fix mlu device dependency error

* fix mlu device dependency error

* enable mlu device for bf16

* fix mlu device memory tracker

* Cambricon support SDPA and flash_attn
MHRDYN7 pushed a commit to MHRDYN7/transformers that referenced this pull request Jul 23, 2024
* add Cambricon MLUs support

* fix mlu device rng state

* up for quality check

* up mlu to support fp16

* fix mlu device dependency error

* fix mlu device dependency error

* enable mlu device for bf16

* fix mlu device memory tracker

* Cambricon support SDPA and flash_attn
zucchini-nlp pushed a commit to zucchini-nlp/transformers that referenced this pull request Jul 24, 2024
* add Cambricon MLUs support

* fix mlu device rng state

* up for quality check

* up mlu to support fp16

* fix mlu device dependency error

* fix mlu device dependency error

* enable mlu device for bf16

* fix mlu device memory tracker

* Cambricon support SDPA and flash_attn
itazap pushed a commit that referenced this pull request Jul 25, 2024
* add Cambricon MLUs support

* fix mlu device rng state

* up for quality check

* up mlu to support fp16

* fix mlu device dependency error

* fix mlu device dependency error

* enable mlu device for bf16

* fix mlu device memory tracker

* Cambricon support SDPA and flash_attn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants