GLM-4-32B-0414 — Requisiti VRAM, matrice di quantizzazione e guida GPU
GLM-4-32B-0414 (Zhipu GLM, MIT) adotta un’architettura Transformer denso con 32B parametri residenti (32B attivi per token), 61 livelli e Attenzione a query raggruppate (GQA) con supporto fino a 32,768 token di contesto.
Simulatore interattivo di memoria e contesto per GLM-4-32B-0414
Matrice VRAM per precisione e quantizzazione (contesto 8K / 32K / 128K)
| Precisione / Formato | bpw effettivi | Solo pesi | Totale @ ctx 8K | Totale @ ctx 32K | Totale @ ctx 128K | Fascia consigliata (@ 32K) |
|---|---|---|---|---|---|---|
| FP16 / BF16 | 16.00 bpw | 59.60 GB | 63.13 GB | 64.56 GB | 70.28 GB | NVIDIA A100 80GB |
| FP8 | 8.50 bpw | 31.66 GB | 34.36 GB | 35.79 GB | 41.50 GB | Apple M4 Pro 48GB |
| Q8_0 | 8.50 bpw | 31.66 GB | 34.36 GB | 35.79 GB | 41.50 GB | Apple M4 Pro 48GB |
| Q6_K | 6.56 bpw | 24.44 GB | 26.91 GB | 28.34 GB | 34.06 GB | RTX 5090 32GB |
| Q5_K_M | 5.69 bpw | 21.20 GB | 23.57 GB | 25.00 GB | 30.72 GB | RTX 5090 32GB |
| Q4_K_M | 4.85 bpw | 18.07 GB | 20.35 GB | 21.78 GB | 27.50 GB | RTX 3090 24GB |
| AWQ INT4 | 4.50 bpw | 16.76 GB | 19.01 GB | 20.44 GB | 26.16 GB | RTX 3090 24GB |
| IQ4_XS | 4.25 bpw | 15.83 GB | 18.05 GB | 19.48 GB | 25.20 GB | RTX 3090 24GB |
Compatibilità hardware e velocità di decodifica (GLM-4-32B-0414 @ Q4_K_M, contesto 32K)
| Fascia hardware | Memoria e banda | Richiesta (32K) | Compatibilità | Velocità decod. stimata |
|---|---|---|---|---|
| RTX 3090 24GB | 24 GB · 936 GB/s | 21.78 GB (91%) | Al limite (>90% usabile) | 27.3 tok/s |
| RTX 4090 24GB | 24 GB · 1008 GB/s | 21.78 GB (91%) | Al limite (>90% usabile) | 29.4 tok/s |
| RTX 5090 32GB | 32 GB · 1792 GB/s | 21.78 GB (68%) | Entra comodamente | 52.3 tok/s |
| Apple M-Max 64GB | 64 GB · 546 GB/s | 21.17 GB (33%) | Entra comodamente | 15.0 tok/s |
| Mac Studio 128GB | 128 GB · 546 GB/s | 21.17 GB (17%) | Entra comodamente | 15.0 tok/s |
| Mac Studio 192GB | 192 GB · 800 GB/s | 21.17 GB (11%) | Entra comodamente | 22.0 tok/s |
| NVIDIA A100 80GB | 80 GB · 2039 GB/s | 21.78 GB (27%) | Entra comodamente | 63.0 tok/s |
| NVIDIA H100 80GB | 80 GB · 3350 GB/s | 21.78 GB (27%) | Entra comodamente | 103.5 tok/s |
Parametri verificati dell’architettura Transformer
- Checkpoint ID
- THUDM/GLM-4-32B-0414
- Ollama Tag
- glm4:32b
- License / Release
- MIT · 2025-Q2
- Topologia e attenzione
- Transformer denso
- Meccanismo di attenzione
- Attenzione a query raggruppate (GQA)
- Parametri totali (B)
- 32B
- Parametri attivi / token (B)
- 32B
- Livelli nascosti / Dimensione nascosta
- 61 / 6144
- Teste di query / Teste KV
- 48Q / 2KV (d=128)
- Vocab / Max Position
- 151,552 / 32,768
I formati quantizzati memorizzano fattori di scala per blocco e zero-point accanto ai pesi interi compatti. Un checkpoint GGUF Q4_K_M a 4 bit richiede in media 4.85 bit effettivi per parametro (non 4.00), mentre Q8_0 si attesta a 8.50 bpw. Nei modelli Mixture-of-Experts, tutti gli esperti instradati e condivisi restano residenti in memoria per evitare il paging dall’host a ogni token.
La Grouped-Query Attention standard alloca 2 × L × H_kv × d_head × S × B × bytes_kv lungo i livelli. La Multi-head Latent Attention di DeepSeek (MLA) comprime chiavi e valori in L × (d_kv_lora + d_qk_rope) × S × B × bytes_kv, riducendo di oltre il 90% la memoria sui contesti lunghi. I modelli ibridi a finestra scorrevole limitano i livelli di attenzione locale a min(S, window_size) facendo scalare linearmente con S quelli globali.
Comandi rapidi vLLM e Ollama per GLM-4-32B-0414
vllm serve THUDM/GLM-4-32B-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
# Save as Modelfile, then run: ollama create glm-4-32b-custom -f Modelfile
FROM glm4:32b
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
Confronta modelli affini e di scala simile a pesi aperti
GLM-4-9B-0414
Zhipu GLM · 9.4B (GQA)
DeepSeek-R1-Distill-Qwen-32B
DeepSeek · 32.8B (GQA)
Qwen3-32B
Qwen · 32.8B (GQA)
QwQ-32B (Reasoning)
Qwen · 32.8B (GQA)
Qwen2.5-Coder-32B-Instruct
Qwen · 32.8B (GQA)
Qwen3-30B-A3B (MoE)
Qwen · 30.5B (GQA)