[deepspeed / m2m_100] make deepspeed zero-3 work with layerdrop#16717
Merged
[deepspeed / m2m_100] make deepspeed zero-3 work with layerdrop#16717
Conversation
|
The documentation is not available anymore as the PR was closed or merged. |
stas00
commented
Apr 12, 2022
patil-suraj
approved these changes
Apr 12, 2022
Contributor
patil-suraj
left a comment
There was a problem hiding this comment.
Thanks a lot for fixing this!
sgugger
approved these changes
Apr 12, 2022
Collaborator
sgugger
left a comment
There was a problem hiding this comment.
Thanks for working on this!
elusenji
pushed a commit
to elusenji/transformers
that referenced
this pull request
Jun 12, 2022
…ingface#16717) * [deepspeed / m2m_100] make deepspeed 3 work with layerdrop * fix * revert last
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.
Same as I had to fix in
wav2vec2it looks that this fix should eventually go to all models that useLayerDrop. At least at the moment Deepspeed is not capable of randomly skipping layers, so this PR uses the same now well tested workaround I used inwav2vec2, where all layers always run when deepspeed zero-3 is detected, but the results are ignored if it was meant to be skipped.transformers/src/transformers/models/wav2vec2/modeling_wav2vec2.py
Lines 817 to 849 in 69233cf
Perhaps one day Deepspeed will be able to randomly skip layers, at the moment the solution is not the most efficient one. I made a request.
When ZeRO-3 is not used the original code path is taken.
The test exercising this code path will be merged as part of this huge additional tests set PR #12695 (it's been long overdue).
For posterity, the error for this issue will look something like:
Fixes: #16688
@patil-suraj, @sgugger