From 07b89858e5230fd37a406232ed5f3bfd8b0c7e01 Mon Sep 17 00:00:00 2001 From: Ruben Ortlam Date: Fri, 18 Sep 2026 14:30:39 +0200 Subject: [PATCH] add optional activation scales to mul_mat and mul_mat_id tensors --- ggml/src/ggml.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ggml/src/ggml.c b/ggml/src/ggml.c index e98ad890bf..ea51552367 100644 --- a/ggml/src/ggml.c +++ b/ggml/src/ggml.c @@ -3405,7 +3405,11 @@ struct ggml_tensor * ggml_mul_mat_ext( result->src[2] = scale_weight; } - GGML_UNUSED(scale_activations); + if (scale_activations) { + GGML_ASSERT(ggml_can_repeat(scale_activations, b)); + result->src[3] = scale_activations; + } + return result; } @@ -3490,7 +3494,11 @@ struct ggml_tensor * ggml_mul_mat_id_ext( result->src[3] = s; } - GGML_UNUSED(scale_activations); + if (scale_activations) { + GGML_ASSERT(ggml_can_repeat(scale_activations, b)); + result->src[4] = scale_activations; + } + return result; }