fix: find_best_model accepts named .pt files without epoch numbers#55
Merged
Merged
Conversation
3 tasks
The old code required filenames to start with PreDecoderModelMemory_ and
encode an epoch number. After the model rename to Ising-Decoder-SurfaceCode-1-
{Fast,Accurate}.pt, copying one of these files into the models dir and running
inference via local_run.sh would fail with "Found 0 model files".
Fall back to any .pt file (sorted, last wins) when no epoch-numbered
PreDecoderModelMemory_ checkpoints are found in the directory.
Fixes regression reported in NVIDIA/Ising-Decoding#51
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
7ba3085 to
955688b
Compare
ivanbasov
added a commit
that referenced
this pull request
Apr 10, 2026
* fix: find_best_model now accepts named .pt files without epoch numbers
The old code required filenames to start with PreDecoderModelMemory_ and
encode an epoch number. After the model rename to Ising-Decoder-SurfaceCode-1-
{Fast,Accurate}.pt, copying one of these files into the models dir and running
inference via local_run.sh would fail with "Found 0 model files".
Fall back to any .pt file (sorted, last wins) when no epoch-numbered
PreDecoderModelMemory_ checkpoints are found in the directory.
Fixes regression reported in #51
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* style: fix yapf formatting in find_best_model
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.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
Regression fix for #51. After the model rename, copying
Ising-Decoder-SurfaceCode-1-Fast.ptinto an outputmodels/dir and runningWORKFLOW=inferencevialocal_run.shfailed with:Root cause:
find_best_modelhad a hard-coded guard requiring filenames to start withPreDecoderModelMemory_and to encode an epoch number in the third dot-separated segment. The renamed files satisfy neither condition.Fix: When no epoch-numbered
PreDecoderModelMemory_*checkpoints are found, fall back to any.ptfile in the directory (sorted, last wins for determinism). The epoch-numbered logic for training checkpoints is unchanged.Test plan
cp models/Ising-Decoder-SurfaceCode-1-Fast.pt outputs/predecoder_model_1/models/ && WORKFLOW=inference EXPERIMENT_NAME=predecoder_model_1 bash code/scripts/local_run.sh— should now printFound 1 model file(s): [*] Ising-Decoder-SurfaceCode-1-Fast.pt (epoch n/a)and load successfullyPreDecoderModelMemory_*files) unaffected🤖 Generated with Claude Code