Skip to content

Commit 3306cea

Browse files
authored
sycl: fix mul_mat selection (#15092)
1 parent c81de6e commit 3306cea

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ggml/src/ggml-sycl/ggml-sycl.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2609,6 +2609,8 @@ static void ggml_sycl_mul_mat_vec_nc(ggml_backend_sycl_context & ctx, const ggml
26092609
GGML_ASSERT(!ggml_backend_buffer_is_sycl_split(src0->buffer));
26102610
GGML_ASSERT(src0->type == GGML_TYPE_F16);
26112611
GGML_ASSERT(src1->type == GGML_TYPE_F32);
2612+
GGML_ASSERT(src1->ne[1] == 1);
2613+
GGML_ASSERT(src1->ne[3] == 1);
26122614

26132615
const int64_t ne00 = src0->ne[0];
26142616
const int64_t ne01 = src0->ne[1];
@@ -3196,7 +3198,7 @@ static void ggml_sycl_mul_mat(ggml_backend_sycl_context & ctx, const ggml_tensor
31963198
// The kernel from the if path is faster for that specific case, but does not support all mul mats.
31973199
ggml_sycl_mul_mat_batched_sycl(ctx, src0, src1, dst);
31983200
}
3199-
} else if (!split && src0->type == GGML_TYPE_F16 && !ggml_is_contiguous(src0) && !ggml_is_transposed(src1) && src1->ne[1] == 1) {
3201+
} else if (!split && src0->type == GGML_TYPE_F16 && !ggml_is_contiguous(src0) && !ggml_is_transposed(src1) && src1->ne[1] == 1 && src1->ne[3] == 1) {
32003202
// KQV single-batch
32013203
ggml_sycl_mul_mat_vec_nc(ctx, src0, src1, dst);
32023204
} else if (!split && src0->type == GGML_TYPE_F16 && !ggml_is_transposed(src0) && !ggml_is_transposed(src1) && src1->ne[2] * src1->ne[3] > 1) {

0 commit comments

Comments
 (0)