Skip to content

✴️ iz2: Add PhiloxStatelessRNG.cpp to build_variables.bzl (sync with internal) - #192615

Closed
izaitsevfb wants to merge 1 commit into
mainfrom
izaitsevfb/sync-build-variables-philox-stateless-rng
Closed

izaitsevfb wants to merge 1 commit into
mainfrom
izaitsevfb/sync-build-variables-philox-stateless-rng

Conversation

@izaitsevfb

Copy link
Copy Markdown
Contributor

✴️ 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.

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

This adds the same single line to the OSS copy, making build_variables.bzl
identical on both sides.

No effect on the default CMake build, which picks the file up via the
file(GLOB native_cpp "native/*.cpp") branch of the BUILD_LITE_INTERPRETER
if/else in aten/src/ATen/CMakeLists.txt. It does add the file to the other
branch and to the buck path, which read the explicit list.
@pytorch-bot

pytorch-bot Bot commented Aug 8, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

✅ You can merge normally! (2 Unrelated Failures)

As of commit 6ea0c98 with merge base 0754e4e (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.

@pytorchgreenlight

pytorchgreenlight Bot commented Aug 8, 2026 •

Copy link
Copy Markdown

PR approved to be merged without human review

Why
The diff is a single line adding the already-existing source file aten/src/ATen/native/PhiloxStatelessRNG.cpp to aten_native_source_non_codegen_list in build_variables.bzl, in correct sorted position between PackedSequence.cpp and PixelShuffle.cpp. I confirmed the file exists in the tree, that its CPU kernels (_philox_key_split_cpu, _philox_uniform_cpu_, _philox_normal_cpu_) are dispatched from native_functions.yaml, and that aten/src/ATen/CMakeLists.txt uses this list only in the BUILD_LITE_INTERPRETER=ON branch (line 515) while the default branch picks the file up via file(GLOB native_cpp "native/*.cpp") at line 106 — so there is no double-add and no change to the default build. The only consumers are that lite-interpreter branch and the buck path via aten_native_source_list, where omitting a file with registered CPU dispatch was the actual defect; no logic, API, test, or CI behavior changes.

reason: clean

Inference job

@izaitsevfb

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 Aug 9, 2026
@izaitsevfb izaitsevfb added the topic: not user facing topic category label Aug 9, 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

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 izaitsevfb/sync-build-variables-philox-stateless-rng branch November 1, 2026 01:49
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 topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants