Full fine-tuning and sharding across GPUs
When full fine-tuning beats LoRA, what it costs in memory, and how data parallelism, ZeRO stages 1 to 3 and FSDP spread that memory across GPUs. With a runnable calculator for 8B, 32B and 70B models, the communication cost of sharding, and a practical recipe.
By Sandip Maity, Applied AI Engineer
LoRA and QLoRA cover most fine-tuning needs (choosing a method). Full fine-tuning updates every weight. It can learn more, and forget more, and it needs about 16 bytes of GPU memory per parameter before activations. This lesson explains when that is worth it and how sharding makes it fit.
#When full fine-tuning is worth it
- Large, data-rich changes: a new language, a new domain with millions of tokens of text, or continued pretraining.
- You will serve a dedicated model anyway, so there is no benefit from swapping small adapters.
- LoRA has plateaued on your evaluation set at higher ranks, and you have the data to go further.
It is usually not worth it for style, format, tool calling or narrow classification, where LoRA matches it at a fraction of the cost.
#Where the memory goes
Mixed-precision training with Adam keeps, per parameter: bf16 weights (2 bytes), bf16 gradients (2), fp32 master weights (4) and two fp32 Adam moments (8). That is 16 bytes, so an 8B model needs about 128 GB before activations (how much GPU, mixed precision).
Pro content
Keep reading with Inference Academy Pro
Unlock the rest of this lesson, plus every advanced lesson, hands-on lab, the larger playground models and completion certificates.
Still to come in this lesson
- Sharding: data parallelism and ZeRO
- The cost: communication
- A practical recipe
- Common mistakes
- Exercises
You will be able to answer
- Plain data parallelism on 8 GPUs. How much of the 16 bytes per parameter does each GPU hold?
- What does ZeRO stage 1 shard?
- What does ZeRO-3 or FSDP pay for its memory savings?
- When is full fine-tuning worth it over LoRA?
- Which part of training memory does ZeRO not shard?