-
Notifications
You must be signed in to change notification settings - Fork 269
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
[BE] Lr schduler flatten #794
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
83d01fa
flatten lr scheduler
mori360 dbf1f07
flatten lr scheduler
mori360 9da918b
remove get_lr_scheduler_state
mori360 2b7e95f
add schedulercontainer as Stateful
mori360 c0f061f
save state_dict to checkpoint
mori360 c0a4057
save and load only one state_dict for lr_scheduler
mori360 4d776f0
change for loop
mori360 12a0bb2
change comment
mori360 fd683e6
update comments
mori360 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
There are no files selected for viewing
This file contains 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 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
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.
I think it won't be this simple. Both
OptimizersContainer
andModelWrapper
definestate_dict
andload_state_dict
to handle flattening and unflattening. Since we don't have things likeget_model_state_dict
andset_model_state_dict
for lr scheduler intorch.distributed.checkpoint.state_dict
, we likely will need to manually write something for the LambdaLR we are using. See #738 (comment)Let's work with @fegin on this.
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.
Compared lr_schedulers before and after flattening, with/without checkpoint
lr_scheduler values are consistent with changes here
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.
does it support DCP resharding? e.g. PP degree from 2 to 4 across two jobs
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.
I think this PR doesn't address the resharding issue, hence the
[BE]
prefix. Supporting lr resharding deserve a separate PR.