Playground · In-browser calculator

LoRA / QLoRA memory calculator

Training memory is roughly weights + gradients + optimizer state + activations. Pick a model and method to see which part dominates.

Training memory estimate

Runs in your browser without a model call. This is an engineering estimate; real usage varies with framework, attention kernel and parallelism.

Usually 0.1%–2%, depending on rank and target modules.

About 20.4 GB

Trainable parameters: 76,100,000

Weights14.5 GB
Gradients0.3 GB
Optimizer state (AdamW)0.6 GB
Activations3.3 GB
Framework overhead (10%)1.9 GB
  • 16 GB · does not fit
  • 24 GB · fits
  • 40 GB · fits
  • 48 GB · fits
  • 80 GB · fits

Assumptions

  • Full: BF16 weights and gradients, FP32 master weights and two FP32 AdamW moments, 16 bytes per parameter.
  • LoRA: frozen BF16 base; adapters trained in FP32 (16 bytes per adapter parameter).
  • QLoRA: NF4 frozen base at about 0.5 bytes per parameter plus double-quantization constants.
  • Activations: about 34 × sequence × batch × hidden bytes per layer, assuming FlashAttention; checkpointing keeps only layer inputs.
  • Excludes multi-GPU sharding (ZeRO/FSDP) and CPU offload.
Read the guide (Chinese): Where LoRA and QLoRA actually save GPU memory →