Repository navigation
Reorder stateless RNG key() args + make them kw-only - #189768
Closed
jbschlosser wants to merge 3 commits into
Closed
jbschlosser wants to merge 3 commits into
jbschlosser wants to merge 3 commits into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/189768
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 79829c5 with merge base 186adfc ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This was referenced Jul 13, 2026
Skylion007
approved these changes
Jul 14, 2026
Contributor
Author
|
@pytorchbot merge |
Collaborator
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Collaborator
|
Starting merge as part of PR stack under #189767 |
1 similar comment
Collaborator
|
Starting merge as part of PR stack under #189767 |
pull Bot
pushed a commit
to sysfce2/pytorch
that referenced
this pull request
Jul 14, 2026
…#189767) This PR addresses beta user feedback on `fold_in(key, data)`: * Tightens up the support regarding dtype for `data`; we now explicitly support ints in the range `[-2**63, 2**64 - 1]` (i.e. all signed int64 AND uint64 values) with negative values reinterpreted as two's complement of uint64 values, following the precedent set by [`manual_seed()`](https://docs.pytorch.org/docs/2.13/generated/torch.manual_seed.html). This requires some python-side gymnastics since we utilize the standard ATen op parsing logic that treats ints as int64. Docs were also updated to indicate this. * Adds a Tensor `data` ATen op overload that can be used to avoid baking in `data` to captured CUDAGraphs. Note that, for simplicity, we only allow a single item Tensor `data` for now. In the future, if necessary, we can support folding broadcastable data across a batched set of keys. Pull Request resolved: pytorch#189767 Approved by: https://github.com/ngimel ghstack dependencies: pytorch#189768
vishalgoyal316
pushed a commit
to vishalgoyal316/pytorch
that referenced
this pull request
Jul 16, 2026
Addresses beta user feedback by reordering `torch.func._random.key()`'s args in a more natural way and making them kw-only. It's technically BC-breaking for this private API but I don't expect it to be widely used yet so let's make this change while we can. Pull Request resolved: pytorch#189768 Approved by: https://github.com/Skylion007, https://github.com/albanD
vishalgoyal316
pushed a commit
to vishalgoyal316/pytorch
that referenced
this pull request
Jul 16, 2026
…#189767) This PR addresses beta user feedback on `fold_in(key, data)`: * Tightens up the support regarding dtype for `data`; we now explicitly support ints in the range `[-2**63, 2**64 - 1]` (i.e. all signed int64 AND uint64 values) with negative values reinterpreted as two's complement of uint64 values, following the precedent set by [`manual_seed()`](https://docs.pytorch.org/docs/2.13/generated/torch.manual_seed.html). This requires some python-side gymnastics since we utilize the standard ATen op parsing logic that treats ints as int64. Docs were also updated to indicate this. * Adds a Tensor `data` ATen op overload that can be used to avoid baking in `data` to captured CUDAGraphs. Note that, for simplicity, we only allow a single item Tensor `data` for now. In the future, if necessary, we can support folding broadcastable data across a batched set of keys. Pull Request resolved: pytorch#189767 Approved by: https://github.com/ngimel ghstack dependencies: pytorch#189768
DamJanusz
pushed a commit
to DamJanusz/pytorch
that referenced
this pull request
Jul 21, 2026
Addresses beta user feedback by reordering `torch.func._random.key()`'s args in a more natural way and making them kw-only. It's technically BC-breaking for this private API but I don't expect it to be widely used yet so let's make this change while we can. Pull Request resolved: pytorch#189768 Approved by: https://github.com/Skylion007, https://github.com/albanD
DamJanusz
pushed a commit
to DamJanusz/pytorch
that referenced
this pull request
Jul 21, 2026
…#189767) This PR addresses beta user feedback on `fold_in(key, data)`: * Tightens up the support regarding dtype for `data`; we now explicitly support ints in the range `[-2**63, 2**64 - 1]` (i.e. all signed int64 AND uint64 values) with negative values reinterpreted as two's complement of uint64 values, following the precedent set by [`manual_seed()`](https://docs.pytorch.org/docs/2.13/generated/torch.manual_seed.html). This requires some python-side gymnastics since we utilize the standard ATen op parsing logic that treats ints as int64. Docs were also updated to indicate this. * Adds a Tensor `data` ATen op overload that can be used to avoid baking in `data` to captured CUDAGraphs. Note that, for simplicity, we only allow a single item Tensor `data` for now. In the future, if necessary, we can support folding broadcastable data across a batched set of keys. Pull Request resolved: pytorch#189767 Approved by: https://github.com/ngimel ghstack dependencies: pytorch#189768
youlituao
pushed a commit
to youlituao/pytorch
that referenced
this pull request
Jul 28, 2026
Addresses beta user feedback by reordering `torch.func._random.key()`'s args in a more natural way and making them kw-only. It's technically BC-breaking for this private API but I don't expect it to be widely used yet so let's make this change while we can. Pull Request resolved: pytorch#189768 Approved by: https://github.com/Skylion007, https://github.com/albanD
youlituao
pushed a commit
to youlituao/pytorch
that referenced
this pull request
Jul 28, 2026
…#189767) This PR addresses beta user feedback on `fold_in(key, data)`: * Tightens up the support regarding dtype for `data`; we now explicitly support ints in the range `[-2**63, 2**64 - 1]` (i.e. all signed int64 AND uint64 values) with negative values reinterpreted as two's complement of uint64 values, following the precedent set by [`manual_seed()`](https://docs.pytorch.org/docs/2.13/generated/torch.manual_seed.html). This requires some python-side gymnastics since we utilize the standard ATen op parsing logic that treats ints as int64. Docs were also updated to indicate this. * Adds a Tensor `data` ATen op overload that can be used to avoid baking in `data` to captured CUDAGraphs. Note that, for simplicity, we only allow a single item Tensor `data` for now. In the future, if necessary, we can support folding broadcastable data across a batched set of keys. Pull Request resolved: pytorch#189767 Approved by: https://github.com/ngimel ghstack dependencies: pytorch#189768
aws-kingrj
pushed a commit
to amazon-contributing/upstream-to-pytorch
that referenced
this pull request
Jul 29, 2026
Addresses beta user feedback by reordering `torch.func._random.key()`'s args in a more natural way and making them kw-only. It's technically BC-breaking for this private API but I don't expect it to be widely used yet so let's make this change while we can. Pull Request resolved: pytorch#189768 Approved by: https://github.com/Skylion007, https://github.com/albanD
aws-kingrj
pushed a commit
to amazon-contributing/upstream-to-pytorch
that referenced
this pull request
Jul 29, 2026
…#189767) This PR addresses beta user feedback on `fold_in(key, data)`: * Tightens up the support regarding dtype for `data`; we now explicitly support ints in the range `[-2**63, 2**64 - 1]` (i.e. all signed int64 AND uint64 values) with negative values reinterpreted as two's complement of uint64 values, following the precedent set by [`manual_seed()`](https://docs.pytorch.org/docs/2.13/generated/torch.manual_seed.html). This requires some python-side gymnastics since we utilize the standard ATen op parsing logic that treats ints as int64. Docs were also updated to indicate this. * Adds a Tensor `data` ATen op overload that can be used to avoid baking in `data` to captured CUDAGraphs. Note that, for simplicity, we only allow a single item Tensor `data` for now. In the future, if necessary, we can support folding broadcastable data across a batched set of keys. Pull Request resolved: pytorch#189767 Approved by: https://github.com/ngimel ghstack dependencies: pytorch#189768
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.
Stack from ghstack (oldest at bottom):
Addresses beta user feedback by reordering
torch.func._random.key()'s args in a more natural way and making them kw-only. It's technically BC-breaking for this private API but I don't expect it to be widely used yet so let's make this change while we can.