Skip to content

[baseten] fix(glm5): plumb indexer_rope_interleave from checkpoint config - #10

Merged
pstefa1707 merged 1 commit into
trainers-mainfrom
fix/glm52-indexer-rope-interleave
Jul 7, 2026
Merged

[baseten] fix(glm5): plumb indexer_rope_interleave from checkpoint config#10
pstefa1707 merged 1 commit into
trainers-mainfrom
fix/glm52-indexer-rope-interleave

Conversation

@pstefa1707

@pstefa1707 pstefa1707 commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

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: set provider.dsa_indexer_rope_interleave = hf_config.indexer_rope_interleave (default False → DeepSeek-V3.2 behavior unchanged).
  • Bump 3rdparty/Megatron-LM to the commit adding the config field + DSAIndexer._apply_rope plumbing.

Why

GLM-5.2's DSA indexer applies interleaved (GPT-J) RoPE (indexer_rope_interleave: true; vLLM reads it as is_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):

seq len 6.6k 10.2k 13.1k ~15k
before 0.010 0.022 0.068 0.084 (8/8 steps over the 0.015 RL gate)
after 0.0098 0.0108 0.0092 (0/8)

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

…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
pstefa1707 force-pushed the fix/glm52-indexer-rope-interleave branch from 14dc301 to 0a4a622 Compare July 7, 2026 20:26
@pstefa1707
pstefa1707 merged commit e5f0021 into trainers-main Jul 7, 2026
4 checks passed
@pstefa1707
pstefa1707 deleted the fix/glm52-indexer-rope-interleave branch July 7, 2026 20:59
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants