Repository navigation
Added separate limits for saving full checkpoints and model weights - #37196
GitGautamHub wants to merge 2 commits into
Conversation
|
Hi 👋, thank you for opening this pull request! The pull request is converted to draft by default. The CI will be paused while the PR is in draft mode. When it is ready for review, please click the |
|
cc @muellerzr @SunMarc here and to the original issue #37195 |
|
Hi @GitGautamHub , what's the status on this? I can take this up but it looks very complicated since these changes could affect a lot of other files. I don't know if i'm right. Would like your inputs on this. |
|
Thanks for the PR, and sorry it didn't make it in! This branch is based on v4, and v5 is very different, so rather than rebasing we'd love to invite you to open a new PR against
Closing this one in the meantime, thanks again! |
What does this PR do?
This PR introduces separate limits for saving full checkpoints and model weights in the Trainer class. Currently, save_total_limit applies to both, which can lead to inefficient storage management. This change allows users to:
Retain intermediate model weights for analysis without storing full checkpoints unnecessarily.
Ensure that the latest full checkpoint is available for resuming training.
Fixes Issue
Fixes #37195
Motivation
The current implementation of save_total_limit does not differentiate between full checkpoints and model weights. This can be problematic when users require frequent weight saves but only need a limited number of full checkpoints. Introducing separate limits enhances flexibility and optimizes storage usage.
Changes Made
Updated _rotate_checkpoints() in trainer.py to support independent limits for full checkpoints and model weights.
Introduced save_checkpoint_limit and save_model_weights_limit as configurable parameters.
Updated relevant documentation and method docstrings.
Tests
Due to local environment issues, I was unable to run the tests locally.
The CI/CD pipeline should validate the changes.