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

Move torch.compile() wrapping after DDP/FSDP wrapping to ensure correct graph breaks during training #22279

Merged
merged 1 commit into from
Mar 20, 2023

Conversation

ani300
Copy link
Contributor

@ani300 ani300 commented Mar 20, 2023

What does this PR do?

This is a simple PR that moves the wrapper for torch.compile() after those for DDP and FSDP, given that the order is important for those two pieces to work together during training.

Fixes #22215

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.

@sgugger

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Mar 20, 2023

The documentation is not available anymore as the PR was closed or merged.

Copy link
Collaborator

@sgugger sgugger 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 the fix!

@ani300
Copy link
Contributor Author

ani300 commented Mar 20, 2023

I don't have permissions to merge the PR, so I don't know what the process looks like from here

@sgugger
Copy link
Collaborator

sgugger commented Mar 20, 2023

I was just waiting for the tests to complete ;-)

@sgugger sgugger merged commit fb0a38b into huggingface:main Mar 20, 2023
@ani300 ani300 deleted the compile-compat-with-fsdp branch March 20, 2023 17:56
raghavanone pushed a commit to raghavanone/transformers that referenced this pull request Apr 5, 2023
novice03 pushed a commit to novice03/transformers that referenced this pull request Jun 23, 2023
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.

torch.compile() and FSDP/DDP wrappers are called in the wrong order.
3 participants