Repository navigation
[Bugfix] Preserve fp32 MoE router precision across model gates - #38719
seongyun1104 wants to merge 1 commit into
Conversation
|
@b8zhong this implements the two independent model-level precision fixes you called out in #38695: keeping correction bias fp32 in MiMo-V2/Ernie4/Kimi Linear, and removing the fp32-router-logit downcast in Bailing/Bailing Linear/LLaDA2. @Fridge003 @ishandhanani @Qiaolin-Yu could one of the NV/model-specific optimization oncalls review the scope and contract? The patch is limited to the six model gates plus one registered CPU regression test. All changed files pass the full local pre-commit hook set, bytecode compilation, and The current red matrix entries are PR-gate authorization failures and the registered CPU test was skipped. If the direction looks right, could a maintainer authorize |
6647674 to
2e7319a
Compare
2e7319a to
22ad29c
Compare
|
@b8zhong I rebased this PR onto current
The resulting patch is 9 insertions and 26 deletions and remains separate from the shared |
22ad29c to
9d1bc30
Compare
|
Rebased onto current main at 961bcf4. The only conflict was LLaDA2: #31768 has independently landed the same router-output precision contract, so I dropped that hunk rather than duplicate it. The PR is now limited to the five still-unfixed model paths (Bailing MoE, Bailing MoE Linear, Ernie4, Kimi Linear, and MiMo-V2). Validation after rebase: Python bytecode compilation, repository-pinned pre-commit on all changed files, and git diff --check all pass. |
9d1bc30 to
f4b4bee
Compare
|
Rebased onto current main at Post-rebase validation: repository pre-commit on all five files, Python bytecode compilation, and |
Motivation
Addresses the independent model fixes called out in #38695.
Several MoE models still discard router precision at model-specific boundaries:
These paths either collapse checkpoint bias values or throw away the fp32 router output immediately before expert selection.
LLaDA2 originally had the same router-output downcast, but #31768 fixed that path independently. The current PR therefore leaves LLaDA2 untouched.
Modifications
e_score_correction_biasparameters in fp32 for MiMo-V2, Ernie4, and Kimi Linear.The patch is limited to five model files. It does not introduce a shared
RouterGate, add a kernel, or change expert computation.Accuracy Tests
No new unit test is included, following the maintainer guidance in #38695 that these model-file fixes do not require one. The changes only preserve the dtype already selected for the correction bias or router GEMM output.
Speed Tests and Profiling
Not applicable. No kernel is added. The Bailing paths remove a dtype-conversion operation when the router is configured for fp32.
Test Plan
main(961bcf481d).pre-commit run --files <all changed files>.git diff --check.Checklist
CI States
Latest PR Test (Base): ❌ Run #38344434492
Latest PR Test (Extra): ❌ Run #38344434204
Latest PR Test (AMD ROCm 10): ❌ Run #38344434321