fix src1->type==F16 bug.

This commit is contained in:
luoyu-intel 2024-01-24 21:29:21 +08:00
parent 0e235fb816
commit 5600118221

View file

@ -12097,11 +12097,15 @@ inline void ggml_sycl_op_dequantize_mul_mat_vec(
src0->type == GGML_TYPE_Q8_0 || src0->type == GGML_TYPE_F16; src0->type == GGML_TYPE_Q8_0 || src0->type == GGML_TYPE_F16;
if (src1_convert_f16) { if (src1_convert_f16) {
if (src1->type == GGML_TYPE_F16) {
src1_dfloat = (sycl::half *)src1->data + row_low * src1_ncols;
} else {
src1_dfloat = src1_dfloat_a.alloc(ne00); src1_dfloat = src1_dfloat_a.alloc(ne00);
ggml_cpy_f32_f16_sycl((const char *)src1_ddf_i, (char *)src1_dfloat, ggml_cpy_f32_f16_sycl((const char *)src1_ddf_i, (char *)src1_dfloat,
ne00, ne00, 1, sizeof(float), 0, 0, ne00, 1, ne00, ne00, 1, sizeof(float), 0, 0, ne00, 1,
sizeof(sycl::half), 0, 0, stream); sizeof(sycl::half), 0, 0, stream);
} }
}
#else #else
const dfloat * src1_dfloat = (const dfloat *) src1_ddf_i; // dfloat == float, no conversion const dfloat * src1_dfloat = (const dfloat *) src1_ddf_i; // dfloat == float, no conversion
#endif // GGML_SYCL_F16 #endif // GGML_SYCL_F16