Skip to content

[JIT] [Bugfix] Add hipccl include path for libhipcxx - #8864

Merged
NguyenNhuDi merged 1 commit into
ROCm:mainfrom
NguyenNhuDi:main
Nov 30, 2026
Merged

NguyenNhuDi merged 1 commit into
ROCm:mainfrom
NguyenNhuDi:main

Conversation

@NguyenNhuDi

@NguyenNhuDi NguyenNhuDi commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

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 requested a review from a team November 27, 2026 16:58
@github-actions

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

  • ✅ Pre-checks (submodule verification, code formatting)
  • ✅ Aiter standard tests on MI35X
  • ✅ Triton tests on MI35X (only when aiter/ops/triton/** or related paths are changed)

Extended tests (opt-in via labels):

Label Tests
ci:mi300x Run Aiter standard tests on MI300X in PRs; main branch always runs them
ci:gfx1250-ffm-triton Run the five-shard gfx1250 FFM Triton test suite
ci:triton-300x Run an additional Triton test job on MI300X in PRs (added automatically when gfx942 configs change); main branch always runs both MI35X and MI300X
ci:triton-355 Run the full Triton test suite on MI35X, not only the tests the change affects
ci:windows Windows JIT op smoke test on the Radeon R9700 ROCm runner
ci:multi-gpu Aiter multi-GPU tests on the 8-GPU runner
ci:sglang SGLang integration tests: DeepSeek-R1-MXFP4 accuracy, Qwen 3.5 accuracy
ci:atom ATOM benchmark: DeepSeek-R1-0528, GPT-OSS-120B
ci:atom_full ATOM accuracy suite for PR and main models from ATOM models_accuracy.json
ci:vllm vLLM benchmark: DeepSeek-V4-Pro, MiniMax-M3-MXFP4
ci:all All standard extended tests (excludes ci:atom_full)

Only add ci:atom_full for FlyDSL or Triton upgrades.
Add labels via the sidebar or gh pr edit 8864 --add-label <label>

One backend per PR:
A PR changes one kernel backend: [Triton/Gluon] (Triton and Gluon count as one), [HIP], [ASM], [CK], [OPUS] or [FlyDSL]. If the title ends up with two backend tags, split the PR -- as stacked pull requests when one part cannot merge without the other.

PR title tags & labels:
Component tags ([Triton/Gluon], [HIP], [CK], [ASM], ...) are added to the PR title and as PR labels automatically from the changed files and re-synced on every push — change-type tags like [fix]/[Perf], op tags like [MLA], and human labels (ci:*) are left untouched. Add the no-auto-title label to stop the title rewrites; labels stay in sync either way.

Reviews:
A reviewer is usually assigned within one working day after the PR is ready for review (see Code Review Process). If nobody has responded for about a week, mention the area contact listed in CONTACTS.md. Want to help review? See REVIEWERS.md.

@github-actions github-actions Bot changed the title fix(aiter): adding in hipccl include path [JIT] fix(aiter): adding in hipccl include path Nov 27, 2026
@github-actions github-actions Bot added the JIT label Nov 27, 2026
@aiter-bot

aiter-bot commented Nov 27, 2026 •

Copy link
Copy Markdown

WAITING ON AUTHOR

PR Self-Review

Revision 56f7c7d0b3d8 · mode shadow

Waiting for the PR author. The readiness report will appear after the self-review answers are complete for this revision.

Questions to answer in the PR description

  1. What behavior does this PR change, and why is the existing behavior insufficient?
  2. What did you validate, and what remains unverified? Include commands, hardware/configuration and results.
  3. What changes in dependency, cache or compilation behavior, and how did you verify both a clean build and an existing-cache path?
  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.

Edit the PR Self-Review section in the PR description. Include the current revision SHA; this comment refreshes automatically.

Missing or invalid answers

  • FAIL — validation answer must explicitly state what remains unverified (or say none with a reason)

Shadow mode reports what would block but keeps the status successful. Set AITER_PR_SELF_REVIEW_MODE=enforce only after reviewing real false positives.

@NguyenNhuDi NguyenNhuDi changed the title [JIT] fix(aiter): adding in hipccl include path [JIT] [Bugfix] Add hipccl include path for libhipcxx Nov 27, 2026

@XiaobingSuper XiaobingSuper left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@NguyenNhuDi
NguyenNhuDi merged commit 2791c05 into ROCm:main Nov 30, 2026
68 of 69 checks passed
NguyenNhuDi added a commit that referenced this pull request Nov 30, 2026
NguyenNhuDi added a commit that referenced this pull request Nov 30, 2026
jvadakat added a commit to jvadakat/aiter that referenced this pull request Dec 1, 2026
adding in hipccl include path (ROCm#8864) and add a line (cherry picked from commit 2791c05)
@jvadakat jvadakat mentioned this pull request Dec 1, 2026
10 tasks
TennyWang1223 pushed a commit that referenced this pull request Dec 2, 2026
(cherry picked from commit 2791c05)

Co-authored-by: Di Nguyen <[email protected]>
zufayu added a commit to zufayu/aiter that referenced this pull request Dec 2, 2026
module_topk_plain is expected to fail on ROCm 10.3 right now (the
torch_exclude path never gets the ROCm#8864 hipccl include fix). Match
the failure against that known signature so the smoke test can tell
apart three states: the gap is still open (xfail, don't block CI), the
gap got fixed upstream (loud PASS notice to clean up the xfail), or
something unrelated broke (real failure, re-raise with the original
error).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants