fix: add best_metric_key field to CheckpointingConfig dataclass#1641
Merged
akoumpa merged 1 commit intoNVIDIA-NeMo:mainfrom Apr 5, 2026
Merged
Conversation
Signed-off-by: stanley1208 <stanley.mei08@gmail.com> Made-with: Cursor
Contributor
Author
Contributor
|
/claude review |
Contributor
|
/ok to test 7ca34bb |
Contributor
|
/claude review |
Contributor
|
@adil-a can you review? IDK if this option is wired with the rest of the checkpointing code. |
akoumpa
approved these changes
Apr 5, 2026
linnanwang
pushed a commit
that referenced
this pull request
Apr 24, 2026
Made-with: Cursor Signed-off-by: stanley1208 <stanley.mei08@gmail.com>
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.
What does this PR do?
Add the missing
best_metric_keyfield toCheckpointingConfigdataclass, fixing a crash when users set this field in their checkpoint YAML config.Fixes #971.
Bug
Setting
best_metric_keyin the checkpoint config crashes withCheckpointingConfig.__init__() got an unexpected keyword argument 'best_metric_key'because the dataclass doesn't include this field.The recipes (
train_ft.py,train_seq_cls.py,finetune.py,kd.py) already readcheckpoint.best_metric_keyfrom config and pass it to_maybe_save_checkpoint(), but theCheckpointingConfigdataclass rejects it during construction atbuild_checkpoint_config().Fix
Add
best_metric_key: str = "default"toCheckpointingConfig. The default value"default"matches the fallback used in all 4 recipe files.Related
CC @akoumpa @adil-a