Repository navigation
[megatron][vlm] GLM-5.3-Flash vision-language model on Megatron (CP=1, packing) - #2432
Draft
xinyuangui2 wants to merge 3 commits into
Draft
xinyuangui2 wants to merge 3 commits into
xinyuangui2 wants to merge 3 commits into
Conversation
…, packing) - glm5_next/vl_model.py: Glm5NextVLModel, the HF Glm5NextVisionModel (replicated across TP) in front of the existing GPTModel; image features replace <|image|> embeddings before the SP scatter. Port of Megatron-Bridge#6044's GLM53FlashModel. model_owns_packing=True (NoPE LM, so a packed stream needs no position rebuild). CP>1 and video raise. - Glm5NextVLModelProvider / Glm5NextVLBridge: language-model mappings under language_model., plus visual.** <-> model.visual.**. Selected via a sentinel architecture only when language_model_only=false; the text-only path is unchanged. - megatron_config.freeze_vision_model / freeze_vision_projection. - Tests: CPU mapping checks; GPU (h100) HF parity, packed-vs-alone, text-only parity on the 4-layer slice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NrJwn14CQRnnMYja3jPNxb Signed-off-by: xgui <xgui@anyscale.com>
… test config - Image-free microbatches carry an empty [0, D] pixel_values tensor; skip the vision tower. - Test config: no colocation, no ref model, ETP=1 (ETP x EP must divide the world size). - Text-only parity: mean bar at the MoE run-to-run noise level instead of bitwise. Found by the first GPU run on 4xH100. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NrJwn14CQRnnMYja3jPNxb Signed-off-by: xgui <xgui@anyscale.com>
…a fixed-shape leak check Packed-vs-alone measures this slice's MoE sensitivity to microbatch shape (~0.13 mean |dlogprob|, reproduced on the text-only GPTModel path with length-matched rows), not cross-sample leakage. The new test keeps the shape fixed and swaps only the neighbour's image pixels (4xH100: 0.005-0.013 vs 0.47 on the swapped image itself). HF bar 0.1 -> 0.15 for the same reason (packed 0.10, alone 0.08 from HF). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NrJwn14CQRnnMYja3jPNxb Signed-off-by: xgui <xgui@anyscale.com>
xinyuangui2
force-pushed
the
glm5-flash-vlm
branch
from
October 12, 2026 20:19
5c0cb53 to
8df97dd
Compare
This branch has not been deployed
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.
Depends on #2357 / #2404 at runtime (VLM packing gate,
model_owns_packing). This PR contains only the GLM-5.3-Flash changes; CI may fail until those land.Trains GLM-5.3-Flash with its vision tower (
language_model_only=false) on Megatron.glm5_next/vl_model.py(Glm5NextVLModel): the HFGlm5NextVisionModel, replicated across TP, in front of the existingGPTModel. Image features replace<|image|>embeddings before the SP scatter. It's a port ofGLM53FlashModelfrom feat(model): add GLM-5.3-Flash support NVIDIA-NeMo/Megatron-Bridge#6044 (open).model_owns_packing=Trueto pass the [megatron][vlm] Allow sequence packing for VLMs incl. Qwen3.5-VL (CP=1) #2357 gate.Glm5NextVLBridge: language-model mappings underlanguage_model., plusvisual.**↔model.visual.**. It is selected through a sentinel architecture only whenlanguage_model_only=false; the text-only bridge and its names are unchanged.megatron_config.freeze_vision_model/freeze_vision_projection.language_model_only=true: 0.017 (bar 0.03).🤖 Generated with Claude Code
https://claude.ai/code/session_01NrJwn14CQRnnMYja3jPNxb