Training VRAM and Batch Size Estimate
Compare single-GPU training state and assumed activation memory to estimate microbatch capacity.
An approximation that depends on activation and workspace estimates. It does not guarantee runtime peak VRAM usage.
Results
—GiB
—samples
- Model weights
- —GiB
- Gradients
- —GiB
- Optimizer state
- —GiB
- Activations for the entered batch
- —GiB
- Total weights, gradients, and optimizer state
- —GiB
- Remaining VRAM (negative if insufficient)
- —GiB
Results update automatically when the required values are entered.
Method, applicability and sources
Calculation method
P=parameter count (millions×10^6); b=microbatch samples per GPU; a=activation memory (MiB/sample); R=reserve for workspace and other overhead (GiB). Weights: 4P bytes for FP32 or (4+2)P bytes for mixed FP16. Gradients: 4P bytes. Optimizer states: 8P for AdamW, 4P for Momentum SGD, or 0 bytes for SGD. Required capacity (GiB)=[weights+gradients+optimizer states+b×a×2^20]÷2^30+R. For GPU capacity V(GiB), maximum microbatch=max(0, floor((V×2^30−fixed state bytes−R×2^30)/(a×2^20))). Display is capped at 100,000 samples. Memory is added directly, assuming activations scale linearly with batch size.
Worked example (hypothetical values)
With 1,000 million parameters, mixed FP16, and AdamW, fixed states occupy 18,000,000,000 bytes (about 16.764 GiB). At 512 MiB per sample, a batch of 2, and a 1 GiB reserve, required VRAM is about 18.764 GiB. A 32 GiB GPU supports an estimated maximum microbatch of 28 samples.
Applicability and limitations
Planning estimate for conventional training with all weights, gradients, and optimizer states held on one GPU. Excludes distributed training, ZeRO/FSDP, quantization, LoRA, partial-parameter training, offloading, automatic prediction of activation savings from gradient checkpointing, guaranteed peak memory, KV caches, inference memory, and GPU pricing.
Method and sources
Method: E085-training-vram-budget-v1.0 (2026-11-13). Data recorded: 2026-11-13.