Repository navigation
Conversation
PR Status: Approved 🚀Please fix all CI failures and trigger merge by commenting "@pytorchbot merge". 🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/201449
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit e3c3f1e with merge base 3d7a235 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@pytorchbot label "release notes: rocm" |
jeffdaily
left a comment
There was a problem hiding this comment.
My agent came up with this analysis, but I've read and approved it.
Non-blocking: the guard covers a project that calls
enable_language(HIP)beforefind_package(Torch). It does not cover a project that only passes-DCMAKE_HIP_COMPILER=<path>with a different spelling (for example a lowercase drive letter) and lets LoadHIP enable HIP. In that case the first configure succeeds, but LoadHIP's spelling silently replaces the user's value. Every re-run of the same configure command then sees the-Dvalue and LoadHIP's value disagree, and deletes the cache again. Checkingif(NOT DEFINED CMAKE_HIP_COMPILER)instead would cover both cases. The tradeoff is that changingROCM_PATHorHIP_CLANG_PATHin an existing build directory would no longer switch compilers, which is CMake's usual compiler behavior. Fine to leave for a follow-up.
54dfb3d to
848a486
Compare
|
Thanks, confirmed: passing only -DCMAKE_HIP_COMPILER with a different spelling made every second configure delete the cache. Switching the guard to |
|
@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: 13 mandatory check(s) failed. The first few are:
Dig deeper by viewing the failures on hud |
|
@pytorchbot rebase |
|
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
|
Successfully rebased |
848a486 to
7d84cb0
Compare
|
|
|
@jeffdaily the earlier merge failed because build-external-packages was missing from main during the #202327 window. Rebased now; could you please approve the workflows and re-run the merge? |
A project that calls check_language(HIP) before find_package(Torch), with no HIP compiler on PATH, caches CMAKE_HIP_COMPILER as NOTFOUND. That value is DEFINED, so LoadHIP skipped its own lookup and enable_language(HIP) failed with "No CMAKE_HIP_COMPILER could be found". Test the value instead of DEFINED; a compiler set by -D or an earlier enable_language(HIP) is still kept. Test Plan: a NONE-language project that runs check_language(HIP) with no clang on PATH, then includes utils.cmake and LoadHIP.cmake, configured against the TheRock ROCm SDK on Windows. Before this change it fails in enable_language(HIP); after it, HIP is enabled with the SDK clang++. With -DCMAKE_HIP_COMPILER set, the given compiler is kept, and a reconfigure keeps the cache. ``` cmake -S src -B build -G Ninja -DLOADHIP=<checkout>/cmake/public/LoadHIP.cmake -DCMAKE_HIP_COMPILER_ROCM_ROOT=<rocm> ``` Authored with Claude.
|
I pushed a small maintainer commit on top of the rebase, e3c3f1e. My agent came up with this analysis, but I've read and approved it.
|
|
Thanks, I hadn't considered that |
|
@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 |
## Linked issue or supporting maintainer Fixes pytorch#201447 ## BC-breaking? No ## Summary (human written only) LoadHIP.cmake now picks the HIP compiler only when CMAKE_HIP_COMPILER is not already defined. A project that passes -DCMAKE_HIP_COMPILER, or enables HIP before find_package(Torch), keeps its own compiler instead of having it replaced, which made CMake delete the cache and reconfigure without the user's options. When nothing sets the compiler, nothing changes. Changing ROCM_PATH or HIP_CLANG_PATH in an existing build directory no longer switches compilers, which matches how CMake treats other compilers. ## Agent details (if applicable) Prepared with Claude; I reviewed the change and reran the tests myself. > Tested on Windows with ROCm torch 2.16.0a0+rocm10.2.0a20261022 (gfx1200), using a copy of the installed torch CMake config with this change applied. Two consumers hit the cache reset before the change: one that enables HIP with a differently spelled path to the same clang++, and one that only passes -DCMAKE_HIP_COMPILER with a different spelling. Both configure repeatedly with their options intact after the change, and build and run a HIP kernel alongside LibTorch. A consumer that sets no compiler behaves as before. Not tested on Linux. Pull Request resolved: pytorch#201449 Approved by: https://github.com/jeffdaily Co-authored-by: Jeff Daily <[email protected]>
## Linked issue or supporting maintainer Fixes pytorch#201447 ## BC-breaking? No ## Summary (human written only) LoadHIP.cmake now picks the HIP compiler only when CMAKE_HIP_COMPILER is not already defined. A project that passes -DCMAKE_HIP_COMPILER, or enables HIP before find_package(Torch), keeps its own compiler instead of having it replaced, which made CMake delete the cache and reconfigure without the user's options. When nothing sets the compiler, nothing changes. Changing ROCM_PATH or HIP_CLANG_PATH in an existing build directory no longer switches compilers, which matches how CMake treats other compilers. ## Agent details (if applicable) Prepared with Claude; I reviewed the change and reran the tests myself. > Tested on Windows with ROCm torch 2.16.0a0+rocm10.2.0a20261022 (gfx1200), using a copy of the installed torch CMake config with this change applied. Two consumers hit the cache reset before the change: one that enables HIP with a differently spelled path to the same clang++, and one that only passes -DCMAKE_HIP_COMPILER with a different spelling. Both configure repeatedly with their options intact after the change, and build and run a HIP kernel alongside LibTorch. A consumer that sets no compiler behaves as before. Not tested on Linux. Pull Request resolved: pytorch#201449 Approved by: https://github.com/jeffdaily Co-authored-by: Jeff Daily <[email protected]>
Linked issue or supporting maintainer
Fixes #201447
BC-breaking?
No
Summary (human written only)
LoadHIP.cmake now picks the HIP compiler only when CMAKE_HIP_COMPILER is not already defined. A project that passes -DCMAKE_HIP_COMPILER, or enables HIP before find_package(Torch), keeps its own compiler instead of having it replaced, which made CMake delete the cache and reconfigure without the user's options. When nothing sets the compiler, nothing changes. Changing ROCM_PATH or HIP_CLANG_PATH in an existing build directory no longer switches compilers, which matches how CMake treats other compilers.
Agent details (if applicable)
Prepared with Claude; I reviewed the change and reran the tests myself.
cc @jeffdaily @sunway513 @jithunnair-amd @pruthvistony @ROCmSupport @jataylo @hongxiayang @naromero77amd @pragupta @jerrymannil @xinyazhang