Commit 2891378 for stable-diffusion.cpp
commit 2891378bb17dbed110b391f9aab47d241413153d
Author: akleine <alb.kleine@gmx.de>
Date: Thu Oct 15 16:26:27 2026 +0200
fix: prevent core dump in CPU backend if using FP8 (e4m3) tensors (#2140)
diff --git a/src/model/common/ggml_block.hpp b/src/model/common/ggml_block.hpp
index 1d35b41..ddf4a19 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);