From 2891378bb17dbed110b391f9aab47d241413153d Mon Sep 17 00:00:00 2001 From: akleine Date: Thu, 15 Oct 2026 16:26:27 +0200 Subject: [PATCH] fix: prevent core dump in CPU backend if using FP8 (e4m3) tensors (#2140) --- src/model/common/ggml_block.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/model/common/ggml_block.hpp b/src/model/common/ggml_block.hpp index 1d35b417..ddf4a199 100644 --- a/src/model/common/ggml_block.hpp +++ b/src/model/common/ggml_block.hpp @@ -14,6 +14,7 @@ #include "core/ggml_extend.h" #include "core/ggml_runner.h" +#include "core/ggml_extend_backend.h" #include "model.h" class GGMLBlock { @@ -222,7 +223,7 @@ public: if (force_prec_f32) { ggml_prec_set_acc(fp8_matmul, GGML_PREC_F32); } - supports_fp8_matmul = ggml_backend_supports_op(ctx->backend, fp8_matmul); + supports_fp8_matmul = ggml_backend_supports_op(ctx->backend, fp8_matmul) && !sd_backend_is_cpu(ctx->backend); } if (!supports_fp8_matmul) { w = ggml_cast(ctx->ggml_ctx, w, GGML_TYPE_BF16);