Zhipu · GLM-4 · 9.4B parameters

GLM-4 9B VRAM requirements

GLM-4 9B has 40 layers and uses grouped-query attention (2 KV heads). At Q4_K_M the weights come to 5.4 GB, and the best quantisation that fits a 24 GB card is FP16 / BF16.

Runs comfortably

6.5 GB of 21.8 GB · 30%
022 GB
Weights 5.4 GB
KV cache 0.3 GB
Runtime overhead 0.8 GB

GLM-4 9B at Q4_K_M leaves 15.2 GB spare on a RTX 4090. There is room to raise the context length or move up a quantisation level.

Generation106tok/s
Prompt processing3686tok/s
Max context128Ktokens
KV per 1K tokens0GB

Every quantisation of GLM-4 9B on a RTX 4090

Highlighted row is the highest quality that still fits at 8K context.

QuantisationbpwWeights TotalVerdictMax ctxtok/s
FP16 / BF16 16.00 17.5 GB 18.6 GB Runs comfortably 88K 33.9
INT8 / W8A8 8.50 9.0 GB 10.2 GB Runs comfortably 128K 64.8
Q8_0 (GGUF) 8.50 9.0 GB 10.2 GB Runs comfortably 128K 64.8
FP8 (E4M3) 8.00 8.8 GB 9.9 GB Runs comfortably 128K 66.8
Q6_K 6.56 7.2 GB 8.3 GB Runs comfortably 128K 80.8
AWQ 4-bit 4.25 6.3 GB 7.5 GB Runs comfortably 128K 90.9
GPTQ 4-bit 4.25 6.3 GB 7.5 GB Runs comfortably 128K 90.9
MXFP4 4.25 6.3 GB 7.5 GB Runs comfortably 128K 90.9
Q5_K_M 5.67 6.2 GB 7.3 GB Runs comfortably 128K 92.9
Q5_K_S 5.52 6.0 GB 7.2 GB Runs comfortably 128K 95.3
Q4_K_M 4.85 5.4 GB 6.5 GB Runs comfortably 128K 106
Q4_K_S 4.58 5.1 GB 6.3 GB Runs comfortably 128K 111
Q4_0 4.55 5.1 GB 6.2 GB Runs comfortably 128K 112
IQ4_XS 4.25 4.8 GB 6.0 GB Runs comfortably 128K 118
Q3_K_M 3.91 4.5 GB 5.6 GB Runs comfortably 128K 126
IQ3_M 3.70 4.3 GB 5.4 GB Runs comfortably 128K 131
IQ3_XXS 3.06 3.7 GB 4.8 GB Runs comfortably 128K 151
Q2_K 2.63 3.3 GB 4.4 GB Runs comfortably 128K 168
IQ2_XXS 2.06 2.8 GB 3.9 GB Runs comfortably 128K 198
IQ1_M 1.75 2.5 GB 3.6 GB Runs comfortably 128K 219

GLM-4 9B on each GPU

Q4_K_M weights at 8K context, single card, monitor attached.

GPUVRAMGB/sVerdictMax ctxtok/s
H100 SXM 80GB 80 3350 Runs comfortably 128K 383
A100 80GB 80 2039 Runs comfortably 128K 218
RTX 5090 32 1792 Runs comfortably 128K 203
RTX 5080 16 960 Runs comfortably 128K 111
RTX 4090 24 1008 Runs comfortably 128K 106
RTX 5070 Ti 16 896 Runs comfortably 128K 104
RTX 3090 24 936 Runs comfortably 128K 103
Radeon RX 7900 XTX 24 960 Runs comfortably 128K 96.0
L40S 48 864 Runs comfortably 128K 91.2
RTX A6000 48 768 Runs comfortably 128K 84.7
RTX 3080 10GB 10 760 Runs comfortably 61K 83.9
Mac Studio M3 Ultra 256GB 256 819 Runs comfortably 128K 83.4
RTX 5070 12 672 Runs comfortably 109K 78.4
RTX 4080 Super 16 736 Runs comfortably 128K 77.9
RTX 4070 Ti Super 16 672 Runs comfortably 128K 71.3
Mac Studio M4 Max 128GB 128 546 Runs comfortably 128K 62.3
RTX 4070 Super 12 504 Runs comfortably 109K 53.7
RTX 4070 12 504 Runs comfortably 109K 53.7
RTX 5060 Ti 16GB 16 448 Runs comfortably 128K 52.6
Arc B580 12 456 Runs comfortably 109K 41.2
RTX 3060 12GB 12 360 Runs comfortably 109K 40.2
NVIDIA DGX Spark (GB10) 128 273 Runs comfortably 128K 32.2
Mac Mini M4 Pro 48GB 48 273 Runs comfortably 128K 31.4
RTX 4060 Ti 16GB 16 288 Runs comfortably 128K 30.8
Ryzen AI Max+ 395 128GB 128 256 Runs comfortably 128K 24.1

Architecture

Parameters9.4B
Layers40
Hidden size4096
Attention heads / KV heads32 / 2
Head dimension128
Vocabulary151,552
Trained context128K
KV cache per 1K tokens0 GB
Hugging FaceTHUDM/glm-4-9b-chat

The Zhipu family

GLM-4 9B is published on Hugging Face under THUDM, the Tsinghua lab that develops the series with Zhipu AI. A 9.4B dense model with a 128K context.

huggingface.co/THUDM · github.com/THUDM/GLM-4

Direct answers