-
Notifications
You must be signed in to change notification settings - Fork 32k
Switch gradient checkpointing default to use_reentrant=False (PyTorch recommended)
#43203
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
Merged
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
7e5c7d1
Switch gradient checkpointing default to use_reentrant=False (PyTorch…
qgallouedec 7ea2cbe
All testers
qgallouedec 340224c
revert
qgallouedec 68c0711
Merge branch 'main' into no-reentrant
qgallouedec d642e52
skip for the right reason
qgallouedec 1210ec2
skip for right reason and this one is fixed
qgallouedec 453d5cc
skip for the right reason
qgallouedec 4356551
fix up to blip2 excluded
qgallouedec 4ac2cee
reactivate all tests
qgallouedec 71df8d6
skip non trainable and xfail know issues
qgallouedec d415471
audio encoder after lm initialization and add xfail tests for gradien…
qgallouedec 09a01fc
continue fixing tests
qgallouedec aa7ed85
some last cases
qgallouedec 1e2c55c
Merge branch 'main' into no-reentrant
qgallouedec c2688be
Merge branch 'no-reentrant' of https://github.com/huggingface/transfo…
qgallouedec 525c1f3
fix check_training_gradient_checkpointing
qgallouedec d2e1b8f
ignore and x fail other tests
qgallouedec 20ec219
this module doesn't support training
qgallouedec 3d090e1
forgot one
qgallouedec 0dbb70f
mra
qgallouedec e0535d8
style
qgallouedec 314f63c
fix recurrent gemma when enable input require grads with gradient che…
qgallouedec da4c49b
mark training test as expected failure for reentrant compatibility
qgallouedec a4603d5
style
qgallouedec 8444141
reverting, moshi won't work anyway
qgallouedec 09012a4
remove skip training tests for Siglip2VisionModel
qgallouedec 8c09f17
Merge branch 'main' into no-reentrant
qgallouedec 183d3a8
Merge branch 'main' into no-reentrant
qgallouedec 36cb28d
Merge branch 'main' into no-reentrant
SunMarc c7bf3e2
Merge branch 'main' into no-reentrant
SunMarc a9c9a66
Merge branch 'main' into no-reentrant
SunMarc 1926ac8
Merge branch 'main' into no-reentrant
SunMarc 75655a8
Merge branch 'main' into no-reentrant
SunMarc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -487,6 +487,8 @@ def forward( | |
| x_branch = x_branch.unsqueeze(-1) | ||
| self.conv1d_state = conv_state[:, :, 1:] | ||
| else: | ||
| self.conv1d_state = None | ||
| self.rg_lru.recurrent_states = None | ||
|
Comment on lines
+490
to
+491
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Clearing recurrent cache state when Result before the change: |
||
| x_branch = self.conv_1d(x_branch)[..., :seq_len] | ||
|
|
||
| x_branch = self.rg_lru(x_branch.transpose(1, 2), position_ids) | ||
|
|
||
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
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
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the main change