Custom AI models for the enterprise · New York · LondonSecurityResearchContact sales
Finetune the World
Research · Cost model

Fine-tuning compute: FLOPs, GPU-hours and what a training run really costs

One training run is far cheaper than most budgets assume. The money goes elsewhere. Here is the arithmetic, with every assumption exposed.

An open rack-mounted GPU server on a workbench, cover removed, showing four large heatsinks, fans and bundled power cables

The finding#

A full fine-tune of a 7B model on 60 million tokens — say 20,000 examples of 1,000 tokens for three epochs — takes about 2.6 H100-hours at 40% model FLOPs utilisation: roughly $5.3–$11 at $2–$4 per GPU-hour. Even a 72B model costs $50–$100 for the same data.

That should change how you budget. If compute for one run is a rounding error, project cost is driven by how many runs you need and by work that isn’t training at all: data, evaluation and engineering time. The levers that matter are the ones that reduce wasted experiments.

FLOPs per training token#

For a dense transformer with parameters, a forward pass costs about floating-point operations per token (one multiply and one add per weight). The backward pass computes two things — gradients with respect to activations and gradients with respect to weights — each costing about the same as the forward pass. That gives the familiar estimate from Kaplan et al.:

LoRA changes the backward pass. The base weights are frozen, so their weight gradients are never computed; activation gradients still flow through every layer. Adapter weight gradients are negligible for small ranks:

So LoRA saves about a third of the compute, not the 99% its parameter count suggests. Activation checkpointing adds one recomputed forward pass, , in both cases. Attention adds a term that grows with sequence length : roughly per token for training, small next to at typical fine-tuning lengths.

where is training tokens, is the accelerator’s dense BF16 throughput (989 TFLOPS for an H100 SXM) and MFU is the fraction you actually achieve. Well-tuned training reaches 35–55%; small batches, short sequences and LoRA kernels often land at 15–30%.

Cost per run, 0.5B to 72B#

60 million training tokens, sequence length 2,048, activation checkpointing on, H100 SXM at 40% MFU, priced at $2–$4 per GPU-hour:

ModelMethodTraining FLOPsH100-hoursCost
Qwen2.5-0.5BFull2.58e+170.2$0.4–$0.7
Qwen2.5-0.5BLoRA1.99e+170.1$0.3–$0.6
Qwen2.5-7BFull3.75e+182.6$5.3–$11
Qwen2.5-7BLoRA2.84e+182.0$4.0–$8.0
Qwen2.5-14BFull7.33e+185.1$10–$21
Qwen2.5-14BLoRA5.56e+183.9$7.8–$16
Qwen2.5-32BFull1.60e+1911.3$23–$45
Qwen2.5-32BLoRA1.21e+198.5$17–$34
Qwen2.5-72BFull3.55e+1925.0$50–$100
Qwen2.5-72BLoRA2.68e+1918.8$38–$75

Memory, not FLOPs, usually decides how many GPUs a run occupies: full fine-tuning a 7B model needs ~114 GB of optimizer and weight state (see our memory model), so it runs on at least two GPUs even though one could do the arithmetic in under three hours.

0.0010.010.11101001,00010,000100,0001M10M100M1BEU ⅓ threshold72B14B7B0.5BTraining tokens (log scale)H100-hours at 40% MFU (log scale)
40%MFU
2.6 h7B full fine-tune, 60M tokens
123 h72B full fine-tune, 300M tokens
23,406 hEU AI Act ⅓ × 10²³ FLOPs, same hardware
Interactive: H100-hours (vertical, log scale) over model size (0.5B–72B, log) and training tokens (1M–1B, log), using 8N FLOPs per token for full fine-tuning with activation checkpointing. Because hours scale as N × D, the surface is a tilted plane in log–log–log space. Yellow markers: a 7B/60M-token and a 72B/300M-token run. The translucent plane is the EU AI Act indicative threshold for unknown original compute; every realistic fine-tune sits far below it. Drag to rotate; the slider changes utilisation.

Sensitivity to utilisation#

MFU is the most uncertain input. For the 7B full fine-tune above:

MFU 20%5.3 hMFU 30%3.5 hMFU 40%2.6 hMFU 50%2.1 hH100-hours for 60M tokens, Qwen2.5-7B full fine-tuning
Halving utilisation doubles GPU time, but the absolute numbers stay small. Source: research/e3_flops/flops.py.

As a sanity check we computed the throughput our own laptop-scale experiment actually achieved. The LoRA rank experiment trained a 0.5B model on an Apple M4 Max GPU shared with other workloads. Full fine-tuning sustained about 0.7 TFLOP/s, LoRA r=16 about 0.6 TFLOP/s — a small fraction of a data-centre GPU, which is why the same job that took minutes there takes seconds on an H100.

Where the money actually goes#

If a run costs tens of dollars, why do fine-tuning projects spend thousands on compute? Four multipliers:

1. The number of runs#

