Training FLOPs Calculator
Inputs
| Pass type | Training step (6ND) |
|---|---|
| Parameters | 70 |
| Training tokens | 1,400 |
Training FLOPs Calculator
Estimate the floating-point operations needed to train a transformer with the 6ND rule, from parameter count and training tokens, reported in total FLOPs and petaFLOP/s-days.
Inputs
Model and data
Results
Enter a value to see results.
Details
Training FLOPs
The compute required to train a large language model is dominated by a single quantity: the number of floating-point operations performed across the full training run. For dense transformers this is well approximated by the 6ND rule, which states that training costs about six operations for every parameter and every token seen. This calculator applies that rule, taking a parameter count and a token count and returning both the raw operation count and the equivalent in petaFLOP/s-days.
The 6ND rule
A transformer forward pass performs roughly two floating-point operations per parameter per token — one multiply and one add in the matrix multiplications that dominate the work. Training adds a backward pass that propagates gradients to both activations and weights, costing about twice the forward pass again. The forward and backward passes together come to roughly six operations per parameter per token. With parameters and training tokens, the total is therefore close to . The estimate captures the dominant linear layers and omits smaller contributions from attention, embeddings, and normalization, which are negligible for large models.
The formula
With the pass factor (six for a training step, two for a forward pass only), parameter count in billions, and token count in billions, the total operation count and the compute in petaFLOP/s-days are
CP=k⋅N⋅D⋅1018=8.64×1019Cwhere is the total FLOPs and is the compute in petaFLOP/s-days. The factor of restores the billions in and to absolute counts. One petaFLOP/s-day is one petaFLOP/s sustained for a day, equal to operations, so dividing by that figure converts a raw FLOP count into the unit large runs are usually reported in.
Worked example
Consider a 70-billion-parameter model trained on 1,400 billion tokens, a token-to-parameter ratio of twenty in line with compute-optimal practice:
CP=6×70×1400×1018=5.88×1023 FLOPs=8.64×10195.88×1023≈6,805.6 PFLOP/s-daysThe run needs about operations, or roughly 6,806 petaFLOP/s-days. Switching the pass factor to two reports the forward-pass cost alone, one third of the training total.
Limits
The 6ND rule is an idealized count of arithmetic, not a prediction of wall-clock time or cost. Real hardware sustains only a fraction of its peak throughput, so the actual time follows from dividing this compute by the achieved rate rather than the advertised one — a gap captured by the Model FLOPs Utilization Calculator. The estimate also omits activation recomputation, optimizer steps, evaluation passes, and any runs that fail and restart, all of which add to the compute spent in practice. The companion question of how many tokens a model of a given size should see is addressed by the Chinchilla Optimal Tokens Calculator, and converting this compute into a rental budget by the GPU Cloud Cost Calculator.
Frequently Asked Questions (FAQ)
What is the 6ND rule?
The 6ND rule estimates that training a dense transformer takes about six floating-point operations for each parameter and each training token, where N is the parameter count and D is the number of tokens. The factor of six comes from roughly two operations per parameter for the forward pass and about four for the backward pass that computes gradients.
It is a first-order approximation introduced in scaling-laws work; it captures the dominant matrix multiplications and omits smaller terms such as attention and embeddings.
How do total FLOPs relate to petaFLOP/s-days?
One petaFLOP/s-day is the amount of compute produced by sustaining one petaFLOP/s for a full day, which equals 8.64 × 10¹⁹ floating-point operations (10¹⁵ operations per second times 86,400 seconds). Dividing a total FLOP count by that figure converts it into petaFLOP/s-days, the unit large training runs are usually reported in because raw FLOP counts reach unwieldy magnitudes.
What does this estimate include and exclude?
The estimate counts the floating-point operations of the dominant linear layers across the forward and backward passes for the given number of training tokens. It does not account for hardware utilization, so the wall-clock time and cost of a real run are higher than the ideal compute implies. It also omits activation recomputation, optimizer overhead, evaluation, and failed or restarted runs, all of which add to the practical compute spent.
Disclaimer
This uses the first-order 6ND approximation for dense transformers and counts only ideal compute. Actual training time and cost depend on hardware utilization, which is well below peak, and on overhead the formula omits. Treat the result as a planning estimate, not an exact accounting.