]> git.djapps.eu Git - pkg/ggml/sources/ggml/commitdiff
opencl: fix support ops condition for `rms_norm` (llama/15560)
authorlhez <redacted>
Mon, 25 Aug 2025 21:18:09 +0000 (14:18 -0700)
committerGeorgi Gerganov <redacted>
Fri, 5 Sep 2025 09:54:04 +0000 (12:54 +0300)
src/ggml-opencl/ggml-opencl.cpp

index df27501361f7fcb3f93196c7b105a7ffa08be282..36b18ddb8a9ac146e4af48710b845e8bb9f49aac 100644 (file)
@@ -2647,8 +2647,9 @@ static bool ggml_opencl_supports_op(ggml_backend_dev_t dev, const struct ggml_te
             return op->src[0]->type == GGML_TYPE_F32;
         case GGML_OP_SOFT_MAX:
         case GGML_OP_NORM:
-        case GGML_OP_RMS_NORM:
             return true;
+        case GGML_OP_RMS_NORM:
+            return op->ne[0] % 4 == 0 && ggml_is_contiguous_rows(op->src[0]);
         case GGML_OP_REPEAT:
             return op->src[0]->type == GGML_TYPE_F32 && op->type == GGML_TYPE_F32; // Assuming F32 for now, can be expanded
         case GGML_OP_PAD: