Skip to content

Commit 50addec

Browse files
airMengAlcpz
andauthored
[SYCL] fallback mmvq (ggml-org#9088)
* fallback mmvq to mul_mat * mmvq in cuda path * Update ggml/src/ggml-sycl.cpp Co-authored-by: Alberto Cabrera Pérez <[email protected]> --------- Co-authored-by: Alberto Cabrera Pérez <[email protected]>
1 parent 4f8d19f commit 50addec

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

ggml/src/ggml-sycl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3477,7 +3477,8 @@ static void ggml_sycl_mul_mat(ggml_backend_sycl_context & ctx, const ggml_tensor
34773477

34783478
bool use_mul_mat_vec_q = ggml_is_quantized(src0->type)
34793479
&& src1->type == GGML_TYPE_F32 && dst->type == GGML_TYPE_F32
3480-
&& src1->ne[1] <= MMVQ_MAX_BATCH_SIZE;
3480+
&& src1->ne[1] <= MMVQ_MAX_BATCH_SIZE
3481+
&& (ctx.stream()->get_backend() == sycl::backend::ext_oneapi_cuda || src1->ne[1] > MMVQ_MIN_BATCH_SIZE);
34813482

34823483
bool use_mul_mat_q = ggml_sycl_supports_mmq(src0->type)
34833484
&& src1->type == GGML_TYPE_F32 && dst->type == GGML_TYPE_F32;

ggml/src/ggml-sycl/common.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ typedef sycl::float2 dfloat2;
130130
#endif // GGML_SYCL_F16
131131

132132
#define MMVQ_MAX_BATCH_SIZE 8
133+
#define MMVQ_MIN_BATCH_SIZE 4
133134

134135
static const int8_t kvalues_iq4nl[16]={-127, -104, -83, -65, -49, -35, -22, -10, 1, 13, 25, 38, 53, 69, 89, 113};
135136

0 commit comments

Comments
 (0)