GLM-4-9B-0414 — VRAM-Anforderungen, Quantisierungsmatrix & GPU-Leitfaden

GLM-4-9B-0414 (Zhipu GLM, MIT) nutzt eine Dichter Transformer-Architektur mit 9.4B residenten Parametern (9.4B aktiv pro Token), 40 Schichten und Grouped-Query Attention (GQA) für bis zu 32,768 Kontext-Tokens.

Interaktiver Speicher- & Kontextsimulator für GLM-4-9B-0414

32,768 Tokens

Speicheraufschlüsselung & Bandbreitenlimit

Passt komfortabel
Modellgewichte: 67.6% KV: 15.9% Overhead: 16.5%
Gesamter Speicherbedarf
7.86 GB
Belegung pro Gerät: 7.86 GB
Modellgewichte
5.31 GB
KV-Cache (FP16): 1.25 GB
Gesch. Einzelstream-Decode
32.0 tok/s
Runtime- & TP-Overhead: 1.30 GB
Max. Kontext vor OOM
136,404
Tokens

Architekturbedingte KV-Komprimierung spart 93.8 % gegenüber naiver MHA FP16 (20.00 GB).

Präzisions- & Quantisierungs-VRAM-Matrix (8K / 32K / 128K Kontext)

Gesamter GPU-Speicherbedarf nach Gewichtspräzision und Kontextlänge (Batch = 1, FP16-KV-Cache)
Präzision / Format Effektive bpw Nur Gewichte Gesamt @ 8K Gesamt @ 32K Gesamt @ 128K Empfohlene Klasse (@ 32K)
FP16 / BF16 16.00 bpw 17.51 GB 19.49 GB 20.42 GB 24.17 GB RTX 3090 24GB
FP8 8.50 bpw 9.30 GB 11.03 GB 11.97 GB 15.72 GB RTX 4060 Ti 16GB
Q8_0 8.50 bpw 9.30 GB 11.03 GB 11.97 GB 15.72 GB RTX 4060 Ti 16GB
Q6_K 6.56 bpw 7.18 GB 8.85 GB 9.78 GB 13.53 GB RTX 3060 12GB
Q5_K_M 5.69 bpw 6.23 GB 7.87 GB 8.80 GB 12.55 GB RTX 3060 12GB
Q4_K_M 4.85 bpw 5.31 GB 6.92 GB 7.86 GB 11.61 GB RTX 3060 12GB
AWQ INT4 4.50 bpw 4.92 GB 6.52 GB 7.46 GB 11.21 GB RTX 3060 12GB
IQ4_XS 4.25 bpw 4.65 GB 6.24 GB 7.18 GB 10.93 GB RTX 3060 12GB

Hardware-Kompatibilität & Decode-Geschwindigkeit (GLM-4-9B-0414 @ Q4_K_M, 32K Kontext)

Passstatus, Speicherauslastung und geschätzter Decode-Durchsatz auf führenden GPUs und Apple Silicon
Hardware-Klasse Speicher & Bandbreite Benötigt (32K) Bewertung Gesch. Decode-Rate
RTX 3090 24GB 24 GB · 936 GB/s 7.86 GB (33%) Passt komfortabel 83.2 tok/s
RTX 4090 24GB 24 GB · 1008 GB/s 7.86 GB (33%) Passt komfortabel 89.6 tok/s
RTX 5090 32GB 32 GB · 1792 GB/s 7.86 GB (25%) Passt komfortabel 159.2 tok/s
Apple M-Max 64GB 64 GB · 546 GB/s 7.44 GB (12%) Passt komfortabel 45.7 tok/s
Mac Studio 128GB 128 GB · 546 GB/s 7.44 GB (6%) Passt komfortabel 45.7 tok/s
Mac Studio 192GB 192 GB · 800 GB/s 7.44 GB (4%) Passt komfortabel 66.9 tok/s
NVIDIA A100 80GB 80 GB · 2039 GB/s 7.86 GB (10%) Passt komfortabel 191.8 tok/s
NVIDIA H100 80GB 80 GB · 3350 GB/s 7.86 GB (10%) Passt komfortabel 315.2 tok/s

Geprüfte Transformer-Architekturparameter

Checkpoint ID
THUDM/GLM-4-9B-0414
Ollama Tag
glm4:9b
License / Release
MIT · 2025-Q2
Topologie & Attention
Dichter Transformer
Aufmerksamkeitsmechanismus
Grouped-Query Attention (GQA)
Gesamtparameter (Mrd.)
9.4B
Aktive Parameter / Token (Mrd.)
9.4B
Verborgene Schichten / Hidden-Dimension
40 / 4096
Query-Heads / KV-Heads
32Q / 2KV (d=128)
Vocab / Max Position
151,552 / 32,768

Quantisierte Formate speichern blockweise Skalierungsfaktoren und Nullpunkte neben gepackten Ganzzahlgewichten. Ein 4-Bit-GGUF-Checkpoint in Q4_K_M benötigt im Schnitt 4.85 effektive Bits pro Parameter (nicht 4.00), während Q8_0 bei 8.50 bpw liegt. Bei Mixture-of-Experts-Modellen bleiben sämtliche gerouteten und geteilten Experten im Speicher resident, um Host-Paging bei jedem Token zu verhindern.

Standard-Grouped-Query-Attention reserviert über alle Schichten hinweg 2 × L × H_kv × d_head × S × B × bytes_kv. DeepSeek Multi-head Latent Attention (MLA) komprimiert Keys und Values auf L × (d_kv_lora + d_qk_rope) × S × B × bytes_kv und senkt den Speicherbedarf langer Kontexte um über 90 %. Hybride Sliding-Window-Modelle deckeln lokale Schichten bei min(S, window_size), während globale Schichten linear mit S wachsen.

Schnellstart-Befehle für vLLM & Ollama (GLM-4-9B-0414)

vLLM CLI (RTX 3060 12GB)
vllm serve THUDM/GLM-4-9B-0414 \
  --tensor-parallel-size 1 \
  --max-model-len 32768 \
  --max-num-seqs 8 \
  --gpu-memory-utilization 0.95 \
  --kv-cache-dtype fp8 \
  --enable-prefix-caching \
  --port 8000
Ollama Modelfile
# Save as Modelfile, then run: ollama create glm-4-9b-custom -f Modelfile
FROM glm4:9b
PARAMETER num_ctx 32768
PARAMETER num_batch 512
PARAMETER flash_attn true

# Environment variables for ollama serve:
# OLLAMA_NUM_PARALLEL=8 OLLAMA_FLASH_ATTENTION=1 OLLAMA_KV_CACHE_TYPE=q8_0 ollama serve

Verwandte & ähnlich große Open-Weight-Modelle vergleichen