Skip to content

Commit 7a824c6

Browse files
committed
1
Signed-off-by: Xiaodong Ye <[email protected]>
1 parent abbf408 commit 7a824c6

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

ggml/src/ggml-cuda/ggml-cuda.cu

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3028,10 +3028,16 @@ static bool ggml_backend_cuda_device_supports_op(ggml_backend_dev_t dev, const g
30283028
}
30293029
#ifdef GGML_USE_MUSA
30303030
const int cc = ggml_cuda_info().devices[dev_ctx->device].cc;
3031-
if (GGML_CUDA_CC_IS_MTHREADS(cc) && GGML_CUDA_CC_IS_QY1(cc) &&
3032-
b->type == GGML_TYPE_F16 && b->ne[2]*b->ne[3] > 1 &&
3031+
if (GGML_CUDA_CC_IS_MTHREADS(cc) && b->ne[2]*b->ne[3] > 1 &&
30333032
!ggml_is_transposed(a) && !ggml_is_transposed(b)) {
3034-
return false;
3033+
if (GGML_CUDA_CC_IS_QY1(cc) && op->op == GGML_OP_MUL_MAT
3034+
&& b->type == GGML_TYPE_F16) {
3035+
return false;
3036+
}
3037+
if (GGML_CUDA_CC_IS_QY2(cc) && op->op == GGML_OP_MUL_MAT_ID &&
3038+
a->type == GGML_TYPE_Q2_K && b->type == GGML_TYPE_F32) {
3039+
return false;
3040+
}
30353041
}
30363042
#endif // GGML_USE_MUSA
30373043
switch (a->type) {
@@ -3058,12 +3064,6 @@ static bool ggml_backend_cuda_device_supports_op(ggml_backend_dev_t dev, const g
30583064
case GGML_TYPE_IQ4_NL:
30593065
case GGML_TYPE_IQ4_XS:
30603066
case GGML_TYPE_BF16:
3061-
#ifdef GGML_USE_MUSA
3062-
if (GGML_CUDA_CC_IS_MTHREADS(cc) && GGML_CUDA_CC_IS_QY2(cc) &&
3063-
a->type == GGML_TYPE_Q2_K) {
3064-
return false;
3065-
}
3066-
#endif // GGML_USE_MUSA
30673067
return true;
30683068
default:
30693069
return false;

0 commit comments

Comments
 (0)