From 4482c3fd05f0af5ce3634a90ea3b21c6cb5fa0ef Mon Sep 17 00:00:00 2001 From: bri-prism <288398250+bri-prism@users.noreply.github.com> Date: Fri, 28 Aug 2026 10:23:44 -0700 Subject: [PATCH] llama: name the pre-rename PQ2_0 ftype instead of reporting unknown ggufs packed before the Q2_0_G128 -> PQ2_0 rename carry the old ftype value 142. The format did not change, only the enum did, so these files load and compute correctly but print print_info: file type = unknown, may not work which reads as a broken file. With this they print print_info: file type = PQ2_0 - 2.13 bpw (group 128, legacy ftype) Naming only. No load path, no quantizer path, and no behaviour changes; the new constant exists so the switch has a case for the value. Worth noting the collision that makes this confusing: 142 is also GGML_TYPE_PQ2_0, the tensor type id, which is current and correct. Only the ftype was renumbered, to 141. Verified on a published gguf that carries ftype 142: reports unknown on the current branch, reports PQ2_0 with this change, same output either way. --- include/llama.h | 1 + src/llama-model-loader.cpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/include/llama.h b/include/llama.h index 34b42dc1f45..e424d5c4010 100644 --- a/include/llama.h +++ b/include/llama.h @@ -157,6 +157,7 @@ extern "C" { LLAMA_FTYPE_MOSTLY_Q1_0 = 40, // except 1d tensors LLAMA_FTYPE_MOSTLY_Q2_0 = 41, // except 1d tensors LLAMA_FTYPE_MOSTLY_PQ2_0 = 141, // except 1d tensors (Prism group-128 Q2_0; matches published PQ2_0 ggufs) + LLAMA_FTYPE_MOSTLY_PQ2_0_LEGACY = 142, // pre-rename value for the same format, still found in published ggufs LLAMA_FTYPE_GUESSED = 1024, // not specified in the model file }; diff --git a/src/llama-model-loader.cpp b/src/llama-model-loader.cpp index 7e7eb5cca66..c43499aa234 100644 --- a/src/llama-model-loader.cpp +++ b/src/llama-model-loader.cpp @@ -40,6 +40,9 @@ const char * llama_ftype_name(llama_ftype ftype) { case LLAMA_FTYPE_MOSTLY_Q1_0: name = LLAMA_FTYPE_PREFIX "Q1_0"; break; case LLAMA_FTYPE_MOSTLY_Q2_0: name = LLAMA_FTYPE_PREFIX "Q2_0"; break; case LLAMA_FTYPE_MOSTLY_PQ2_0: name = LLAMA_FTYPE_PREFIX "PQ2_0 - 2.13 bpw (group 128)"; break; + // ggufs packed before the Q2_0_G128 -> PQ2_0 rename carry the old ftype value. + // They load and compute correctly; name it so it does not report as unknown. + case LLAMA_FTYPE_MOSTLY_PQ2_0_LEGACY: name = LLAMA_FTYPE_PREFIX "PQ2_0 - 2.13 bpw (group 128, legacy ftype)"; break; case LLAMA_FTYPE_MOSTLY_Q4_0: name = LLAMA_FTYPE_PREFIX "Q4_0"; break; case LLAMA_FTYPE_MOSTLY_Q4_1: name = LLAMA_FTYPE_PREFIX "Q4_1"; break; case LLAMA_FTYPE_MOSTLY_Q5_0: name = LLAMA_FTYPE_PREFIX "Q5_0"; break;