Fine-Tuning & Serving

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

Billion (B)
Million tokens
epochs
TFLOPS
RTX 4090=165 (dense FP16), A100=312, H100 SXM=989 TFLOPS.
%
GPUs
USD/hr
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 TierDense BF16 TFLOPSRef. Cloud RateEst. Wall TimeEst. 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

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.

Related Engineering Calculators

ComputeSizer runs 100% locally in your browser with open formulas and zero account gates. If these VRAM and GPU cost tools saved your team money, support us via Fourthwall or sponsor an ad-free developer placement.