-
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
Use a dataclass as the scheduler config #11443
Conversation
@@ -52,6 +52,7 @@ def __init__( | |||
self.checkpoint_io = checkpoint_io | |||
self.precision_plugin = precision_plugin | |||
self.optimizers: List[Optimizer] = [] | |||
# FIXME: rename to _config? |
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.
There's no need to rename this in this PR, but do we want to?
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.
+1 for renaming it to lr_scheduler_configs
. Should we have consistent variable names in the codebase, too? because currently, variable name lr_scheduler(s)
is used for both configs and actual lr schedulers.
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.
Yes. Would you like to help with that after this PR is merged?
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.
Yes!
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.
@akihironitta You are good to start this now. No need to deprecate because strategies are currently experimental so should be a simple rename
@@ -52,6 +52,7 @@ def __init__( | |||
self.checkpoint_io = checkpoint_io | |||
self.precision_plugin = precision_plugin | |||
self.optimizers: List[Optimizer] = [] | |||
# FIXME: rename to _config? |
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.
+1 for renaming it to lr_scheduler_configs
. Should we have consistent variable names in the codebase, too? because currently, variable name lr_scheduler(s)
is used for both configs and actual lr schedulers.
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!
small comments
Co-authored-by: Rohit Gupta <[email protected]>
Co-authored-by: Rohit Gupta <[email protected]>
What does this PR do?
Closes #11211
Part of #7037
trainer.lr_schedulrs
which still needs to return a dict for compatibility.trainer.lr_scheduler_configs
which does return a list ofLRSchedulerConfig
dataclasses.If anybody has a better name than
lr_scheduler_config
, let me know.Follow-ups:
Resolve:
Does your PR introduce any breaking changes? If yes, please list them.
None
Before submitting
PR review
cc @Borda @justusschock @awaelchli @akihironitta @rohitgr7 @tchaton