ggml : implement fast walsh-hadamard transform for kv rotation (#21352) (#22631)

This commit is contained in:
Ismail 2026-05-05 04:05:05 +02:00 committed by GitHub
parent eff06702b2
commit a817a22bc6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 183 additions and 0 deletions

View file

@ -67,6 +67,7 @@ static ggml_tensor * ggml_mul_mat_aux(
res = ggml_reshape_2d(ctx, cur, n, ggml_nelements(cur)/n);
res = ggml_mul_mat (ctx, rot, res);
ggml_mul_mat_set_hint(res, GGML_HINT_SRC0_IS_HADAMARD);
res = ggml_reshape_4d(ctx, res, cur->ne[0], cur->ne[1], cur->ne[2], cur->ne[3]);
return res;