[release/2.13] [ROCm] Prefer TheRock _rocm_sdk_devel when locating ROCM_HOME (#196503) - #3635
Merged
Merged
Conversation
…h#196503) TheRock pip wheels split the SDK: `_rocm_sdk_core` has the HIP runtime and hipcc, while math-library headers (hipblas, hipsparse, hipsolver) live in `_rocm_sdk_devel`. `_find_rocm_home()` previously always selected core, so cpp_extension include_paths only added that include root. JIT extensions that include ATen CUDA headers (which hipify to hipblas/hipsparse/hipsolver) then fail to compile with `hipblas/hipblas.h: No such file or directory`. Prefer `_rocm_sdk_devel` when that package is importable, falling back to `_rocm_sdk_core` Warn if `rocm[devel]` is installed but not expanded via `rocm-sdk init`, instead of expanding at import time. Test Plan: ``` python test_cuda.py TestMemPool.test_mempool_limited_memory_with_allocator python test_cpp_extensions_jit.py python test_cuda.py TestMemPool ``` Pull Request resolved: pytorch#196503 Approved by: https://github.com/jeffdaily, https://github.com/ethanwee1 (cherry picked from commit 54549a9)
This was referenced Sep 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TheRock pip wheels split the SDK:
_rocm_sdk_corehas the HIP runtime and hipcc, while math-library headers (hipblas, hipsparse, hipsolver) live in_rocm_sdk_devel._find_rocm_home()previously always selected core, so cpp_extension include_paths only added that include root. JIT extensions that include ATen CUDA headers (which hipify to hipblas/hipsparse/hipsolver) then fail to compile withhipblas/hipblas.h: No such file or directory.Prefer
_rocm_sdk_develwhen that package is importable, falling back to_rocm_sdk_coreWarn if
rocm[devel]is installed but not expanded viarocm-sdk init, instead of expanding at import time.Test Plan:
Pull Request resolved: pytorch#196503
Approved by: https://github.com/jeffdaily, https://github.com/ethanwee1
(cherry picked from commit 54549a9)