Vibe Engines
YouTube

Vibe Engines is free, interactive AI engineering & system design — runs in your browser. Pick a learning path

Training Compute Calculator

Put in a model size and a token budget and see the training compute it implies — the classic 6ND FLOPs, the GPU-hours and wall-clock time on your cluster, the dollar cost, and how your token budget compares to the Chinchilla compute-optimal 20× rule. Every number is editable, from GPU peak FLOP/s to model-FLOPs-utilization.

8.40 × 10²²training FLOPs · 972 petaFLOP-days
2.4 dayswall-clock on 1,024 GPUs
58923GPU-hours
$176.8Kestimated cost
286 tokens / param14.3× over compute-optimal — you're trading training compute for a cheaper, stronger model at inference (deliberate over-training).
GPU

Training FLOPs use the 6ND approximation (≈ 6 FLOPs per parameter per token). Wall-clock divides by GPUs × peak × MFU. A first-order planning estimate — real runs pay extra for restarts, checkpointing, warmup and data stalls.

Every large model starts as a compute budget. Before a GPU spins up, teams choose the model size and the number of training tokens, and those two numbers multiplied by a small constant fix the FLOPs, the GPU-hours, the wall-clock time and the bill. This calculator walks that chain and checks your token budget against the Chinchilla rule.

What it computes

FLOPs         = 6 × N × D                     N params, D tokens
throughput    = GPUs × peak TFLOP/s × 10¹² × MFU
seconds       = FLOPs / throughput
GPU-hours     = seconds × GPUs / 3,600
cost          = GPU-hours × price per GPU-hour
petaFLOP-days = FLOPs / 10¹⁵ / 86,400
tokens/param  = D / N      Chinchilla target ≈ 20
  • Peak is the GPU’s dense BF16 rate. Presets are A100 312, H100 990, H200 990, B200 2,250, MI300X 1,300 and TPU v5e 197 TFLOP/s, each with an illustrative on-demand price, and both are editable.
  • MFU is the share of peak you sustain; 40% is the default.
  • The Chinchilla banner reads on target within 15% of 20 tokens per parameter, over-trained above that and under-trained below.

A worked example

The defaults are 7B parameters, 2,000B tokens, 1,024 H100s at 990 TFLOP/s, 40% MFU and $3.00 per GPU-hour.

  1. FLOPs: 6 × 7×10⁹ × 2×10¹² = 8.40 × 10²², about 972 petaFLOP-days.
  2. Throughput: 1,024 × 990×10¹² × 0.40 = 4.05 × 10¹⁷ FLOP/s.
  3. Time: 8.4×10²² / 4.05×10¹⁷ = 207,000 s, shown as 2.4 days.
  4. GPU-hours: 207,000 × 1,024 / 3,600 = 58,923. Cost: 58,923 × $3 = $176,768, shown as $176.8K.
  5. Tokens per parameter: 2,000 / 7 = 286, which is 14.3× over the 140B-token optimum, a deliberately over-trained model.
ScenarioFLOPsWall-clockCost
7B, 2,000B tokens, H100 ×1,0248.40 × 10²²2.4 days$176.8K
7B, 140B tokens (20×)5.88 × 10²¹4.0 hr$12.4K
70B, 1,400B tokens (20×)5.88 × 10²³16.8 days$1.24M
7B, 2,000B tokens, A100 ×1,024 at $1.808.40 × 10²²7.6 days$336.5K

The last row shows cost is not just speed: an A100 is about three times slower, and even at 60% of the hourly price the run costs nearly twice as much.

Assumptions and limits

  • Dense transformer. Mixture-of-experts models should enter their active parameter count, and non-transformer architectures follow different rules.
  • Perfect scaling. One MFU number covers communication, bubbles and stalls, and real utilization falls as clusters grow.
  • No overhead. Failures, restarts, evaluation, ablations and failed experiments are excluded and usually exceed the final run.
  • Illustrative prices. GPU rates vary by provider, commitment and region, and the presets are not quotes.
  • Pre-training only. Post-training, fine-tuning and inference are separate budgets.

