fix(training): exclude unavailable metrics from checkpoint ranking - #3677
Merged
Conversation
Signed-off-by: zhifu gao <zhifu.gzf@alibaba-inc.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.
Summary
Fix the verified checkpoint-selection defect reported in #3388. This PR does not close that issue or claim to solve catastrophic forgetting.
accis not zero, andacc_richis not ASR accuracy. Unavailable selected metrics are excluded from best, keep-N ranking and metric-based averaging, with a rank-zero warning.Verification
On ind-gpu8, Python 3.12 and PyTorch 2.10.0+cu128 with CPU execution:
85 passed, no skips. Adjacent training-document/API-signature contracts: 12 passed. Shell syntax and
git diff --checkpass. Independent static review found no remaining actionable issue.The tests call actual validation and checkpoint save/load paths with real CPU tensors and files. With validation losses
[3, 1, 2], explicit loss selection retains epoch 2 as best; averaging retained epochs 2/3 produces the expected parameter mean. They also cover persisted ranking, resume, self-pruning and simulated latest/best write failures retaining prior candidates.Real two-rank CPU Gloo tests exercise asymmetric inputs and post-save rank differences. The original implementation reproduced a collective-size mismatch/SIGABRT; the fixed implementation completes and agrees on valid means and unavailable metrics. The initial metric regression was 41 failing/6 passing against the original source, followed by targeted RED/GREEN tests for review findings.
Boundaries