-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Fix checkpointed state for lr_schedulers with step interval #7877
Fix checkpointed state for lr_schedulers with step interval #7877
Conversation
Hello @simran2905! Thanks for updating this PR. There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2021-06-21 10:13:15 UTC |
for more information, see https://pre-commit.ci
Codecov Report
@@ Coverage Diff @@
## master #7877 +/- ##
=======================================
- Coverage 92% 87% -5%
=======================================
Files 210 210
Lines 13579 13581 +2
=======================================
- Hits 12452 11812 -640
- Misses 1127 1769 +642 |
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.
Overall, looks good to me
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
for more information, see https://pre-commit.ci
moved your changes from |
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.
Pushed a few minor changes. Almost ready
Changed the milestone to 1.4 as this requires several refactors not in the bug-fix branch |
Thanks @awaelchli and @carmocca for the merges. |
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
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.
LGTM !
Hey @simran2905, quick question: Why differentiate reduce_on_plateau schedulers from the rest. Can't we call Best, |
See the discussion in the linked issue: #7637 (comment) |
What does this PR do?
Fixes #7637
The lr schedulers are being updated after calling on_train_batch_end and trainer._run_evaluation(), both of which can save checkpoints. This means that the latest state of lr_scheduler is not saved during checkpoint. This PR fixes the issue for classic schedulers.
NOTE: The ReduceLROnPlateau schedulers need on_train_batch_end called first for any metrics logging and will continue to save an older state potentially.
Before submitting
PR review
Anyone in the community is free to review the PR once the tests have passed.
Before you start reviewing make sure you have read Review guidelines. In short, see the following bullet-list:
Did you have fun?
Make sure you had fun coding 🙃