Skip to content

[release/2.13] [ROCm] Prefer TheRock _rocm_sdk_devel when locating ROCM_HOME (#196503) - #3635

Merged
pragupta merged 1 commit into
release/2.13from
dnikolaev/find-rocm-home-devel-2.13
Sep 14, 2026
Merged

pragupta merged 1 commit into
release/2.13from
dnikolaev/find-rocm-home-devel-2.13

Conversation

@dnikolaev-amd

Copy link
Copy Markdown

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)

…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)
@pragupta
pragupta merged commit 125e973 into release/2.13 Sep 14, 2026
3 checks passed
@pragupta
pragupta deleted the dnikolaev/find-rocm-home-devel-2.13 branch September 14, 2026 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants