Repository navigation
Conversation
Probe the installed PyTorch CUDAGraph registration API once and skip explicit per-graph registration only when it reports that registration is deprecated and is now a no-op. Preserve the existing path on builds that still require registration. Signed-off-by: RunguoLi <li19107254665@gmail.com>
Signed-off-by: RunguoLi <li19107254665@gmail.com>
Signed-off-by: RunguoLi <li19107254665@gmail.com>
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.
Description
Fixes #3645.
PyTorch builds that auto-register CUDA graph RNG state expose
CUDAGraph.register_generator_state()as a deprecated no-op. TransformerEngine currently treats method availability as proof that explicit
registration is required, so every forward, backward, and wgrad graph emits
warnings. Pipeline-parallel training multiplies that warning volume across
layers and microbatches, and the resulting stderr traffic can delay graph
capture enough to trip a distributed watchdog.
This change probes the installed implementation once per process by capturing a
tiny random operation and checking whether replay advances the default CUDA
generator without explicit registration. Builds that auto-register RNG state
advance across replays and skip the per-graph registration loop. Builds that
still require explicit registration, including the NGC 26.09 case noted in the
issue, retain the existing behavior. The probe restores the original generator
state. A unit test covers both branches.
Type of change
Changes
from PyTorch's deprecated no-op implementation.
builds that still need it.
Validation
Validated on an NVIDIA RTX A6000 with PyTorch 2.14.1+cu130 and CUDA 13.0.
The affected PyTorch build emitted the expected C++ deprecation warning outside
Python's warning machinery:
The behavioral probe correctly inferred that explicit registration is
unnecessary. RNG advanced across graph replays, and backward remained finite:
The focused capability test passed both legacy and auto-registration cases:
qa/L0_license/test.shand the changed-file pre-commit checks also pass.This draft was prepared with AI assistance. The human author must review the
complete diff and validation results before marking it ready for maintainer
review.