How to use the result

  • Start from the budget. Divide your FLOPs by what the cluster delivers to see whether a model size is feasible in the time you have.
  • Choose tokens per parameter on purpose. Near 20 for the best quality per training FLOP; far higher if the model will serve heavy traffic and cheaper inference matters.
  • Run an MFU sensitivity. Compare 30%, 40% and 50%; the spread is a good estimate of schedule risk.
  • Multiply the estimate by two or three to cover experiments and reruns, since the final run is usually a minority of what a project actually spends.
  • Mind inference too. An over-trained small model costs more to train but can be cheaper to serve every day, so compare lifetime cost, not training cost alone.

When to use it, and when not

Use it to decide what is feasible. Can a 13B model be trained on this cluster before the deadline? Is a vendor’s quote, or a paper’s claimed compute, the right order of magnitude? Which costs less overall, more tokens on a small model or fewer on a big one? Those questions need ratios and orders of magnitude, and 6ND gives both in seconds.

Use a measurement instead once you can run a short pilot. Tokens per second per GPU from a few hundred real steps already includes your kernels, sequence length and communication, so GPU-hours = tokens / (tokens per second per GPU) / 3,600 beats any MFU guess. Also adjust before trusting the formula for mixture-of-experts models or very long contexts, which it does not describe.

Trade-offs and limits

6ND counts the matrix multiplies against the weights and nothing else. Two omissions can be large:

Left outExtra computeHow big
Attention over the context: about 6 × layers × context × d_model FLOPs per token in the scaling-laws accountingGrows linearly with contextFor a 32-layer, 4,096-wide model near 8B: +3% at 2K tokens, +13% at 8K, +215% at 128K
Full activation recomputation, which reruns the forward pass to save memory8ND instead of 6ND+33% time and cost

The attention figures are an upper bound: kernels that skip the masked half of causal attention do less. They still show why long-context training is planned separately. At 128K tokens, attention alone outweighs the 6N term.

The formula also prices only training. Serving costs about 2N FLOPs per generated token, the forward pass alone, or 1.4 × 10¹⁰ for a 7B model. The default run’s 8.4 × 10²² FLOPs therefore equal about 6 trillion served tokens. A model that will serve more than that over its life is worth over-training: a smaller model trained on more tokens can reach the same quality more cheaply per token served.

Common mistakes

  • Entering the sparsity peak. H100 spec sheets also quote about 1,979 TFLOP/s “with sparsity”, twice the dense rate. Training does not run on that structured sparsity, and entering it halves every answer: the defaults drop to 1.2 days and $88.4K. Always enter the dense BF16 rate, as the presets do.
  • Using hardware utilization as MFU. MFU counts only the 6ND model FLOPs. With full recomputation the GPUs execute 8ND, so a measured 40% hardware utilization is 30% MFU. Entering 40% understates the defaults by a third: 3.2 days and $235.7K, not 2.4 days and $176.8K.
  • Using total parameters for a mixture-of-experts model. N is the parameters each token touches. A model with 46.7B total and 12.9B active parameters entered at 46.7B overstates compute 3.6 times.
  • Using dataset size instead of tokens seen. D counts every pass. Two epochs over 500B tokens is a D of 1,000B, and the bill doubles with it.
  • Comparing GPUs by hourly price. What matters is dollars per useful FLOP. At the presets and 40% MFU, 10²¹ FLOPs costs $2,104 on H100 and $4,006 on A100, although A100 is 40% cheaper per hour. The cheapest hour here, TPU v5e at $1.20, is the dearest FLOP at $4,230. Divide each hourly price by peak TFLOP/s × MFU before you compare.

Check yourself

You double the defaults’ cluster to 2,048 H100s. What happens to time and cost?

Throughput doubles, so the 207,000 s become about 103,600 s, 1.2 days. GPU-hours stay at 58,923 and cost stays at $176.8K: twice the GPUs for half the time. That holds only under the tool’s perfect scaling. In practice MFU falls as clusters grow, so the bill rises a little.