A typical project runs a base-model bake-off (3–5 models), learning-rate and rank sweeps, two or three data iterations and ablations. Thirty to eighty training runs is normal. Multiply the table by 50.

2. Reinforcement learning is mostly generation#

GRPO and PPO sample several completions per prompt every step. Generation costs FLOPs per token but is memory-bandwidth bound, so it typically runs at single-digit MFU. An RL step can cost ten times an SFT step on the same number of tokens. See GRPO explained.

3. Evaluation is generation too#

Scoring every checkpoint on a 2,000-example held-out set with 300-token outputs is 600k generated tokens per checkpoint, plus judge-model calls. Over a project, evaluation compute rivals training compute.

4. Idle and minimum billing#

Reserved multi-GPU nodes bill while you analyse results. The cheapest compute strategy is usually a small node for exploration and short bursts on large nodes for final runs.

Budgeting rule

Estimate one run with , multiply by your experiment count, add 50–100% for evaluation, and 3–10× for any RL stage. For an 8B SFT+DPO project that lands at $500–$5,000 of GPU time; with RL, $5,000–$15,000.

From MFU to tokens per second#

Inverting the cost equation gives the training throughput to expect, which is the number to check against a real run in its first minutes:

For a 7B model with full fine-tuning and checkpointing ( FLOPs per token) at 40% MFU on an H100, that is about 6,490 tokens per second per GPU. If your logged throughput is half that, you are at 20% MFU and something — data loading, padding, small micro-batches, communication — deserves attention before you scale up.

# Measure achieved MFU from your training logs
N          = 7.62e9          # parameters
flops_tok  = 8 * N           # full FT with activation checkpointing (6N + 2N)
tokens_s   = 3.1e3           # logged training tokens/s per GPU
peak       = 989e12          # H100 SXM dense BF16
print(f"MFU = {tokens_s * flops_tok / peak:.1%}")   # -> 19.1%

Worked example: compute budget for a project#

A realistic 8B project, assuming 25% MFU for training jobs and 5% for generation-heavy work (evaluation and RL sampling are memory-bandwidth bound):

LineWhat runsH100-hours
Base-model bake-off4 models × 1 LoRA run, 10M tokens2.1
Hyperparameter sweep12 LoRA runs, 10M tokens6.4
Data iterations3 rounds × 2 runs, 30M tokens9.6
Preference tuning (DPO)3 runs, 15M tokens incl. reference model3.2
Evaluation40 checkpoints × 2,000 items × 300 tokens generated2.1
RL stage (optional)GRPO, G=8, 2,000 prompts × 3 epochs × 500 tokens3.7
Total27

At $2–$4 per GPU-hour that is roughly $54–$108 — consistent with the $500–$5,000 range for SFT+DPO projects in our cost guide, with RL pushing toward the top. Note how evaluation and RL, both generation-heavy, account for 21% of the total despite being a minority of the “training”.

Assumptions and limitations#

The rule ignores embedding lookups and some elementwise operations and slightly overstates FLOPs for models with large tied embeddings. MFU varies with kernel quality, sequence packing and interconnect. GPU prices are assumption ranges, not quotes; spot and reserved pricing can sit well outside them. Mixture-of-experts models need instead of for FLOPs but full for memory.

Method and reproducibility

Script: research/e3_flops/flops.py; inputs: parameter counts from research/results/e2_memory.json; peak throughput from the NVIDIA datasheet; output: research/results/e3_flops.json. The measured anchor uses wall-clock training time from the E1 runs.

References#

  1. Kaplan, J. et al. (2020). Scaling Laws for Neural Language Models. arXiv:2001.08361.
  2. NVIDIA. H100 Tensor Core GPU datasheet (BF16 dense tensor throughput, SXM form factor: 989 TFLOPS).
  3. Korthikanti, V. et al. (2023). Reducing Activation Recomputation in Large Transformer Models. MLSys 2023. arXiv:2205.05198.
  4. Hu, E. J. et al. (2021). LoRA: Low-Rank Adaptation of Large Language Models. arXiv:2106.09685.

Frequently asked

Can’t find your question? Ask a senior engineer.

How many GPU hours does it take to fine-tune a 7B model?

For 60 million training tokens, about 2–4 H100-hours of compute for full fine-tuning at 30–50% utilisation, and about a third less for LoRA. Memory requirements mean it typically runs across two or more GPUs.

Is LoRA faster than full fine-tuning?

Per token, LoRA needs about 4N FLOPs versus 6N for full fine-tuning, so roughly a third less compute. Its bigger advantage is memory, which lets it run on fewer or smaller GPUs.

Why is RL fine-tuning so much more expensive?

Because each step generates several completions per prompt, and generation is memory-bandwidth bound with low hardware utilisation. RL stages commonly cost 3–10 times an SFT stage.

Bring us one task. We’ll show you what a specialist model can do.

A 45-minute briefing with a senior research engineer. You leave with a feasibility read, a data plan and a fixed quote, whether or not you hire us.

Book a briefing →