From: Aaron Teo Date: Fri, 17 Jul 2026 08:39:33 +0000 (+0800) Subject: ggml-blas: default hadamard mul_mat to cpu routine (#25710) X-Git-Tag: upstream/0.0.10438~379 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=11fd0a6fb756b9d3f387b4901aa1ce8173c03170;p=pkg%2Fggml%2Fsources%2Fllama.cpp ggml-blas: default hadamard mul_mat to cpu routine (#25710) Signed-off-by: Aaron Teo --- diff --git a/ggml/src/ggml-blas/ggml-blas.cpp b/ggml/src/ggml-blas/ggml-blas.cpp index b4c735267..9745fa29f 100644 --- a/ggml/src/ggml-blas/ggml-blas.cpp +++ b/ggml/src/ggml-blas/ggml-blas.cpp @@ -1,3 +1,4 @@ +#include "ggml.h" #include "ggml-impl.h" #include "ggml-blas.h" #include "ggml-backend-impl.h" @@ -415,6 +416,12 @@ static bool ggml_backend_blas_device_supports_op(ggml_backend_dev_t dev, const s // TODO: find the optimal value const int64_t min_batch = 32; + // default back to CPU fast path + // see: https://github.com/ggml-org/llama.cpp/issues/25565 + if (ggml_get_op_params_i32(op, 1) == GGML_HINT_SRC0_IS_HADAMARD) { + return false; + } + return ggml_is_contiguous(src0) && ggml_is_contiguous(src1) && src1->type == GGML_TYPE_F32 &&