Skip to content

Commit 2923cc9

Browse files
committed
opencl: fix ROPE
1 parent 553f1e4 commit 2923cc9

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

ggml/src/ggml-opencl/ggml-opencl.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,8 +1044,16 @@ static bool ggml_opencl_supports_op(ggml_backend_dev_t dev, const struct ggml_te
10441044
return true;
10451045
case GGML_OP_DIAG_MASK_INF:
10461046
return op->ne[3] == 1;
1047-
case GGML_OP_ROPE:
1047+
case GGML_OP_ROPE: {
1048+
const int mode = ((const int32_t *) op->op_params)[2];
1049+
if (mode & GGML_ROPE_TYPE_MROPE) {
1050+
return false;
1051+
}
1052+
if (mode & GGML_ROPE_TYPE_VISION) {
1053+
return false;
1054+
}
10481055
return true;
1056+
}
10491057
default:
10501058
return false;
10511059
}
@@ -3766,7 +3774,8 @@ static void ggml_cl_rope(ggml_backend_t backend, const ggml_tensor * src0, const
37663774
const int nb2 = dst ? dst->nb[2] : 0;
37673775
const int nb3 = dst ? dst->nb[3] : 0;
37683776

3769-
GGML_ASSERT(ne10 == ne02);
3777+
GGML_ASSERT(ne10 % ne02 == 0);
3778+
GGML_ASSERT(ne10 >= ne02);
37703779

37713780
int nth = MIN(64, ne00);
37723781

0 commit comments

Comments
 (0)