fix computation
This commit is contained in:
parent
4be60a28b6
commit
ffe3e82c8b
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue