Spaces:
Sleeping
Sleeping
fallback mmvq (llama/9088)
Browse files* 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]>
- ggml/src/ggml-sycl.cpp +2 -1
- ggml/src/ggml-sycl/common.hpp +1 -0
ggml/src/ggml-sycl.cpp
CHANGED
|
@@ -3477,7 +3477,8 @@ static void ggml_sycl_mul_mat(ggml_backend_sycl_context & ctx, const ggml_tensor
|
|
| 3477 |
|
| 3478 |
bool use_mul_mat_vec_q = ggml_is_quantized(src0->type)
|
| 3479 |
&& src1->type == GGML_TYPE_F32 && dst->type == GGML_TYPE_F32
|
| 3480 |
-
&& src1->ne[1] <= MMVQ_MAX_BATCH_SIZE
|
|
|
|
| 3481 |
|
| 3482 |
bool use_mul_mat_q = ggml_sycl_supports_mmq(src0->type)
|
| 3483 |
&& src1->type == GGML_TYPE_F32 && dst->type == GGML_TYPE_F32;
|
|
|
|
| 3477 |
|
| 3478 |
bool use_mul_mat_vec_q = ggml_is_quantized(src0->type)
|
| 3479 |
&& src1->type == GGML_TYPE_F32 && dst->type == GGML_TYPE_F32
|
| 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);
|
| 3482 |
|
| 3483 |
bool use_mul_mat_q = ggml_sycl_supports_mmq(src0->type)
|
| 3484 |
&& src1->type == GGML_TYPE_F32 && dst->type == GGML_TYPE_F32;
|
ggml/src/ggml-sycl/common.hpp
CHANGED
|
@@ -130,6 +130,7 @@ typedef sycl::float2 dfloat2;
|
|
| 130 |
#endif // GGML_SYCL_F16
|
| 131 |
|
| 132 |
#define MMVQ_MAX_BATCH_SIZE 8
|
|
|
|
| 133 |
|
| 134 |
static const int8_t kvalues_iq4nl[16]={-127, -104, -83, -65, -49, -35, -22, -10, 1, 13, 25, 38, 53, 69, 89, 113};
|
| 135 |
|
|
|
|
| 130 |
#endif // GGML_SYCL_F16
|
| 131 |
|
| 132 |
#define MMVQ_MAX_BATCH_SIZE 8
|
| 133 |
+
#define MMVQ_MIN_BATCH_SIZE 4
|
| 134 |
|
| 135 |
static const int8_t kvalues_iq4nl[16]={-127, -104, -83, -65, -49, -35, -22, -10, 1, 13, 25, 38, 53, 69, 89, 113};
|
| 136 |
|