Skip to content

[release/v0.1.12] Cherry-pick #2839: add missing c10/hip/HIPException.h include - #2842

Closed
sunway513 wants to merge 1 commit into
release/v0.1.12from
pensun/cp-2839-c10-include-release-v0.1.12
Closed

sunway513 wants to merge 1 commit into
release/v0.1.12from
pensun/cp-2839-c10-include-release-v0.1.12

Conversation

@sunway513

Copy link
Copy Markdown
Collaborator

Cherry-picks #2839 (by @ChuanLi1101) onto release/v0.1.12 to prepare v0.1.12.post2.

Why

Building v0.1.12.post1 from source with PREBUILD_KERNELS=1 fails in vLLM's ml-ci-internal base image:

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

AITER CI doesn't catch this because rocm/pytorch:latest happens to pull <c10/hip/HIPException.h> transitively through other includes in this file. vLLM ml-ci-internal's base image doesn't, so the build fails. Per Richard's audit, this macro is referenced in exactly one .cu file across all of csrc/, so a single explicit include fully resolves it.

Fixes #2837. See #2839 for the full root-cause analysis from @ChuanLi1101.

Diff

One line added after the existing #include <ATen/...> block:

 #include "dispatch_utils.h"
 #include <ATen/hip/impl/HIPGuardImplMasqueradingAsCUDA.h>
+#include <c10/hip/HIPException.h>

 namespace aiter {

CI

Adding ci:vllm, ci:atom, ci:sglang, ci:triton-355 to validate downstream impact before merge — this is the v0.1.12.post2 candidate so we want full coverage.

Follow-up

Lingpeng raised the option of removing C10_HIP_KERNEL_LAUNCH_CHECK entirely instead of adding the header. We're going with the explicit include here to unblock @gshtras / vLLM 0.20 train today; macro removal will be tracked as a separate audit (no other csrc/ files use it).

…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.
@sunway513

Copy link
Copy Markdown
Collaborator Author

Heads up — opened #2846 as the supersede for this PR, per Lingpeng's preferred approach (remove the macro outright rather than rely on #include <c10/hip/HIPException.h>).

Context: Greg confirmed today (2026-04-21) that even with this PR's include applied, his build against an older PyTorch still fails to find C10_HIP_KERNEL_LAUNCH_CHECK — the macro is only defined in recent PyTorch versions of c10/hip/HIPException.h, so the include-based fix is brittle across PyTorch versions. Removing the macro (it's a one-liner used in exactly one place across all of csrc/, wrapping hipGetLastError()) eliminates the dependency entirely.

Leaving this PR open for Peng's call on whether to close.

@sunway513

Copy link
Copy Markdown
Collaborator Author

Superseded by #2846 (Lingpeng's macro-removal fix), which is robust to PyTorch versions that don't define C10_HIP_KERNEL_LAUNCH_CHECK even when the c10/hip header is included — confirmed by @gshtras 2026-04-21 that the include-only fix in this PR was insufficient against vLLM ml-ci-internal's older PyTorch.

Closing in favor of #2846. Issue #2837 stays open until #2846 merges and a v0.1.12.post2 tag ships.

@sunway513 sunway513 closed this Apr 22, 2026
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 deleted the pensun/cp-2839-c10-include-release-v0.1.12 branch August 11, 2026 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant