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 support for autocast custom ops in GaudiTrainer #308

Merged
merged 6 commits into from
Sep 12, 2023

Conversation

regisss
Copy link
Collaborator

@regisss regisss commented Jul 26, 2023

What does this PR do?

For some models, specifying custom bf16 and fp32 ops for Torch Autocast can lead to significant speedups. This PR enables users to specify such custom ops the same way as with HMP and they will be recognized by the trainer.

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

@regisss regisss marked this pull request as ready for review September 10, 2023 15:02
@regisss regisss merged commit 9441bf2 into main Sep 12, 2023
9 checks passed
@regisss regisss deleted the add_autocast_ops_lists branch September 12, 2023 17:10
@ZhaiFeiyue
Copy link
Collaborator

@regisss LGTM! 👍
one question, when will you decided to remove HMP totally, or just leave it there?

@regisss
Copy link
Collaborator Author

regisss commented Sep 13, 2023

@ZhaiFeiyue The only remaining obstacle is to make Wav2Vec2 training work. @libinta is taking a look at it in HS-1107.
Once this is cleared, I'll publish new Gaudi configs for GPT2 and Wav2Vec2 and release a patch to make sure everything works fine with autocast.
Finally, when SynapseAI 1.12 is released, I'll merge #349 to completely remove HMP.

@ZhaiFeiyue
Copy link
Collaborator

that's great!

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.

3 participants