Skip to content

[release/2.13] [ROCm] Add hipccl include dir for HIP extension builds (#206478) - #4071

Merged
jeffdaily merged 1 commit into
release/2.13from
amd-mcieslak/cherry-pick/2.13/hipccl-include-dir
Nov 26, 2026
Merged

jeffdaily merged 1 commit into
release/2.13from
amd-mcieslak/cherry-pick/2.13/hipccl-include-dir

Conversation

@amd-mcieslak

@amd-mcieslak amd-mcieslak commented Nov 25, 2026 •

Copy link
Copy Markdown

Linked issue or supporting maintainer

Supported by @jeffdaily

BC-breaking?

No. Upcoming changes in ROCm/rocm-libraries (ROCm/rocm-libraries#15610) will likely break ROCm/HIP-based builds of plugins (torchaudio, torchvision, and any third-party torch.utils.cpp_extension consumers) unless they include this patch.

Backporting is required, but should be done on ROCm/pytorch.

Summary

  • Plugins (torchaudio, torchvision) cannot be built because they cannot find libhipcxx, see TheRock CI.
  • Root cause is that hipCUB and rocThrust now rely on libhipcxx, which is only provided under ${ROCM_HOME}/include/hipccl. CMake-based builds (PyTorch itself) find it through find_package(libhipcxx), but cpp_extension compiles have no such mechanism.
  • A minimal fix on the PyTorch side is to add this directory to include_paths() for HIP extensions, guarded by an existence check so it is a no-op on ROCm installs that do not ship hipccl.

Agent details

Key steps: traced the Could not find libhipcxx! error to __has_include(<hip/std/version>) probes in rocthrust's thrust/detail/config/libcxx.h; confirmed the probe path only resolves with -I${ROCM_HOME}/include/hipccl; placed the fix in include_paths() so it reaches the CUDAExtension/CppExtension setup.py flow, JIT load()/load_inline(), and hipify header resolution.

Pull Request resolved: pytorch#206478
Approved by: https://github.com/jeffdaily

…ension builds (pytorch#206478)

Backport of pytorch#206478 to release/2.13.

Plugins (torchaudio, torchvision) and any third-party
torch.utils.cpp_extension consumer fail to build because they cannot find
libhipcxx. The root cause is that hipCUB and rocThrust now rely on libhipcxx,
which is only provided under ${ROCM_HOME}/include/hipccl. CMake-based builds
(PyTorch itself) find it through find_package(libhipcxx), but cpp_extension
compiles have no such mechanism. This adds the directory to include_paths()
for HIP extensions, guarded by an existence check so it is a no-op on ROCm
installs that do not ship hipccl.

Adapted rather than cherry-picked: include_paths() was refactored on main
after this branch point to use a rocm_home_include local with a '/usr/include'
guard, so the upstream hunk does not apply here. The added lines are
identical; only the anchor differs.

Co-authored-by: Nara Prasetya <[email protected]>
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@amd-mcieslak
amd-mcieslak marked this pull request as ready for review November 25, 2026 16:49
@jeffdaily jeffdaily changed the title [release/2.13] fix(cpp_extension): add hipccl include dir for hip extension builds (#206478) [release/2.13] [ROCm] Add hipccl include dir for HIP extension builds (#206478) Nov 26, 2026
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