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 for DistilBert #33724

Merged
merged 9 commits into from
Oct 2, 2024
Merged

Conversation

OmarManzoor
Copy link
Contributor

What does this PR do?

Towards #28005

Adds sdpa for the DistilBert model

Who can review?

@amyeroberts

@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

@amyeroberts amyeroberts left a comment

Choose a reason for hiding this comment

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

Thanks for adding this feature and all the benchmark numbers!

Regarding the tests:

  • The slow tests were skipped because the PR didn't have the run-slow label on the PR. Could you try retriggering with another [run-slow] distilbert commit?
  • The failure on the fetch_tests step is something which seems to be afflicting other PRs -- we've contacted CircleCI to try and get this resolved

On a local benchmark (NVIDIA GeForce RTX 2060-8GB, PyTorch 2.3.1, OS Ubuntu 20.04) with `float16` and the `distilbert-base-uncased` model with
a MaskedLM head, we saw the following speedups during training and inference.

#### Training
Copy link
Collaborator

Choose a reason for hiding this comment

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

❤️

@HuggingFaceDocBuilderDev

Hey! 🤗 Thanks for your contribution to the transformers library!

Before merging this pull request, slow tests CI should be triggered. To enable this:

  • Add the run-slow label to the PR
  • When your PR is ready for merge and all reviewers' comments have been addressed, push an empty commit with the command [run-slow] followed by a comma separated list of all the models to be tested, i.e. [run_slow] model_to_test_1, model_to_test_2
    • If the pull request affects a lot of models, put at most 10 models in the commit message
  • A transformers maintainer will then approve the workflow to start the tests

(For maintainers) The documentation for slow tests CI on PRs is here.

@OmarManzoor
Copy link
Contributor Author

@amyeroberts It seems the tests worked.

@amyeroberts amyeroberts merged commit e7c8af7 into huggingface:main Oct 2, 2024
21 checks passed
@OmarManzoor OmarManzoor deleted the distilbert_sdpa branch October 2, 2024 13:19
NielsRogge pushed a commit to NielsRogge/transformers that referenced this pull request Oct 21, 2024
* Add sdpa for DistilBert

* [run_slow] distilbert

* [run_slow] distilbert

* [run_slow] distilbert

* Try without slow tests

* [run_slow] distilbert

* [run_slow] distilbert
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