Skip to content
induwara.lk
Premium
induwara.lkAI · Training compute

LLM Training Compute (FLOPs) Calculator

Estimate the FLOPs, petaFLOP/s-days, GPU-hours, and dollar cost to pre-train a transformer language model from scratch. Enter the parameter count and tokens, and the tool applies the 6ND rule, checks the Chinchilla-optimal token count, and prices the run. Runs entirely in your browser.

By Induwara AshinsanaUpdated Aug 4, 2026
Training compute estimate
6ND · Kaplan + Chinchilla
Reference runs

D is set to 20 × N = 140B tokens (Hoffmann et al. 2022).

Model FLOPs Utilization — real runs hit 30–55%.

Total compute (FLOPs)
5.88×1021
PetaFLOP/s-days
68.06
GPU-hours
4,129
Est. cost (USD)
$10,321.87
Chinchilla optimality
Compute-optimal

Compute-optimal tokens for 7B params = 20 × 7B = 140B. Your D is 1× the optimum. Tokens are within ±25% of the Chinchilla optimum (20 tokens/param).

Wall-clock time

Cluster sizeWall-clock (ideal)
1 GPU172 days
8 GPUs22 days
64 GPUs2.7 days
512 GPUs8.1 hrs

Magnitude check vs. real runs

RunFLOPs (6ND)PF/s-daysvs. published
GPT-3 175B
Undertrained
3.15×10233,645.83+0.32%
Chinchilla 70B
Compute-optimal
5.88×10236,805.56+2.08%
Llama-2 7B
Over-trained (inference-efficient)
8.40×1022972.22

The 6ND estimate reproduces GPT-3's published 3.14×10²³ FLOPs (≈3,640 PF/s-days) to within ~0.3% — the same idea as cross-checking a tax figure against the regulator's own formula.

Compute uses C ≈ 6·N·D from Kaplan et al. (2020) and the 20-tokens-per-parameter optimum from Hoffmann et al. (2022, Chinchilla). GPU peaks are dense BF16/FP16 from NVIDIA datasheets; estimates assume your stated MFU and ideal scaling. This is the dense 6ND approximation — MoE, attention-FLOPs, and very long context can shift the real number ±10–30%.

How it works

Every figure comes from two published scaling-law results, applied as closed-form arithmetic in your browser — nothing is trained, uploaded, or downloaded.

1. Total compute — the 6ND rule

Training a dense transformer costs about six floating-point operations per parameter per token: C ≈ 6 × N × D, where N is the parameter count and D is the number of training tokens. The factor 6 is two FLOPs for the forward pass plus four for the backward pass (the backward pass costs roughly twice the forward pass). This is the standard estimate from Kaplan et al.'s Scaling Laws for Neural Language Models (2020).

2. PetaFLOP/s-days

To compare runs, total FLOPs are divided by the compute in one petaFLOP/s-day: 1 PF/s-day = 10¹⁵ × 86,400 = 8.64×10¹⁹ FLOPs. This is the unit OpenAI used to report GPT-3 at ≈3,640 petaFLOP/s-days.

3. Chinchilla-optimal tokens

Hoffmann et al. (2022) showed that for a fixed compute budget, model size and dataset size should grow together — about D ≈ 20 × N training tokens per parameter. The tool computes that optimum and flags your run as undertrained (well below it), compute-optimal (within ±25%), or over-trained (well above it — a deliberate choice when you want a smaller model that is cheaper to serve, as with Llama-2). The ±25% band is deliberate: Hoffmann et al. report a flat loss basin around the optimum, so a run does not have to hit 20 tokens per parameter exactly to be treated as compute-optimal. If you want to work the problem the other way — start from a fixed FLOP budget and split it into the best N and D — use the compute-optimal (Chinchilla) calculator, which inverts the same two equations.

4. GPU-hours, wall-clock, and cost

