Fix(test): match the current scan_layers mismatch error in test_scan_layers_mismatch_tpu#4443
Open
ecnal-cienet wants to merge 1 commit into
Open
Fix(test): match the current scan_layers mismatch error in test_scan_layers_mismatch_tpu#4443ecnal-cienet wants to merge 1 commit into
ecnal-cienet wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
73195d3 to
530b444
Compare
The restore path now reports an unmatched checkpoint with 'Checkpoint does not match the model', listing each weight the checkpoint didn't carry. The test still expected the older wording. 'Failed to restore checkpoint' is not raised anywhere, and 'Configuration mismatch' comes from the load_parameters_path metadata check, which this test doesn't exercise. Also assert the missing per-layer weight path, so the check is tied to the scan/unscan mismatch rather than the generic hint line, which any architecture mismatch would print.
530b444 to
9c1cc42
Compare
xibinliu
approved these changes
Jul 14, 2026
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.
Description
tests/integration/checkpointing_test.py::test_scan_layers_mismatch_tpufails on scheduled CI (run 29234138806). The behavior under test is correct — restoring ascan_layers=Truecheckpoint into ascan_layers=Falsemodel still raisesValueError, and the message still namesscan_layers. Only the wording the test matches on has moved, so this is a test-only change; nothing insrc/is touched.The mismatch is now reported by the weight-mismatch check in
_raise_on_weight_mismatch, added in #4343 (fbb35123a), which lists each weight the checkpoint didn't carry:The test instead expected one of two older strings, and neither can match:
"Failed to restore checkpoint"is raised nowhere in the repository — grepping the tree, the only occurrence is the assertion itself."Configuration mismatch"comes fromverify_and_sync_scan_layers, which returns early unlessload_parameters_pathis set. This test resumes frombase_output_directoryand never sets that flag, so the path is unreachable from here. It is already covered directly bytests/unit/model_creation_utils_test.py.So the assertion is rewritten against the message the restore path actually produces, rather than OR-ing in strings that cannot fire.
The test carries
scheduled_only, so it does not run on presubmit — which is why #4343's own CI was green and the staleness only surfaced on the next scheduled run.The
"scan_layers" in messageassertion is kept but is no longer sufficient on its own: that substring now comes from the error's generic trailing hint (...num layers, scan_layers)), which is printed for any architecture mismatch — a wrongemb_dimwould satisfy it too. The new"decoder/layers/0/"assertion pins the failure to the missing unscanned per-layer weight, which is what a scan/unscan mismatch specifically produces.Tests
tests/integration/checkpointing_test.py::test_scan_layers_mismatch_tpupasses on a v6e-8 (it fails onmainat the same assertion reported by CI, and passes with this change).Checklist
Before submitting this PR, please make sure (put X in square brackets):
gemini-reviewlabel.