Skip to content

fix(build): add missing c10/hip/HIPException.h include in gated_rmsnorm_quant_kernels.cu - #2839

Closed
ChuanLi1101 wants to merge 1 commit into
mainfrom
chuan/fix-2837-prebuild-c10-hip-include
Closed

ChuanLi1101 wants to merge 1 commit into
mainfrom
chuan/fix-2837-prebuild-c10-hip-include

Conversation

@ChuanLi1101

Copy link
Copy Markdown
Contributor

Summary

Adds the missing #include <c10/hip/HIPException.h> to csrc/kernels/gated_rmsnorm_quant_kernels.cu so that wheel builds with PREBUILD_KERNELS=1 succeed.

Fixes #2837.

Root cause

gated_rmsnorm_quant_kernels.cu line 223 uses C10_HIP_KERNEL_LAUNCH_CHECK() but the file never includes the header that defines it. The macro lives in c10/hip/HIPException.h (analogue of C10_CUDA_KERNEL_LAUNCH_CHECK in c10/cuda/CUDAException.h).

  • JIT path: the AITER hipify pipeline under aiter/jit/utils/hipify/ injects these c10 headers implicitly, so the missing include was invisible in per-PR CI.
  • PREBUILD_KERNELS=1 path: compiles the .cu directly via setup.py extensions, without that injection, and fails with
csrc/kernels/gated_rmsnorm_quant_kernels.cu:223:5:
  error: use of undeclared identifier 'C10_HIP_KERNEL_LAUNCH_CHECK'

The regression was introduced in 875f6b7 (#2499, "Fuse gated rmsnorm + group_quant for qwen3next and qwen3.5") and is present in v0.1.12.post1.

Fix

One-line change: add #include <c10/hip/HIPException.h> to the file's include block.

Test plan

  • Local: PREBUILD_KERNELS=1 pip install . no longer errors on gated_rmsnorm_quant_kernels.cu.
  • JIT path still builds the kernel unchanged (no behavioral change; only adds a header).
  • No runtime semantics change - same macro, same call site.

Follow-up suggestion

This class of bug (compiles via JIT, fails via PREBUILD_KERNELS=1) is only catchable by a wheel-build CI lane. Consider adding a per-PR job that runs PREBUILD_KERNELS=1 pip wheel . on at least one config; happy to send a separate proposal.

…rm_quant_kernels.cu

The file uses C10_HIP_KERNEL_LAUNCH_CHECK() at line 223 but never
includes the header that defines it, so PREBUILD_KERNELS=1 builds fail
with:

  csrc/kernels/gated_rmsnorm_quant_kernels.cu:223:5:
  error: use of undeclared identifier 'C10_HIP_KERNEL_LAUNCH_CHECK'

JIT builds do not hit this because the JIT hipify pipeline injects
these headers implicitly; PREBUILD_KERNELS=1 goes through setup.py
extensions directly and does not.

Fixes #2837

Made-with: Cursor
@ChuanLi1101
ChuanLi1101 requested a review from a team April 21, 2026 15:14
@github-actions

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

  • ✅ Pre-checks (submodule verification, code formatting)
  • ✅ Aiter op tests (gfx942 + gfx950)
  • ✅ Triton tests (only when aiter/ops/triton/** or related paths are changed)

Extended tests (opt-in via labels):

Label Tests
ci:triton-355 Run Triton tests on MI355 in addition to MI325
ci:sglang SGLang integration tests
ci:atom ATOM benchmark (DeepSeek-R1 + GPT-OSS)
ci:vllm vLLM benchmark
ci:all All of the above

Add labels via the sidebar or gh pr edit 2839 --add-label <label>

sunway513 pushed a commit that referenced this pull request Apr 21, 2026
…rm_quant_kernels.cu

Cherry-pick of #2839 (by @ChuanLi1101) onto release/v0.1.12 to unblock
PREBUILD_KERNELS=1 builds in vLLM ml-ci-internal base image.

Fixes #2837. See PR #2839 for full root-cause analysis.
sunway513 added a commit that referenced this pull request Apr 21, 2026
…nels.cu

Per Lingpeng's review on PR #2839/#2842 — the macro is defined only by
recent PyTorch versions' c10/hip/HIPException.h. Building AITER from
source against older PyTorch releases (e.g. vLLM ml-ci-internal lane,
issue #2837) fails to find the macro even when the include is present.

The macro is used in exactly one place across all of csrc/. It's an
error-reporting wrapper around hipGetLastError() — the kernel launches
themselves are unaffected. Removing it eliminates the build-env
dependency and is robust across PyTorch versions.

Supersedes #2842 (cherry-pick of #2839's include-based fix).
Fixes #2837.
valarLip pushed a commit that referenced this pull request Apr 22, 2026
…nels.cu (#2846)

Per Lingpeng's review on PR #2839/#2842 — the macro is defined only by
recent PyTorch versions' c10/hip/HIPException.h. Building AITER from
source against older PyTorch releases (e.g. vLLM ml-ci-internal lane,
issue #2837) fails to find the macro even when the include is present.

The macro is used in exactly one place across all of csrc/. It's an
error-reporting wrapper around hipGetLastError() — the kernel launches
themselves are unaffected. Removing it eliminates the build-env
dependency and is robust across PyTorch versions.

Supersedes #2842 (cherry-pick of #2839's include-based fix).
Fixes #2837.
@zufayu

zufayu commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

@ChuanLi1101 This PR has been inactive for over 2 months. Is the HIPException.h include fix still applicable? If you still plan to pursue it, please rebase onto current main and push an update. If there's no response within ~2 weeks, we'll close this to keep the PR queue clean — it can always be reopened or resubmitted.

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

No activity for 15 days, so this is now labelled stale. A push or a comment clears it; keep-open exempts it.

@github-actions github-actions Bot added the stale The PR hasn't been updated in 2 weeks label Oct 7, 2026
@zufayu zufayu closed this Oct 23, 2026
@zufayu
zufayu deleted the chuan/fix-2837-prebuild-c10-hip-include branch October 23, 2026 02:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale The PR hasn't been updated in 2 weeks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Building 0.1.12.post1 with PREBUILD_KERNELS fails

2 participants