Standardize misc graph interface - #4485
Merged
Merged
Conversation
|
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. |
Contributor
Author
|
/claude review |
mathemakitten
approved these changes
Apr 28, 2026
tdene
force-pushed
the
tde/refactor_mtp_graphs
branch
from
April 28, 2026 19:58
e7b3abe to
8bf775d
Compare
Co-authored-by: mathemakitten <helen.ngo14@gmail.com>
tdene
force-pushed
the
tde/refactor_mtp_graphs
branch
from
April 29, 2026 03:02
8bf775d to
a1a2fdf
Compare
santhnm2
approved these changes
Apr 29, 2026
Comment on lines
1103
to
1161
| @@ -1126,11 +1144,18 @@ def teardown_method(self, method): | |||
| CudaGraphManager.global_mempool = None | |||
| Utils.destroy_model_parallel() | |||
|
|
|||
| @pytest.mark.parametrize( | |||
| "make_module", | |||
| [ | |||
| pytest.param(_make_simple_module, id="nn_module"), | |||
| pytest.param(_make_simple_non_module, id="plain_class"), | |||
| ], | |||
| ) | |||
| @torch.inference_mode() | |||
| def test_inline_capture_matches_eager(self): | |||
| def test_inline_capture_matches_eager(self, make_module): | |||
| """Inline-captured graph output must match eager execution.""" | |||
| config = self._make_config() | |||
| module = _SimpleModule(config).cuda().eval() | |||
| module = make_module(config) | |||
|
|
|||
| # Get eager reference before wrapping | |||
| x = torch.randn(4, config.hidden_size, device="cuda") | |||
Contributor
There was a problem hiding this comment.
Can we use the existing model building logic for this? Seems more rigorous than a dummy model.
kvareddy
approved these changes
Apr 29, 2026
tdene
enabled auto-merge
April 29, 2026 16:51
shanmugamr1992
approved these changes
Apr 29, 2026
Contributor
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/25129217585 |
yangbofun
pushed a commit
to xlm-research/Megatron-LM
that referenced
this pull request
May 22, 2026
Co-authored-by: mathemakitten <helen.ngo14@gmail.com>
yhgalaxy
pushed a commit
to yhgalaxy/Megatron-LM
that referenced
this pull request
Jun 17, 2026
Co-authored-by: mathemakitten <helen.ngo14@gmail.com> Signed-off-by: yhgalaxy <yhgalaxy@outlook.com>
jon-barker
pushed a commit
to jon-barker/Megatron-LM
that referenced
this pull request
Jul 10, 2026
Co-authored-by: mathemakitten <helen.ngo14@gmail.com> Signed-off-by: Jon Barker <jbarker@aws-cmh-slurm-1-vscode-02.cm.cluster>
terminator123
pushed a commit
to 021ai/Megatron-LM
that referenced
this pull request
Aug 3, 2026
Co-authored-by: mathemakitten <helen.ngo14@gmail.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.
What does this PR do ?
#4425 added syntactic sugar to CudaGraphManager to make it easy to graph arbitrary, non-layer, torch ops which may be keyed on things other than
padded_batch_dimensions. This common sugar will be shared by several pieces of upcoming code.In parallel, #4260 added similar syntactic sugar, but special-cased specifically to MTP CUDA Graphs. The implementation is very similar to that of #4425.
This PR subsumes MTP CUDA graphs into the same sugar as #4425, reconciling #4260's implementation with that of other planned work.
Issue tracking
For PRs from open-source community contributors:
Linked issue:
Contribution process
Pre-checks
Code review
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!
All PRs start as draft. If you open a non-draft PR, it will be automatically converted to draft.
Step 1: Mark PR as "Ready for Review"
.github/CODEOWNERS.Final Review might get declined if these requirements are not fulfilled.
Step 2: Final Review
For PRs that change
megatron/core, once all expert reviewers have approved, theFinal Reviewlabel is applied automatically and final reviewers are assigned.For PRs outside
megatron/core, this step is skipped.Step 3: Approved
Once all required reviewers have approved, the
Approvedlabel is applied automatically.Merge
Any member of mcore-engineers will be able to merge your PR.
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.