Repository navigation
Conversation
…xt.h from generated per-op headers [ghstack-poisoned]
PR Status: Approved 🚀Please fix all CI failures and trigger merge by commenting "@pytorchbot merge". ✅ AUTOMATED REVIEW - OUTDATED (earlier commit) - Ready for human review:
Findings (1): Reviewed commit: 🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/200676
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 Unclassified FailureAs of commit 6b10e23 with merge base 090a616 ( 🟡 GREEN LIGHT - OUTDATED (earlier commit) - PR requires human review:
reason: UNCLASSIFIED FAILURE - DrCI could not classify the following job because the workflow did not run on the merge base. The failure may be pre-existing on trunk or introduced by this PR:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
[ghstack-poisoned]
Every generated ATen/ops/<op>.h includes ATen/Context.h, but the generated code in those headers doesn't use anything from it. Since most of aten/src/ATen/native is built with per-operator headers, this makes nearly every kernel TU depend on Context.h, which changes often (new global settings: TF32/precision flags, BLAS/SDPA backend knobs, ...), and every such change recompiles most of the tree. Drop the include from the template. Based on a static include-graph scan of in-tree sources with AT_PER_OPERATOR_HEADERS defined, the number of translation units that depend on ATen/Context.h drops from about 1510 to about 1020 of about 2500. ATen/Functions.h and ATen/ATen.h still include ATen/Context.h, so code using those is unaffected. Out-of-tree code that includes only ATen/ops/*.h and uses at::globalContext() must now include ATen/Context.h itself. Test plan: regenerated the headers with torchgen, then ran every non-third-party host C++ TU of a Linux CUDA build with -fsyntax-only (1846 TUs) and compiled with nvcc every CUDA TU that no longer reaches Context.h (64 TUs); all pass. MPS, XPU and ROCm sources were checked only by a static scan for uses of Context.h symbols. ghstack-source-id: bba1b34 Pull-Request: #200676
… code (fixes Activation.cpp build break) [ghstack-poisoned]
Every generated ATen/ops/<op>.h includes ATen/Context.h, but the generated code in those headers doesn't use anything from it. Since most of aten/src/ATen/native is built with per-operator headers, this makes nearly every kernel TU depend on Context.h, which changes often (new global settings: TF32/precision flags, BLAS/SDPA backend knobs, ...), and every such change recompiles most of the tree. Drop the include from the template. Based on a static include-graph scan of in-tree sources with AT_PER_OPERATOR_HEADERS defined, the number of translation units that depend on ATen/Context.h drops from about 1510 to about 1020 of about 2500. ATen/Functions.h and ATen/ATen.h still include ATen/Context.h, so code using those is unaffected. Out-of-tree code that includes only ATen/ops/*.h and uses at::globalContext() must now include ATen/Context.h itself. Test plan: regenerated the headers with torchgen, then ran every non- third-party host C++ TU of a Linux CUDA build (MKLDNN, XNNPACK and NNPACK off) with -fsyntax-only (1846 TUs) and compiled with nvcc every CUDA TU that no longer reaches Context.h (64 TUs); all pass. MKLDNN-, ROCm-, MPS- and XPU-only code was checked only by a static scan for uses of Context.h symbols. ghstack-source-id: 7818dd9 Pull-Request: #200676
…xes ROCm build) [ghstack-poisoned]
Every generated ATen/ops/<op>.h includes ATen/Context.h, but the generated code in those headers doesn't use anything from it. Since most of aten/src/ATen/native is built with per-operator headers, this makes nearly every kernel TU depend on Context.h, which changes often (new global settings: TF32/precision flags, BLAS/SDPA backend knobs, ...), and every such change recompiles most of the tree. Drop the include from the template. Based on a static include-graph scan of in-tree sources with AT_PER_OPERATOR_HEADERS defined, the number of translation units that depend on ATen/Context.h drops from about 1510 to about 1020 of about 2500. ATen/Functions.h and ATen/ATen.h still include ATen/Context.h, so code using those is unaffected. Out-of-tree code that includes only ATen/ops/*.h and uses at::globalContext() must now include ATen/Context.h itself. Test plan: regenerated the headers with torchgen, then ran every non- third-party host C++ TU of a Linux CUDA build (MKLDNN, XNNPACK and NNPACK off) with -fsyntax-only (1846 TUs) and compiled with nvcc every CUDA TU that no longer reaches Context.h (64 TUs); all pass. MKLDNN-, ROCm-, MPS- and XPU-only code was checked only by a static scan for uses of Context.h symbols. ghstack-source-id: 1ff2b3e Pull-Request: #200676
|
blocked on xpu updates |
Every generated ATen/ops/<op>.h includes ATen/Context.h, but the generated code in those headers doesn't use anything from it. Since most of aten/src/ATen/native is built with per-operator headers, this makes nearly every kernel TU depend on Context.h, which changes often (new global settings: TF32/precision flags, BLAS/SDPA backend knobs, ...), and every such change recompiles most of the tree. Drop the include from the template. Based on a static include-graph scan of in-tree sources with AT_PER_OPERATOR_HEADERS defined, the number of translation units that depend on ATen/Context.h drops from about 1510 to about 1020 of about 2500. ATen/Functions.h and ATen/ATen.h still include ATen/Context.h, so code using those is unaffected. Out-of-tree code that includes only ATen/ops/*.h and uses at::globalContext() must now include ATen/Context.h itself. This depends on third_party/torch-xpu-ops: several of its kernels call globalContext() without including ATen/Context.h, so the XPU build fails until intel/torch-xpu-ops adds the include and third_party/xpu.txt is bumped. Test plan: regenerated the headers with torchgen, then ran every non- third-party host C++ TU of a Linux CUDA build (MKLDNN, XNNPACK and NNPACK off) with -fsyntax-only (1846 TUs) and compiled with nvcc every CUDA TU that no longer reaches Context.h (64 TUs); all pass. MKLDNN-, ROCm-, MPS- and XPU-only code was checked only by a static scan for uses of Context.h symbols. ghstack-source-id: 1ff2b3e Pull-Request: #200676
AdaptiveAveragePooling3d.cpp, DilatedMaxPool3d.cpp and FractionalMaxPool3d.cpp call globalContext().alertNotDeterministic() without including ATen/Context.h. They currently get it transitively through the generated per-operator headers (ATen/ops/*.h), which include ATen/Context.h. PyTorch is removing that include from the per-operator header template to cut the rebuild cost of edits to ATen/Context.h (pytorch/pytorch#200676). Include the header directly so these files keep building. No functional change; this builds against current PyTorch too.
|
XPU commit pin is intel/torch-xpu-ops@4260c03 |
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 |
Merge failedReason: 4 mandatory check(s) failed. The first few are:
Dig deeper by viewing the failures on hud |
|
@pytorchbot merge -r |
|
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
[ghstack-poisoned]
|
Successfully rebased |
Every generated ATen/ops/<op>.h includes ATen/Context.h, but the generated code in those headers doesn't use anything from it. Since most of aten/src/ATen/native is built with per-operator headers, this makes nearly every kernel TU depend on Context.h, which changes often (new global settings: TF32/precision flags, BLAS/SDPA backend knobs, ...), and every such change recompiles most of the tree. Drop the include from the template. Based on a static include-graph scan of in-tree sources with AT_PER_OPERATOR_HEADERS defined, the number of translation units that depend on ATen/Context.h drops from about 1520 to about 1030 of about 2500. ATen/Functions.h and ATen/ATen.h still include ATen/Context.h, so code using those is unaffected. Out-of-tree code that includes only ATen/ops/*.h and uses at::globalContext() must now include ATen/Context.h itself. UnaryOps.cpp used M_SQRT1_2, which MSVC only defines when _USE_MATH_DEFINES is set; it was getting that through ATen/Context.h -> ATen/CPUGeneratorImpl.h -> ATen/core/MT19937RNGEngine.h. Use c10::frac_sqrt_2<double> from c10/util/MathConstants.h (already included) instead. Three torch-xpu-ops kernels called globalContext() without including ATen/Context.h; intel/torch-xpu-ops#5749 (intel/torch-xpu-ops#5749) fixed them, and third_party/xpu.txt already points at a torch-xpu-ops commit that includes it (#201371). Test plan: regenerated the headers with torchgen, then ran every non-third-party host C++ TU of a Linux CUDA build (MKLDNN, XNNPACK and NNPACK off) with -fsyntax-only (1905 TUs) and compiled with nvcc every CUDA TU that no longer reaches Context.h (64 TUs); all pass. MKLDNN-, ROCm-, MPS-, XPU- and Windows-only code, and torch-xpu-ops at the current pin, were checked only by static scans for uses of Context.h symbols and of M_* math constants without _USE_MATH_DEFINES. ghstack-source-id: 11c0756 Pull-Request: #200676
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 |
Merge failedReason: 2 jobs have failed, first few of them are: .github/workflows/trunk.yml, .github/workflows/lint.yml Details for Dev Infra teamRaised by workflow job |
|
@pytorchbot merge |
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 |
Merge failedReason: 1 jobs have failed, first few of them are: trunk Details for Dev Infra teamRaised by workflow job |
mergedog handoffNote This PR is being shepherded by mergedog, an automation tool run by a maintainer. It watches CI and may push fixes; the PR author does not need to act unless a maintainer asks. All CI is green (or skipped). Ready for human review and Current PR head: Autonomous changes pushed
CI notes at handoffmergedog is treating these still-failing checks as unrelated/spurious. Please verify before merging:
Warning: mergedog's suppressed check list differs from the latest Dr. CI summary. Suppressed by mergedog but not listed by Dr. CI:
Latest Dr. CI summary## PR Status: Approved 🚀
Please fix all CI failures and trigger merge by commenting "@pytorchbot merge".
<details><summary>✅ <b>AUTOMATED REVIEW</b> - OUTDATED (earlier commit) - Ready for human review:</summary><p>
The PR removes [minor] aten/src/ATen/templates/Function.h:5 During shepherding, the configured LLM was invoked 1 time. If any CI shows red, it judged that failure unrelated to this PR's changes — please verify below before merging. Session 1 — fix-CI (2026-10-27T16:00:55+00:00)
LLM transcript |
|
@pytorchbot merge -f "looks good" |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
AdaptiveAveragePooling3d.cpp, DilatedMaxPool3d.cpp and FractionalMaxPool3d.cpp call globalContext().alertNotDeterministic() without including ATen/Context.h. They currently get it transitively through the generated per-operator headers (ATen/ops/*.h), which include ATen/Context.h. PyTorch is removing that include from the per-operator header template to cut the rebuild cost of edits to ATen/Context.h (pytorch/pytorch#200676). Include the header directly so these files keep building. No functional change; this builds against current PyTorch too.
…orch#200676) Every generated ATen/ops/<op>.h includes ATen/Context.h, but the generated code in those headers doesn't use anything from it. Since most of aten/src/ATen/native is built with per-operator headers, this makes nearly every kernel TU depend on Context.h, which changes often (new global settings: TF32/precision flags, BLAS/SDPA backend knobs, ...), and every such change recompiles most of the tree. Drop the include from the template. Based on a static include-graph scan of in-tree sources with AT_PER_OPERATOR_HEADERS defined, the number of translation units that depend on ATen/Context.h drops from about 1520 to about 1030 of about 2500. ATen/Functions.h and ATen/ATen.h still include ATen/Context.h, so code using those is unaffected. Out-of-tree code that includes only ATen/ops/*.h and uses at::globalContext() must now include ATen/Context.h itself. UnaryOps.cpp used M_SQRT1_2, which MSVC only defines when _USE_MATH_DEFINES is set; it was getting that through ATen/Context.h -> ATen/CPUGeneratorImpl.h -> ATen/core/MT19937RNGEngine.h. Use c10::frac_sqrt_2<double> from c10/util/MathConstants.h (already included) instead. Three torch-xpu-ops kernels called globalContext() without including ATen/Context.h; intel/torch-xpu-ops#5749 (intel/torch-xpu-ops#5749) fixed them, and third_party/xpu.txt already points at a torch-xpu-ops commit that includes it (pytorch#201371). Test plan: regenerated the headers with torchgen, then ran every non-third-party host C++ TU of a Linux CUDA build (MKLDNN, XNNPACK and NNPACK off) with -fsyntax-only (1905 TUs) and compiled with nvcc every CUDA TU that no longer reaches Context.h (64 TUs); all pass. MKLDNN-, ROCm-, MPS-, XPU- and Windows-only code, and torch-xpu-ops at the current pin, were checked only by static scans for uses of Context.h symbols and of M_* math constants without _USE_MATH_DEFINES. Pull Request resolved: pytorch#200676 Approved by: https://github.com/Skylion007, https://github.com/guangyey
Stack from ghstack (oldest at bottom):
Every generated ATen/ops/.h includes ATen/Context.h, but the
generated code in those headers doesn't use anything from it. Since most
of aten/src/ATen/native is built with per-operator headers, this makes
nearly every kernel TU depend on Context.h, which changes often (new
global settings: TF32/precision flags, BLAS/SDPA backend knobs, ...),
and every such change recompiles most of the tree.
Drop the include from the template. Based on a static include-graph scan
of in-tree sources with AT_PER_OPERATOR_HEADERS defined, the number of
translation units that depend on ATen/Context.h drops from about 1520 to
about 1030 of about 2500. ATen/Functions.h and ATen/ATen.h still include
ATen/Context.h, so code using those is unaffected. Out-of-tree code that
includes only ATen/ops/*.h and uses at::globalContext() must now include
ATen/Context.h itself.
UnaryOps.cpp used M_SQRT1_2, which MSVC only defines when
_USE_MATH_DEFINES is set; it was getting that through ATen/Context.h ->
ATen/CPUGeneratorImpl.h -> ATen/core/MT19937RNGEngine.h. Use
c10::frac_sqrt_2 from c10/util/MathConstants.h (already
included) instead.
Three torch-xpu-ops kernels called globalContext() without including
ATen/Context.h; intel/torch-xpu-ops#5749
(intel/torch-xpu-ops#5749) fixed them, and
third_party/xpu.txt already points at a torch-xpu-ops commit that
includes it (#201371).
Test plan: regenerated the headers with torchgen, then ran every
non-third-party host C++ TU of a Linux CUDA build (MKLDNN, XNNPACK and
NNPACK off) with -fsyntax-only (1905 TUs) and compiled with nvcc every
CUDA TU that no longer reaches Context.h (64 TUs); all pass. MKLDNN-,
ROCm-, MPS-, XPU- and Windows-only code, and torch-xpu-ops at the
current pin, were checked only by static scans for uses of Context.h
symbols and of M_* math constants without _USE_MATH_DEFINES.