Skip to content

CPU support for stateless RNG APIs - #177692

Closed
jbschlosser wants to merge 35 commits into
gh/jbschlosser/257/basefrom
gh/jbschlosser/257/head
Closed

jbschlosser wants to merge 35 commits into
gh/jbschlosser/257/basefrom
gh/jbschlosser/257/head

Conversation

@jbschlosser

@jbschlosser jbschlosser commented Mar 17, 2026 •

Copy link
Copy Markdown
Contributor

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Mar 17, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/177692

Note: Links to docs will display an error until the docs builds have been completed.

✅ You can merge normally! (31 Unrelated Failures)

As of commit 4d894e6 with merge base 4cd33ef (image):

CRCR (non-blocking) - The following CRCR downstream CI jobs failed but are non-blocking:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@github-actions

Copy link
Copy Markdown
Contributor

Attention! native_functions.yaml was changed

If you are adding a new function or defaulted argument to native_functions.yaml, you cannot use it from pre-existing Python frontend code until our FC window passes (two weeks). Split your PR into two PRs, one which adds the new C++ functionality, and one that makes use of it from Python, and land them two weeks apart. See https://github.com/pytorch/pytorch/wiki/PyTorch's-Python-Frontend-Backward-and-Forward-Compatibility-Policy#forwards-compatibility-fc for more info.


Caused by:

[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@pytorch-bot pytorch-bot Bot added the module: cpu CPU specific problem (e.g., perf, algorithm) label Mar 26, 2026
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@jbschlosser
jbschlosser marked this pull request as ready for review July 28, 2026 20:27
@jbschlosser jbschlosser added the topic: not user facing topic category label Jul 28, 2026

@lucasb-eyer lucasb-eyer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, BUT with the caveat that I don't actually feel skilled enough to correctly review the code :)

@jbschlosser

Copy link
Copy Markdown
Contributor Author

@pytorchbot merge

@pytorch-bot pytorch-bot Bot added the ciflow/trunk Trigger trunk jobs on your pull request label Jul 30, 2026
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your 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

Advanced Debugging
Check the merge workflow status
here

pytorchmergebot pushed a commit that referenced this pull request Aug 9, 2026
…internal) (#192615)

✴️ iz2: (opened by Ivan's agent on his behalf)

#177692 ("CPU support for stateless RNG APIs") added `aten/src/ATen/native/PhiloxStatelessRNG.cpp` but did not register it in `build_variables.bzl`. When that PR was imported internally, the entry was added to the internal copy of `build_variables.bzl` before it landed. The two copies of the file have been out of sync since.

This adds the same single line to the OSS copy, so `build_variables.bzl` matches on both sides.

The entry goes into `aten_native_source_non_codegen_list`, in sorted position between `PackedSequence.cpp` and `PixelShuffle.cpp`.

### Build impact

No effect on the default CMake build. `aten/src/ATen/CMakeLists.txt` has an if/else on `BUILD_LITE_INTERPRETER`: the `append_filelist("aten_native_source_non_codegen_list" ...)` call is only in the `ON` branch, while the default `OFF` branch composes `all_cpu_cpp` from `file(GLOB native_cpp "native/*.cpp")`, which already picks this file up. The two branches are mutually exclusive, so there is no double-add.

The change does add the file to the source list used by the `BUILD_LITE_INTERPRETER=ON` branch and by the buck path (`aten_native_source_list` → `buckbuild.bzl`, `pt_template_srcs.bzl`), where it is currently absent. That is a real change in source composition for those configurations rather than pure metadata, so it is worth calling out — though it is the composition the file's own `native_functions.yaml` CPU dispatch entries imply. The equivalent internal buck build already compiles this file from a list containing this exact line.

### Verification

- `build_variables.bzl` on this branch is byte-identical to the internal copy as of internal master `63074c69e3aa` (both 79151 bytes, matching md5). Before this change the OSS copy was 79100 bytes and the only difference between the two files was this one line, in one direction — there were no OSS-only lines.
- `lintrunner` is clean.

Byte-identity is stated against that named internal snapshot; it is not a claim about future drift.

Pull Request resolved: #192615
Approved by: https://github.com/pytorchgreenlight, https://github.com/Skylion007
ankitbhrdwj pushed a commit to ankitbhrdwj/pytorch that referenced this pull request Aug 12, 2026
…internal) (pytorch#192615)

✴️ iz2: (opened by Ivan's agent on his behalf)

pytorch#177692 ("CPU support for stateless RNG APIs") added `aten/src/ATen/native/PhiloxStatelessRNG.cpp` but did not register it in `build_variables.bzl`. When that PR was imported internally, the entry was added to the internal copy of `build_variables.bzl` before it landed. The two copies of the file have been out of sync since.

This adds the same single line to the OSS copy, so `build_variables.bzl` matches on both sides.

The entry goes into `aten_native_source_non_codegen_list`, in sorted position between `PackedSequence.cpp` and `PixelShuffle.cpp`.

### Build impact

No effect on the default CMake build. `aten/src/ATen/CMakeLists.txt` has an if/else on `BUILD_LITE_INTERPRETER`: the `append_filelist("aten_native_source_non_codegen_list" ...)` call is only in the `ON` branch, while the default `OFF` branch composes `all_cpu_cpp` from `file(GLOB native_cpp "native/*.cpp")`, which already picks this file up. The two branches are mutually exclusive, so there is no double-add.

The change does add the file to the source list used by the `BUILD_LITE_INTERPRETER=ON` branch and by the buck path (`aten_native_source_list` → `buckbuild.bzl`, `pt_template_srcs.bzl`), where it is currently absent. That is a real change in source composition for those configurations rather than pure metadata, so it is worth calling out — though it is the composition the file's own `native_functions.yaml` CPU dispatch entries imply. The equivalent internal buck build already compiles this file from a list containing this exact line.

### Verification

- `build_variables.bzl` on this branch is byte-identical to the internal copy as of internal master `63074c69e3aa` (both 79151 bytes, matching md5). Before this change the OSS copy was 79100 bytes and the only difference between the two files was this one line, in one direction — there were no OSS-only lines.
- `lintrunner` is clean.

Byte-identity is stated against that named internal snapshot; it is not a claim about future drift.

Pull Request resolved: pytorch#192615
Approved by: https://github.com/pytorchgreenlight, https://github.com/Skylion007
@github-actions
github-actions Bot deleted the gh/jbschlosser/257/head branch October 28, 2026 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request Merged module: cpu CPU specific problem (e.g., perf, algorithm) topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants