Skip to content

Commit 741eb44

Browse files
OuadiElfaroukiiThalay
authored andcommitted
Enabled more data types for oneMKL gemm_batch (llama/8236)
1 parent 8725b21 commit 741eb44

File tree

1 file changed

+0
-30
lines changed

1 file changed

+0
-30
lines changed

ggml/src/ggml-sycl.cpp

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3493,10 +3493,6 @@ static void ggml_sycl_mul_mat_batched_sycl(ggml_backend_sycl_context & ctx,
34933493
SYCL_CHECK(ggml_sycl_set_device(ctx.device));
34943494
queue_ptr main_stream = ctx.stream();;
34953495

3496-
bool no_mixed_dtypes = main_stream->get_backend() == sycl::backend::ext_oneapi_cuda ||
3497-
main_stream->get_backend() == sycl::backend::ext_oneapi_hip;
3498-
3499-
35003496
void * src0_ddq = src0->data;
35013497
sycl::half *src0_as_f16 = (sycl::half *)src0_ddq;
35023498
float * src1_ddf = (float *) src1->data;
@@ -3514,15 +3510,10 @@ static void ggml_sycl_mul_mat_batched_sycl(ggml_backend_sycl_context & ctx,
35143510
sycl::half *src1_f16 = src1->type == GGML_TYPE_F16 ? (sycl::half *)src1_ddf
35153511
: src1_f16_alloc.get();
35163512

3517-
ggml_sycl_pool_alloc<sycl::half> dst_f16(ctx.pool());
35183513
char * dst_t;
35193514

35203515
dpct::library_data_t cu_compute_type = dpct::library_data_t::real_float;
35213516
dpct::library_data_t cu_data_type = dpct::library_data_t::real_float;
3522-
if (no_mixed_dtypes) {
3523-
cu_compute_type = dpct::library_data_t::real_half;
3524-
cu_data_type = dpct::library_data_t::real_half;
3525-
}
35263517

35273518
// dst strides
35283519
size_t nbd2 = dst->nb[2];
@@ -3531,26 +3522,10 @@ static void ggml_sycl_mul_mat_batched_sycl(ggml_backend_sycl_context & ctx,
35313522
const float alpha_f32 = 1.0f;
35323523
const float beta_f32 = 0.0f;
35333524

3534-
const sycl::half alpha_f16 = 1.0f;
3535-
const sycl::half beta_f16 = 0.0f;
3536-
35373525
const void * alpha = &alpha_f32;
35383526
const void * beta = &beta_f32;
3539-
if (no_mixed_dtypes) {
3540-
alpha = &alpha_f16;
3541-
beta = &beta_f16;
3542-
}
3543-
3544-
// TODO: Renable (dst->op_params[0] =! GGML_PREC_DEFAULT) pathway
3545-
// when oneMKL open source supports half, half, float, float: datatypes
35463527

35473528
dst_t = (char *) dst_ddf;
3548-
if (no_mixed_dtypes) {
3549-
dst_t = (char *) dst_f16.alloc(ne_dst);
3550-
3551-
nbd2 /= sizeof(float) / sizeof(sycl::half);
3552-
nbd3 /= sizeof(float) / sizeof(sycl::half);
3553-
}
35543529

35553530
GGML_ASSERT(ne12 % ne02 == 0);
35563531
GGML_ASSERT(ne13 % ne03 == 0);
@@ -3612,11 +3587,6 @@ static void ggml_sycl_mul_mat_batched_sycl(ggml_backend_sycl_context & ctx,
36123587
(void **)(ptrs_dst.get() + 0 * ne23), cu_data_type, ne01, ne23,
36133588
cu_compute_type)));
36143589
}
3615-
3616-
if (no_mixed_dtypes) {
3617-
const to_fp32_sycl_t to_fp32_sycl = ggml_get_to_fp32_sycl(GGML_TYPE_F16);
3618-
to_fp32_sycl(dst_f16.get(), dst_ddf, ne_dst, main_stream);
3619-
}
36203590
}
36213591
catch (sycl::exception const &exc) {
36223592
std::cerr << exc.what() << "Exception caught at file:" << __FILE__

0 commit comments

Comments
 (0)