Skip to content

Commit 948f4ec

Browse files
authored
[SYCL] rm wait() (#7233)
1 parent 9aa6724 commit 948f4ec

File tree

1 file changed

+1
-24
lines changed

1 file changed

+1
-24
lines changed

ggml-sycl.cpp

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15564,26 +15564,6 @@ static void ggml_sycl_mul_mat_batched_sycl(const ggml_tensor *src0,
1556415564
const int64_t r2 = ne12/ne02;
1556515565
const int64_t r3 = ne13/ne03;
1556615566

15567-
#if 0
15568-
// use syclGemmEx
15569-
{
15570-
for (int i13 = 0; i13 < ne13; ++i13) {
15571-
for (int i12 = 0; i12 < ne12; ++i12) {
15572-
int i03 = i13 / r3;
15573-
int i02 = i12 / r2;
15574-
15575-
SYCL_CHECK(
15576-
syclGemmEx(g_sycl_handles[g_main_device], CUBLAS_OP_T, CUBLAS_OP_N,
15577-
ne01, ne11, ne10,
15578-
alpha, (const char *) src0_as_f16 + i02*src0->nb[2] + i03*src0->nb[3] , SYCL_R_16F, nb01/sizeof(half),
15579-
(const char *) src1_as_f16 + i12*src1->nb[2]/2 + i13*src1->nb[3]/2, SYCL_R_16F, nb11/sizeof(float),
15580-
beta, ( char *) dst_t + i12*nbd2 + i13*nbd3, cu_data_type, ne01,
15581-
cu_compute_type,
15582-
CUBLAS_GEMM_DEFAULT_TENSOR_OP));
15583-
}
15584-
}
15585-
}
15586-
#else
1558715567
if (r2 == 1 && r3 == 1 && src0->nb[2]*src0->ne[2] == src0->nb[3] && src1->nb[2]*src1->ne[2] == src1->nb[3]) {
1558815568
// there is no broadcast and src0, src1 are contiguous across dims 2, 3
1558915569
SYCL_CHECK(CHECK_TRY_ERROR(dpct::gemm_batch(
@@ -15595,7 +15575,6 @@ static void ggml_sycl_mul_mat_batched_sycl(const ggml_tensor *src0,
1559515575
nb11 / nb10, nb12 / nb10, beta,
1559615576
(char *)dst_t, cu_data_type, ne01, nb2 / nb0,
1559715577
ne12 * ne13, cu_compute_type)));
15598-
g_sycl_handles[g_main_device]->wait();
1559915578
} else {
1560015579
const int ne23 = ne12*ne13;
1560115580

@@ -15626,7 +15605,7 @@ static void ggml_sycl_mul_mat_batched_sycl(const ggml_tensor *src0,
1562615605
nb02, nb03, nb12_scaled, nb13_scaled,
1562715606
nbd2, nbd3, r2, r3, item_ct1);
1562815607
});
15629-
}).wait();
15608+
});
1563015609
}
1563115610
SYCL_CHECK(CHECK_TRY_ERROR(dpct::gemm_batch(
1563215611
*g_sycl_handles[g_main_device], oneapi::mkl::transpose::trans,
@@ -15637,9 +15616,7 @@ static void ggml_sycl_mul_mat_batched_sycl(const ggml_tensor *src0,
1563715616
dpct::library_data_t::real_half, nb11 / nb10, beta,
1563815617
(void **)(ptrs_dst.get() + 0 * ne23), cu_data_type, ne01, ne23,
1563915618
cu_compute_type)));
15640-
g_sycl_handles[g_main_device]->wait();
1564115619
}
15642-
#endif
1564315620

1564415621
if (no_mixed_dtypes) {
1564515622
const to_fp32_sycl_t to_fp32_sycl = ggml_get_to_fp32_sycl(GGML_TYPE_F16);

0 commit comments

Comments
 (0)