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

Fixed wrong lr initialization when loading checkpoints #22

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

AleHD
Copy link

@AleHD AleHD commented Nov 20, 2024

For some reason the lr in the parameter groups of the optimizers is set to zero in the very first iteration. This is problematic when loading checkpoints as it essentially means you are no longer following the same training as an uninterrupted run, but rather skipping one optimization iteration. This PR fixes this issue.

Minimalistic example:
image
Green follows a 10 iteration training without interruption. Orange is the current behaviour, loading from iteration 5 and quickly diverging because of the incorrect lr set when loading. Brown (overlapping green) is the fix loading from iteration 5 but now follows the same expected route.

@AleHD AleHD marked this pull request as draft November 29, 2024 12:57
AleHD and others added 2 commits December 2, 2024 15:52
@AleHD
Copy link
Author

AleHD commented Dec 2, 2024

I have introduced Kyle's changes to finally fix the issue. Now it looks to be resuming succesfully regerdless of stage of the learning rate (during warmup, steady, cooldown or after cooldown all work fine). Should be good to merge :)

image

@AleHD AleHD marked this pull request as ready for review December 2, 2024 15:31
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.

1 participant