Skip to content
E
Educatum
Daily

Cloud Progress Sync

Sign in to Educatum

Sync your Daily AI/ML streaks, Stanford CS329Z progress, and study bookmarks across devices. Your existing browser progress will merge automatically.

🦙
Guest Alias
Google Gemma 3Verified google/gemma-3-4b-it config.json ·

Gemma 3 4B VRAM & GPU Requirements Calculator

Gemma 3 4B requires 8.0 GiB in FP16, 4.0 GiB in FP8, and 2.4 GiB in GGUF Q4_K_M for GPU weights alone (34 layers · 5:1 sliding window (1,024 tok) + GQA). At 8K context (batch=1, FP16 KV), KV-cache adds 0.27 GiB (7.9× smaller than MHA).

FP16 Inference (8K)
9.7 GiB
8.0 GiB weights
FP8 Weights + FP8 KV
5.6 GiB
4.0 GiB weights
GGUF Q4_K_M (8K)
4.2 GiB
2.4 GiB weights
32K KV-Cache (FP16)
0.74 GiB
11.5× vs MHA

Can Your GPU or Mac Run Gemma-3 4B? (8K Context, Batch=1)

Pre-computed fit verdict and estimated decode speed across RTX 4090, Apple Silicon Unified Memory, and NVIDIA H100/H200 clusters. Column headers show 1× GPU baseline (incl. 1.0 GiB runtime; multi-GPU rows add per-GPU NCCL overhead). Apple Silicon runs Q8_0 (Metal/llama.cpp) instead of datacenter FP8.

Hardware RigQ4_K_M (4.2 GiB)FP8 / Q8_0* (5.6 GiB FP8)FP16 (9.7 GiB)
1× RTX 4090 (23.9 GiB usable)FIT · ~215 tok/sFIT · ~152 tok/sFIT · ~82 tok/s
2× RTX 4090 (47.8 GiB usable)FIT · ~147 tok/sFIT · ~127 tok/sFIT · ~90 tok/s
Apple M4 Max (128 GiB Unified · 96 GiB GPU)FIT · ~120 tok/sQ8_0 FIT · ~75 tok/sFIT · ~42 tok/s
Apple M3 Ultra (256 GiB Unified · 192 GiB GPU)FIT · ~170 tok/sQ8_0 FIT · ~109 tok/sFIT · ~62 tok/s
1× H100 SXM (79.6 GiB usable)FIT · ~486 tok/sFIT · ~378 tok/sFIT · ~230 tok/s
4× H100 SXM (318.4 GiB usable)FIT · ~270 tok/sFIT · ~258 tok/sFIT · ~229 tok/s
8× H100 SXM (636.8 GiB usable)FIT · ~209 tok/sFIT · ~205 tok/sFIT · ~195 tok/s
8× H200 SXM (1,123.2 GiB usable)FIT · ~211 tok/sFIT · ~208 tok/sFIT · ~201 tok/s
vLLM Serve · 1× H100 (79.6 GiB)

Ready-to-run deployment commands for Gemma-3 4B

vllm serve google/gemma-3-4b-it --tensor-parallel-size 1 --max-model-len 8192 --gpu-memory-utilization 0.90

Sized at 9.7 GiB total BF16 VRAM (including CUDA/NCCL overhead) out of 79.6 GiB usable.

llama.cpp GGUF Q4_K_M · Needs 4.2 GiB
llama-server -m /path/to/gemma-3-4b-Q4_K_M.gguf -c 8192 -ngl 999 -fa on

Fits on a single RTX 4090 (23.9 GiB usable) at ~215 tok/s.

Interactive Gemma-3 4B VRAM & Roofline Simulator

1. Model & Workload

GQA · 4.3B Dense

34 layers · 5:1 sliding window (1,024 tok) + GQA

Execution Mode
Weight Precision (Datacenter & GGUF)
KV:
8,192 tok
1 reqs

2. Target GPU / Mac Silicon

23.9 GiB Usable · 1.01 TB/s eff.
GPU Count (Tensor Parallel)
FITS IN VRAM (+14.2 GiB headroom)
9.7 / 23.9 GiB usable (41%)

Decode is HBM-bandwidth bound (1.0 vs 327 FLOPs/B ridge): increasing batch size improves cluster tok/s nearly linearly.

Total VRAM
9.7 GiB
Weights 8.0 GiB (FP16)
KV-Cache
0.3 GiB
7.9× vs MHA
Decode / User
~81.6 tok/s
HBM Bound
Cluster Output
~82 tok/s
AI 1.0 FLOP/B

VRAM Allocation vs. Hardware Capacity

Binary GiB (1 GiB = 2³⁰ B) · Usable VRAM excludes ECC/OS & per-GPU CUDA/NCCL buffers

Dashed line = Usable VRAM
Used: 9.7 GiB · Usable: 23.9 GiB (41%) 23.9 GiB Usable Weights: 8.0 GiBKV-Cache: 0.3 GiBAct + CUDA: 1.4 GiB educatum.com/kv-cache

Decode Arithmetic Intensity Roofline

AI 1.0 vs Ridge 327 FLOPs/B
1416642561024 Ridge: 327 FLOPs/B · 330 TFLOPS Memory-Bandwidth Bound (1.0 FLOP/B) Arithmetic Intensity (FLOPs / Byte, log scale) educatum.com/kv-cache
Canonical URL stays clean; click Copy Shareable Link to share your exact slider config.
Gemma 3 4B Instruct · KV_tok (5G + 29L @ 1024 window) = (5 × 8192 + 29 × 1024)/8192 = 34.5 KiB/tok eff. (7.9× vs MHA)
Decode Step Read: 8.0 GiB active weights + 0.27 GiB KV → AI = 1.03 FLOPs/Byte (Memory-Bandwidth Bound; BW in decimal GB/s)

Compare Other LLM VRAM Requirements

All 37 Models →

Frequently Asked Questions

Can 1× or 2× RTX 4090 (24 GiB / 48 GiB) run Gemma 3 4B?

At 8K context (batch=1) in GGUF Q4_K_M, Gemma 3 4B needs 4.2 GiB single-GPU VRAM (2.4 GiB weights). Single 23.9 GiB usable RTX 4090: Fits at ~215 tok/s. Dual 47.8 GiB usable (2× RTX 4090): Fits Q4_K_M cleanly (~147 tok/s TP).

Can an Apple M4 Max (128 GiB) Mac Studio / MacBook Pro run Gemma 3 4B?

An Apple M4 Max 128 GiB reserves 96 GiB wired GPU memory by default. In GGUF Q4_K_M (4.2 GiB GPU wired at 8K), it fits on M4 Max 128 GiB at ~119.7 tok/s.

How much KV-cache does Gemma 3 4B use at 32K context?

Gemma 3 4B uses GQA with 5:1 sliding window (1,024 local tokens), giving a 11.5× KV-cache reduction vs standard MHA. At 32,768 context (batch=1, FP16 KV), KV-cache occupies 0.74 GiB.

Try keywords like RoPE, FlashAttention, DPO, or Blind 75.