Skip to content

[Backport - 0.1.28] [JIT] [Bugfix] Add hipccl include path for libhipcxx - #8956

Merged
NguyenNhuDi merged 1 commit into
ROCm:release/v0.1.28from
NguyenNhuDi:backport/v0.1.28-hipccl-8864
Nov 30, 2026
Merged

NguyenNhuDi merged 1 commit into
ROCm:release/v0.1.28from
NguyenNhuDi:backport/v0.1.28-hipccl-8864

Conversation

@NguyenNhuDi

Copy link
Copy Markdown
Contributor

Back port of #8864

Summary

Add the ROCm include/hipccl directory to the include paths that the AITER JIT
uses for HIP extensions. Add it only when the directory exists.

Motivation

In newer ROCm releases, rocThrust and hipCUB require libhipcxx
(<hip/std/...>). ROCm supplies libhipcxx only in ${ROCM_HOME}/include/hipccl.
The AITER JIT does not add this directory, so a build that includes rocThrust
headers fails. Example from the vLLM nightly build (ROCm 10.3.0a20261127,
torch 2.14.0, Python 3.14), while it compiles module_attention:

_rocm_sdk_devel/include/thrust/detail/config/libcxx.h:91:4: error: Could not find libhipcxx!
_rocm_sdk_devel/include/thrust/detail/type_traits.h:105:27: error: use of undeclared identifier '_THRUST_STD'

PyTorch has the same fix in ROCm/pytorch#4071. AITER uses its own copy of
torch.utils.cpp_extension (aiter/jit/utils/cpp_extension.py), so the
PyTorch fix does not apply to AITER builds.

Changes

  • include_paths() in aiter/jit/utils/cpp_extension.py: for HIP extensions,
    add <rocm_include>/hipccl and <devel_include>/hipccl when each directory
    exists.
  • include_paths() supplies the include directories for setuptools
    extensions, JIT ninja builds and hipify header lookup. This one change
    applies to all of them.
  • The existing include and _rocm_sdk_devel/include paths do not change.
    On ROCm installs without hipccl, the behavior does not change.

Testing

  • Unit tests added or updated
  • Performance benchmarks run
  • Tested on MI250X
  • Tested on MI300X
  • Build only change. Verified locally

No unit test is added: this change is to a build path. The real test is a
successful JIT build on a ROCm release that ships include/hipccl.

Documentation

  • Docstrings updated
  • User guide updated
  • Performance guide updated
  • No documentation change is needed, with the reason stated below

This is an internal build fix. Users do not see a change.

Dependencies

  • No new third-party dependencies added
  • New dependencies are listed and justified below

Breaking Changes

None.

PR Self-Review

Reviewed revision

56f7c7d

Behavior and intent

Before: JIT builds of HIP extensions that include rocThrust or hipCUB headers
fail on newer ROCm with Could not find libhipcxx!. The include/hipccl
directory is not on the include path.
After: include_paths() adds include/hipccl from the ROCm include tree and
from the _rocm_sdk_devel include tree when each exists. Older ROCm installs
see no change.

Validation and unverified scope

Using this mini build test.py:

from aiter.jit import core
a = core.get_args_of_build("module_attention")
core.build_module(md_name=a["md_name"], srcs=a["srcs"],
    flags_extra_cc=a["flags_extra_cc"], flags_extra_hip=a["flags_extra_hip"],
    blob_gen_cmd=a["blob_gen_cmd"], extra_include=a["extra_include"],
    extra_ldflags=a.get("extra_ldflags"), verbose=True, is_python_module=True,
    is_standalone=False, torch_exclude=a.get("torch_exclude", False),
    third_party=a["third_party"])
# setting up env
docker run -it --device=/dev/kfd --device=/dev/dri --security-opt seccomp=unconfined --group-add video --network=host -v $HOME:/dockerx python:3.14 bash

# inside the container:
pip install --index-url https://stable.repo.amd.com/rocm/whl-next/ \
  --extra-index-url https://nightly.repo.amd.com/rocm/whl-next \
  "rocm[libraries,devel]==10.3.0a20261127" "torch==2.14.0" && rocm-sdk init
pip install pyyaml ninja pybind11

cd /dockerx/aiter/aiter && git submodule update --init --recursive

pip install -r requirements.txt packaging numpy setuptools wheel "setuptools_scm[toml]>=6.2"

Reproducing error step

# reproducing error (ran with main)
rm -rf aiter/jit/build/module_attention aiter/jit/module_attention*.so
PYTHONPATH=$PWD GPU_ARCHS="gfx1201" python ~/test.py

Error observed:

In file included from /usr/local/lib/python3.14/site-packages/_rocm_sdk_devel/include/thrust/detail/config/config.h:24:
In file included from /usr/local/lib/python3.14/site-packages/_rocm_sdk_devel/include/thrust/detail/libcxx_wrapper/__cccl_config.h:17:
/usr/local/lib/python3.14/site-packages/_rocm_sdk_devel/include/thrust/detail/config/libcxx.h:91:4: error: Could not find libhipcxx!
   91 | #  error Could not find libhipcxx!
      |    ^

Showing fix step

# ran with changes in this pr
rm -rf aiter/jit/build/module_attention aiter/jit/module_attention*.so
PYTHONPATH=$PWD GPU_ARCHS="gfx1201" python ~/test.py

Build completes

PR-specific question

  1. What behavior does this PR change, and why is the existing behavior insufficient?
    need to include hipccl in order to include rocthrust and hipcub. Current code does not do this correctly
  2. What did you validate, and what remains unverified? Include commands, hardware/configuration and results.
    I validated the error comes from the existing code base and validated the changes fixes the error. This was done by reproducing the CI pipeline. Nothing should be unverified based on these experiments.
  3. What changes in dependency, cache or compilation behavior, and how did you verify both a clean build and an existing-cache path?
    see validation section for detailed steps
  4. For every changed op_tests/ file, what behavior does it cover and why is it not redundant? Write None if no op test changed.
    None

Changed op tests

None.

@NguyenNhuDi NguyenNhuDi changed the title fix(aiter): adding in hipccl include path (#8864) [Backport - 0.1.28] [JIT] [Bugfix] Add hipccl include path for libhipcxx Nov 30, 2026
@NguyenNhuDi
NguyenNhuDi merged commit f74670b into ROCm:release/v0.1.28 Nov 30, 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.

1 participant