Implement Quantile Balancing in MoE - #5349
Merged
Merged
Conversation
Contributor
Author
|
/claude review |
Contributor
Author
|
/ok to test b4dde89 |
Mellonta
force-pushed
the
haoranz
branch
2 times, most recently
from
June 16, 2026 00:59
afeed9a to
4b2f1d7
Compare
Contributor
Author
|
/ok to test 4b2f1d7 |
Contributor
Author
|
/ok to test 2c1fadf |
deepakn94
approved these changes
Jul 13, 2026
Phlip79
approved these changes
Jul 13, 2026
yaoyu-33
approved these changes
Jul 13, 2026
Contributor
Author
|
/ok to test 6e0ef96 |
Contributor
Author
|
/ok to test c1123ab |
Contributor
Author
|
/ok to test f1dddce |
Signed-off-by: Haoran Zhang <haoranz@nvidia.com>
Contributor
Author
|
/ok to test cd4aed8 |
Contributor
Author
|
Also fixes a pre-existing order-dependent hang in |
Contributor
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/29379425584 |
Contributor
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/29381411801 |
This was referenced Aug 17, 2026
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.
Adding Quantile Balancing (QB) MoE.
Standard MoE load balancing adds an auxiliary loss whose gradient nudges the router toward uniform expert usage. QB instead enforces balance directly through a per-expert routing bias, with no auxiliary loss and no gradient contribution, load balancing is handled entirely by a bias that is updated once per global batch from a quantile estimate. From marin's report: https://openathena.ai/blog/quantile-balancing/
Usage
Verified on 2B models