How much VRAM does Llama 3.1 8B need to fine-tune at FP16? Adam optimizer math
By TechCompare · Updated · How we check
Full fine-tuning at FP16 is the worst-case memory configuration. Use it only if you must. LoRA reduces memory to roughly inference + a few GB, and QLoRA reduces it further by quantizing the base model weights. For most fine-tuning use cases, QLoRA on a single 24 GB GPU gets results close to full fine-tuning.
Calculator
Estimated VRAM required
41.1 GB
8B params at FP16, 131,072 token context, batch 1, training (Adam).
Estimate accuracy: Weights within ~3% of most GGUF files from Q4_K_M up, ~7% for Q3_K_M and Q2_K. KV cache within ~5% for standard GQA models, ~10% for MLA or hybrid state estimates. Real VRAM may vary with framework (vLLM vs llama.cpp vs Transformers), Flash Attention, and driver overhead.
LoRA fine-tune sizing: Forward weights at FP16, only ~1% of params get optimizer state (FP32 master + grad + AdamW m + v). Real LoRA peak depends on rank and target modules; this is the typical r=16 ceiling.
Hardware that fits
Unified memory machines show a model budget, not their installed memory. We hold back 8 GB for the system, or use the vendor's GPU limit when that's lower. It's a planning estimate, not a hard limit.
Multi-GPU setups
Pooled cards show up once a model outgrows the biggest single card of that kind. Each card past the first keeps about 1 GB for its own buffers, and that's counted here. Your inference engine has to support the split, and speed also depends on how the cards connect.
Just barely too small
Full fine-tuning Llama 3.1 8B at FP16 with native 128K context needs about 167.9 GB of VRAM. Training weights, gradients and Adam states alone take 144 GB, against 4.9 GB for Q4 inference weights.
How this is calculated
Training weights + gradients + Adam optimizer buffers take 144 GB. The 128K KV cache takes 17.2 GB, and activation overhead adds roughly 6.7 GB, totaling 167.9 GB.
Verdict
A single 24 GB consumer card cannot host this configuration. At FP16 plus an FP32 master copy plus the two FP32 Adam buffers, the weight side is roughly 4x the inference weight cost: Adam's two FP32 buffers per parameter triple or quadruple the memory per parameter, then activations saved for backprop add another chunk.
LoRA drops the optimizer and gradient memory to a few GB by training only adapter weights, and QLoRA goes further by quantizing the base model to 4-bit before training the adapters, fitting a single 24 GB card comfortably with results that match full fine-tuning for most use cases.
More Training scenarios
Related guides
Frequently asked questions
Why does training need so much more memory than inference?
Can I fine-tune Llama 3.1 8B on a single 24 GB GPU?
What does QLoRA actually store during fine-tuning?
Related tools
RAM Latency Calculator
Convert DDR3/DDR4/DDR5 timings (CL, tRCD, tRP, tRAS) into true latency in nanoseconds.
Use toolPower Cost Estimator
Estimate annual electricity costs for your PC, Server, or TV.
Use toolData Transfer Calculator
Calculate file transfer time or the speed you need over USB, Wi-Fi or Ethernet, with latency.
Use toolMemory and Storage Throughput Visualizer
Visualize the large speed gap between CPU cache, RAM, and storage.
Use tool