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
Microsoft Phi-4Verified microsoft/phi-4 config.json ·

Phi-4 14B VRAM & GPU Requirements Calculator

Phi-4 14B requires 27.4 GiB in FP16, 13.7 GiB in FP8, and 8.4 GiB in GGUF Q4_K_M for GPU weights alone (40 layers · GQA (40Q / 10KV = 4× KV savings)). At 8K context (batch=1, FP16 KV), KV-cache adds 1.56 GiB (4.0× smaller than MHA).

FP16 Inference (8K)
30.4 GiB
27.4 GiB weights
FP8 Weights + FP8 KV
15.9 GiB
13.7 GiB weights
GGUF Q4_K_M (8K)
11.4 GiB
8.4 GiB weights
32K KV-Cache (FP16)
6.25 GiB
4.0× vs MHA

Can Your GPU or Mac Run Phi-4 14B? (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 (11.4 GiB)FP8 / Q8_0* (15.9 GiB FP8)FP16 (30.4 GiB)
1× RTX 4090 (23.9 GiB usable)FIT · ~69 tok/sFIT · ~48 tok/sOOM (-7G)
2× RTX 4090 (47.8 GiB usable)FIT · ~76 tok/sFIT · ~60 tok/sFIT · ~36 tok/s
Apple M4 Max (128 GiB Unified · 96 GiB GPU)FIT · ~36 tok/sQ8_0 FIT · ~22 tok/sFIT · ~12 tok/s
Apple M3 Ultra (256 GiB Unified · 192 GiB GPU)FIT · ~52 tok/sQ8_0 FIT · ~33 tok/sFIT · ~19 tok/s
1× H100 SXM (79.6 GiB usable)FIT · ~196 tok/sFIT · ~143 tok/sFIT · ~77 tok/s
4× H100 SXM (318.4 GiB usable)FIT · ~197 tok/sFIT · ~178 tok/sFIT · ~137 tok/s
8× H100 SXM (636.8 GiB usable)FIT · ~167 tok/sFIT · ~160 tok/sFIT · ~139 tok/s
8× H200 SXM (1,123.2 GiB usable)FIT · ~173 tok/sFIT · ~167 tok/sFIT · ~151 tok/s
vLLM Serve · 1× H100 (79.6 GiB)

Ready-to-run deployment commands for Phi-4 14B

vllm serve microsoft/phi-4 --tensor-parallel-size 1 --max-model-len 8192 --gpu-memory-utilization 0.90

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

llama.cpp GGUF Q4_K_M · Needs 11.4 GiB
llama-server -m /path/to/phi-4-14b-Q4_K_M.gguf -c 8192 -ngl 999 -fa on

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

Interactive Phi-4 14B VRAM & Roofline Simulator

1. Model & Workload

GQA · 14.7B Dense

40 layers · GQA (40Q / 10KV = 4× KV savings)

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)
OOM CLIFF (-6.5 GiB over limit)
30.4 / 23.9 GiB usable (127%)

Quantize weights to FP8 (~13.7 GiB) or GGUF Q4_K_M (~8.4 GiB).

Total VRAM
30.4 GiB
Weights 27.4 GiB (FP16)
KV-Cache
1.6 GiB
4.0× vs MHA
Decode / User
~24.7 tok/s
HBM Bound
Cluster Output
~25 tok/s
AI 1.2 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: 30.4 GiB · Usable: 23.9 GiB (127%) 23.9 GiB Usable Weights: 27.4 GiBKV-Cache: 1.6 GiBAct + CUDA: 1.5 GiB educatum.com/kv-cache

Decode Arithmetic Intensity Roofline

AI 1.2 vs Ridge 327 FLOPs/B
1416642561024 Ridge: 327 FLOPs/B · 330 TFLOPS Memory-Bandwidth Bound (1.2 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.
Microsoft Phi-4 (14B) · KV_tok = 2 × 40L × 10 KV heads × 128d × 2B = 200.0 KiB/tok (4.0× vs MHA)
Decode Step Read: 27.4 GiB active weights + 1.56 GiB KV → AI = 1.16 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 Phi-4 14B?

At 8K context (batch=1) in GGUF Q4_K_M, Phi-4 14B needs 11.4 GiB single-GPU VRAM (8.4 GiB weights). Single 23.9 GiB usable RTX 4090: Fits at ~69 tok/s. Dual 47.8 GiB usable (2× RTX 4090): Fits Q4_K_M cleanly (~76 tok/s TP).

Can an Apple M4 Max (128 GiB) Mac Studio / MacBook Pro run Phi-4 14B?

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

How much KV-cache does Phi-4 14B use at 32K context?

Phi-4 14B uses GQA, giving a 4.0× KV-cache reduction vs standard MHA. At 32,768 context (batch=1, FP16 KV), KV-cache occupies 6.25 GiB.

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