feat(scan_layers): verify scan_layers compatibility from checkpoint metadata#4304
Draft
RexBearIU wants to merge 2 commits into
Draft
feat(scan_layers): verify scan_layers compatibility from checkpoint metadata#4304RexBearIU wants to merge 2 commits into
RexBearIU wants to merge 2 commits into
Conversation
Co-authored-by: Xibin Liu <xibin@google.com>
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
0451365 to
0330b0a
Compare
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
Note
This PR is based on #4269.
This PR introduces proactive validation of
scan_layersconfiguration compatibility when loading checkpoint metadata in MaxText.Key changes:
load_checkpoint_metadatahelper incheckpointing.pythat handles custom metadata loading with a simplified broad-except fallback.sync_lora_metadatainlora_utils.pyto reuse the unified metadata helper.scan_layersvalue from the checkpoint custom metadata insidefrom_pretrainedfunction inmodel_creation_utils.pyto assert configuration match and prevent silent model mismatches.Tests
Tested this change by running the unit tests for both
hf_checkpoint_conversion_test.pyandmodel_creation_utils_test.pyunder the CPU platform:Output:
45 passed, 25 skippedChecklist
Before submitting this PR, please make sure (put X in square brackets):
gemini-reviewlabel.