GPU-hours are the compute divided by the GPU's effective throughput: GPU-hours = C / (peak FLOP/s × MFU) / 3600. Peak throughput is the dense BF16/FP16 tensor figure from the NVIDIA datasheet (A100 312 TFLOP/s, H100 SXM 989 TFLOP/s), and MFU (Model FLOPs Utilization) is the fraction of peak a real run achieves — typically 30–55%. Wall-clock time divides GPU-hours by the number of GPUs (ideal scaling), and cost multiplies GPU-hours by your price per GPU-hour. MFU is the single most sensitive input here: GPU-hours are inversely proportional to it, so a run planned at 50% MFU that actually lands at 25% costs exactly twice as much. If you are shopping for a price per GPU-hour rather than guessing one, the GPU cloud cost calculator compares RunPod, Lambda, Vast.ai, and AWS rates for the same card.

5. Cross-check against published runs

As an independent check, the 6ND formula is applied to three documented runs. For GPT-3 and Chinchilla — where the papers state a compute number — the tool shows the percentage difference. The 6ND estimate reproduces GPT-3's published 3.14×10²³ FLOPs to within about 0.3%, the same idea as cross-checking a tax figure against the regulator's own formula. This is the dense approximation: Mixture-of-Experts, the attention-FLOPs correction, and very long context can shift the real number by ±10–30%.

6. Guard rails and edge cases

Inputs are bounded before anything is computed: 1K to 100T parameters, 1K to 1,000T training tokens, and MFU between 5% and 80%. A blank, zero, negative, or non-numeric entry is clamped to zero rather than producing NaN, so the page never shows a broken figure — you get a specific message telling you which field to fix. A zero or missing GPU peak yields zero GPU-hours instead of dividing by zero, and the Chinchilla ratio falls back to “undertrained” when the parameter count is zero. Every number is recomputed synchronously in the browser as you type; nothing is sent to a server.

What the 6ND rule leaves out

6ND is an approximation, and knowing where it drifts is the difference between a planning figure and a wrong budget. Four corrections matter in practice.

Attention FLOPs at long context

The 6ND term counts only the matrix multiplies whose cost scales with parameters. The attention score computation scales with sequence length instead, adding roughly 12 × L × s × d FLOPs per token, where L is the layer count, s the sequence length, and d the model dimension. Kaplan et al. note this stays a small fraction of the total while d > s / 12. For Llama-2 7B (L = 32, d = 4,096, s = 4,096) the correction is 12 × 32 × 4,096 × 4,096 ≈ 6.4×10⁹ FLOPs per token against 6N = 4.2×10¹⁰ — about 15% on top, and roughly half that once causal masking is accounted for. Push the same model to 32K context and attention stops being a rounding error. If context length is the variable you are actually reasoning about, the context window calculator is the better starting point.

Activation recomputation

Large runs trade compute for memory with gradient checkpointing, re-running the forward pass during the backward pass to avoid storing activations. Full recomputation turns 6ND into roughly 8ND — a flat 33% surcharge that this tool does not add. By convention, Model FLOPs Utilization deliberately excludes recompute (that is what separates MFU from Hardware FLOPs Utilization), so an MFU figure quoted from a paper is already the right thing to divide by here. Do not add the 33% and lower the MFU; that double-counts.

Mixture-of-Experts

For an MoE model, N in 6ND is the parameters activated per token, not the total checkpoint size. Mixtral 8×7B holds about 46.7B parameters but routes roughly 12.9B per token, so using the total overstates training compute by about 3.6×. The worked example below shows the same mistake at GPT-4 scale. Total parameters still govern memory, which is what the LLM VRAM calculator sizes.

Embeddings and the small-model regime

Kaplan et al. fit their scaling laws on non-embedding parameters. For a 70B model the embedding and output matrices are a rounding error, but for a 100M-parameter model with a 128K vocabulary they can be a third of the checkpoint — so a small-model estimate that includes embeddings in N runs high. Beyond that, restarts, failed runs, checkpoint reloads, and evaluation passes are real spend that no closed-form formula captures. Budget 10–20% headroom on top of whatever this page returns.

How to read the results

Total FLOPs is the physics of the run — hardware-independent, and the number to quote when comparing your plan against a published model. PetaFLOP/s-days is the same quantity in the unit the GPT-3 paper used, so it is the easiest column to eyeball against the reference table.

GPU-hours and costare the first hardware-dependent figures, and both move with MFU and card choice. Quoted cloud rates usually assume on-demand pricing; spot and reserved capacity can be 40–70% cheaper but expose you to preemption, which means checkpointing overhead. If you are budgeting in rupees rather than dollars, convert the USD figure at the day's rate with the currency converter — GPU rental is invoiced in USD everywhere, so the rupee cost of a fixed run moves with the exchange rate, not with anything about the model.

