-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Enable training cudagraphs for RL #2452
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
Merged
mathemakitten
merged 25 commits into
NVIDIA:main
from
mathemakitten:helenn-training-graphs-rl
Jan 14, 2026
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
8ae06df
Turn on training cudagraphs for RL
mathemakitten 97266e3
Add data pointer comparison to tensors in ArgMetadata
mathemakitten 8cd1808
Merge branch 'main' into helenn-training-graphs-rl
mathemakitten e59966f
persist cudagraphs
mathemakitten 836bda6
Gate training cudagraph persistency via -–rl-persist-cuda-graphs
mathemakitten c8903d9
Fix typo in args
mathemakitten 4185aac
persist cudagraphs
mathemakitten b966303
Update to rl_training_cuda_graphs
mathemakitten fd156c3
Merge main
mathemakitten 587ee8c
Fix RNG state tracking for cudagraphs and grad mode
mathemakitten 484d916
Include Peter's change on RNG state tracking safety for cudagraphs
mathemakitten b271f28
Include Peter's change on RNG state tracking safety for cudagraphs
mathemakitten cae2cb9
merge main
mathemakitten 52600fb
Merge
mathemakitten 075530f
Flip training cudagraphs back on after refit MR
mathemakitten 3e6fafc
Fix RL sequence packing bin size (#2909)
tdene c0882a4
If empty bin, give it a default PackedSeqParams so the signature will…
mathemakitten 3d71442
runs fast need refactor
mathemakitten 67b9f3b
Cleanup
mathemakitten 792310a
Merge branch 'main' into rl-training-graphs
mathemakitten db1bae4
Maximize --rl-sequence-packing-max-sequences-per-bin for now
mathemakitten fb687b0
Merge branch 'main' into rl-training-graphs
mathemakitten 1c488ff
Scope the self.training check so logprobs will not trigger cudagraph …
mathemakitten d37d0ce
Add an error if we ever pass a set of tensors through _clone_nested_t…
mathemakitten 69fdba5
Merge branch 'main' into helenn-training-graphs-rl
mathemakitten File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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
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
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
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
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
Oops, something went wrong.
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.
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.
Seems a bit dangerous to have Any and not throw an exception for unsupported data types. For instance, if I send a set of tensors, this will not clone them but return a set of tensors which a user of the function would expect to have cloned.
Uh oh!
There was an error while loading. Please reload this page.
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.
We actually don't want to throw an exception, but to pass-through for unsupported datatypes. This helper function is scoped very tightly within the cudagraphs code such that the "send set of tensors" case would *not be realistic, in my opinion.
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.
I did not think of that! Got it now. The only q I have is why if I send a tuple/list of tensors we want to clone them, but if I send a set of tensors we don't clone them?
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.
Sets of tensors are never used as cudagraph input/output containers — it wouldn't make sense because inputs are ordered, duplicates are meaningful, etc. I would be more concerned if we were sending in a set of tensors at all so I will just throw an error.
This function does see other types (e.g. generators) which need to pass through so I'm not going to modify the typing hints.