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

[trainer] fix double wrapping + test #10583

Merged
merged 2 commits into from Mar 8, 2021

Conversation

stas00
Copy link
Contributor

@stas00 stas00 commented Mar 8, 2021

We have an issue with

trainer.train()
trainer.train()

under any environment that requires model wrapping - we currently get the wrapping multiple times - and things may kind of work - but most of the time it breaks badly - thanks to apex for complaining noisily when it's being wrapped second time.

i.e. we get things like DataParallel(DataParallel(model))

This PR fixes this problem and adds a test.

@sgugger, @LysandreJik

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.

Very clean! Thanks for fixing this!

@LysandreJik LysandreJik merged commit f882966 into huggingface:master Mar 8, 2021
@stas00 stas00 deleted the multiple-wraps branch March 8, 2021 16:23
Iwontbecreative pushed a commit to Iwontbecreative/transformers that referenced this pull request Jul 15, 2021
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.

None yet

3 participants