Support multimodule pipelining in 1F1B schedule#3129
Merged
Conversation
- Rename ProcessGroupCollectionWrapper to MultiModuleProcessGroupCollection - Rename language_model field to language_model_module_name for clarity - Add language_model_module_name param to backward_step_multimodule - Use functools.partial to bind param, keeping signature consistent - Add type hints to _ensure_3d_tensor and _restore_tensor_shape - Move is_multimodule check earlier for validation and backward selection
Contributor
|
/ok to test 2d7c176 |
yaoyu-33
reviewed
Feb 2, 2026
6 tasks
yaoyu-33
reviewed
Feb 4, 2026
yaoyu-33
reviewed
Feb 4, 2026
Contributor
|
/ok to test 6542743 |
Replace num_warmup_microbatches property on P2PCommunicator and MultiModulePipelineCommunicator with total_stages and current_stage properties. Compute num_warmup_microbatches in schedules.py instead. Addresses review feedback from jaredcasper on PR NVIDIA#3129. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
# Conflicts: # megatron/core/pipeline_parallel/schedules.py
… tests - Add HyperCommGrid.destroy() and BridgeCommunicator.destroy_broadcast_pgs() to clean up PGs created during tests - Add expt_dp grid dimension and cache embedding PGs to prevent creation of undestroyed PGs in DDP init and add_embedding_groups - Reuse pg_collection across finalize_model_grads calls instead of rebuilding from scratch each iteration - Add teardown_method to bridge/communicator/schedules test classes
Contributor
Author
|
/ok to test edc8159 |
embd, pos_embd, pp, dp_cp are already validated in finalize_model_grads. Only tp and cp are directly used in the schedule functions.
2ad399d to
92b65d1
Compare
Contributor
Author
|
/ok to test 92b65d1 |
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Contributor
Author
|
/ok to test 78ee58c |
jaredcasper
approved these changes
Mar 17, 2026
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/23229957578 |
ilml
added a commit
to ilml/Megatron-LM
that referenced
this pull request
Mar 20, 2026
…edule (NVIDIA#3129) New files: - tests/unit_tests/pipeline_parallel/test_multimodule_schedules.py
ilml
added a commit
to ilml/Megatron-LM
that referenced
this pull request
Mar 20, 2026
These test files import from existing modules that are modified in Phase 2: - test_rmsnorm_residual_fusion.py: imports TEFusedResidualRMSNorm (added in NVIDIA#3384) - test_mup.py: imports get_mup_config_overrides (added in NVIDIA#3058) - test_multimodule_schedules.py: imports MultiModuleProcessGroupCollection (added in NVIDIA#3129) They will be re-added in Phase 2 when the corresponding code changes land. Made-with: Cursor
copy-pr-bot Bot
pushed a commit
that referenced
this pull request
Mar 24, 2026
Resolve merge conflicts in 8 files after syncing fork with upstream (including merged #3129). Take main's improvements for multimodule communicator, p2p_communication, process_groups_config, and schedule tests. Keep both non-colocated PP changes and main's new features. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This was referenced Apr 13, 2026
yangbofun
pushed a commit
to xlm-research/Megatron-LM
that referenced
this pull request
May 22, 2026
Signed-off-by: ykarnati <ykarnati@nvidia.com> Co-authored-by: Dmytro Pykhtar <37850217+dimapihtar@users.noreply.github.com> Co-authored-by: Shifang Xu <shifangx@nvidia.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
Adds support for multi-module pipeline parallelism (encoder + LLM) in the 1F1B schedule.
Changes:
MultiModuleProcessGroupCollectionfor managing process groups across modules{module_name: tensor}in forward/backwardbackward_step_multimoduleto handle backward for multimodule casesContribution process
flowchart LR A[Pre-checks] --> B[PR Tests] subgraph Code Review/Approval C1[Expert Review] --> C2[Final Review] end B --> C1 C2 --> D[Merge]Pre-checks
Core 0.8)Code review
The following process is enforced via the CODEOWNERS file for changes into
megatron/core. For changes outside ofmegatron/core, it is up to the PR author whether or not to tag the Final Reviewer team.For MRs into `main` branch
Feel free to message or comment the @mcore-oncall to help accelerate your merge into main. The less complex your PR is, the faster it will be approved and merged!
(Step 1): Add PR label
Expert Review(Step 2): Collect the expert reviewers reviews
Expert Reviewlabel when your PR is ready for review.Final Review might get declined if these requirements are not fulfilled.
(Step 3): Final Review
Final Reviewlabel(Optional Step 4): Cherry-pick into release branch
If this PR also needs to be merged into
core_r*release branches, after this PR has been merged, selectCherry-pickto open a new PR into the release branch.For MRs into `dev` branch
The proposed review process for `dev` branch is under active discussion.MRs are mergable after one approval by either
eharper@nvidia.comorzijiey@nvidia.com.Merging your PR
Any member of core-adlr and
core-nemowill be able to merge your PR.