GPU Architecture & VRAM Memory Math
Interactive technical curriculum synthesized from FAANG and Tier-1 AI startup interview rounds.
GPU Architecture, Hardware Sizing & Memory Mathematics
Comprehensive coverage of QA-04, QA-06, and QA-12. Master Grouped-Query Attention (GQA) memory equations, the Roofline Model, and emergency capacity levers.
Whiteboard Memory Math Step-Through
Click each component to walk through the exact equations required in senior engineering technical screens:
Parameters × Precision Bytes
2 × L × H_kv × d_h × Bytes
Batch × Context Length × KV_Token
VRAM Per GPU & Headroom Buffer
Step 1: Static Weights Footprint
Formula: Memory = Parameters × Bytes_Per_Weight
For Llama-3-70B in 16-bit (FP16/BF16, 2 bytes):
70 × 10^9 × 2 bytes = 140,000,000,000 bytes ≈ 140 GB.
This memory is completely static and independent of how many users are actively querying the server.
Live Hardware Sizing Simulator
nvidia-smi's utilization metric only measures the percentage of time that any kernel was executing on the GPU. If a single warp is fetching memory from DRAM while the other 128 SMs sit completely idle, nvidia-smi still reports 100% Utilization!
- Decode Phase is Memory-Bound: Each generated token must load 140GB of weights from HBM to register files. The GPU is memory-bandwidth bound ($O(1)$ arithmetic intensity).
- Nsight Profiling (nsys): Profile DRAM throughput vs Tensor Core active cycles. If DRAM throughput is at 95% while SM compute is at 15%, you cannot fix it with faster clocks—you need Continuous Batching, Quantization (FP8/AWQ), or PagedAttention.