-
Notifications
You must be signed in to change notification settings - Fork 6.9k
[train] Clean up checkpoint config and trainer param deprecations #58022
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
Conversation
Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]>
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.
Code Review
This pull request effectively deprecates checkpoint_at_end and checkpoint_frequency in CheckpointConfig, and resume_from_checkpoint and metadata in various Trainer constructors. The implementation for deprecation is solid, raising DeprecationWarning upon usage. The changes are consistent across the affected modules.
My main feedback is to improve the docstrings for the deprecated parameters. While the deprecation warnings at runtime are informative, updating the docstrings to include the reason for deprecation and the recommended alternative would greatly improve the developer experience for users browsing the API documentation. I've left specific suggestions on the relevant files.
JasonLi1909
left a comment
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.
Nice!
Signed-off-by: Justin Yu <[email protected]>
…_config_cleanup
Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]>
…y-project#58022) Deprecate `CheckpointConfig(checkpoint_at_end, checkpoint_frequency)` and mark the `resume_from_checkpoint, metadata` Trainer constructor arguments as deprecated in the docstrings. Update the "inspecting results" user guide doc code to show how to catch and inspect errors raised by trainer.fit(). The previous recommendation to check result.error is unusable because we always raise the error which prevents the user from accessing the result object. --------- Signed-off-by: Justin Yu <[email protected]>
…y-project#58022) Deprecate `CheckpointConfig(checkpoint_at_end, checkpoint_frequency)` and mark the `resume_from_checkpoint, metadata` Trainer constructor arguments as deprecated in the docstrings. Update the "inspecting results" user guide doc code to show how to catch and inspect errors raised by trainer.fit(). The previous recommendation to check result.error is unusable because we always raise the error which prevents the user from accessing the result object. --------- Signed-off-by: Justin Yu <[email protected]> Signed-off-by: Aydin Abiar <[email protected]>
Description
Deprecate
CheckpointConfig(checkpoint_at_end, checkpoint_frequency)and mark theresume_from_checkpoint, metadataTrainer constructor arguments as deprecated in the docstrings.Drive-by changes
Update the "inspecting results" user guide doc code to show how to catch and inspect errors raised by trainer.fit(). The previous recommendation to check result.error is unusable because we always raise the error which prevents the user from accessing the result object.
Related issues
#49454