Gemma 3 4B IT (Q4_K_M) : VRAM exacte, KV-Cache & Tenseurs
Architecture Google Gemma 3 4B à grand vocabulaire multilingue (262k tokens) et contexte 128k pour GPU dès 6 Go.
⚡ Simuler sur votre GPU dans l’onglet (WASM)
Mesurer & signer Ed25519 dans Local Cockpit 0.4.0
Voir le fichier sur HuggingFace
VRAM min (8k · KV FP16)4,13 Gio32k en KV Q8_0 : 5,52 Gio
Poids binaires .GGUF2,31 Gio5,12 bits/poids effectifs
Paramètres (Actifs / Totaux)3,88 / 3,88 Md444 tenseurs analysés
Coût du Cache KV136,0 Mio/1kEn Q8_0 : 72,2 Mio / 1 000 tok
1. Provenance binaire HuggingFace
| Dépôt officiel | bartowski/google_gemma-3-4b-it-GGUF |
|---|---|
| Fichier inspecté | google_gemma-3-4b-it-Q4_K_M.gguf (2,32 Gio) |
| Commit HuggingFace | 71506238f970 |
| Date de lecture | 2026-11-29 15:28:15 UTC |
| En-tête analysé | 6 539 673 octets (SHA-256 f2796389571a2f0f63f1…) |
2. Architecture & dimensions GQA
| Architecture GGUF | gemma3 (Dense) |
|---|---|
| Couches Transformer | 34 couches (~54,2 Mio / couche) |
| Dimensions (d_model / FFN) | 2560 / 10240 |
| Têtes d’attention (Q / KV) | 8 Q / 4 KV (GQA 2,0:1, dim 256) |
| Contexte natif & Vocabulaire | 131 072 tokens · vocab 262 144 |
3. Distribution réelle des types de quantification GGML dans ce fichier
Contrairement à une quantification uniforme, un fichier Q4_K_M conserve certains tenseurs critiques dans une précision supérieure :
| Type GGML | Nombre de tenseurs | Volume | Part du poids | Répartition |
|---|---|---|---|---|
Q4_K | 204 | 1,42 Gio | 61,6 % | |
Q6_K | 35 | 0,89 Gio | 38,4 % | |
F32 | 205 | 0,00 Gio | 0,1 % |
4. Falaise du Cache KV de 2k à 128k tokens (FP16 vs Q8_0 vs Q4_0)
Activer Flash Attention et un cache KV en Q8_0 divise presque par deux la mémoire de contexte sans modifier les poids du modèle :
| Longueur de contexte | KV seul (FP16) | KV seul (Q8_0) | KV seul (Q4_0) | VRAM totale (FP16) | VRAM totale (Q8_0) |
|---|---|---|---|---|---|
| 2k (2 048) | 0,27 Gio | 0,14 Gio | 0,07 Gio | 3,33 Gio | 3,20 Gio |
| 4k (4 096) | 0,53 Gio | 0,28 Gio | 0,15 Gio | 3,59 Gio | 3,34 Gio |
| 8k (8 192) | 1,06 Gio | 0,56 Gio | 0,30 Gio | 4,12 Gio | 3,62 Gio |
| 16k (16 384) | 2,13 Gio | 1,13 Gio | 0,60 Gio | 5,19 Gio | 4,19 Gio |
| 32k (32 768) | 4,25 Gio | 2,26 Gio | 1,20 Gio | 7,31 Gio | 5,32 Gio |
| 64k (65 536) | 8,50 Gio | 4,52 Gio | 2,39 Gio | 11,56 Gio | 7,58 Gio |
| 128k (131 072) | 17,00 Gio | 9,03 Gio | 4,78 Gio | 20,06 Gio | 12,09 Gio |
5. Matrice de placement couche par couche par configuration matérielle
Simulation déterministe incluant la réserve VRAM du système d’exploitation et les tampons d’évaluation :
| Configuration matérielle | Contexte & KV | Couches en VRAM | VRAM occupée | Débordement RAM | Verdict mémoire |
|---|---|---|---|---|---|
| GPU 8 Go + 16 Go RAM | 8k · KV FP16 | 34 / 34 | 3,60 Gio | — | 100 % VRAM |
| GPU 8 Go + 16 Go RAM | 32k · KV FP16 | 34 / 34 | 6,92 Gio | — | 100 % VRAM |
| GPU 8 Go + 16 Go RAM | 32k · KV Q8_0 | 34 / 34 | 4,93 Gio | — | 100 % VRAM |
| GPU 12 Go + 32 Go RAM | 8k · KV FP16 | 34 / 34 | 3,60 Gio | — | 100 % VRAM |
| GPU 12 Go + 32 Go RAM | 32k · KV FP16 | 34 / 34 | 6,92 Gio | — | 100 % VRAM |
| GPU 12 Go + 32 Go RAM | 32k · KV Q8_0 | 34 / 34 | 4,93 Gio | — | 100 % VRAM |
| GPU 16 Go + 32 Go RAM | 8k · KV FP16 | 34 / 34 | 3,60 Gio | — | 100 % VRAM |
| GPU 16 Go + 32 Go RAM | 32k · KV FP16 | 34 / 34 | 6,92 Gio | — | 100 % VRAM |
| GPU 16 Go + 32 Go RAM | 32k · KV Q8_0 | 34 / 34 | 4,93 Gio | — | 100 % VRAM |
| GPU 24 Go + 64 Go RAM | 8k · KV FP16 | 34 / 34 | 3,60 Gio | — | 100 % VRAM |
| GPU 24 Go + 64 Go RAM | 32k · KV FP16 | 34 / 34 | 6,92 Gio | — | 100 % VRAM |
| GPU 24 Go + 64 Go RAM | 32k · KV Q8_0 | 34 / 34 | 4,93 Gio | — | 100 % VRAM |
| GPU 32 Go + 64 Go RAM | 8k · KV FP16 | 34 / 34 | 3,60 Gio | — | 100 % VRAM |
| GPU 32 Go + 64 Go RAM | 32k · KV FP16 | 34 / 34 | 6,92 Gio | — | 100 % VRAM |
| GPU 32 Go + 64 Go RAM | 32k · KV Q8_0 | 34 / 34 | 4,93 Gio | — | 100 % VRAM |
| Bi-GPU 48 Go + 128 Go RAM | 8k · KV FP16 | 34 / 34 | 3,60 Gio | — | 100 % VRAM |
| Bi-GPU 48 Go + 128 Go RAM | 32k · KV FP16 | 34 / 34 | 6,92 Gio | — | 100 % VRAM |
| Bi-GPU 48 Go + 128 Go RAM | 32k · KV Q8_0 | 34 / 34 | 4,93 Gio | — | 100 % VRAM |
| Mémoire unifiée 64 Go | 8k · KV FP16 | 34 / 34 | 3,60 Gio | — | Mémoire unifiée |
| Mémoire unifiée 64 Go | 32k · KV FP16 | 34 / 34 | 6,92 Gio | — | Mémoire unifiée |
| Mémoire unifiée 64 Go | 32k · KV Q8_0 | 34 / 34 | 4,93 Gio | — | Mémoire unifiée |
6. Commandes d’exécution locale prêtes à copier
Avec Ollama :
ollama run gemma3:4b
Avec
llama-server (Flash Attention + Cache KV Q8_0 calibré pour 16 Go VRAM) :llama-server -m google_gemma-3-4b-it-Q4_K_M.gguf -ngl 34 -c 32768 -fa --cache-type-k q8_0 --cache-type-v q8_0
7. Bancs réels certifiés Ed25519 sur ce modèle
Aucun passeport Ed25519 certifié n’est encore enregistré pour cette variante exacte (aucun débit tok/s n’est jamais inventé). Lancez ce modèle dans Local Cockpit 0.4.0 pour publier la première mesure signée /b/lc-… !