mamba : fix non-contiguous usage of ggml_silu

This commit is contained in:
Francis Couture-Harpin 2024-06-12 12:57:02 -04:00
parent ff794f5535
commit 33425a7e1e

View File

@ -8867,7 +8867,7 @@ static struct ggml_tensor * llm_build_mamba(
// {d_inner, n_seq_tokens, n_seqs} * {d_inner} => {d_inner, n_seq_tokens, n_seqs} // {d_inner, n_seq_tokens, n_seqs} * {d_inner} => {d_inner, n_seq_tokens, n_seqs}
y = ggml_add(ctx, y, ggml_mul(ctx, x, model.layers[il].ssm_d)); y = ggml_add(ctx, y, ggml_mul(ctx, x, model.layers[il].ssm_d));
y = ggml_mul(ctx, y, ggml_silu(ctx, z)); y = ggml_mul(ctx, y, ggml_silu(ctx, ggml_cont(ctx, z)));
// {d_inner, n_embd} @ {d_inner, n_seq_tokens, n_seqs} => {n_embd, n_seq_tokens, n_seqs} // {d_inner, n_embd} @ {d_inner, n_seq_tokens, n_seqs} => {n_embd, n_seq_tokens, n_seqs}
cur = ggml_mul_mat(ctx, model.layers[il].ssm_out, y); cur = ggml_mul_mat(ctx, model.layers[il].ssm_out, y);