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

This commit is contained in:
Ismail
2026-05-05 10:05:05 +08:00
committed by GitHub
parent eff06702b2
commit a817a22bc6
8 changed files with 183 additions and 0 deletions
+6
View File
@@ -1245,6 +1245,12 @@ void ggml_compute_forward_mul_mat(
const struct ggml_tensor * src0 = dst->src[0];
const struct ggml_tensor * src1 = dst->src[1];
const int32_t hint = ggml_get_op_params_i32(dst, 1);
if (hint == GGML_HINT_SRC0_IS_HADAMARD && !params->use_ref) {
ggml_compute_forward_fwht(params, dst);
return;
}
GGML_TENSOR_BINARY_OP_LOCALS
const int ith = params->ith;