From ec7506d680cf6b40d7a5a140dc25bab1805e37d0 Mon Sep 17 00:00:00 2001 From: City <125218114+city96@users.noreply.github.com> Date: Thu, 27 Nov 2025 22:05:57 +0100 Subject: [PATCH] Flux2 specific filter --- tools/lcpp.patch | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tools/lcpp.patch b/tools/lcpp.patch index 3e449ac..975ee26 100644 --- a/tools/lcpp.patch +++ b/tools/lcpp.patch @@ -39,7 +39,7 @@ index b16c462f..6d1568f1 100644 const int idx = gguf_find_tensor(ctx, name); if (idx < 0) { diff --git a/src/llama.cpp b/src/llama.cpp -index 24e1f1f0..8a1e9ef8 100644 +index 24e1f1f0..78b74deb 100644 --- a/src/llama.cpp +++ b/src/llama.cpp @@ -205,6 +205,18 @@ enum llm_arch { @@ -354,7 +354,7 @@ index 24e1f1f0..8a1e9ef8 100644 } // Set split info if needed -@@ -18647,6 +18908,124 @@ static void llama_model_quantize_internal(const std::string & fname_inp, const s +@@ -18647,6 +18908,127 @@ static void llama_model_quantize_internal(const std::string & fname_inp, const s // do not quantize relative position bias (T5) quantize &= name.find("attn_rel_b.weight") == std::string::npos; @@ -368,6 +368,9 @@ index 24e1f1f0..8a1e9ef8 100644 + quantize &= name.find("vector_in.") == std::string::npos; + quantize &= name.find("guidance_in.") == std::string::npos; + quantize &= name.find("final_layer.") == std::string::npos; ++ // flux2 ++ quantize &= name.find("single_stream_modulation.") == std::string::npos; ++ quantize &= name.find("double_stream_modulation_") == std::string::npos; + } + if (model.arch == LLM_ARCH_SD1 || model.arch == LLM_ARCH_SDXL) { + image_model = true; @@ -479,7 +482,7 @@ index 24e1f1f0..8a1e9ef8 100644 enum ggml_type new_type; void * new_data; size_t new_size; -@@ -18655,6 +19034,9 @@ static void llama_model_quantize_internal(const std::string & fname_inp, const s +@@ -18655,6 +19037,9 @@ static void llama_model_quantize_internal(const std::string & fname_inp, const s new_type = default_type; // get more optimal quantization type based on the tensor shape, layer, etc. @@ -489,7 +492,7 @@ index 24e1f1f0..8a1e9ef8 100644 if (!params->pure && ggml_is_quantized(default_type)) { new_type = llama_tensor_get_type(qs, new_type, tensor, ftype); } -@@ -18664,6 +19046,7 @@ static void llama_model_quantize_internal(const std::string & fname_inp, const s +@@ -18664,6 +19049,7 @@ static void llama_model_quantize_internal(const std::string & fname_inp, const s if (params->output_tensor_type < GGML_TYPE_COUNT && strcmp(tensor->name, "output.weight") == 0) { new_type = params->output_tensor_type; }