Batch Size Memory Estimator
Enter model parameters, data precision, and batch size to estimate training memory usage — weights, activations, gradients, and optimizer states included.
Model Configuration
Total trainable parameters in the model
Batch Configuration
Number of samples per training step
Rough intermediate tensor size for one sample during forward pass
Memory Breakdown
Configure the model and click "Estimate Memory"
Total Estimated Memory
Batch Size vs. Memory
Run an estimate first to see the sweep.
| Batch Size | Weights + Grad + Opt | Activations | Total |
|---|
Copied!
Summary
Enter model parameters, data precision, and batch size to estimate training memory usage — weights, activations, gradients, and optimizer states included.
How it works
- Enter the total number of model parameters (e.g. 7000 for 7B, or use the "M/B" suffix selector).
- Choose numerical precision: FP32, FP16/BF16, or INT8.
- Select an optimizer: AdamW (standard), SGD with momentum, or None (inference only).
- Enter the batch size and an average activation size per sample in MB.
- Read the breakdown: weights, activations, gradients, optimizer state, and total.
- Adjust batch size or precision until the total fits your available VRAM.
Use cases
- Determine the largest batch size that fits on a specific GPU.
- Compare memory cost of FP32 vs FP16 mixed-precision training.
- Plan multi-GPU setups by knowing per-card memory demand.
- Estimate whether a model fits in CPU RAM for inference.
- Teach students how optimizer choice affects memory footprint.
- Validate rough VRAM estimates before launching a cloud instance.
- Plan gradient accumulation steps when full batch does not fit.
Frequently Asked Questions
Last updated: 2026-07-22 ·
Reviewed by Nham Vu