DeepSeek-R1-Distill-Qwen-32B — Requisiti VRAM, matrice di quantizzazione e guida GPU

DeepSeek-R1-Distill-Qwen-32B (DeepSeek, MIT) adotta un’architettura Transformer denso con 32.8B parametri residenti (32.8B attivi per token), 64 livelli e Attenzione a query raggruppate (GQA) con supporto fino a 131,072 token di contesto.

Simulatore interattivo di memoria e contesto per DeepSeek-R1-Distill-Qwen-32B

32,768 token

Ripartizione memoria e limite di banda passante

Al limite (>90% usabile)
Pesi del modello: 65.5% KV: 28.3% Overhead: 6.2%
Memoria totale richiesta
28.28 GB
Allocazione per dispositivo: 28.28 GB
Pesi del modello
18.52 GB
KV Cache (FP16): 8.00 GB
Decodifica stimata (singolo flusso)
39.4 tok/s
Overhead runtime e TP: 1.76 GB
Contesto max prima di OOM
44,216
token

La compressione KV architetturale risparmia il 80.0% rispetto a MHA FP16 standard (40.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 61.09 GB 66.13 GB 72.13 GB 96.13 GB NVIDIA A100 80GB
FP8 8.50 bpw 32.46 GB 36.63 GB 42.63 GB 66.63 GB NVIDIA L40S 48GB
Q8_0 8.50 bpw 32.46 GB 36.63 GB 42.63 GB 66.63 GB NVIDIA L40S 48GB
Q6_K 6.56 bpw 25.05 GB 29.00 GB 35.00 GB 59.00 GB Apple M4 Pro 48GB
Q5_K_M 5.69 bpw 21.73 GB 25.58 GB 31.58 GB 55.58 GB Apple M4 Pro 48GB
Q4_K_M 4.85 bpw 18.52 GB 22.28 GB 28.28 GB 52.28 GB RTX 5090 32GB
AWQ INT4 4.50 bpw 17.18 GB 20.90 GB 26.90 GB 50.90 GB RTX 5090 32GB
IQ4_XS 4.25 bpw 16.23 GB 19.92 GB 25.92 GB 49.92 GB RTX 5090 32GB

Compatibilità hardware e velocità di decodifica (DeepSeek-R1-Distill-Qwen-32B @ 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 28.28 GB (118%) Memoria esaurita (OOM) —
RTX 4090 24GB 24 GB · 1008 GB/s 28.28 GB (118%) Memoria esaurita (OOM) —
RTX 5090 32GB 32 GB · 1792 GB/s 28.28 GB (88%) Al limite (>90% usabile) 39.4 tok/s
Apple M-Max 64GB 64 GB · 546 GB/s 27.66 GB (43%) Entra comodamente 11.3 tok/s
Mac Studio 128GB 128 GB · 546 GB/s 27.66 GB (22%) Entra comodamente 11.3 tok/s
Mac Studio 192GB 192 GB · 800 GB/s 27.66 GB (14%) Entra comodamente 16.5 tok/s
NVIDIA A100 80GB 80 GB · 2039 GB/s 28.28 GB (35%) Entra comodamente 47.4 tok/s
NVIDIA H100 80GB 80 GB · 3350 GB/s 28.28 GB (35%) Entra comodamente 77.9 tok/s

Parametri verificati dell’architettura Transformer

Checkpoint ID
deepseek-ai/DeepSeek-R1-Distill-Qwen-32B
Ollama Tag
deepseek-r1:32b
License / Release
MIT · 2025-Q1
Topologia e attenzione
Transformer denso
Meccanismo di attenzione
Attenzione a query raggruppate (GQA)
Parametri totali (B)
32.8B
Parametri attivi / token (B)
32.8B
Livelli nascosti / Dimensione nascosta
64 / 5120
Teste di query / Teste KV
40Q / 8KV (d=128)
Vocab / Max Position
152,064 / 131,072

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 DeepSeek-R1-Distill-Qwen-32B

CLI vLLM (RTX 5090 32GB)
vllm serve deepseek-ai/DeepSeek-R1-Distill-Qwen-32B \
  --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 deepseek-r1-distill-qwen-32b-custom -f Modelfile
FROM deepseek-r1: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