Repository navigation
refactor(moe): restore local MoE composition and consolidate auxiliary losses - #1677
Merged
github-actions[bot] merged 1 commit intoNov 28, 2026
Merged
Conversation
Er1ckPang
requested review from
kisnwangg,
liuchongming74,
suteng,
yangzhenzhang02 and
yaoyifanx
as code owners
November 24, 2026 14:01
Er1ckPang
force-pushed
the
refactor/moe_1124
branch
from
November 25, 2026 02:08
dd64da8 to
1b38b67
Compare
Er1ckPang
force-pushed
the
refactor/moe_1124
branch
from
November 25, 2026 02:28
1b38b67 to
394e11e
Compare
Er1ckPang
force-pushed
the
refactor/moe_1124
branch
4 times, most recently
from
November 26, 2026 08:42
4d12dff to
487419a
Compare
Er1ckPang
force-pushed
the
refactor/moe_1124
branch
2 times, most recently
from
November 26, 2026 13:18
a51953e to
c6a8942
Compare
Contributor
Author
|
/check-pr |
Contributor
Author
|
/retest |
|
🔵 The pipeline #2302 is running. Please wait a moment... (Link) |
|
|
Contributor
Author
|
/retest |
|
🔵 The pipeline #2305 is running. Please wait a moment... (Link) |
|
|
Contributor
Author
|
/check-pr |
Contributor
Author
|
/retest |
|
🔵 The pipeline #2348 is running. Please wait a moment... (Link) |
|
|
…y losses Move auxiliary loss calculation and gradient scaling to components/losses/aux_loss.py so routing, attention, and the trainer can share the implementation. Remove the old exports from functional. Bring in the loss and MoE module-family changes from mindspore-ai#1652 needed for this refactor. Reuse the existing SwiGLU and grouped GEMM paths. (partial cherry-pick from commit 2e62f7b)
Er1ckPang
force-pushed
the
refactor/moe_1124
branch
from
November 28, 2026 02:12
4c83c69 to
8d99eeb
Compare
Contributor
Author
|
/check-pr |
Contributor
Author
|
/retest |
|
🔵 The pipeline #2357 is running. Please wait a moment... (Link) |
|
|
yangzhenzhang02
approved these changes
Nov 28, 2026
yaoyifanx
approved these changes
Nov 28, 2026
github-actions
Bot
merged commit Nov 28, 2026
81e4fa8
into
mindspore-ai:master
7 of 13 checks passed
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.
Paired: GitHub #1677 ↔ GitCode !2045
What type of PR is this?
/kind refactor
What does this PR do / why do we need it:
MoElayer by composingGateModule,GroupedExpertsModule, and an optionalSharedExpertModuledirectly from their configurations.hyper_parallel.components.losses.aux_loss. Move the four public scaling helpers fromfunctionaltolossesand update callers and documentation. Keep the Qwen3-MoE token-choice objective alongside the sequence-level objective.router.pyand expose SwiGLU precision and clamp settings for packed expert sources while preserving the default grouped GEMM path.ChunkedCausalLMLossbind a compatible native model head and optionally shift raw labels together with their loss mask when context parallelism is disabled.Which issue(s) this PR fixes:
Related to RFC #1593 and continues the MoE and EP module-family work in #1644.
What scenarios were tested, and what were the verification results(Function, performance, reliability, etc.):
Self-checklist:(Please check carefully,and mark an x in the [] brackets. We will review your completion status.)