Repository navigation
[Fix] bailing: Renormalize top-k routing weights by default for Ling-2.5/2.6 - #45662
Merged
Merged
Conversation
…2.5/2.6 BailingMoeV2_5 checkpoints (Ling-2.6-flash) have no norm_topk_prob key, so the model read renormalize=False. The reference modeling always renormalizes before applying routed_scaling_factor. The FlashInfer fused_topk_deepseek path renormalized regardless of the flag, which hid the mismatch until #44904 gated that path on renormalize; since then Ling-2.6-flash GSM8K fell from 0.87 to ~0.4. Co-Authored-By: Claude Opus 5.5 <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.
Motivation
The nightly
test_ling_2_6_flash.py(8-GPU H200 and B200) has failed GSM8K since #44904. On 10/21 (8e3e2980d) it scored 0.39 on H200 and 0.35 on B200, against a 0.825 threshold. The 10/17 nightly scored 0.87.Root cause:
BailingMoeV2_5ForCausalLMcheckpoints (Ling-2.6-flash, Ling-2.5-1T, Ling-2.6-1T, Ring-2.5-1T) have nonorm_topk_probkey.bailing_moe_linear.pyreadsgetattr(config, "norm_topk_prob", False), so the router getsrenormalize=False.modeling_bailing_moe_v2_5.pyalways renormalizes the top-k weights, then multiplies byrouted_scaling_factor(2.5):fused_topk_deepseekpath, which always renormalizes regardless of the flag. That hid the wrong default.renormalize, so Ling moved to a path that respectsrenormalize=False. The top-k weights no longer sum to 1, the MoE output is mis-scaled at every layer, and GSM8K collapsed.#44904 is correct and should stay; the bug is the model's default.
Modifications
bailing_moe_linear.py:norm_topk_probnow defaults toTrue, matching the reference modeling. Configs that set the key explicitly are unaffected.Accuracy Tests
The CI test file was run unchanged (
test_ling_2_6_flash.py: TP=4, NEXTN MTP,extra_buffer, 200-question 5-shot GSM8K) on 4×B200:4eb606b2ae(10/17 nightly, last green)3a059de94c(parent of #44904)48ea486928(#44904)8e3e2980db(10/21 nightly)8e3e2980db+ this changeThe first bad commit was found by bisecting
62cee1b15c..8e3e2980db. The fixed run applied this same one-line change on top of8e3e2980db; this branch is based on a newermain.Not covered here:
bailing_moe_v3.pyhas the samegetattr(config, "norm_topk_prob", False)default. I haven't checked whether its reference modeling also always renormalizes.Checklist
cc @ch-wan (#44904)
🤖 Generated with Claude Code
CI States
Latest PR Test (Base): ❌ Run #39671654604
Latest PR Test (Extra): ❌ Run #39671654736
Latest PR Test (AMD ROCm 10): ❌ Run #39671655084