Add auto logging of trainer metadata and optimizer state saving to help with resumation of training - #39
Open
wli51 wants to merge 3 commits into
Open
Add auto logging of trainer metadata and optimizer state saving to help with resumation of training#39wli51 wants to merge 3 commits into
wli51 wants to merge 3 commits into
Conversation
…ate existing properties by best effort inferring some. Remove some confusing and unused properties. Adjust model saving defaults.
… trainer metadata and couple logging of model weights by logging of optimizer state to facilitate resuming of complete trainings in whole epoch increments.
gwaybio
approved these changes
Aug 7, 2026
| save_best_model: bool = True, | ||
| ) -> List[Path]: | ||
|
|
||
| if file_name_prefix is None: |
Member
There was a problem hiding this comment.
why change this file? isn't the old default equivalent behavior?
Comment on lines
+17
to
+18
| if file_name_prefix is None: | ||
| file_name_prefix = 'optimizer' |
Member
There was a problem hiding this comment.
same comment here, why not default to "optimizer" instead of None?
| if trainer is None: | ||
| return | ||
|
|
||
| config = { |
| mlflow.log_artifact(str(file_path), artifact_path=artifact_path) | ||
|
|
||
|
|
||
| def _log_trainer_artifact( |
Member
There was a problem hiding this comment.
I didn't catch this until reading the next file, but, to me, naming this file "_log_trainer_artifact" implies you're writing to a log file, but in the next file (and actually the function within) is saving the best model and logging artifacts.
Consider enhancing the name of this function
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Also doing small refactors of modules modified by the feature addition to move code away from main module and move class methods as independent methods to facilitate easier unit testing.