[Dev] Fix full CUDA graph capture reverted by pull main#4792
Open
Victarry wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
/ok to test 05fc772 |
BestJuly
approved these changes
May 14, 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
torch.empty(1, dtype=torch.int64, device=dev).fill_(n).torch.tensor(n, dtype=torch.int64, device=dev), which can perform a CPU-to-CUDA copy and fails during full-iteration CUDA graph capture when the CPU source is not pinned.f9f9fe415(Add minor tweaks to support full-iter CG capture). The nightly pull-main chore: nightly sync main into dev (10_05_2026) #4716 post-merge commitcd2001de7(chore: post-merge fixes for nightly sync main into dev (28_04_2026)) took main'smegatron/training/utils.pyand reverted this line back totorch.tensor(...).Test plan
python -m py_compile megatron/training/utils.pyCHECK_ONLY=true BASE_REF=dev uv run --project /Users/denliu/Projects/repos/agentic-mcore-dev --extra mcore-lint -- bash tools/autoformat.shmegatron/coreortestsPython files changed.umb-b300-003) withlocal/b300-cudnnfe1221:latest; reached iteration 100, printed validation loss, and no longer hit the CUDA graph capture error fromtorch.tensor(n, device=dev).