[Dev] feat(moe): Support placing MTP layers into standalone stages - #1916
Merged
Conversation
Contributor
Author
|
/ok to test 4a342ec |
BestJuly
force-pushed
the
lit/mtp_layer_standalone_dev
branch
from
October 28, 2025 08:22
4a342ec to
ef3337c
Compare
BestJuly
force-pushed
the
lit/mtp_layer_standalone_dev
branch
from
October 28, 2025 08:29
ef3337c to
3e5cd0a
Compare
move output layer outside mtp block support mtp layer for --pipeline-model-parallel-layout run test with mtp on the second last vpp stage, with the following error message. can run, but need to check lm loss and mtp loss with baseline. fix some issue by refering to MR2996 Signed-off-by: Li Tao <lit@nvidia.com>
Signed-off-by: Li Tao <lit@nvidia.com>
Signed-off-by: Li Tao <lit@nvidia.com>
…apes later Signed-off-by: Li Tao <lit@nvidia.com>
Signed-off-by: Li Tao <lit@nvidia.com>
Signed-off-by: Li Tao <lit@nvidia.com>
Signed-off-by: Li Tao <lit@nvidia.com>
Signed-off-by: Li Tao <lit@nvidia.com>
Signed-off-by: Li Tao <lit@nvidia.com>
Signed-off-by: Li Tao <lit@nvidia.com>
Signed-off-by: Li Tao <lit@nvidia.com>
Signed-off-by: Li Tao <lit@nvidia.com>
Signed-off-by: Li Tao <lit@nvidia.com>
BestJuly
force-pushed
the
lit/mtp_layer_standalone_dev
branch
from
October 30, 2025 01:31
76f76ee to
786ec1d
Compare
Contributor
Author
|
Pipeline 37554648 triggered in gitlab for functional test validation. |
ko3n1g
approved these changes
Oct 30, 2025
6 tasks
48 tasks
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.
What does this PR do ?
Support placing MTP to a standalone stage, e.g., MTP in the 2nd last VPP stage for better VPP balance.
PR for main branch: PR2136
Highlights
This document outlines the design of a new MTP (Multi-Token Prediction) standalone feature. This feature allows MTP layers to be placed into a standalone VPP (Virtual Pipeline Parallelism) stage, rather than being confined to the last VPP stage.
Key Benefits:
Considerations:
Design idea
We split MTP computation into two parts
The advantage is that we put the MTP loss computation as main, so for the untie embedding part, the MTP loss can use exactly the same code path of the lm loss as they are in the same vpp stage, which is simpler than putting MTP loss calculation in the same vpp stage as MR#2996 so that we can avoid bugs related to this. With the new design, the DSv3 TFLOPs will also be compatible with the #2996 one which included in the 0.13 EA branch.We divide MTP computation into two parts: output head computation and others. This approach offers the advantage of treating MTP loss computation as primary. Consequently, for the untied embedding, the MTP loss can utilize the exact same code path as the LM loss, as they are within the same VPP stage. This simplifies the process compared to placing MTP loss calculation in the same VPP stage as MR#2996, thereby mitigating potential bugs. Furthermore, this new design ensures DSv3 TFLOPs compatibility with the #2996 version included in the 0.13 EA branch.
Perf and results
Perf
Convergence
On full DSv3
(Real training mode) Almost overlapped with the main branch settings for the metrics which is related to convergence.
Deterministic correctness check
We validate the correctness in mainly two parts (when using different pp layout, can be bitwise aligned when manually disabling grad clipping)