Fix NVRTC compilation for HyperConnection kernels - #376
Conversation
| #pragma clang diagnostic push | ||
| #pragma clang diagnostic ignored "-Wunknown-attributes" | ||
|
|
||
| #include <cuda_device_runtime_api.h> |
There was a problem hiding this comment.
🟡 warning: Unconditional, outside-guard placement (same at sm100_tf32_hc_prenorm_gemm.cuh:5). The only reference is at sm90:122 / sm100:139 inside #if (defined(__CUDA_ARCH__) and (__CUDA_ARCH__ >= ...)) ... or defined(__CLION_IDE__), and NVCC already provides the decl only on the device pass. This header is device-runtime-only and is also pulled into host/prebuilt/clang-cuda compilation of the same .cuh. Recommend moving/guarding it consistently (e.g. behind __CUDACC_RTC__/__CUDA_ARCH__, or use a minimal extern "C" cudaError_t cudaGridDependencySynchronize(void); prototype guarded by __CUDACC_RTC__) to avoid fragile/version-dependent effects on the other build paths.
🤖 v4
| #pragma clang diagnostic push | ||
| #pragma clang diagnostic ignored "-Wunknown-attributes" | ||
|
|
||
| #include <cuda_device_runtime_api.h> |
There was a problem hiding this comment.
🟡 warning: Validation/scope. The original failure was NVRTC-specific, but the fix is unconditional and is now compiled by the NVCC/clang host/prebuilt and the non-NVRTC device paths as well. The PR only ran NVRTC compile-only regressions and git diff --check, so a green NVRTC compile does not prove those other compiler configurations still compile/link, nor that device behavior is unchanged. A full build (NVCC/clang/prebuilt) and, if possible, a GPU run should be done before merge.
🤖 v4
🤖 ds-review-bot Code Reviewv4The patch re-enables NVRTC (DG_JIT_USE_NVRTC=1) compilation of the SM90/SM100 HyperConnection pre-norm GEMM kernels by adding v3This PR adds Files reviewed: 2 |
Summary
<cuda_device_runtime_api.h>in the SM90 and SM100 HyperConnection pre-norm GEMM kernels.cudaGridDependencySynchronize()declaration available to the NVRTC compilation path.Root cause
Both HyperConnection kernels call the Programmatic Dependent Launch synchronization intrinsic. With
DG_JIT_USE_NVRTC=1, the current include chain does not expose its device-runtime declaration, so NVRTC fails with:NVCC provides the declaration implicitly in this path, which is why the failure is NVRTC-specific.
Impact
This restores NVRTC compilation for both SM90 and SM100 HyperConnection kernels. It does not change kernel logic, synchronization behavior, or launch configuration.
Validation
git diff --check origin/main...HEADGPU runtime validation was not performed because the Actions runner did not have an NVIDIA GPU.
Fixes #359