Repository navigation
Conversation
… files
fetch_latest_checkpoint_name promised <name>.pth support but raised
ValueError on int('model') whenever a stepless name shared the list with
numbered checkpoints, and again on .pt files (int('100.pt')) that the
W&B caller's own (".pth", ".pt") filter feeds it. Rank stepless names
as -1 so numbered checkpoints win, resolve all-stepless sets
lexicographically, and parse both suffixes.
This branch has not been deployed
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
fetch_latest_checkpoint_namenow ranks checkpoint filenames instead of crashing on them. The old sort key wasint(x.split(".pth")[0].split("_")[-1]). It raisedValueError: invalid literal for int() with base 10: 'model'on the docstring's own second supported format, a bare<name>.pthsharing the list with numbered checkpoints. It raised again on every.ptfile, because the W&B caller's own(".pth", ".pt")filter feeds it those (int("100.pt")). Restoring a run whose artifacts include either shape crashesresolve_run_files.Ranking rules, applied after the unchanged prefix filter:
_<int>in the stem (.pthor.pt) is that file's stepmodel.pth,model_final.pth) ranks as stepless (-1), so any numbered checkpoint outranks itTests
param_decomp/tests/infra/test_fetch_latest_checkpoint_name.pyadds 12 cases: max-step and numeric-vs-lexicographic ordering, the bare-name-among-numbered crash,.ptsuffixes alone and mixed with.pth, word suffixes, all-stepless resolution, the single-file short-circuit, and the prefix filter plus its no-match error. Full infra suite: 52 passed.ruff check,ruff format --check, andbasedpyrightare clean on the touched files.