Wall-clock time assumes perfect linear scaling and is therefore a lower bound. Real clusters lose 10–40% to gradient all-reduce, pipeline bubbles, stragglers, and restarts, and that loss grows with node count — 512 GPUs will not be exactly 64× faster than eight. Two things the compute figure does not tell you: whether the model plus optimizer states even fit in the memory you have, and what the run costs in electricity and emissions. Those are the VRAM calculator and the AI energy & carbon calculator respectively. And if the goal is adapting an existing model rather than pre-training one, the fine-tuning cost calculator works at the scale you actually care about — fine-tuning typically costs three to four orders of magnitude less than the pre-training run modelled here.

Worked examples

Reproduce GPT-3 — 175B params, 300B tokens

  1. Total compute: 6 × 175e9 × 300e9 = 3.15×10²³ FLOPs (published 3.14×10²³, +0.3%)
  2. PetaFLOP/s-days: 3.15×10²³ / 8.64×10¹⁹ = 3,646 (published ≈ 3,640 ✓)
  3. Chinchilla optimum: 20 × 175e9 = 3.5×10¹² → D is 0.09× the optimum ⇒ undertrained
  4. A100 @ 30% MFU: 3.15×10²³ / (312e12 × 0.30) / 3600 ≈ 934,829 GPU-hours
  5. Cost at $1.50/GPU-hour ≈ $1.40M

7B model — Chinchilla-optimal mode

  1. Tokens: 20 × 7e9 = 1.4×10¹¹ (140B), ratio 1.0 ⇒ compute-optimal
  2. Total compute: 6 × 7e9 × 1.4e11 = 5.88×10²¹ FLOPs
  3. PetaFLOP/s-days: 5.88×10²¹ / 8.64×10¹⁹ = 68.1
  4. H100 @ 40% MFU: 5.88×10²¹ / (989e12 × 0.40) / 3600 ≈ 4,129 GPU-hours
  5. Cost at $2.50/GPU-hour ≈ $10,300

Edge case — Llama-2 7B was deliberately over-trained

  1. Real Llama-2 7B used ~2T tokens, not the 140B Chinchilla optimum
  2. Total compute: 6 × 7e9 × 2e12 = 8.4×10²² FLOPs ; 972 PF/s-days
  3. Ratio: 2e12 / 1.4e11 = 14.3× the optimum ⇒ over-trained
  4. Why: more training data makes a small model stronger, so it is cheaper to serve at inference

Small scale — 1B params on 8× A100, what one person can actually run

  1. Chinchilla tokens: 20 × 1e9 = 2×10¹⁰ (20B tokens)
  2. Total compute: 6 × 1e9 × 2e10 = 1.2×10²⁰ FLOPs ; 1.39 PF/s-days
  3. A100 @ 35% MFU: eff = 312e12 × 0.35 = 1.092×10¹⁴ FLOP/s
  4. GPU-hours = 1.2e20 / 1.092e14 / 3600 ≈ 305 A100-hours
  5. Wall-clock: 305 / 8 / 24 ≈ 1.6 days on eight cards (12.7 days on one)
  6. Cost at $1.50/GPU-hour ≈ $458 — a weekend project, not a datacentre

Edge case — MoE, and the 6× error from using total parameters

  1. GPT-4-class (reported, unconfirmed): ~1.8T total params, ~280B active, ~13T tokens
  2. Correct — active params: 6 × 2.8e11 × 1.3e13 = 2.18×10²⁵ FLOPs ; 252,800 PF/s-days
  3. H100 @ 40% MFU: 2.18e25 / 3.956e14 / 3600 ≈ 15.3M GPU-hours ≈ $38M at $2.50/hr
  4. On 25,000 H100s: 15.3e6 / 25000 / 24 ≈ 26 days wall-clock
  5. Wrong — total params: 6 × 1.8e12 × 1.3e13 = 1.40×10²⁶ FLOPs — 6.4× too high
  6. Rule: for MoE, N is the parameters routed per token, not the checkpoint size

Published training runs, checked against 6ND

