add Qwen3 VL tests, update logit checker, and golden logit generator#4330
Draft
subawocit wants to merge 6 commits into
Draft
add Qwen3 VL tests, update logit checker, and golden logit generator#4330subawocit wants to merge 6 commits into
subawocit wants to merge 6 commits into
Conversation
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 adds logit checking and end-to-end integration validation support for Qwen3-VL models. It extends both the golden logit generation utility and the forward-pass logit checker to handle multimodal components for Qwen3-VL models. An end-to-end shell script was also added to compare MaxText logits with Hugging Face golden logits.
generate_hf_golden_logits.pyQwen3VLForConditionalGenerationmodel class for"qwen3-vl"model identifiers.forward_pass_logit_checker.py(channels, time * temporal_patch_size, height * patch_size, width * patch_size).processor_qwen3_omni.get_rope_indexwhenuse_mropeis enabled for Qwen3 models.vision_start,vision_end,image_pad,video_pad) during KL divergence calculation. Since the model is not trained to predict next token from raw vision placeholders, their logits can be random and vary numerically. Masking them prevents visual placeholders from skewing the max KL divergence score, and focuses the comparison on actual language-generation logits.test_qwen3_vl_2b_to_hf_e2e.shtests/end_to_end/tpu/qwen3/vl_2b/test_qwen3_vl_2b_to_hf_e2e.shfollowing test_gemma4_to_hf.sh:--max_kl_div=0.1).Tests
Define variables: HF_TOKEN, MODEL_BUCKET, LOCAL_PATH, USE_MULTIMODAL, USE_SCAN_LAYERS in
tests/end_to_end/tpu/qwen3/vl_2b/test_qwen3_vl_2b_to_hf_e2e.shTest Results
Text-only input (USE_MULTIMODAL=false)
Text and image input (USE_MULTIMODAL=true)
Checklist
Before submitting this PR, please make sure (put X in square brackets):
gemini-reviewlabel.