Cloud GPU Fine-Tuning Cost & Time Estimator
Estimate training hours and total cloud GPU spend from model size, dataset tokens, epochs, MFU %, and hardware TFLOPS.
Input Parameters
Calculated Output
Primary Result
—
Adjust inputs to recalculate immediately.
Spin Up Pay-Per-Second Training GPUs
Launch RTX 4090, A100, or H100 instances for burst fine-tuning without idle commitments.
Browse Vast.ai GPU Nodes ↗50M-Token 8B LoRA Training Run Across Cloud GPUs (3 Epochs, 38% MFU)
Shows cost vs wall-clock trade-off between consumer 4090 nodes and datacenter H100s.
| GPU Tier | Dense BF16 TFLOPS | Ref. Cloud Rate | Est. Wall Time | Est. Compute Spend |
|---|---|---|---|---|
| RTX 4090 (Vast.ai) | 165 TFLOPS | $0.47 / hr | ~22.3 hrs | ~$10.48 |
| A100 80GB (RunPod) | 312 TFLOPS | $1.39 / hr | ~11.8 hrs | ~$16.40 |
| H100 SXM (RunPod/Vast) | 989 TFLOPS | $2.69 / hr | ~3.7 hrs | ~$10.01 |
Formula & Engineering Methodology
Standard Transformer training requires roughly 6 * P * D floating-point operations (2x forward pass, 4x backward pass including activation recomputation). LoRA freezes base weight updates, reducing effective FLOPs to ~4.2 * P * D.
total_flops = method_factor * (params_b * 1e9) * (dataset_tokens_m * 1e6) * epochs
effective_flops_sec = gpu_tflops * 1e12 * (mfu_pct / 100) * gpu_count
hours = (total_flops / effective_flops_sec) / 3600
total_cost_usd = hours * gpu_hourly_usd * gpu_count
Variable Definitions
6.0 vs 4.2: Full fine-tuning computes weight+input gradients (~6PD); LoRA skips base weight gradient accumulation (~4.2PD).MFU: Model FLOPs Utilization accounting for data loading, optimizer overhead, and gradient checkpointing.
Practical Note: Small sequence lengths with heavy padding waste compute; enable sequence packing to maintain 35–48% MFU.
Frequently Asked Questions
Why does the 6 x P x D training FLOP rule apply?
Forward passes cost ~2 FLOPs per parameter per token, while backward passes compute both activation gradients (~2PD) and weight gradients (~2PD), totaling 6PD (plus extra if gradient checkpointing recomputes activations).
What MFU percentage should I expect in real runs?
Well-tuned Unsloth/Axolotl/PyTorch FSDP pipelines reach 32–48% MFU. Unpacked short-sequence datasets often drop below 20%.
Why can H100s actually cost less per run than cheaper A100s?
An H100 SXM delivers over 3x the BF16 TFLOPS of an A100 while costing less than 2x per hour, finishing the same FLOPs faster and cheaper.