refactor: remove obsolete dynamic checkpoint mismatch handling (cleanup PR #4099)#4340
Open
RexBearIU wants to merge 1 commit into
Open
refactor: remove obsolete dynamic checkpoint mismatch handling (cleanup PR #4099)#4340RexBearIU wants to merge 1 commit into
RexBearIU wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
2349804 to
9a4fc10
Compare
9a4fc10 to
5b2fc87
Compare
5b2fc87 to
009e7ad
Compare
shralex
approved these changes
Jul 2, 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
This PR cleans up the dynamic checkpoint mismatch error-handling logic originally introduced in PR #4099. Since the proactive validation of
scan_layersfrom checkpoint metadata (PR #4304) catches mismatches early, the after-the-fact recovery logic is no longer needed.Key Changes:
handle_checkpoint_mismatch,is_structural_or_shape_mismatch) fromcheckpointing.py.from_pretrainedloading block inmodel_creation_utils.py.TestCheckpointMismatchHandlingand related test cases) incheckpointing_nnx_load_test.py.test_scan_layers_mismatch_tpuincheckpointing_test.pyto assert on proactive verification error messages.inspect_checkpoint.pyto allow pylint to pass on Python < 3.12.Dependency Note:
Tests
Tested this change by running the following unit and integration tests under the CPU platform:
tests/unit/checkpointing_nnx_load_test.pytests/unit/model_creation_utils_test.pytests/post_training/unit/lora_utils_test.pytests/integration/checkpointing_test.pyChecklist
Before submitting this PR, please make sure (put X in square brackets):
gemini-reviewlabel.