mirror of
https://github.com/leejet/stable-diffusion.cpp.git
synced 2026-11-10 19:06:33 +00:00
fix: avoid f16 overflow in Z-Image quantized matmuls on CUDA (#2074)
Co-authored-by: leejet <leejet714@gmail.com>
This commit is contained in:
1 parent
9db0db6570
commit
b6947b8bdc
2 files changed
+9
-2
No files matched your search
@@ -205,6 +205,11 @@ public:
|
||||
force_prec_f32 = force_prec_f32_;
|
||||
}
|
||||
|
||||
bool has_quantized_weight() const {
|
||||
auto it = params.find("weight");
|
||||
return it != params.end() && it->second != nullptr && ggml_is_quantized(it->second->type);
|
||||
}
|
||||
|
||||
ggml_tensor* forward(GGMLRunnerContext* ctx, ggml_tensor* x) override {
|
||||
ggml_tensor* w = params["weight"];
|
||||
const float scale = ctx->linear_scale > 0.f ? ctx->linear_scale : this->scale;
|
||||
|
||||
Reference in new issue
Block a user