From ffe3e82c8b51c3207dc6094c35c95a160987b4ce Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Wed, 11 Feb 2026 11:34:47 +0530 Subject: [PATCH] fix computation --- ggml/src/ggml-cpu/ops.cpp | 1 - ggml/src/ggml.c | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ggml/src/ggml-cpu/ops.cpp b/ggml/src/ggml-cpu/ops.cpp index c249e54772..74b3368480 100644 --- a/ggml/src/ggml-cpu/ops.cpp +++ b/ggml/src/ggml-cpu/ops.cpp @@ -10399,7 +10399,6 @@ static void ggml_compute_forward_gated_delta_net_one_chunk( ggml_vec_scale_f32(S_v, k_local, 1.0f / fmaxf(norm, eps)); // state decay: S *= exp(g) - // s_t is row-major, but scaling all elements is layout-agnostic ggml_vec_scale_f32(S_v * S_v, s_t, g_val); // kv_mem[j] = sum_i S[j][i] * k[i] = dot(s_t[j*S_v:], k) diff --git a/ggml/src/ggml.c b/ggml/src/ggml.c index 86b7e8741a..e7865b683a 100644 --- a/ggml/src/ggml.c +++ b/ggml/src/ggml.c @@ -6141,8 +6141,8 @@ struct ggml_tensor * ggml_gated_delta_net( GGML_ASSERT(ggml_nelements(state) == S_v * S_v * H * n_seqs); // concat output and new_state into a single tensor - // output: S_v * H * n_tokens, state: S_v * S_v * H * n_seqs - const int64_t ne[4] = { S_v * H, n_tokens + S_v * n_seqs, 1, 1 }; + // output: S_v * H * n_tokens * n_seqs, state: S_v * S_v * H * n_seqs + const int64_t ne[4] = { S_v * H, n_tokens * n_seqs + S_v * n_seqs, 1, 1 }; struct ggml_tensor * result = ggml_new_tensor(ctx, GGML_TYPE_F32, 4, ne); result->op = GGML_OP_GATED_DELTA_NET;