Support Qwen3.5-VL (dense + MoE) via Megatron-Bridge#2075
Open
demouo wants to merge 1 commit into
Open
Conversation
…se + MoE) with MTP-naming alias and end-to-end geo3k example Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.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.
Summary
Support Qwen3.5-VL (dense + MoE) via NVIDIA Megatron-Bridge and solve #2073 with a standard method.
Changes:
slime_plugins/megatron_bridge/qwen3_5_vl.pyto register the official Qwen35VLBridge / Qwen35VLMoEBridge by simply importing them so their @MegatronModelBridge.register_bridge decorators run.slime_plugins/megatron_bridge/__init__.py.examples/geo3k_vlm/run_geo3k_qwen35.shso a single script covers both dense (Qwen3.5-9B / 27B) and MoE (Qwen3.5-35B-A3B, ...) via MODEL_NAME, on top of the official megatron-bridge>=0.4.0 (no fork install needed).Motivation
Qwen3.5-VL support is missing in slime — the only existing path is the legacy text-only
slime_plugins/mbridge/qwen3_5.py, which doesn't know about the vision encoder, GDN+Gated-Attention hybrid layers, or M-RoPE.NVIDIA already shipped these bridges in megatron-bridge 0.4.0 — we just needs to import them so the dispatch decorators run before AutoBridge.from_hf_pretrained. So we reuse NVIDIA's implementation rather than reimplementing on the slime side.
The plugin also patches mapping_registry() to add legacy transformer_layer aliases for every mtp_model_layer mapping (idempotent, no-op on newer Megatron-LM), to absorb the upstream Megatron-LM ↔ megatron-bridge module-naming drift around MTP layers:
Usage
Pass