[model] feat: add Qwen3.5 text model bridges (dense + MoE)#3769
Open
HowardZorn wants to merge 1 commit intoNVIDIA-NeMo:mainfrom
Open
[model] feat: add Qwen3.5 text model bridges (dense + MoE)#3769HowardZorn wants to merge 1 commit intoNVIDIA-NeMo:mainfrom
HowardZorn wants to merge 1 commit intoNVIDIA-NeMo:mainfrom
Conversation
… MTP mcore path Add Qwen3_5Bridge and Qwen3_5MoEBridge for HF ↔ Megatron-Core weight conversion of Qwen3.5 language models with hybrid GDN+Attention architecture. Also align MTP Megatron-Core parameter paths from transformer_layer to mtp_model_layer in Qwen3 and Qwen3-Next bridges. Signed-off-by: He Ruozhou <heruozhou@xiaohongshu.com>
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.
What does this PR do?
Add Megatron Bridge support for Qwen3.5 language models (Qwen3.5-LM), which are the text-only component extracted from Qwen3.5-VL. The model architecture is similar to Qwen3-Next (hybrid GDN + standard attention), but the HF checkpoint organization follows the Qwen3.5-VL convention (
model.language_model.*prefix instead ofmodel.layers.*). Additionally, the MTP mcore path is renamed fromtransformer_layertomtp_model_layerto align with Megatron-Core's actual module naming.Changelog
Qwen3_5Bridgefor dense Qwen3.5 language models (qwen3_5_bridge.py)Qwen3_5MoEBridgefor MoE variant of Qwen3.5 language models (qwen3_5_moe_bridge.py)models/qwen/__init__.pywith model typesqwen3_5_textandqwen3_5_moe_textqwen3_bridge.py:mtp.layers.*.transformer_layer.*→mtp.layers.*.mtp_model_layer.*qwen3_next_bridge.py: same rename as above (13 mappings updated)test_qwen35_bridge.py)Key design decisions
model.language_model.*model.layers.*gate_up_proj)gate_proj/up_proj)GDNLinearMappingSeparate(4-tensor: qkv/z/b/a)GDNLinearMapping(2-tensor: qkvz/ba)GitHub Actions CI
See the CI section in the Contributing doc for how to trigger the CI. A Nvidia developer will need to approve and trigger the CI for external contributors.
Before your PR is "Ready for review"
Pre checks:
Additional Information