Add MoE load balancing loss to distillation#3679
Open
JamesDeng42 wants to merge 1 commit intomainfrom
Open
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
69341c6 to
414e2f0
Compare
ajkv-google
reviewed
Apr 20, 2026
vlad-karp
reviewed
Apr 20, 2026
gagika
reviewed
Apr 20, 2026
414e2f0 to
9628440
Compare
vlad-karp
reviewed
Apr 21, 2026
Collaborator
vlad-karp
left a comment
There was a problem hiding this comment.
please address the comment
ae5c4cf to
74012ee
Compare
gagika
reviewed
Apr 21, 2026
74012ee to
4d546e3
Compare
gagika
reviewed
Apr 22, 2026
ccd17dc to
2a27030
Compare
2a27030 to
2833dab
Compare
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.
Description
This PR introduces support for Mixture of Experts (MoE) load balancing loss during the distillation workflow.
Key Changes
minimizes it.
whenever load_balance_loss_weight > 0.0 to ensure NNX variables can successfully write to the state.
Tests
Added "distill/moe_lb_loss" to the expected metrics keys in the test suite to prevent regressions in train_distill_test.py.
Checklist
Before submitting this PR, please make sure (put X in square brackets):
gemini-reviewlabel.