Support old and new MCore CUDA graph APIs#3546
Merged
Merged
Conversation
7857f39 to
440c0b3
Compare
Contributor
|
/ok to test 440c0b3 |
Signed-off-by: Robin Zhang <robinz@nvidia.com>
440c0b3 to
6815c35
Compare
Contributor
|
/ok to test 6815c35 |
yaoyu-33
approved these changes
Apr 28, 2026
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
Add a small CUDA graph compatibility layer so Megatron-Bridge can work with both the old MCore
cuda_graph_scopeAPI and the newer split API usingcuda_graph_modulespluscuda_graph_impl="full_iteration". (MCore PR NVIDIA/Megatron-LM#4293)This updates Bridge call sites that inspect CUDA graph scope directly to go through the compatibility helpers, including full-iteration training/eval paths, local CUDA graph manager creation, delayed wgrad validation, and Qwen3-VL vision CUDA graph config propagation.
Motivation
Megatron-LM is refactoring CUDA graph configuration away from overloaded
CudaGraphScopevalues. Bridge still needs to support existing MCore releases while also remaining compatible with the new API shape.Validation
git diff --checkpython -m py_compile src/megatron/bridge/models/qwen_vl/modelling_qwen3_vl/transformer_config.py tests/unit_tests/models/qwen_vl/modelling_qwen3_vl/test_qwen3_vl_transformer_config.pyFull pytest was not run locally because dependency setup fails while building
nvidia-resiliency-extwithout a CUDA installation /CUDA_PATHin this environment.