Add transformers-like checkpoint parameters (--save-total-limit, --save-strategy, and so on)#547
Open
thechaos16 wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces fine-grained checkpoint management to the training pipeline, allowing users to automatically track and preserve the best-performing model based on evaluation metrics while limiting the total number of saved checkpoints to manage disk space. Key updates include new command-line arguments in train_eagle3.py, documentation updates, and the addition of checkpoint rotation utilities in specforge/utils.py. Review feedback identifies a critical typo in an attribute name that would cause a runtime error, significant indentation and logic issues in the sort_checkpoints function, and an unused variable initialization.
| best_metric = float("-inf") if args.greater_is_better else float("inf") | ||
| best_model_checkpoint = None | ||
| current_is_best = False | ||
| is_best = False |
Contributor
…d save the best parameter at end
e896c4f to
10bb1c7
Compare
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.
Motivation
Modifications
--save-strategystep: same as beforebest: keep the best one--save-total-limit--metric-for-bestacc_0)--greater-is-better--load-best-mode-at-endTrainerclass, so it can send best checkpoint viaself, but here, we need to use external variable)best).Accuracy Test
I believe that it is not related to model-code
Benchmark & Profiling
I belive that is not related to benchmark performance
Checklist