Repository navigation
feat(moe): Support placing MTP layers into standalone stages #2136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ericharper
merged 22 commits into
NVIDIA:main
from
BestJuly:lit/mtp_layer_standalone_main
Jan 14, 2026
Merged
Changes from 14 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
48792b7
Squash following code changes (commits):
shifangx 259cd21
Fix error when saving checkpoints
BestJuly d515cb0
fix hang issue with torch.distributed.batch_isend_irecv
shifangx ebee833
add conditions to communicate p2p shapes, will switch to calculate sh…
BestJuly 813985d
make it compatible with 1f1b
BestJuly cebb164
support mtp standalone in 1f1b
Wohox 9b61229
fix duplicated final layer norm in mtp combine
Wohox e650d5a
formatting
BestJuly e0dae54
update mtp offset in 1f1b callcables
Wohox db1435f
fix 1f1b overlap ut & remove final layernorm in postprocess
Wohox 29e7ea0
fix ut failure: no mtp_standalone attribute
BestJuly 8947471
add UT, fix pipeline failure and add document
BestJuly 41e0bee
Update copyright
BestJuly c1022a7
format
BestJuly 319390b
remove abundant argument in BlendedMegatronDatasetBuilder
BestJuly 95031fc
Merge branch 'main' into lit/mtp_layer_standalone_main
BestJuly e3116bb
Merge branch 'main' into lit/mtp_layer_standalone_main
BestJuly 5d3f862
Merge branch 'main' into lit/mtp_layer_standalone_main
BestJuly a3fa990
fix missing layernorm
Wohox ae43919
Merge branch 'main' into lit/mtp_layer_standalone_main
BestJuly 50d34a3
Address review comments
BestJuly 69bf9bf
Merge branch 'main' into lit/mtp_layer_standalone_main
BestJuly File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed here? We are not even passing the
vp_stagewhen calling theBlendedMegatronDatasetBuilderhttps://github.com/BestJuly/Megatron-LM/blob/c1022a7696393759729dbb8da3ff7144f27df634/pretrain_gpt.py#L230-L233
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am also confused. Is it because we want to make sure we don't build the datasets on more than one vp stage per rank?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be wrongly added when resolving conflicts, as I find vp_stage has been included in
partial(is_dataset_built_on_rank, vp_stage=vp_stage). Will correct this.