Repository navigation
Pass the process-group collection to MTP's input projections - #7403
Merged
asolergi-nv merged 1 commit intoSep 17, 2026
Merged
Conversation
eh_proj, and e_proj/h_proj on the MHC path, were built with tp_group alone, so resolve_gtp_remat_group fell through to the MPU globals for their GTP axis. Non-MIMO runs got the right group by accident; a MIMO run never creates those globals, so the projections were silently built unsharded and replicated across every GTP peer. Pass pg_collection, which all three implementations already accept. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Deepak Narayanan <dnarayanan@nvidia.com>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
yashaswikarnati
approved these changes
Sep 16, 2026
Phlip79
approved these changes
Sep 16, 2026
jaredcasper
approved these changes
Sep 16, 2026
asolergi-nv
approved these changes
Sep 16, 2026
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/35176313472 |
Closed
xuwchen
added a commit
to xuwchen/Megatron-LM
that referenced
this pull request
Sep 22, 2026
…7403) Signed-off-by: Deepak Narayanan <dnarayanan@nvidia.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> (cherry picked from commit fb425d6) Ported by hand: this tree builds e_proj / h_proj / eh_proj directly rather than through a projection_kwargs dict, so pg_collection= is added at each of the three build sites; the test file is taken verbatim.
xuwchen
pushed a commit
to xuwchen/Megatron-LM
that referenced
this pull request
Sep 22, 2026
…7403) Signed-off-by: Deepak Narayanan <dnarayanan@nvidia.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> (cherry picked from commit fb425d6) Ported by hand: this tree builds e_proj / h_proj / eh_proj directly rather than through a projection_kwargs dict, so pg_collection= is added at each of the three build sites; the test file is taken verbatim.
xuwchen
pushed a commit
to xuwchen/Megatron-LM
that referenced
this pull request
Sep 22, 2026
…7403) Signed-off-by: Deepak Narayanan <dnarayanan@nvidia.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> (cherry picked from commit fb425d6) Ported by hand: this tree builds e_proj / h_proj / eh_proj directly rather than through a projection_kwargs dict, so pg_collection= is added at each of the three build sites; the test file is taken verbatim.
xuwchen
pushed a commit
to xuwchen/Megatron-LM
that referenced
this pull request
Oct 10, 2026
…7403) Signed-off-by: Deepak Narayanan <dnarayanan@nvidia.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> (cherry picked from commit fb425d6) Ported by hand: this tree builds e_proj / h_proj / eh_proj directly rather than through a projection_kwargs dict, so pg_collection= is added at each of the three build sites; the test file is taken verbatim. Signed-off-by: xuwenc <xuwenc@nvidia.com>
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.
What does this PR do?
MTP's input projections are the only weight-bearing modules in that path built without a
pg_collection:Everything else in the path passes the collection through:
mtp_model_layer, and the block's layers.enorm,hnormandfinal_layernormtake no group arguments at all, but they are 1-D norm weights and are not GTP-sharded anywhere.ColumnParallelLinearand the TE equivalents read their GTP axis withresolve_gtp_remat_group(pg_collection, is_expert). Withpg_collection=Nonethat skips theattr in vars(...)branch and falls back toProcessGroupCollection.use_mpu_process_groups(...):gtp_rematgroup, and the projection is sharded. The missing argument is invisible.examples/mimo/pretrain_mimo.pypassesskip_model_parallel_init=True, so the accessors run withcheck_initialized=Falseand returnNone. The projection is then silently built unsharded.Same silent-
Nonefallback as #7356, reached by a different route: there the top-level wrapper failed thevars()check, here the argument is simply never passed.Impact
eh_projis[2h, h]. Athidden_size=8192that is ~134M parameters held as a full replica on every GTP peer rather than one shard, so atgtp_weight_remat_size=64the layer costs 64 copies instead of one.e_projandh_projare[h, h]each and have the same problem on the MHC path.Gradient accounting stays correct: the parameters are not tagged
is_gtp_weight_remat, soparam_is_not_gtp_duplicatecounts them on GTP rank 0 only, which is the right answer for genuinely replicated tensors. The other visible consequence is that these projections' checkpoint shapes differ between a MIMO and a non-MIMO run at the same GTP size.Fix
Pass
pg_collectionon both paths. All three implementations already accept it:ColumnParallelLinear,TEColumnParallelLinearandInferenceColumnParallelLinear.The
eh_projline dates to9a60a18ef7("ultra refit", 2026-03-19), before GTP under MIMO existed, and the MHC path inherited the same shape, so this looks like an oversight rather than a deliberate exclusion.Tests
test_mtp_eh_proj_uses_custom_gtp_groupintests/unit_tests/generalized_tensor_parallel/test_gtp_custom_pgs.py, modelled on the neighbouringtest_gdp_projections_use_custom_gtp_group. The MPU keeps one GTP pairing while the layer is handed the other, so reading the globals yields a valid-but-wrong group and the assertion onweight.groupfails. The existingtest_gtp_mtp.pycases cannot catch this, since they run with MPU globals initialized to the same topology.The test covers the default
eh_projpath only;mhc_enabledis off by default and its projections take the identical fix.Pre-checks
black and isort clean. The test was not run locally; it needs 4 GPUs.
🤖 Generated with Claude Code