[baseten] fix(glm5): plumb indexer_rope_interleave from checkpoint config - #10
Merged
Merged
Conversation
…nfig GLM-5.2 declares indexer_rope_interleave: true — its DSA indexer uses GPT-J interleaved RoPE, which serving engines honor (vLLM: is_neox_style = not flag). The bridge never plumbed it, so Megatron's indexer defaulted to the DeepSeek-V3.2 non-interleaved convention and its top-k selection drifted from inference progressively with sequence length (trainer<->vLLM logprob KL 0.010 -> 0.084 between 9k and 15k tokens; 0.009 flat after the fix). Bumps 3rdparty/Megatron-LM to pick up dsa_indexer_rope_interleave (basetenlabs/Megatron-LM#6).
pstefa1707
force-pushed
the
fix/glm52-indexer-rope-interleave
branch
from
July 7, 2026 20:26
14dc301 to
0a4a622
Compare
JackRao123
approved these changes
Jul 7, 2026
pstefa1707
pushed a commit
that referenced
this pull request
Jul 7, 2026
#10 landed with the submodule pointing at the pre-squash PR-branch head (377e4f5e); repoint to the squash-merged commit on trainers-main (2229188e, identical tree) so the gitlink doesn't depend on the PR branch existing.
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.
Companion to basetenlabs/Megatron-LM#6 (merge that first — the submodule pointer here targets its head
377e4f5e; if #6 lands via squash, update the pointer to the merged SHA).What
glm5_bridge.provider_bridge: setprovider.dsa_indexer_rope_interleave = hf_config.indexer_rope_interleave(default False → DeepSeek-V3.2 behavior unchanged).3rdparty/Megatron-LMto the commit adding the config field +DSAIndexer._apply_ropeplumbing.Why
GLM-5.2's DSA indexer applies interleaved (GPT-J) RoPE (
indexer_rope_interleave: true; vLLM reads it asis_neox_style = not flag). Megatron hardcoded the DeepSeek-V3.2 non-interleaved convention, so the trainer scored its indexer on differently-rotated q/k than serving: top-k selections agree at short context but diverge progressively with length, compounding through all sparse layers.Measured on 3×8 B200 (GLM-5.2 trainer vs vLLM 0.23, teacher-forced per-token logprob KL, identical sequences):
Systematic bias (−0.09 nats/token at 15k) → ~0. Unblocks long-context GLM-5.2 RL (the advertised S64K training config was silently degraded beyond ~9k). Full diagnosis trail in Baseten TRN-1406.
🤖 Generated with Claude Code