You have 10²³ FLOPs. What model size and token count are Chinchilla-optimal?

Set D = 20N, so C = 6 × N × 20N = 120N². Then N = √(10²³ / 120) ≈ 28.9B parameters and D = 20N ≈ 577B tokens.

Why do “MFU falls from 40% to 30%” and “turn on full recomputation” give the same bill?

Both scale the time by 4/3. Lower MFU divides the throughput by 40 / 30; recomputation multiplies the work by 8 / 6. Either way the defaults become 3.2 days and $235.7K.

How long does a Chinchilla-optimal 1B model take on one H100 at 40% MFU?

D is 20B tokens, so FLOPs are 6 × 10⁹ × 2 × 10¹⁰ = 1.2 × 10²⁰. One GPU delivers 990 × 10¹² × 0.40 = 3.96 × 10¹⁴ FLOP/s, so it takes 303,000 s: 3.5 days, 84 GPU-hours and about $253 at $3.00.

height: D = 2,000B tokens 2ND forward 4ND backward width: 6 × N (7B params) area = 8.40×10²² FLOPs ÷ cluster rate 1,024 × 990 TFLOP/s × 40% = 4.05×10¹⁷ FLOP/s 207,000 s = 2.4 days
The defaults as an area: 6 FLOPs per parameter per token, one third forward and two thirds backward, over 7B parameters and 2,000B tokens. Dividing by what 1,024 H100s deliver at 40% MFU gives the 2.4 days.

How it works

  • Training FLOPs ≈ 6 × N (params) × D (tokens).
  • Effective throughput = GPUs × peak FLOP/s × MFU.
  • Wall-clock = total FLOPs ÷ effective throughput; cost = GPU-hours × price.
  • Chinchilla compute-optimal ≈ 20 tokens per parameter.

Frequently asked questions

Where does the 6ND formula come from?

Training a dense transformer costs roughly 6 FLOPs per parameter per token: about 2 for the forward pass, a multiply and an add per weight, and about 4 for the backward pass, which computes gradients with respect to both activations and weights. Total training FLOPs are therefore about 6 times the parameter count N times the token count D. It ignores attention’s quadratic term and embedding overhead, which are small at typical sequence lengths, but it is the number practitioners plan with.

What is Chinchilla-optimal?

DeepMind’s Chinchilla study found that, for a fixed compute budget, loss is lowest when parameters and training tokens grow together at roughly 20 tokens per parameter, far more data than earlier models used. A compute-optimal 70B model therefore wants about 1.4 trillion tokens. Training beyond 20 tokens per parameter still improves the model; it is just not the most loss per FLOP, which is why models meant for heavy inference use are deliberately over-trained.

What is MFU and why is it not 100%?

Model FLOPs utilization is the fraction of a GPU’s peak FLOP/s that training actually sustains, after memory bandwidth limits, communication between GPUs, pipeline bubbles and kernel gaps. Well-tuned large-scale training commonly lands around 35 to 50%, and the calculator defaults to 40%. Peak FLOP/s times MFU is the effective throughput that the total FLOPs are divided by, so a 10-point change in MFU moves time and cost by about a quarter.

How much does it cost to train a 7B model?

With the defaults, a 7B model on 2 trillion tokens needs 8.4 × 10²² FLOPs. On 1,024 H100s at 990 TFLOP/s, 40% MFU and $3 per GPU-hour, that is about 2.4 days, 58,900 GPU-hours and roughly $177K. At the Chinchilla-optimal 140 billion tokens it falls to about 4 hours and $12K. Prices and utilization vary widely, so treat these as the tool’s illustrative defaults and substitute your own rates.

Why is my estimate different from a real training run?

This is a first-order planning estimate. Real runs differ because of restarts and hardware failures, evaluation and checkpointing overhead, data-loading stalls, a warmup where utilization is low, and architecture-specific costs: mixture-of-experts models activate only some parameters, and long context inflates attention. Use the calculator to size the order of magnitude and compare scenarios, not to predict a cloud invoice to the dollar.