Skip to content

Commit a12488b

Browse files
committed
iq2_xxs: add to llama ftype enum
1 parent bbb21db commit a12488b

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

llama.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -2196,6 +2196,7 @@ struct llama_model_loader {
21962196
case GGML_TYPE_Q4_K: ftype = LLAMA_FTYPE_MOSTLY_Q4_K_M; break;
21972197
case GGML_TYPE_Q5_K: ftype = LLAMA_FTYPE_MOSTLY_Q5_K_M; break;
21982198
case GGML_TYPE_Q6_K: ftype = LLAMA_FTYPE_MOSTLY_Q6_K; break;
2199+
case GGML_TYPE_IQ2_XXS: ftype = LLAMA_FTYPE_MOSTLY_IQ2_XXS; break;
21992200
default:
22002201
{
22012202
LLAMA_LOG_WARN("%s: unknown type %s\n", __func__, ggml_type_name(type_max));
@@ -2567,6 +2568,7 @@ static std::string llama_model_ftype_name(llama_ftype ftype) {
25672568
case LLAMA_FTYPE_MOSTLY_Q5_K_S: return "Q5_K - Small";
25682569
case LLAMA_FTYPE_MOSTLY_Q5_K_M: return "Q5_K - Medium";
25692570
case LLAMA_FTYPE_MOSTLY_Q6_K: return "Q6_K";
2571+
case LLAMA_FTYPE_MOSTLY_IQ2_XXS:return "IQ2_XSS - 2.0625 bpw";
25702572

25712573
default: return "unknown, may not work";
25722574
}
@@ -9022,6 +9024,7 @@ static void llama_model_quantize_internal(const std::string & fname_inp, const s
90229024
case LLAMA_FTYPE_MOSTLY_Q5_K_S:
90239025
case LLAMA_FTYPE_MOSTLY_Q5_K_M: quantized_type = GGML_TYPE_Q5_K; break;
90249026
case LLAMA_FTYPE_MOSTLY_Q6_K: quantized_type = GGML_TYPE_Q6_K; break;
9027+
case LLAMA_FTYPE_MOSTLY_IQ2_XXS:quantized_type = GGML_TYPE_IQ2_XXS; break;
90259028

90269029
default: throw std::runtime_error(format("invalid output file type %d\n", ftype));
90279030
}

llama.h

+1
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ extern "C" {
103103
LLAMA_FTYPE_MOSTLY_Q5_K_S = 16, // except 1d tensors
104104
LLAMA_FTYPE_MOSTLY_Q5_K_M = 17, // except 1d tensors
105105
LLAMA_FTYPE_MOSTLY_Q6_K = 18, // except 1d tensors
106+
LLAMA_FTYPE_MOSTLY_IQ2_XXS = 19, // except 1d tensors
106107

107108
LLAMA_FTYPE_GUESSED = 1024, // not specified in the model file
108109
};

0 commit comments

Comments
 (0)