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"

Batch Size vs. Memory

Run an estimate first to see the sweep.
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

  1. Enter the total number of model parameters (e.g. 7000 for 7B, or use the "M/B" suffix selector).
  2. Choose numerical precision: FP32, FP16/BF16, or INT8.
  3. Select an optimizer: AdamW (standard), SGD with momentum, or None (inference only).
  4. Enter the batch size and an average activation size per sample in MB.
  5. Read the breakdown: weights, activations, gradients, optimizer state, and total.
  6. 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