Guides
LLM Fine Tuning GPU: What I Rent and Why
If you're fine-tuning a large language model, the GPU you pick determines whether you finish before lunch or before the month ends. I've been doing this for years, renting cloud GPUs weekly for both training and inference, and I've learned that the best GPU for LLM fine tuning isn't always the biggest one. It's the one that fits your model, your data, and your budget. Let me walk you through what I actually consider before I rent anything.
Start With VRAM, Not FLOPS
For fine-tuning, VRAM is the first constraint. Your model weights, gradients, optimizer states, and activations all live in memory. A 7B parameter model in full FP16 needs roughly 14GB for weights alone, but with AdamW and gradients you're looking at 50-60GB just to train. That's why most of my small fine-tunes use a single A100 80GB or L40S 48GB. If you're doing LoRA or QLoRA, you can shrink that to 8-16GB, but you still need enough headroom for context length and batch size.
I've seen people try to fine-tune a 13B model on a 24GB GPU with full fine-tuning. It doesn't end well. The llm fine tuning gpu requirements aren't just about the model size—they include your sequence length, batch size, and whether you're using gradient checkpointing. Always check the peak memory usage on a small run before you rent a big cluster.
Single GPU vs Multi-GPU: When to Scale
For models under 10B parameters, a single high-VRAM GPU is usually the sweet spot. No distributed overhead, no tensor parallelism, just run the script and go. But when I fine-tune a 30B or 70B model, llm fine tuning multi gpu becomes necessary. I typically use DeepSpeed ZeRO-3 or FSDP to shard optimizer states and gradients across 4-8 GPUs.
Here's the trade-off: multi-GPU setups scale almost linearly for compute, but communication can eat your gains if you're on a slow interconnect. On cloud platforms, that means paying for NVLink or InfiniBand. If you're on a budget, you might be better off with a single H100 80GB for a 13B model than two L40S 48GB with PCIe only—the H100 will finish faster and be easier to debug.
Comparing the Usual Suspects: A100, H100, L40S
I get asked about gpu for llm fine tuning comparison all the time. Here's my honest take based on what I've run:
- A100 80GB – The workhorse. Still great for fine-tuning, especially if you need 80GB VRAM. It's cheaper than H100 and has NVLink for multi-GPU setups. I use it for 13B and 30B fine-tunes.
- H100 80GB – Faster than A100, especially with FP8 and FlashAttention-2. For the same fine-tuning job, I've seen 1.5-2x speedup. But it costs more. The a100 vs h100 for llm fine tuning decision comes down to whether your time is worth more than your dollars.
- L40S 48GB – The dark horse. It's basically an Ada Lovelace chip with 48GB, great for fine-tuning 7B-13B models without needing a full 80GB. It's often cheaper per hour than A100, and the FP8 performance is solid. But you don't get NVLink, so multi-GPU scaling is limited to PCIe.
For l40s for llm fine tuning, I'd say it's the best value if you're doing LoRA or QLoRA on models under 10B. You get enough VRAM, good compute, and lower cost. But if you need to fine-tune a 70B model, you'll be waiting a long time on L40S—you want H100s.
Memory: The Real Bottleneck
Let me be concrete about llm fine tuning gpu memory. A 7B model with full fine-tuning, batch size 4, sequence length 2048, and AdamW—I've seen peak memory hit 78GB on an A100. That's tight. You can reduce it with gradient checkpointing (saves ~50%) but you trade compute for memory. For a 13B model, you're looking at 110-140GB, which means you need multi-GPU or a very aggressive LoRA.
My rule of thumb: if the model weights fit in VRAM with room for gradients, you're fine. If not, use LoRA or reduce batch size. Don't rent a 4-GPU cluster for a 7B model—it's overkill and you'll waste money on communication overhead.
Cloud GPU Cost: What You Actually Pay
LLM fine tuning gpu cost varies wildly by platform and GPU type. On-demand A100 80GB runs around $1.50-$2.50/hour on most clouds. H100 is $3-$4.50/hour. L40S is often $1-$1.50/hour. Spot instances can cut that by 60-70%, but you risk interruptions. For a typical 7B LoRA fine-tune on a single A100, I budget 2-4 hours of training, so that's $3-$10 in GPU cost. For a 13B full fine-tune on 4 GPUs, I'm looking at 10-20 hours, so $60-$150.
The thing people miss is that the GPU cost is often less than the engineer's time. If an H100 finishes a job in 2 hours instead of 3 on A100, and you're billing at $100/hour, the H100 saves you $100 in time for an extra $3 in GPU cost. That's why I often pick H100 for fine-tuning even when A100 is cheaper per hour.
What About Cloud GPU Rentals?
I do almost all my fine-tuning on cloud GPUs—I don't own a single GPU. llm fine tuning on cloud gpu is the norm now. You get flexibility: you can spin up 8 H100s for a day, then shut them down. No depreciation, no maintenance. The main thing is to check the platform's interconnect. If you're doing multi-GPU, you need NVLink or InfiniBand, not just ethernet. I've made that mistake once—trained on a cluster with slow networking and the throughput tanked.
Also, check the storage. Fine-tuning datasets can be huge, and you don't want to pay for GPU idle time while you're loading data from a slow disk. Mount a fast SSD or use a cloud object store that's co-located.
My Recommended Setup for Most Fine-Tunes
If you're starting out, here's what I'd pick:
- 7B or smaller, LoRA: Single L40S 48GB or A100 40GB. Cheap, fast enough, and you'll have plenty of VRAM.
- 7B-13B, full fine-tune: Single A100 80GB. That's the sweet spot. You can do batch size 8 with gradient checkpointing.
- 13B-30B, full fine-tune: 4x A100 80GB with NVLink. Use DeepSpeed ZeRO-3 or FSDP.
- 30B-70B, full fine-tune: 8x H100 80GB with InfiniBand. You'll need the speed and the memory bandwidth.
For a budget-conscious alternative, I've fine-tuned a 13B model on a single RTX 4090 24GB with QLoRA. It works, but it's slow and you're limited to 4-bit quantization. It's fine for experiments, but not for production.
Making the Call
The best GPU for LLM fine tuning is the one that balances your model size, your time, and your wallet. Start with VRAM. Then look at cost per hour. Then think about your time. I've seen too many people over-provision and waste money, or under-provision and waste days. You don't need a 8x H100 cluster for a 3B model—a single L40S will do. And you don't want to wait a week on a 4090 for a 30B fine-tune. Rent what you need, shut it down when you're done, and move on.
FAQ
What is the best GPU for LLM fine tuning?
For most models under 13B, an A100 80GB or L40S 48GB is the best balance of VRAM, compute, and cost. For larger models, you'll need multi-GPU H100s. It really depends on your model size and whether you use LoRA.
How much VRAM do I need for fine-tuning a 7B model?
Full fine-tuning with AdamW and batch size 4-8 can need 60-80GB. With LoRA, you can get away with 8-16GB. Always use gradient checkpointing if you're tight on memory.
Is it better to use multiple GPUs or one big GPU?
For models under 10B, one big GPU is simpler and often faster. For larger models, multi-GPU is necessary. But make sure you have NVLink or InfiniBand—PCIe only will bottleneck you.
How much does fine-tuning cost on cloud GPUs?
For a 7B LoRA on a single A100, expect $3-$10 in GPU cost. For a 13B full fine-tune on 4 GPUs, $60-$150. Spot instances can cut that by 60%, but you risk interruptions.
Should I use A100 or H100 for fine-tuning?
If time is money, H100 is worth the premium—you'll finish 1.5-2x faster. If you're on a tight budget, A100 is still perfectly capable. For large models, H100's memory bandwidth helps a lot.
Is L40S good for LLM fine tuning?
Yes, especially for 7B-13B models with LoRA or QLoRA. It's cheaper per hour than A100 and has 48GB VRAM. But it lacks NVLink, so multi-GPU scaling is limited.