Skip to content
E
Educatum
Fine-Tuning Memory Planner

LoRA, QLoRA & Full Fine-Tuning VRAM Calculator

Compare base weights, BF16 gradients, FP32 AdamW optimizer states, and sequence-length activations across Full Fine-Tuning, LoRA, and 4-bit QLoRA—and pair it with our first-principles LoRA breakdown.

1. Model & Workload

GQA · 70.6B Dense

80 layers · GQA (64Q / 8KV = 8× KV savings)

Execution Mode
Weight Precision (Datacenter & GGUF)
KV:
4,096 tok
2 reqs

2. Target GPU / Mac Silicon

47.8 GiB Usable · 1.77 TB/s eff.
GPU Count (Tensor Parallel)
OOM CLIFF (-5.2 GiB over limit)
53.0 / 47.8 GiB usable (111%)

Scale to 3× RTX 4090 24 GiB or shorten sequence length to fit activations.

Total VRAM
53.0 GiB
Weights 36.2 GiB (INT4)
Grads + Opt
10.5 GiB
QLORA
VRAM / GPU
26.5 GiB
2× RTX 4090 24 GiB
Min GPUs
3×
for RTX 4090 24 GiB

VRAM Allocation vs. Hardware Capacity

Binary GiB (1 GiB = 2³⁰ B) · Usable VRAM excludes ECC/OS & per-GPU CUDA/NCCL buffers

Dashed line = Usable VRAM
Used: 53.0 GiB · Usable: 47.8 GiB (111%) 47.8 GiB Usable Weights: 36.2 GiBGrads + Opt: 10.5 GiBAct + CUDA: 6.3 GiB educatum.com/kv-cache

Decode Arithmetic Intensity Roofline

QLORA Training Memory Mode
Roofline Decode Analysis applies to Inference Mode Current mode (QLORA) optimizes VRAM for weights, gradients & AdamW optimizer states.
Canonical URL stays clean; click Copy Shareable Link to share your exact slider config.
Llama-3.1 70B Instruct · KV_tok = 2 × 80L × 8 KV heads × 128d × 2B = 320.0 KiB/tok (8.0× vs MHA)
Training Footprint: 36.2 GiB weights + 10.5 GiB grads/AdamW + 3.3 GiB activations

Full Fine-Tuning vs. LoRA vs. QLoRA Memory Comparison (4K Seq, Micro-Batch=2)

ModelFull FT (BF16 + AdamW)LoRA (BF16 Base)QLoRA (4-bit NF4 Base)QLoRA Savings vs. Full FT
Llama-3.1 8B Instruct122.2 GiB (2× H100)17.8 GiB (1× H100)7.0 GiB (1× 4090)17.5× less VRAM
Qwen3-32B Dense493.5 GiB (7× H100)68.6 GiB (1× H100)24.4 GiB (2× 4090)20.3× less VRAM
Llama-3.1 70B Instruct1060.5 GiB (15× H100)146.4 GiB (3× H100)51.0 GiB (3× 4090)20.8× less VRAM

Frequently Asked Questions

Why does Full Fine-Tuning an 8B model need ~120+ GiB instead of 16 GiB?

Mixed-precision BF16 training with AdamW stores model weights (2 B/param), gradients (2 B/param), FP32 master weights (4 B/param), and first/second AdamW moment vectors (8 B/param)—totaling 16 bytes per parameter before activations and CUDA buffers.

How much VRAM does QLoRA save compared to LoRA and Full Fine-Tuning?

QLoRA freezes the base weights in 4-bit NF4 (~0.55 B/param including double-quantization constants) and applies AdamW only to ~1% rank-r adapter weights. On a 70B model, total VRAM drops from ~1,070 GiB (Full FT) and ~160 GiB (FP16 LoRA) down to ~47–52 GiB (QLoRA).

Why does context length spike training VRAM faster than weight count?

Even with gradient checkpointing enabled, stored forward activations scale linearly with layers × batch size × sequence length × hidden dimension. Cutting micro-batch size or sequence length is the fastest lever when LoRA/QLoRA hits OOM.

Try keywords like RoPE, FlashAttention, DPO, or Blind 75.