The fastest way to sanity-check a compute estimate is to run the same formula over models whose training cost is a matter of public record. Below, the FLOPs and petaFLOP/s-days columns are what 6ND returns from the parameter and token counts in the same row — nothing in those two columns is quoted from a paper. The last column is what the source actually published, so the gap between them is the error of the approximation itself.

Compiled 4 August 2026 from the papers and model cards linked under Sources & references. N is the parameters activated per token, not the checkpoint size.
ModelNTokens D6ND FLOPsPF/s-daysWhat the source says
GPT-3 175BOpenAI, 2020175B300B3.15×10²³3,646Paper reports 3.14×10²³ FLOPs — the 6ND estimate is 0.3% high.
Chinchilla 70BDeepMind, 202270B1.4T5.88×10²³6,806Paper reports 5.76×10²³ FLOPs — 6ND is 2.1% high.
PaLM 540BGoogle, 2022540B780B2.53×10²⁴29,248Paper reports 2.56×10²⁴ FLOPs — 6ND is 1.3% low. Achieved 46.2% MFU on 6,144 TPU v4 chips.
Llama-2 7BMeta, 20237B2T8.40×10²²972184,320 A100-80GB hours published ⇒ implied MFU ≈ 41%.
Llama-2 70BMeta, 202370B2T8.40×10²³9,722≈1.72M A100-80GB hours published ⇒ implied MFU ≈ 43%.
Llama 3.1 405BMeta, 2024405B15.6T3.79×10²⁵438,750Paper reports 3.8×10²⁵ FLOPs and 30.84M H100 hours ⇒ implied MFU ≈ 35%.
DeepSeek-V3DeepSeek, 2024 — MoE37B active (671B total)14.8T3.29×10²⁴38,0282.664M H800 hours for pre-training ⇒ implied MFU ≈ 35%. Using the 671B checkpoint size instead of the 37B active count would overstate compute by 18×.
GPT-4-classunconfirmed third-party estimate~280B active~13T2.18×10²⁵252,800OpenAI published no compute figure. The N and D here are reported estimates, so treat the whole row as order-of-magnitude.

Three things fall out of that table. First, where a paper states a compute number at all, 6ND lands within about 2% of it — GPT-3 to 0.3%, PaLM to 1.3%, Llama 3.1 405B to under 0.2%. For dense models the approximation is far tighter than the ±10–30% caveat elsewhere on this page suggests; that wider band is for the cases where architecture or context length pulls the run away from the assumptions, not for a standard dense pre-train.

Second, the implied MFU column is the real spread. Divide published GPU-hours into the 6ND compute and the frontier runs cluster between 35% and 46% — PaLM at 46.2% on TPU v4, Llama-2 around 41–43% on A100, Llama 3.1 405B and DeepSeek-V3 both near 35% on Hopper-class hardware. The pattern is that utilization falls as cluster size rises, because communication and stragglers eat more of the budget. If you are planning a run on more than a few hundred GPUs, 35% is a more defensible default than the 40% the calculator starts with, and the GPU cloud cost calculator will show what that five-point difference costs at your provider's rate.

Third, DeepSeek-V3 is the cleanest published demonstration of the MoE trap. Its checkpoint holds 671B parameters but routes only 37B per token, so 6ND on the total would return 5.96×10²⁵ FLOPs against a true 3.29×10²⁴ — an 18× overstatement, and a budget wrong by more than an order of magnitude. Enter active parameters here. The total is still the number that governs how much memory the weights occupy, which is what the LLM VRAM calculator sizes, and the number that decides whether you can serve the model at all once training finishes.

A note on reading these as costs. Published GPU-hours are hardware time, not invoices — Meta and Google train on owned fleets, so no rental rate applies. Multiplying Llama 3.1 405B's 30.84M H100-hours by a $2.50 on-demand rate gives roughly $77M, which is what the run would have cost a renter, not what it cost Meta. The tool prices your plan the renter's way because that is the decision most people using this page are actually making.

Frequently asked questions

Sources & references

Related tools

Rate this tool
Be the first to rate

Comments & feedback

Spotted a bug or want an improvement? Tell us — our team reviews every comment, and good ideas get built. Comments are public and anonymous.

Found a bug, edge case, or want another GPU or reference run added?

Email me at [email protected] — most fixes ship within 24 hours.