onnxruntime
2125ec43 - [Build] Fix cuda packaging build error (#29580)

Commit
99 days ago
[Build] Fix cuda packaging build error (#29580) ### Description Fixes the CUDA packaging pipeline build error (with CUDA arch `52-real`) that was introduced by #29451. ### Root cause The small-M batched GEMV path added in #29451 defines `half` helpers for the batched kernel — the `Acc2<half>` accumulator trait and the `PackNatural` / `DotAccum` / `HorizontalAdd` overloads — inside a single `#if (!defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 530)` guard that compiles the *entire* declaration out for archs below `sm_53`. However, `MatMulFloat4BatchedKernel<half>` is launched from host code and is therefore instantiated for **every** target architecture, including `sm_52`. During the `sm_52` device pass those `half` helpers no longer exist, so `nvcc` reported (100 errors, e.g.): - `incomplete type "Acc2<half>" is not allowed` - `no suitable user-defined conversion from "WPack<half>" to "const WPack<nv_bfloat16>" exists` (the compiler fell back to the `nv_bfloat16` overloads) ### Fix Mirror the existing `nv_bfloat16` convention in the same file: always define the type and function **signatures**, and gate only the arch-specific (half2-intrinsic) **bodies**. Now `Acc2<half>` is always a complete type and the `half` overloads always exist, so `MatMulFloat4BatchedKernel<half>` compiles for `sm_52`. On archs below `sm_53` the bodies compile to no-ops (returning zeros), which matches the already-shipped `nv_bfloat16` behavior for archs below `sm_80`. ### Motivation and Context The CUDA packaging pipeline builds with `CMAKE_CUDA_ARCHITECTURES=52-real;61-real;75-real;86-real;89-real;90-virtual`, so the `sm_52` device pass is required and the pipeline was broken by #29451.
Author
Parents
Loading