Repository navigation
feat(training): wire generalized tensor parallelism - #5569
Merged
Merged
Conversation
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Contributor
Author
|
/ok to test 008670b |
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Contributor
Author
|
/ok to test 40b50b4 |
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Contributor
Author
|
/ok to test 8edbc78 |
Contributor
Author
|
/ok to test 8edbc78 |
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Contributor
Author
|
/ok to test 152fced |
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Contributor
Author
|
/ok to test fdc651c |
11 tasks done
Contributor
Author
|
/ok to test 54bbc27 |
cuichenx
reviewed
Aug 26, 2026
cuichenx
left a comment
Contributor
There was a problem hiding this comment.
Looks good.
Several question that cross my mind:
- Do we have GTP on/off training experiments and verify loss identical?
- Is GTP supported for conversion? if not should we explicitly disallow it.
This branch was previously 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.
Summary
This is Stage 1 of #5434. It intentionally keeps GTP implementation ownership in Megatron Core.
Validation
Pinned revisions:
064b77054eed990778d7ab4f092083449445b76414346b65a2d0790e451919858f7771078105c5f0c280e7cb192f57a182a6aab64d3d6bd40d933d922.13.0a0+8145d630e8.nv26.6, Megatron Core0.20.0+14346b65a, Transformer Engine2.19.0.dev0Targeted results:
105 passedacross GTP, distributed initialization, setup, process-group wiring, and decentralized-group unit tests2, 4, 6, and no skipped/NaN iterationsuv run --active --no-sync pre-commit run --all-filesReproducible Bridge/MLM scalar comparison
Both runs used a 2-layer GPT (hidden size 128, FFN size 256, 4 heads, sequence length 64, vocabulary size 128), TP1/PP1/CP1/GTP2, BF16, mock data, micro/global batch sizes 1/2, seed 1234, dropout 0, untied embeddings/output weights, no linear bias, attention softmax in FP32, weight decay 0.01, clip grad 1.0, and the same three-step cosine schedule (
3e-4,1.65e-4,3e-5; minimum3e-5; one warmup step). The optimizer was Adam with betas 0.9/0.999 and epsilon 1e-8, without distributed optimizer.Bridge command:
Megatron-LM command:
GTP is enabled from the same source setting in both frontends: Bridge sets
tensor_model_parallel_size=1andtensor_parallel_num_weight_shards=2on its model config; MLM uses the corresponding two CLI flags. MCore derivesgtp_weight_remat_size = tensor_parallel_num_weight_shards / tensor_model_parallel_size = 2; the derived field is not set directly.The step-2 absolute loss difference is
0.016579, or0.342268%relative to MLM. It reproduced across reruns. Matching dropout and FP32-softmax settings aligned step 1 and the displayed grad norms but did not remove step 2. Both frontends reduce token-summed loss and token counts over the GTP-inclusive data-distribution group. Disabling cross-entropy fusion did not remove the Bridge value, and a matched SGD control retained the same step-2 difference, so it is not explained solely by Adam state. A GTP-off run changes data topology and is not a clean isolation control.These are rounded, reported scalar observations only. No per-rank inputs, logits, tensors, parameter deltas, per-parameter gradients, or optimizer slots were captured, so this does not establish bitwise/tensor parity or rule out transient state drift. The exact source of the step-2 discrepancy remains unresolved. The checked-in functional test therefore asserts the intended GTP topology, nonempty GTP parameter classification, progress, and finite results; it is deliberately not a numerical-parity assertion.
Deferred
HyperCommGridGTP support2026-08-17 latest-main refresh
main(46c42552bcb7ae6be22d7e117de0776775371d48) normally through DCO-signed merge commits, with final headfdc651cab1362d760fd6027c8fc7ee55c4df7764provider finalize -> configure GTP -> build distributed model -> classify GTP chains, preserving current-main provider finalization and the Stage 1 GTP lifecycle; a later main-only chat-processing commit merged without conflicts or GTP-path overlap4.860444,4.827285,4.781815), grad (2.126,2.480,2.413), LR (3e-4,1.65e-4,3e-5), and consumed samples (2,4,6)4.860444,4.843864,4.781815) with the same displayed grad/LR/sample sequence; the step-2 loss difference remains0.016579(0.342268%) and unexplained, so this remains scalar smoke evidence rather than bitwise or tensor-parity evidence