[model] feat: add Qwen3.5 text model bridges (dense + MoE) #3769
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.46) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.46 · 471 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.368
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3769"
general
weight: 0.35
HowardZorn
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)Second commit changelog
- Rename
Qwen3_5Bridge →Qwen35BridgeandQwen3_5MoEBridge→Qwen35MoEBridgeto follow project naming conventions.
- Merge dense and MoE text bridges into a single
qwen35_bridge.pymodule withextracted helper functions and static mapping methods that are consumed by both text and VL bridges, eliminating code duplication.
- Fix incorrect HF param paths in dense LM mappings (removed spurious language_model nesting).
- Remove
transpose_on_exportfrom Qwen3.5 bridge to fix shape mismatch.- Add functional tests for dense and MoE bridges.
Key design decisions
| Aspect | Qwen3.5-LM | Qwen3-Next (reference) |
|--------|-----------|----------------------|
| HF param prefix |
model.language_model.|model.layers.|| Decoder expert format | Fused (
gate_up_proj) | Individual (gate_proj/up_proj) || MTP expert format | Individual per-expert | Individual per-expert |
| GDN linear mapping |
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
Acknowledgements
From Engine Architecture Group 5, Engine Infrastructure Department, Xiaohongshu (RedNote).