LLM Fine-Tuning VRAM, Training Time & Cloud GPU Cost Calculator
Model base weights, LoRA adapter gradients, AdamW optimizer states, activation checkpointing, wall-clock training hours, and cloud run costs across QLoRA, BF16 LoRA, DPO, and DeepSpeed ZeRO-3—with one-click Axolotl, Unsloth, and DeepSpeed config export.
Total Training VRAM26.4 GBBase: 18.2GB | Opt+Grad: 1.9GB | Act: 6.3GB
Recommended Training Node1x NVIDIA L40S (48GB)Trainable: 268M params (0.82%)
Est. Wall-Clock Time6.4 hrs75.0M total training tokens
Estimated Cloud Run Cost$8.00At $1.25/hr on-demand
GPU Cluster Training Fit, Duration & Total Run Cost (Click headers to sort)
Fit
Anatomy of LLM Fine-Tuning Memory & Compute
Unlike inference—where parameters are read-only and working memory is dominated by the KV-cache—supervised fine-tuning (SFT) and Direct Preference Optimization (DPO) allocate four distinct GPU memory pools: base parameters, parameter gradients, AdamW momentum & variance states, and intermediate forward activations saved for backpropagation.
When should I choose QLoRA vs. BF16 LoRA vs. DeepSpeed ZeRO-3 Full Fine-Tuning?
Start with QLoRA (`r=32`, all linear modules) when adapting instruction style, structured JSON formatting, or domain terminology on single-GPU budgets. Upgrade to Full Fine-Tuning under DeepSpeed ZeRO-3 across 4×–8× H100/H200 NVLink nodes when injecting >1B tokens of novel domain knowledge or continual pretraining.
Why does DPO consume extra activation memory compared to SFT?
Direct Preference Optimization evaluates log-probabilities across both chosen and rejected completions per prompt. Using QLoRA/LoRA lets the frozen base weights serve simultaneously as the reference policy (disable_adapter()), avoiding a second copy of the base model in VRAM.