Repository navigation
Conversation
Originally NVIDIA#7487. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Yan Xu <yxu1@nvidia.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Yan Xu <yxu1@nvidia.com>
Originally NVIDIA#6259. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Yan Xu <yxu1@nvidia.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Yan Xu <yxu1@nvidia.com>
Originally NVIDIA#6293. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Yan Xu <yxu1@nvidia.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Yan Xu <yxu1@nvidia.com>
…groups Originally NVIDIA#8042. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Yan Xu <yxu1@nvidia.com>
Originally NVIDIA#8043. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Yan Xu <yxu1@nvidia.com>
Originally NVIDIA#8045. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Yan Xu <yxu1@nvidia.com>
Originally NVIDIA#8731. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Yan Xu <yxu1@nvidia.com>
Originally NVIDIA#6257. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Yan Xu <yxu1@nvidia.com>
Originally NVIDIA#6303. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Yan Xu <yxu1@nvidia.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Yan Xu <yxu1@nvidia.com>
Originally NVIDIA#8026. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Yan Xu <yxu1@nvidia.com>
Originally NVIDIA#8723. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Yan Xu <yxu1@nvidia.com>
Originally NVIDIA#8017. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Yan Xu <yxu1@nvidia.com>
Originally NVIDIA#8039. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Yan Xu <yxu1@nvidia.com>
Originally NVIDIA#8049. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Yan Xu <yxu1@nvidia.com>
Originally NVIDIA#8037. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Yan Xu <yxu1@nvidia.com>
Originally NVIDIA#8048. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Yan Xu <yxu1@nvidia.com>
Originally NVIDIA#8726. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Yan Xu <yxu1@nvidia.com>
Originally NVIDIA#8727. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Yan Xu <yxu1@nvidia.com>
Originally NVIDIA#8740. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Yan Xu <yxu1@nvidia.com>
Originally NVIDIA#8742. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Yan Xu <yxu1@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. |
This was referenced Nov 3, 2026
This was referenced Nov 3, 2026
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.
This PR moves the training loop's I/O onto the model's
ProcessGroupCollection.pretrain()builds one collection and passes it to DDP, the schedules, batch loading, the data loaders and checkpoint save and load. The GPT and ModelOpt spec builders take the collection's pipeline rank. A model built on its own grid, such as an RL inference model or a distillation teacher, then loads, builds and checkpoints the right stage on the right ranks. On the standard grid, results are unchanged. It consolidates six draft PRs from #6307 without changes. Each member is one commit, so review commit by commit. It does not depend on any other unit. It lands after the optimizer unit #8889, which also editstraining.pyandcheckpointing.py, and before the FP8/FP4 amax, CUDA graphs and 1F1B unit #8893, which also editstraining.py.Review
The unit's own commits: Connor-XY/Megatron-LM@eb768e2...74906a8
The full PR diff also includes #7487, #6259, #6293, #6257, #6303, the optimizer unit #8889 and the core process-group API unit #8890 until they merge.
Members
pretrain()builds the collection once and passes it to every DDP wrapper, the optimizer (when Gloo groups are off), schedule selection, the schedules with aP2PCommunicatorover its PP group, and the parameter norm. It also adds the all-gather groups to the collection.gpt_builder,GPTModelBuilder, the ModelOpt builder, the distillation teacher and the multimodal example pass their collection's pipeline rank to the GPT block spec builders, anddefault_layer_spectakes an optionalpp_rank.get_gpt_modelopt_spectakesvp_stageandpp_rankand forwards them to the layer-count and offset helpers. Its builder edits are identical to Pass the model's pipeline rank to spec builders outside core #8048's, so the commit keeps one copy.wrap_data_iteratorraisesValueErrornaming each missing group instead of asserting, and rejects aNonecollection.save_checkpointandload_checkpointtakepg_collection, defaulting to the model's own collection, for shard names, RNG state, replica ids, writers and fully parallel save and load groups.get_batchinpretrain_gpt.py,pretrain_hybrid.pyandpretrain_vlm.pyand the pretraining data loaders read their TP, PP, CP and DP groups from the collection.Behavior changes for callers
--create-all-gather-groupnow takes effect underpretrain(). All-gather groups whose ranks differ from the data-parallel groups are rejected.wrap_data_iteratorraisesValueErrorwhere it raisedAssertionError, orAttributeErrorfor aNonecollection.get_batchraiseValueErrorfor a collection withcp=None.pretrain()always setscp.dpandexpt_dp, as the training loop already did. With expert GTP remat, the fully parallel expert save and load group becomesexpt_dp.rng_state.(pp, tp)instead of(0, 0). A strict load into a different TP/PP layout fails on the missing key._MPU_*setters. External converters that emulate stages with those setters must also set their stand-in pipeline group's rank, astools/checkpoint/loader_base.pynow does.account_for_embedding_in_pipeline_splitoraccount_for_loss_in_pipeline_split, the ModelOpt spec no longer gives the first or last chunk one extra layer.Teams
core-adlr, core-nemo, training, datasets, post-training. Needs the
determinism-exemptlabel:megatron/training/utils/common_utils.pyis a registered kernel file, and only its stage predicate changes.Testing
Each member was GPU-tested against its base before consolidation. The consolidated chain (every unit in landing order, on current main) was run against main on 4 GPUs: 258 test files, and no test fails on the chain that passes on main. Tests in 28 files fail on both, mostly tests written for 8 GPUs, and one file times out on both.
🤖 Generated with Claude Code