fix(testing): resolve tokenizer loading error and UnboundLocalError in logit checker#4438
Open
chiajunglien wants to merge 3 commits into
Open
Conversation
…bug in logit checker
c726d4e to
4713810
Compare
RexBearIU
reviewed
Jul 13, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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 fixes two regression bugs that cause the
mistral-7bnightly E2E test to crash inforward_pass_logit_checker.py:DAG Error Log
.modelfiles.model_prefixbeing referenced outside its defined conditional block for text-only models.Changes
mistral-7bOnline ID Mappingsrc/maxtext/utils/globals.py"mistral-7b": "mistralai/Mistral-7B-v0.1"to the HF_IDS dictionary. This enables the logit checker to fall back to the correct online Hugging Face repository if local loading fails.tests/utils/forward_pass_logit_checker.pyHF_IDSfromglobals.py.main(): If loading from the localconfig.tokenizer_pathfails (which occurs becausetokenizer.mistral-v1is a binary SentencePiece.modelfile instead of JSON), the script now catches the exception and falls back to loading the mapped Hugging Face ID fromHF_IDS.model_prefixVariable Scope (Fixes UnboundLocalError Crash)tests/utils/forward_pass_logit_checker.pymodel_prefixfrom inside theif config.use_multimodal: block to the very top ofget_data().model_prefixis always defined, preventing text-only models (likemistral-7b) from crashing when the script checks the Qwen3 RoPE 3D position ID logic.Tests
pytest tests/unit/configs_test.pylocally: All 76 tests passed successfully.Log: https://paste.googleplex.com/4641417803726848
Checklist
Before submitting this PR, please make sure (put X in square brackets):
gemini-reviewlabel.