Some of these files were built with a layout computed for this model instead of llama.cpp's standard one-size-fits-all rules. A Q4_K_M is still mostly Q4_K; the extra precision goes to the weights this particular model is most sensitive to. The S, M or L in a name says how much of the model stays at the base precision: about 90 % for S, 70 % for M and 50 % for L. An
_L
name is simply the large size of its family. Q4_K_L is to Q4_K_M what Q4_K_M is to Q4_K_S, and Q6_K_L sits about halfway between Q6_K and Q8_0. In earlier releases an
_L
name meant the embedding and output weights were kept at Q8_0; in these files it means the larger size of the base type. There is no size target, so each file's bits per weight is reported rather than promised.
The layout each of these files was built with is published in the
layouts/
folder:
<file>.tensor-types.txt
is the exact
--tensor-type-file
given to
llama-quantize
, and
<file>.layout.json
records how it was computed, including the generator version, the llama.cpp release and the commit, so any of them can be rebuilt.
Checked on this model before any of these files were released: Q4_K_M reached 0.94×, Q3_K_M 0.69× and IQ2_M 0.65× the KL divergence of the standard layout at the same file size.
Layout details
Files built from a computed layout:
Quant
Size
Body bits/weight
File bits/weight
Body kept at base type
Q6_K_L
2.28GB
7.41
7.24
50 %
Q6_K
2.11GB
6.71
6.70
90 %
Q5_K_M
1.92GB
6.10
6.10
70 %
Q5_K_S
1.82GB
5.68
5.77
90 %
Q4_K_L
1.71GB
5.41
5.45
50 %
Q4_K_M
1.62GB
5.01
5.14
70 %
IQ4_NL
1.61GB
4.96
5.10
70 %
Q4_K_S
1.53GB
4.68
4.88
90 %
IQ4_XS
1.46GB
4.43
4.65
90 %
IQ3_M
1.36GB
4.26
4.33
50 %
Q3_K_L
1.29GB
3.96
4.09
50 %
Q3_K_M
1.24GB
3.75
3.93
70 %
IQ3_XS
1.19GB
3.58
3.79
90 %
Q3_K_S
1.19GB
3.56
3.78
90 %
IQ3_XXS
1.14GB
3.38
3.64
70 %
Q2_K
1.01GB
3.00
3.22
70 %
IQ2_M
0.97GB
2.82
3.08
70 %
Checked on this model: the computed layout against the standard one, measured by KL divergence against the unquantized model. The ratio compares each computed file with the standard ladder read at that file's own size, so it can differ from the two KLD columns when the two files differ in size.
Quant
Computed layout KLD
Standard layout KLD
Ratio at equal size
Size vs standard file
Q4_K_M
0.0428 ± 0.0004
0.0468 ± 0.0004
0.94×
equal
Q3_K_M
0.2007 ± 0.0017
0.1696 ± 0.0015
0.69×
−6.9 %
IQ2_M
0.8957 ± 0.0097
0.8516 ± 0.0095
0.65×
−7.8 %
How it works: the base type is a floor for every body tensor and a fixed share of the body bytes stays at it (90 % for S, 70 % for M, 50 % for L); the remaining bytes go where a cross-model sensitivity prior, measured by KL divergence against the unquantized model, says they buy the most quality. The embedding and output tensors are sized by their share of the file: a small table is kept at Q8_0, a large one follows the file's bitrate. A K-quant and the IQ quant with the same base bitrate (Q3_K_S and IQ3_XS, Q3_K_M and IQ3_S, Q3_K_L and IQ3_M) come out at about the same size; the IQ file is the GPU-oriented twin. The whole-file bitrates sit above the body bitrates because the embedding tables are a large share of this model's files.
llama.cpp automatically "repacks" weights into an interleaved layout at load time for faster inference on ARM and AVX machines - details in
this PR
. This once required downloading special Q4_0_4_4/4_8/8_8 files; those are long gone. Online repacking now covers Q4_0, IQ4_NL, and most K-quants, so no special quant choice is needed for CPU inference.
Which file should I choose?
Click here for details
An older (early 2024) but still useful write-up with charts comparing quant performances is provided by Artefact2
here
The first thing to figure out is how big a model you can run. To do this, you'll need to figure out how much RAM and/or VRAM you have.
If you want your model running as FAST as possible, you'll want to fit the whole thing on your GPU's VRAM. Aim for a quant with a file size 1-2GB smaller than your GPU's total VRAM.
If you want the absolute maximum quality, add both your system RAM and your GPU's VRAM together, then similarly grab a quant with a file size 1-2GB Smaller than that total.
Hugging Face can also do this math for you: add your hardware in your
Local Apps settings
and the model page will show which files fit.
Next, you'll need to decide if you want to use an 'I-quant' or a 'K-quant'.
If you don't want to think too much, grab one of the K-quants. These are in format 'QX_K_X', like Q5_K_M.
If you want to get more into the weeds, you can check out this extremely useful feature chart:
But basically, if you're aiming for below Q4, and you're running cuBLAS (Nvidia) or rocBLAS (AMD), you should look towards the I-quants. These are in format IQX_X, like IQ3_M. These are newer and offer better performance for their size.
These I-quants can also be used on CPU, but will be slower than their K-quant equivalent, so speed vs performance is a tradeoff you'll have to decide.
Credits
Thank you kalomaze and Dampf for assistance in creating the imatrix calibration dataset.
Thank you ZeroWw for the inspiration to experiment with embed/output.
MiniCPM5-2B-GGUF huggingface.co is an AI model on huggingface.co that provides MiniCPM5-2B-GGUF's model effect (), which can be used instantly with this bartowski MiniCPM5-2B-GGUF model. huggingface.co supports a free trial of the MiniCPM5-2B-GGUF model, and also provides paid use of the MiniCPM5-2B-GGUF. Support call MiniCPM5-2B-GGUF model through api, including Node.js, Python, http.
MiniCPM5-2B-GGUF huggingface.co is an online trial and call api platform, which integrates MiniCPM5-2B-GGUF's modeling effects, including api services, and provides a free online trial of MiniCPM5-2B-GGUF, you can try MiniCPM5-2B-GGUF online for free by clicking the link below.
bartowski MiniCPM5-2B-GGUF online free url in huggingface.co:
MiniCPM5-2B-GGUF is an open source model from GitHub that offers a free installation service, and any user can find MiniCPM5-2B-GGUF on GitHub to install. At the same time, huggingface.co provides the effect of MiniCPM5-2B-GGUF install, users can directly use MiniCPM5-2B-GGUF installed effect in huggingface.co for debugging and trial. It also supports api for free installation.