Qwen2.5-72B-Instruct — Requisiti VRAM, matrice di quantizzazione e guida GPU

Qwen2.5-72B-Instruct (Qwen, Qwen License) adotta un’architettura Transformer denso con 72.7B parametri residenti (72.7B attivi per token), 80 livelli e Attenzione a query raggruppate (GQA) con supporto fino a 32,768 token di contesto.

Simulatore interattivo di memoria e contesto per Qwen2.5-72B-Instruct

32,768 token

Ripartizione memoria e limite di banda passante

Entra comodamente
Pesi del modello: 76.5% KV: 18.6% Overhead: 4.9%
Memoria totale richiesta
53.67 GB
Allocazione per dispositivo: 53.67 GB
Pesi del modello
41.05 GB
KV Cache (FP16): 10.00 GB
Decodifica stimata (singolo flusso)
24.6 tok/s
Overhead runtime e TP: 2.62 GB
Contesto max prima di OOM
110,333
token

La compressione KV architetturale risparmia il 87.5% rispetto a MHA FP16 standard (80.00 GB).

Matrice VRAM per precisione e quantizzazione (contesto 8K / 32K / 128K)

Memoria GPU totale richiesta in base alla precisione dei pesi e alla lunghezza del contesto (batch = 1, KV cache FP16)
Precisione / Formato bpw effettivi Solo pesi Totale @ ctx 8K Totale @ ctx 32K Totale @ ctx 128K Fascia consigliata (@ 32K)
FP16 / BF16 16.00 bpw 135.41 GB 143.37 GB 150.87 GB 180.87 GB Mac Studio 512GB
FP8 8.50 bpw 71.94 GB 77.99 GB 85.49 GB 115.49 GB RTX PRO 6000 96GB
Q8_0 8.50 bpw 71.94 GB 77.99 GB 85.49 GB 115.49 GB RTX PRO 6000 96GB
Q6_K 6.56 bpw 55.52 GB 61.08 GB 68.58 GB 98.58 GB NVIDIA A100 80GB
Q5_K_M 5.69 bpw 48.16 GB 53.49 GB 60.99 GB 90.99 GB NVIDIA A100 80GB
Q4_K_M 4.85 bpw 41.05 GB 46.17 GB 53.67 GB 83.67 GB NVIDIA A100 80GB
AWQ INT4 4.50 bpw 38.09 GB 43.12 GB 50.62 GB 80.62 GB NVIDIA A100 80GB
IQ4_XS 4.25 bpw 35.97 GB 40.94 GB 48.44 GB 78.44 GB Apple M-Max 64GB

Compatibilità hardware e velocità di decodifica (Qwen2.5-72B-Instruct @ Q4_K_M, contesto 32K)

Esito di compatibilità, utilizzo memoria e throughput di decodifica stimato sulle principali GPU e Apple Silicon
Fascia hardware Memoria e banda Richiesta (32K) Compatibilità Velocità decod. stimata
RTX 3090 24GB 24 GB · 936 GB/s 53.67 GB (224%) Memoria esaurita (OOM) —
RTX 4090 24GB 24 GB · 1008 GB/s 53.67 GB (224%) Memoria esaurita (OOM) —
RTX 5090 32GB 32 GB · 1792 GB/s 53.67 GB (168%) Memoria esaurita (OOM) —
Apple M-Max 64GB 64 GB · 546 GB/s 52.71 GB (82%) Richiede sysctl wired_limit 5.9 tok/s
Mac Studio 128GB 128 GB · 546 GB/s 52.71 GB (41%) Entra comodamente 5.9 tok/s
Mac Studio 192GB 192 GB · 800 GB/s 52.71 GB (28%) Entra comodamente 8.6 tok/s
NVIDIA A100 80GB 80 GB · 2039 GB/s 53.67 GB (67%) Entra comodamente 24.6 tok/s
NVIDIA H100 80GB 80 GB · 3350 GB/s 53.67 GB (67%) Entra comodamente 40.5 tok/s

Parametri verificati dell’architettura Transformer

Checkpoint ID
Qwen/Qwen2.5-72B-Instruct
Ollama Tag
qwen2.5:72b
License / Release
Qwen License · 2024-Q4
Topologia e attenzione
Transformer denso
Meccanismo di attenzione
Attenzione a query raggruppate (GQA)
Parametri totali (B)
72.7B
Parametri attivi / token (B)
72.7B
Livelli nascosti / Dimensione nascosta
80 / 8192
Teste di query / Teste KV
64Q / 8KV (d=128)
Vocab / Max Position
152,064 / 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 Qwen2.5-72B-Instruct

CLI vLLM (NVIDIA A100 80GB)
vllm serve Qwen/Qwen2.5-72B-Instruct \
  --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
Modelfile Ollama
# Save as Modelfile, then run: ollama create qwen2-5-72b-custom -f Modelfile
FROM qwen2.5:72b
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