Skip to content

Commit 8b69686

Browse files
authored
SYCL: fix rms_norm_mul_add for tensor dim not a multiple of sg_size (ggml-org#15592)
The original implementation unconditionally returned true for this operation, leading to a failure when the tensor's first dimension (ne[0]) was not a multiple of WARP_SIZE. This caused an GGML_ASSERT(ncols % WARP_SIZE == 0) failure in ggml-sycl/norm.cpp. This change updates the ggml_backend_sycl_device_supports_op check to correctly return true for GGML_OP_RMS_NORM only when the first dimension of the tensor is a multiple of WARP_SIZE, ensuring the operation can be performed without error.
1 parent 8ce3ff1 commit 8b69686

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ggml/src/ggml-sycl/ggml-sycl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4364,11 +4364,12 @@ static bool ggml_backend_sycl_device_supports_op(ggml_backend_dev_t dev, const g
43644364
return (op->type == GGML_TYPE_F32 && op->src[0]->type == GGML_TYPE_F32) && (op->type == op->src[0]->type);
43654365
#endif
43664366
case GGML_OP_NORM:
4367-
case GGML_OP_RMS_NORM:
43684367
return true;
43694368
case GGML_OP_L2_NORM:
43704369
case GGML_OP_GROUP_NORM:
43714370
return ggml_is_contiguous(op->src[0]);
4371+
case GGML_OP_RMS_NORM:
4372+
return ((op->src[0]->ne[0] % WARP_SIZE) == 0);
43724373
case GGML_OP_SCALE:
43734374
return true;
43744375
case GGML_OP_CONT:

0 commit comments

Comments
 (0)