Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Testing checkpoint limit changes from PR #37196#41899

Open
Aravind-11 wants to merge 13 commits into
huggingface:mainfrom
Aravind-11:feature/separate-checkpoint-limits
Open

Testing checkpoint limit changes from PR #37196#41899
Aravind-11 wants to merge 13 commits into
huggingface:mainfrom
Aravind-11:feature/separate-checkpoint-limits

Conversation

@Aravind-11

@Aravind-11 Aravind-11 commented Oct 27, 2025

Copy link
Copy Markdown
Contributor

What does this PR do?

This PR adds separate checkpoint limits for regular checkpoints and best model checkpoints in the Trainer.

Changes:

  • Adds save_total_limit_best parameter to TrainingArguments to control the number of best checkpoints kept
  • Separates checkpoint management logic so that best model checkpoints and regular interval checkpoints are tracked independently
  • Best checkpoints (based on metrics) are no longer deleted when regular checkpoints are rotated

Motivation:

Currently, save_total_limit applies to ALL checkpoints, meaning best models can be deleted to make room for new regular checkpoints. This PR allows users to preserve their best-performing models while limiting regular checkpoint storage.

Fixes #37196

Before submitting

Who can review?

@vasqu

@Aravind-11

Copy link
Copy Markdown
Contributor Author

hi @vasqu , would love your inputs on this. I'm not sure if my logic is right , are you willing to check it? Thanks a lot!

@vasqu

vasqu commented Oct 30, 2025

Copy link
Copy Markdown
Collaborator

cc @SunMarc

@Aravind-11

Copy link
Copy Markdown
Contributor Author

cc @SunMarc

Hi @SunMarc ! Could you please review the code and let me know what you think? Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants