-
Notifications
You must be signed in to change notification settings - Fork 633
Fix on TE to support Mcore Vision Encoder CUDA Graph #2657
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix on TE to support Mcore Vision Encoder CUDA Graph #2657
Conversation
Signed-off-by: Lifu Zhang <lifuz@login-lyris02.lyris.clusters.nvidia.com>
for more information, see https://pre-commit.ci
Greptile OverviewGreptile SummaryThis PR updates Concretely, it:
These changes fit into TE’s Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant U as User code
participant MG as make_graphed_callables
participant WU as Warmup
participant CG as CUDAGraph
participant AG as Autograd
U->>MG: call(modules, sample_args/kwargs)
MG->>WU: run warmup func(*args, **kwargs)
WU->>WU: flatten outputs (may include None)
opt training
WU->>AG: backward(outputs requiring grad)
Note over WU,AG: PR skips None outputs
end
MG->>CG: capture forward graph
CG->>CG: store static_outputs
opt training
MG->>CG: capture backward graph
CG->>AG: backward(non-None outputs requiring grad)
end
U->>MG: replay graphed callable
MG->>CG: fwd_graph.replay()
MG-->>U: return detached tensors + None leaves
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 file reviewed, no comments
|
/te-ci pytorch |
ptrendx
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the one small comment LGTM.
Signed-off-by: Lifu Zhang <lifuz@login-lyris02.lyris.clusters.nvidia.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 file reviewed, no comments
Description
This PR is needed to support vision encoder CUDA Graph.
Related MLM PR: NVIDIA/Megatron-LM#3293, NVIDIA/Megatron-LM#3294
Fixes # (issue)
Type of change
Changes
Please list the changes introduced in this PR:
Checklist: