Repository navigation
Conversation
dinodeep
requested review from
A9isha,
NuojCheng,
RissyRan,
SurbhiJainUSC,
abhinavclemson,
aireenmei,
bvandermoon,
darisoy,
dipannita08,
gagika,
gobbleturk,
hengtaoguo,
huytransformer,
igorts-git,
jiangjy1982,
khatwanimohit,
michelle-yooh,
parambole,
richjames0,
shralex,
shuningjin,
vipannalla,
xibinliu and
zxhe-sean
as code owners
October 1, 2026 13:51
dinodeep
marked this pull request as draft
October 1, 2026 13:51
There was a problem hiding this comment.
Code Review
This pull request adds support for hash routing and routed bias updates in TransformerEngine MoE blocks, particularly for DeepSeek-V4. It introduces the moe_from_routing path when hash routing is enabled, handles routed bias updates, and adds a corresponding integration test. However, a critical issue was identified where input_ids (which is required for hash routing) is not forwarded by the caller DeepSeekMoELayer in src/maxtext/models/deepseek.py to self.mlp_op or self.DeepSeekMoeBlock_0, which will cause a runtime ValueError.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
dinodeep
force-pushed
the
dinodeep/te-moe-block-dsv4-support
branch
2 times, most recently
from
October 1, 2026 23:06
335a81d to
852bc73
Compare
dinodeep
force-pushed
the
dinodeep/te-moe-block-dsv4-support
branch
from
October 4, 2026 16:55
852bc73 to
1791d6c
Compare
dinodeep
force-pushed
the
dinodeep/te-moe-block-dsv4-support
branch
3 times, most recently
from
October 22, 2026 21:08
a97e92a to
0e1ced1
Compare
dinodeep
force-pushed
the
dinodeep/te-moe-block-dsv4-support
branch
from
October 22, 2026 22:01
0e1ced1 to
7c100e1
Compare
This branch has not been deployed
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 integrates the updated support for TE MoE block for supporting DSv4. It does the following
moe(...)call so that hash routing layers can correctly use TE MoE blockrouted_bias_update_rateself.tid2eidfrom zero array to randomly initialized experts, preventing (1) a single token going to the same expert multiple times (2) having a balanced distribution of tokens to experts (3) prevent infinite gradients when all tokens go to the same expertThis is a useful change so that TE MoE block can work with DSv4 out of the box.
Tests
Tested by integrating a end-to-end train test to validate full execution.
Checklist
Before submitting this PR, please make sure (put X in square brackets):
gemini-reviewlabel.