mirror of
https://github.com/leejet/stable-diffusion.cpp.git
synced 2026-11-11 03:24:30 +00:00
fix: prevent core dump in CPU backend if using FP8 (e4m3) tensors (#2140)
This commit is contained in:
1 parent
120e3e875c
commit
2891378bb1
1 file changed
+2
-1
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user