[OSS] Getting rid of the "should bucket" hash table, just use a list +non-trainable param fix#259
Merged
blefaudeux merged 5 commits intomasterfrom Dec 19, 2020
Merged
Conversation
Properly handle all params, with or without requires_grad
4 tasks
Contributor
|
Thank you very much for the fix, @blefaudeux! |
Contributor
Author
|
ping reviews, if you don't mind, I would love master to work for HuggingFace |
min-xu-ai
approved these changes
Dec 19, 2020
Contributor
min-xu-ai
left a comment
There was a problem hiding this comment.
Looks sane to me. Again, it seems the changes are centered around having params that doesn't have require_grads. Perhaps more explicit test cases would help prevent regression?
| model.register_buffer("test_buffer", torch.ones((1)) * rank) | ||
| model.to(device) | ||
|
|
||
| next(model.parameters()).requires_grad = False |
Contributor
Author
There was a problem hiding this comment.
Yes, I was about to write that this is the unit test change which makes sure that this is caught in the future. Will do !
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Properly handle all params, with or without requires_grad, HuggingFace has triggered a bug which was always there. Remove the hash table to store the strategy (a bit risky if the tensors are moved around) and replace with a simple list. Make sure that we update the strategy if a new parameter group is added
Before submitting
What does this PR do?
Fixes huggingface/transformers#9156 for the multi-node case, ie: with bucketing involved, tested locally by commenting out the no-bucketing statement.
Fixes #258
Makes sure that this case is caught by the unit test, I'm really surprised that this was not covered before, but I did check that master fails on this
PR review
Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.
Did you have fun?
Well, yes 🙃 the fp16 issue is not solved though
cc @stas00