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

add sdpa mbart #32033

Merged
merged 7 commits into from
Sep 7, 2024
Merged

add sdpa mbart #32033

merged 7 commits into from
Sep 7, 2024

Conversation

nbroad1881
Copy link
Contributor

@nbroad1881 nbroad1881 commented Jul 17, 2024

Adds MBartSdpaAttention which is useful for donut.

just copy-pasting from modeling_bart.py

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?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

Felix :(

@ArthurZucker

@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.

@ArthurZucker ArthurZucker self-requested a review July 26, 2024 16:03
@ArthurZucker
Copy link
Collaborator

Will review, could you make sure CIs are green first?

@nbroad1881
Copy link
Contributor Author

🟢

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.

One nit and should be good to go!

src/transformers/models/mbart/modeling_mbart.py Outdated Show resolved Hide resolved
@nbroad1881
Copy link
Contributor Author

@ArthurZucker

I finally made the changes 😃

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.

LGTM, could you run the slow tests (which should trigger eager vs sdpa equivalence) ! 🤗

@nbroad1881
Copy link
Contributor Author

nbroad1881 commented Sep 6, 2024

How do I run slow tests?
I think I figured it out

@nbroad1881 nbroad1881 merged commit 66bc4de into main Sep 7, 2024
23 checks passed
@nbroad1881 nbroad1881 deleted the mbart-sdpa branch September 7, 2024 00:31
@nbroad1881
Copy link
Contributor Author

We did it!

itazap pushed a commit to NielsRogge/transformers that referenced this pull request Sep 20, 2024
* add sdpa mbart

useful for donut

* update sdpa docs

* formatting

* add self._use_sdpa in mbartencoder

* use self.config to check attn

* retrigger checks

* [run-slow] mbart
BernardZach pushed a commit to BernardZach/transformers that referenced this pull request Dec 5, 2024
* add sdpa mbart

useful for donut

* update sdpa docs

* formatting

* add self._use_sdpa in mbartencoder

* use self.config to check attn

* retrigger checks

* [run-slow] mbart
BernardZach pushed a commit to innovationcore/transformers that referenced this pull request Dec 6, 2024
* add sdpa mbart

useful for donut

* update sdpa docs

* formatting

* add self._use_sdpa in mbartencoder

* use self.config to check attn

* retrigger checks

* [run-slow] mbart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants