π Model Description
quantized_by: AesSedai pipeline_tag: text-generation base_model: zai-org/GLM-4.5 license: mit basemodelrelation: quantized
This repository contains some custom quants of GLM-4.5 that focus on a couple of different schemas compared to the usual quantization schemas.
The idea being that given the huge size of the FFN tensors compared to the rest of the tensors in the model, it should be possible to achieve a better quality while keeping the overall size of the entire model smaller compared to a similar naive quantization.
The following charts showcase a very wide variety of GLM-4.5 quants that were tested for KL Divergence using the reference logits and corpus included in this repo: GLM-4.5-KLD-8192-ref-logits-ed-combined-all-micro-Q80.bin and combinedall_micro.txt
A full CSV with the data is included as well in glm-4.5-quantization-output.csv.
The naming convention is (inconsistently) as follows, generally: [Default Type]-[FFNUP]-[FFNGATE]-[FFNDOWN], eg: Q6K-IQ2S-IQ2S-IQ3_S. This means:
- Q6K is the default type (attention, shared expert, etc.)
- IQ2S was used for the FFNUP and FFNGATE conditional expert tensors
- IQ3S was used for the FFNDOWN conditional expert tensors
Generally speaking, quants following the above convention tend to have a better KLD and PPL compared to quants from other providers. Visualized here are the Mean KLD and Mean PPL of the quants on the Pareto frontier (so, best for a given size). Full graphs are available in the plots-glm-4.5-8192 folder.
!KLD vs File Size
!PPL vs File Size
Provided here are a few quants, separated into llama.cpp and ikllama.cpp folders for convenience (though, ikllama.cpp is capable of running the quants in llama.cpp, but the opposite is not true).
llama.cpp imatrix Quantizations of zai-org/GLM-4.5
This quant collection can be run on llama.cpp or kobold.cpp like normal.
Q6K-IQ2S-IQ2S-IQ3S: 128.18 GiB (3.07 BPW), Final estimate: PPL = 4.786993 Β± 0.031213, KLD = 0.145117 Β± 0.002232
GLM-4.5-Q6K-Q2K-Q2K-Q3K: 129.57 GiB (3.11 BPW), Final estimate: PPL = 4.700384 Β± 0.030202, KLD = 0.164863 Β± 0.002339
GLM-4.5-Q80-IQ3XXS-IQ3XXS-IQ3S: 144.68 GiB (3.47 BPW), Final estimate: PPL = 4.729934 Β± 0.030769, KLD = 0.116520 Β± 0.002072
ik_llama.cpp imatrix Quantizations of zai-org/GLM-4.5
This quant collection REQUIRES ik_llama.cpp fork to support the ik's latest SOTA quants and optimizations! Do not download these big files and expect them to run on mainline vanilla llama.cpp, ollama, LM Studio, KoboldCpp, etc!
NOTE ik_llama.cpp can also run your existing GGUFs from bartowski, unsloth, mradermacher, etc if you want to try it out before downloading my quants.
Some of ik's new quants are supported with Nexesenex/croco.cpp fork of KoboldCPP with Windows builds for CUDA 12.9. Also check for Windows builds by Thireus here. which have been CUDA 12.8.
See Ubergarm's GLM-4.5 quants for info on how to use the recipe or make your own quant.
IQ2_KT: 109.269 GiB (2.619 BPW): Lost the results somewhere, oops.
# 93 Repeating Layers [0-92]
Attention
blk\..\.attnq.=iq4k
blk\..\.attnk.=iq6k
blk\..\.attnv.=iq6k
blk\..\.attnoutput.=iq5ks
First 3 Dense Layers [0-2]
blk\..*\.ffndown\.weight=iq4ks
blk\..*\.ffn(gate|up)\.weight=iq3ks
Shared Expert Layers [3-92]
blk\..*\.ffndownshexp\.weight=iq6_k
blk\..*\.ffn(gate|up)shexp\.weight=iq6_k
Routed Experts Layers [3-92]
blk\..*\.ffndownexps\.weight=iq3_kt
blk\..*\.ffn(gate|up)exps\.weight=iq2_kt
NextN MTP Layer [92]
blk\..*\.nextn\.embedtokens\.weight=iq4k
blk\..*\.nextn\.sharedheadhead\.weight=iq6_k
blk\..*\.nextn\.ehproj\.weight=iq6k
Non-Repeating Layers
tokenembd\.weight=iq4k
output\.weight=iq6_k
IQ4_KSS: 176.499 GiB (4.231 BPW): Lost the results somewhere, oops.
# 93 Repeating Layers [0-92]
Attention
blk\.(0|1|2)\.attnq.*=q80
blk\.(0|1|2)\.attnk.*=q80
blk\.(0|1|2)\.attnv.*=q80
blk\.(0|1|2)\.attnoutput.*=q80
blk\..\.attnq.=iq6k
blk\..\.attnk.=iq6k
blk\..\.attnv.=iq6k
blk\..\.attnoutput.=iq6k
First 3 Dense Layers [0-2]
blk\..*\.ffndown\.weight=iq5ks
blk\..*\.ffn(gate|up)\.weight=iq4ks
Shared Expert Layers [3-92]
blk\..*\.ffndownshexp\.weight=q8_0
blk\..*\.ffn(gate|up)shexp\.weight=q8_0
Routed Experts Layers [3-92]
blk\..*\.ffndownexps\.weight=iq4_ks
blk\..*\.ffn(gate|up)exps\.weight=iq4_kss
NextN MTP Layer [92]
blk\..*\.nextn\.embedtokens\.weight=iq5ks
blk\..*\.nextn\.sharedheadhead\.weight=iq5_ks
blk\..*\.nextn\.ehproj\.weight=q80
Non-Repeating Layers
tokenembd\.weight=iq4k
output\.weight=iq6_k
IQ4KS-IQ4KS-IQ5_KS: 200.326 GiB (4.802 BPW), Final estimate: PPL = 4.618597 Β± 0.029981, KLD = 0.072590 Β± 0.001816
Default quant level @ Q8_0
Shared Expert Layers [3-92]
blk\..*\.ffndownshexp\.weight=q8_0
blk\..*\.ffn(gate|up)shexp\.weight=q8_0
Routed Experts Layers [3-92]
blk\..*\.ffnupexps\.weight=iq4_ks
blk\..*\.ffngateexps\.weight=iq4_ks
blk\..*\.ffndownexps\.weight=iq5_ks
IQ5_K: 204.948 GiB (4.913 BPW), Final estimate: PPL = 4.665419 Β± 0.030393, KLD = 0.078092 Β± 0.001891
# 93 Repeating Layers [0-92]
Attention
blk\.(0|1|2)\.attnq.*=q80
blk\.(0|1|2)\.attnk.*=q80
blk\.(0|1|2)\.attnv.*=q80
blk\.(0|1|2)\.attnoutput.*=q80
blk\..\.attnq.=iq5k
blk\..\.attnk.=iq5k
blk\..\.attnv.=iq5k
blk\..\.attnoutput.=iq5k
First 3 Dense Layers [0-2]
blk\..*\.ffndown\.weight=q80
blk\..*\.ffn(gate|up)\.weight=q80
Shared Expert Layers [3-92]
blk\..*\.ffndownshexp\.weight=q8_0
blk\..*\.ffn(gate|up)shexp\.weight=q8_0
Routed Experts Layers [3-92]
blk\..*\.ffndownexps\.weight=iq5_k
blk\..*\.ffn(gate|up)exps\.weight=iq4_k
NextN MTP Layer [92]
blk\..*\.nextn\.embedtokens\.weight=iq5k
blk\..*\.nextn\.sharedheadhead\.weight=iq5_k
blk\..*\.nextn\.ehproj\.weight=q80
Non-Repeating Layers
tokenembd\.weight=q80
output\.weight=q8_0
π GGUF File List
| π Filename | π¦ Size | β‘ Download |
|---|---|---|
|
imatrix.gguf
Recommended
LFS
|
655.7 MB | Download |