[MaxText][vLLM] Fix weight converter layout transposes for Qwen3.5 MoE - #4713
Open
igorts-git wants to merge 1 commit into
Open
[MaxText][vLLM] Fix weight converter layout transposes for Qwen3.5 MoE#4713igorts-git wants to merge 1 commit into
igorts-git wants to merge 1 commit into
Conversation
…ields for Qwen3.5 MoE Fix projection matrix layout transpositions in Qwen35MaxTextToVLLMConverter and restore missing Qwen3.5 config fields in RLConfig. Details: 1. Weight Converter Transpose Fix (qwen35_moe.py): - Transposed linear projection weight matrices (qkv_proj, o_proj, in_proj_qkvz, in_proj_ba, out_proj, shared_expert.gate_up_proj, shared_expert.down_proj) from PyTorch (out, in) convention to vLLM tpu-inference JAX (in, out) layout. - Eliminates 190 matrix shape mismatches during weight sync and resolves post-conversion gibberish text generation. 2. Config Field Validation (types.py): - Added Qwen3Next, MlaAttention, CompressedAttention, Llama4Attention, SplashAttention, and Multimodal base classes to RLConfig. - Resolves Pydantic validation failures for GDN linear attention parameters (gdn_conv_kernel_dim, gdn_key_head_dim, etc.) when running post-training RL workflows. 3. Validation Safety Guard (validate_converter.py): - Added defensive key lookup check to skip weight assignment if a converted key is not present in golden_llm_state. TAG=agy CONV=b9b64cc6-73ab-4d67-926d-337f43b87cae
igorts-git
requested review from
RissyRan,
SurbhiJainUSC,
abhinavclemson,
bvandermoon,
gagika,
gobbleturk,
khatwanimohit,
richjames0,
shralex and
vipannalla
as code owners
August 3, 2026 16:58
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
igorts-git
requested review from
A9isha,
NuojCheng,
aireenmei,
darisoy,
dipannita08,
hengtaoguo,
huytransformer,
jiangjy1982 and
xibinliu
as code owners
August 3, 2026 16:58
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
NuojCheng
approved these changes
Aug 3, 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
Fix projection matrix layout transpositions in
Qwen35MaxTextToVLLMConverterand restore missing Qwen3.5 config fields inRLConfig.Details
qwen35_moe.py):qkv_proj,o_proj,in_proj_qkvz,in_proj_ba,out_proj,shared_expert.gate_up_proj,shared_expert.down_proj) from PyTorch(out, in)convention to vLLMtpu-inferenceJAX(in, out)layout.types.py):Qwen3Next,MlaAttention,CompressedAttention,Llama4Attention,SplashAttention, andMultimodalbase classes toRLConfig.gdn_conv_kernel_dim,gdn_key_head_dim, etc.) when running post-training RL workflows.validate_converter.py):golden_llm_state.BUG: b/521604343
Tests
validate_converter.pyforqwen3.5-35b-a3bon TPU VM (v5p-8):'The capital of France is'produced fluent, coherent output (' Paris.\nThe capital of France is Paris...').tests/unit/pyconfig_test.py): PASSED 100% (19/19 passed).Checklist
Before submitting this PR, please make sure (put X in square brackets):
gemini-reviewlabel.