Repository navigation
Conversation
**Problem**
Building PyTorch against kineto requires three negative-form switches:
LIBKINETO_NOCUPTI, LIBKINETO_NOROCTRACER, LIBKINETO_NOXPUPTI. A CPU-only
build has to set all three, and the negation lives only in the build glue:
kineto's C++ sources have always used the positive-form HAS_CUPTI /
HAS_ROCTRACER / HAS_XPUPTI. PyTorch's CMake mirrors the awkwardness with a
three-way flag derivation and a CXX_FLAGS pass-through of the negative
macros into PyTorch's own translation units.
**Why**
Kineto's main branch (third_party/kineto pin 7739225) replaces the three
NO-flags with a single mode-style KINETO_BACKEND, one of {cpu, cuda, rocm,
xpu}, and ships a compatibility shim that still honors the old flags. The
shim is meant to be deleted once PyTorch migrates. This change does the
PyTorch-side migration so the shim can go.
**Fix**
Dependencies.cmake derives KINETO_BACKEND directly from
USE_CUDA / USE_ROCM / USE_XPU+XPU_ENABLE_KINETO and forwards it to kineto.
The global CXX_FLAGS append is kept -- torch_cpu links kineto PRIVATE, so
kineto's own PUBLIC HAS_* compile defs don't reach torch_python TUs like
init.cpp -- but it now emits the positive macros -DHAS_*. init.cpp's
preprocessor guard switches to those positive macros. The cudart-link
guard in caffe2/CMakeLists.txt switches from NOT LIBKINETO_NOCUPTI to
KINETO_BACKEND STREQUAL "cuda".
Authored by Claude.
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/183388
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ❌ You can merge normally! (4 Unrelated Failures), 2 Unclassified FailuresAs of commit 03da2a7 with merge base 3d5307b ( UNCLASSIFIED FAILURES - DrCI could not classify the following jobs because the workflow did not run on the merge base. The failures may be pre-existing on trunk or introduced by this PR:
FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
LGTM, looking at the hud, the last time the XPU tests were run was on https://hud2.pytorch.org/pytorch/pytorch/commit/dc8be5dc1f4b31076cbb0739e57553d383ba4b1b, and they look pretty broken there already. |
|
Agreed on XPU; the fact that everything compiles indicates to me that this PR is not the cause of the failures. |
|
@pytorchbot merge |
Merge failedReason: Approvers from one of the following sets are needed:
|
|
@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: 2 jobs have failed, first few of them are: xpu / linux-noble-xpu-n-py3.10 / test (default, 3, 12, linux.idc.xpu), xpu / linux-noble-xpu-n-py3.10 / test (default, 7, 12, linux.idc.xpu) Details for Dev Infra teamRaised by workflow job |
|
@pytorchbot merge -i |
Merge startedYour change will be merged while ignoring the following 6 checks: xpu / linux-noble-xpu-n-py3.10 / test (default, 3, 12, linux.idc.xpu), xpu / linux-noble-xpu-n-py3.10 / test (default, 10, 12, linux.idc.xpu), xpu / linux-noble-xpu-n-py3.10 / test (default, 7, 12, linux.idc.xpu), xpu / linux-noble-xpu-n-py3.10 / test (default, 11, 12, linux.idc.xpu), xpu / linux-noble-xpu-n-py3.10 / test (default, 8, 12, linux.idc.xpu), xpu / linux-noble-xpu-n-py3.10 / test (default, 9, 12, linux.idc.xpu) Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Summary: The CMake refactor (#1388) replaced `LIBKINETO_NOCUPTI`, `LIBKINETO_NOROCTRACER`, and `LIBKINETO_NOXPUPTI` with a single `KINETO_BACKEND` variable, but kept a shim that translated the legacy flags during the cross-repo migration window. pytorch/pytorch#183388 migrated PyTorch's `cmake/Dependencies.cmake` and `torch/csrc/autograd/init.cpp` have now both been migrated to use `KINETO_BACKEND` / `HAS_*` directly. The shim has no remaining caller. **Approach** Delete the shim block and the cached-vs-new-legacy-flags conflict warning that existed only to ease the migration. Replace with a simpler guard that warns when `KINETO_BACKEND` wasn't set at all and the build defaulted to `cpu`. This catches stragglers passing legacy `LIBKINETO_NO*` flags as a side effect — they'll be silently ignored, `KINETO_BACKEND` will default to `cpu`, and the new warning will tell them how to pick a backend explicitly. The new code carries no knowledge of the legacy flag names, so the kineto repo is now free of all `LIBKINETO_NO*` references. The warning fires only on initial configure (subsequent re-runs find `KINETO_BACKEND` populated in the cache) and on a freshly-wiped build directory. Pull Request resolved: #1399 Reviewed By: NicolasHug Differential Revision: D104927633 Pulled By: scotts fbshipit-source-id: 71e5f4103d77e4550bf74c5bed22c9808c8a6f5b
…ND (pytorch#183388) **Problem** Building PyTorch against kineto requires three negative-form switches: LIBKINETO_NOCUPTI, LIBKINETO_NOROCTRACER, LIBKINETO_NOXPUPTI. A CPU-only build has to set all three, and the negation lives only in the build glue: kineto's C++ sources have always used the positive-form HAS_CUPTI / HAS_ROCTRACER / HAS_XPUPTI. PyTorch's CMake mirrors the awkwardness with a three-way flag derivation and a CXX_FLAGS pass-through of the negative macros into PyTorch's own translation units. **Why** In pytorch/kineto#1388, Kineto replaced the three NO-flags with a single mode-style KINETO_BACKEND flags. It can take on one of the values in {cpu, cuda, rocm, xpu} and included a compatibility shim that still honors the old flags. The shim is meant to be deleted once PyTorch migrates. This change does the PyTorch-side migration so the shim can go. **Fixes** - Dependencies.cmake derives KINETO_BACKEND directly from USE_CUDA / USE_ROCM / USE_XPU+XPU_ENABLE_KINETO and forwards it to Kineto. The global CXX_FLAGS append is kept -- torch_cpu links kineto PRIVATE, so kineto's own PUBLIC HAS_* compile defs don't reach torch_python TUs like init.cpp -- but it now emits the positive macros -DHAS_*. - init.cpp's preprocessor guard switches to those positive macros. - The cudart-link guard in caffe2/CMakeLists.txt switches from NOT LIBKINETO_NOCUPTI to KINETO_BACKEND STREQUAL "cuda". Authored by Claude. Pull Request resolved: pytorch#183388 Approved by: https://github.com/NicolasHug, https://github.com/jathu
…ND (pytorch#183388) **Problem** Building PyTorch against kineto requires three negative-form switches: LIBKINETO_NOCUPTI, LIBKINETO_NOROCTRACER, LIBKINETO_NOXPUPTI. A CPU-only build has to set all three, and the negation lives only in the build glue: kineto's C++ sources have always used the positive-form HAS_CUPTI / HAS_ROCTRACER / HAS_XPUPTI. PyTorch's CMake mirrors the awkwardness with a three-way flag derivation and a CXX_FLAGS pass-through of the negative macros into PyTorch's own translation units. **Why** In pytorch/kineto#1388, Kineto replaced the three NO-flags with a single mode-style KINETO_BACKEND flags. It can take on one of the values in {cpu, cuda, rocm, xpu} and included a compatibility shim that still honors the old flags. The shim is meant to be deleted once PyTorch migrates. This change does the PyTorch-side migration so the shim can go. **Fixes** - Dependencies.cmake derives KINETO_BACKEND directly from USE_CUDA / USE_ROCM / USE_XPU+XPU_ENABLE_KINETO and forwards it to Kineto. The global CXX_FLAGS append is kept -- torch_cpu links kineto PRIVATE, so kineto's own PUBLIC HAS_* compile defs don't reach torch_python TUs like init.cpp -- but it now emits the positive macros -DHAS_*. - init.cpp's preprocessor guard switches to those positive macros. - The cudart-link guard in caffe2/CMakeLists.txt switches from NOT LIBKINETO_NOCUPTI to KINETO_BACKEND STREQUAL "cuda". Authored by Claude. Pull Request resolved: pytorch#183388 Approved by: https://github.com/NicolasHug, https://github.com/jathu
…ND (pytorch#183388) **Problem** Building PyTorch against kineto requires three negative-form switches: LIBKINETO_NOCUPTI, LIBKINETO_NOROCTRACER, LIBKINETO_NOXPUPTI. A CPU-only build has to set all three, and the negation lives only in the build glue: kineto's C++ sources have always used the positive-form HAS_CUPTI / HAS_ROCTRACER / HAS_XPUPTI. PyTorch's CMake mirrors the awkwardness with a three-way flag derivation and a CXX_FLAGS pass-through of the negative macros into PyTorch's own translation units. **Why** In pytorch/kineto#1388, Kineto replaced the three NO-flags with a single mode-style KINETO_BACKEND flags. It can take on one of the values in {cpu, cuda, rocm, xpu} and included a compatibility shim that still honors the old flags. The shim is meant to be deleted once PyTorch migrates. This change does the PyTorch-side migration so the shim can go. **Fixes** - Dependencies.cmake derives KINETO_BACKEND directly from USE_CUDA / USE_ROCM / USE_XPU+XPU_ENABLE_KINETO and forwards it to Kineto. The global CXX_FLAGS append is kept -- torch_cpu links kineto PRIVATE, so kineto's own PUBLIC HAS_* compile defs don't reach torch_python TUs like init.cpp -- but it now emits the positive macros -DHAS_*. - init.cpp's preprocessor guard switches to those positive macros. - The cudart-link guard in caffe2/CMakeLists.txt switches from NOT LIBKINETO_NOCUPTI to KINETO_BACKEND STREQUAL "cuda". Authored by Claude. Pull Request resolved: pytorch#183388 Approved by: https://github.com/NicolasHug, https://github.com/jathu
Problem
Building PyTorch against kineto requires three negative-form switches: LIBKINETO_NOCUPTI, LIBKINETO_NOROCTRACER, LIBKINETO_NOXPUPTI. A CPU-only build has to set all three, and the negation lives only in the build glue: kineto's C++ sources have always used the positive-form HAS_CUPTI / HAS_ROCTRACER / HAS_XPUPTI. PyTorch's CMake mirrors the awkwardness with a three-way flag derivation and a CXX_FLAGS pass-through of the negative macros into PyTorch's own translation units.
Why
In pytorch/kineto#1388, Kineto replaced the three NO-flags with a single mode-style KINETO_BACKEND flags. It can take on one of the values in {cpu, cuda, rocm, xpu} and included a compatibility shim that still honors the old flags. The shim is meant to be deleted once PyTorch migrates. This change does the PyTorch-side migration so the shim can go.
Fixes
Authored by Claude.