Model fits in VRAM ≠ runs: an 8B model really needs ~18.9 GiB, thread explains

techNmak · x · 2026-11-26

A detailed thread (with infographic) on why parameter count only tells you weight size, not peak GPU memory. FP32 Adam training costs 16 bytes/param (weights+grads+moments) before activations; inference swaps those for a KV cache that grows with tokens and concurrency. Worked example: an 8B BF16 model with 32 layers, 8 KV heads, head dim 128 needs 1 GiB KV per 8,192-token sequence — four concurrent sequences plus 16 GB weights ≈ 18.90 GiB raw payload. Also covers the allocated-vs-reserved distinction in PyTorch's caching allocator, why emptycache() can't free live tensors, and which optimization targets which cost (microbatches, activation checkpointing, ZeRO/FSDP, quantization, paged/prefix-shared KV). Bottom line: measure peak workload memory, not checkpoint size.

Original post →

More from Infra

Infra channel →