From 2016b7fe015a0b185ec2002deacaaafa69e5f553 Mon Sep 17 00:00:00 2001 From: Niko1221 Date: Thu, 15 Oct 2026 09:52:43 +0200 Subject: [PATCH] sycl: the migrated Gemm::bf16 / gr_norm* definitions take #2091's new parameters (the shared headers changed; SYCL never uses the FP16 image) The SYCL build of the sm_75 series failed with 'out-of-line definition of bf16 does not match any declaration' (sycl/src/prefill/gemm.dp.cpp); the four gr_* writers would have failed at link. Gemm::bf16_converts_x() answers false. --- sycl/src/prefill/gemm.dp.cpp | 5 ++++- sycl/src/prefill/kernels.dp.cpp | 9 +++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/sycl/src/prefill/gemm.dp.cpp b/sycl/src/prefill/gemm.dp.cpp index 7c173c21..5439886f 100644 --- a/sycl/src/prefill/gemm.dp.cpp +++ b/sycl/src/prefill/gemm.dp.cpp @@ -743,8 +743,11 @@ inline bool staged_gemm(sycl::queue& q, void* handle, const uint16_t* W, int lda } } // namespace +// (#2091, CUDA Turing only) no FP16 activation image on this backend +bool Gemm::bf16_converts_x() const { return false; } + void Gemm::bf16(const uint16_t* X, const uint16_t* W, float* Y, int64_t T, int64_t N, int64_t K, int64_t ldy, - float beta, int64_t ldx) { + float beta, int64_t ldx, bool /*x_f16*/) { if (T <= 0 || N <= 0) return; if (ldy <= 0) ldy = N; if (ldx <= K) ldx = 0; diff --git a/sycl/src/prefill/kernels.dp.cpp b/sycl/src/prefill/kernels.dp.cpp index 7f187957..aadec5b9 100644 --- a/sycl/src/prefill/kernels.dp.cpp +++ b/sycl/src/prefill/kernels.dp.cpp @@ -2278,7 +2278,7 @@ void to_bf16(const float* x, uint16_t* y, int64_t n, void* stream, uint16_t* ylo } void gr_norm(const float* R, const float* w_norm, float eps, float* xn, uint16_t* xn16, int64_t T, void* stream, - uint16_t* xn16_lo) { + uint16_t* xn16_lo, bool /*f16img: the Turing FP16 image of xn16 (CUDA only)*/) { { auto exp_props = sycl::ext::oneapi::experimental::properties{ sycl::ext::oneapi::experimental::use_root_sync}; @@ -2297,7 +2297,7 @@ void gr_norm(const float* R, const float* w_norm, float eps, float* xn, uint16_t check("gr_norm"); } void gr_norm_rs(const float* R, const float* w_norm, float eps, float* rs, uint16_t* xn16, int64_t T, void* stream, - uint16_t* xn16_lo, int64_t ldx) { + uint16_t* xn16_lo, int64_t ldx, bool /*f16img*/) { { auto exp_props = sycl::ext::oneapi::experimental::properties{ sycl::ext::oneapi::experimental::use_root_sync}; @@ -2360,7 +2360,8 @@ bool gr_upmix(const uint16_t* lo16, const uint16_t* w_up, const float* R, const #endif } void gr_write_norm_rs(float* R, const float* bo, const float* inj, int64_t inj_ld, const float* w_norm_next, float eps, - float* rs, uint16_t* xn16, int64_t T, void* stream, uint16_t* xn16_lo, int64_t ldx) { + float* rs, uint16_t* xn16, int64_t T, void* stream, uint16_t* xn16_lo, int64_t ldx, + bool /*f16img*/) { { auto exp_props = sycl::ext::oneapi::experimental::properties{ sycl::ext::oneapi::experimental::use_root_sync}; @@ -2387,7 +2388,7 @@ void gr_write_norm_rs(float* R, const float* bo, const float* inj, int64_t inj_l } void gr_write_cvec_norm_rs(float* R, const float* bo, const float* inj, int64_t inj_ld, const float* v_l, const float* s_l, const int* on, int mode, const float* w_norm_next, float eps, float* rs, - uint16_t* xn16, int64_t T, void* stream, uint16_t* xn16_lo, int64_t ldx) { + uint16_t* xn16, int64_t T, void* stream, uint16_t* xn16_lo, int64_t ldx, bool /*f16img*/) { { auto exp_props = sycl::ext::oneapi::experimental::properties{ sycl::ext::oneapi::experimental::use_root_sync};