Skip to content

[sglang-miles] exclude shared skip-topk layer indexer weights from RL weight check - #29339

Merged
yueming-yuan merged 1 commit into
sglang-milesfrom
glm5.2-skip-layer-indexer-weight-check
Jun 25, 2026
Merged

yueming-yuan merged 1 commit into
sglang-milesfrom
glm5.2-skip-layer-indexer-weight-check

Conversation

@yueming-yuan

@yueming-yuan yueming-yuan commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Problem

On DSA models with cross-layer index sharing (index_topk_freq > 1, e.g. GLM-5.2), "skip-topk" layers reuse the source computing layer's top-k indices and never run their own indexerforward_mla gates self.indexer(...) behind not self.skip_topk. Those layers' indexer weights (wq_b/wk/k_norm/weights_proj) are therefore absent from the checkpoint and never loaded, so they keep uninitialized values.

DeepseekV2AttentionMLA still builds the Indexer module on every DSA layer (uniform layout, correct for V3.2 where every layer computes). So on a sharing model the RL weight-update equality checker (WeightChecker) compares those never-loaded skip-layer indexer params and fails with max_abs_err=nan on *.self_attn.indexer.wq_b/wk (and k_norm).

This only surfaces on sharing models (GLM-5.2); plain DSA (DeepSeek-V3.2, index_topk_freq=1) has an indexer on every layer and is unaffected.

Fix

Tag the skip-layer indexer params with _skip_weight_check (already honored by WeightChecker → routed to non-fatal info). The weights are provably never read at forward, so excluding them from the equality check is safe and the per-layer module layout is unchanged.

🤖 Generated with Claude Code


CI States

Latest PR Test (Base): ❌ Run #28205643775
Latest PR Test (Extra): ❌ Run #28205643694

…eight check

On DSA cross-layer index-sharing models (e.g. GLM-5.2), skip-topk layers
reuse the source computing layer's top-k and never run their own indexer,
so their indexer weights are absent from the checkpoint and never loaded.
The RL weight-update equality checker then flags those uninitialized
params. Tag them with _skip_weight_check (already honored by WeightChecker)
so the comparison skips them.
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@yueming-yuan yueming-yuan changed the title deepseek_v2: exclude shared skip-topk layer indexer weights from RL weight check [sglang-miles] exclude shared skip-topk layer indexer weights from RL weight check Jun 25, 2026
@yueming-yuan
yueming-yuan merged commit 63e5bb2 into sglang-miles Jun 25, 2026
38 of 43 checks passed
@yueming-yuan
yueming-yuan deleted the glm5.2-skip-layer-indexer-weight-check branch June 25, 2026 23:04
yushengsu-thu pushed a commit to yushengsu-thu/sglang that referenced this pull request Jun 27, 2026
nanjiangwill pushed a commit to nanjiangwill/sglang that referenced this pull request Jul 7, 2026
yueming-yuan added a commit that referenced this pull request Jul 14, 2026
yueming-yuan added a commit that referenced this pull request Jul 14, 2026
yueming-yuan added a commit that referenced this pull request Jul 14, 2026
yueming-yuan added a commit that referenced this pull request Jul 14, 2026
yueming-yuan added a commit that referenced this pull request Jul 25, 2026
yueming-yuan added a commit that referenced this pull request Jul 25, 2026
yueming-yuan added a commit that referenced this pull request Jul 25, 2026
yueming-yuan added a commit that referenced this pull request Jul 25, 2026
Arist12 pushed a commit to Arist12/sglang that referenced this pull request Aug 27, 2026
Kh4L pushed a commit to Kh4L/sglang that referenced this pull request Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant