★ FOUR BRAND-NEW COURSES ANNOUNCED! ★ Machine Learning End To End  •  Hands-On Deep Learning with Python  •  Generative AI & LLMs with Python  •  AI Agents and Agentic AI with Python  ★  Open the “Educational” menu above to explore them ★  ★  NEW! 5. JOB ASSISTANCE: JD Report • Resume customization • AI Mock Interviews — FREE with course bundles, or just ₹499 / US$5. Single Payment. No Subscription. ★★ FOUR BRAND-NEW COURSES ANNOUNCED! ★ Machine Learning End To End  •  Hands-On Deep Learning with Python  •  Generative AI & LLMs with Python  •  AI Agents and Agentic AI with Python  ★  Open the “Educational” menu above to explore them ★  ★  NEW! 5. JOB ASSISTANCE: JD Report • Resume customization • AI Mock Interviews — FREE with course bundles, or just ₹499 / US$5. Single Payment. No Subscription. ★★ FOUR BRAND-NEW COURSES ANNOUNCED! ★ Machine Learning End To End  •  Hands-On Deep Learning with Python  •  Generative AI & LLMs with Python  •  AI Agents and Agentic AI with Python  ★  Open the “Educational” menu above to explore them ★  ★  NEW! 5. JOB ASSISTANCE: JD Report • Resume customization • AI Mock Interviews — FREE with course bundles, or just ₹499 / US$5. Single Payment. No Subscription. ★★ FOUR BRAND-NEW COURSES ANNOUNCED! ★ Machine Learning End To End  •  Hands-On Deep Learning with Python  •  Generative AI & LLMs with Python  •  AI Agents and Agentic AI with Python  ★  Open the “Educational” menu above to explore them ★  ★  NEW! 5. JOB ASSISTANCE: JD Report • Resume customization • AI Mock Interviews — FREE with course bundles, or just ₹499 / US$5. Single Payment. No Subscription. ★

How much will a training run cost? C = 6ND

How much will a training run cost? C = 6ND
23-10-2026  |  By Tejas Desai, Ecube Analytics  |  Generative AI: Build a Small GPT From Scratch (Chapter 3)  |  3 min read
READ 6TH OF 8 IN THIS SERIES

How much will a training run cost? C = 6ND

Build a Small GPT From Scratch · Part 6 of 8

Before you spend a GPU-hour, you can estimate what a training run will cost with one line of arithmetic. It is rough, but it is accurate enough to stop you from planning something impossible.

The rule of thumb

Training a dense transformer costs about 6 floating-point operations per parameter per training token: roughly 2 for the forward pass and 4 for the backward pass. So for N parameters and D tokens, the total compute is about C = 6 × N × D.

Turning FLOPs into days

FLOPs mean little until you convert them to time on a real GPU. An A100 peaks at about 312 trillion operations per second in bfloat16, and a good run reaches perhaps 40% of that. Dividing the total by 40% of peak, and by the seconds in a day, gives A100-days. Using the 20-tokens-per-parameter ratio that the next post explains:

ModelParametersTokens (20 per parameter)Training FLOPsA100-days
Lab 3 tiny GPT10 million0.2 billion1.2e+16about 0.001 (minutes)
Small125 million2.5 billion1.9e+180.2
1B1 billion20 billion1.2e+2011.1
7B7 billion1.4e+02 billion5.9e+21545
70B70 billion1.4 trillion5.9e+2354,532
Training compute by model sizeBars on a log scale: 0.001 A100-days for the tiny GPT up to 54,500 for a 70B model at 20 tokens per parameter.Training cost at 20 tokens per parameter (A100-days, log scale)Lab 3 tiny GPTabout 0.001 (minutes)Small0.21B11.17B54570B54,532Each tenfold step in parameters costs a hundredfold in compute, because the tokens grow too.
The same table as bars on a log scale.
def train_flops(N, D):
    return 6 * N * D

def a100_days(flops, mfu=0.4, peak=312e12):          # bf16 peak; 40% utilisation is a good run
    return flops / (mfu * peak) / 86400

for name, N in (("tiny GPT", 10e6), ("1B", 1e9), ("7B", 7e9), ("70B", 70e9)):
    D = 20 * N
    print(name, "A100-days:", round(a100_days(train_flops(N, D)), 3))
# tiny GPT A100-days: 0.001
# 1B A100-days: 11.129
# 7B A100-days: 545.317
# 70B A100-days: 54531.695

What the table teaches

At a fixed number of tokens per parameter, cost grows with the square of model size, because parameters and tokens both grow. A 70B run costs a hundred times a 7B run, not ten times. And the whole of Lab 3 is about one five-hundred-thousandth of a 7B run, which is what “Colab-scale” honestly means. These are estimates: real runs differ in architecture, utilisation and wasted work.

Open in Colab Change the model size and the tokens-per-parameter ratio and see the bill.

Do this sum first. If the answer is hundreds of A100-days, the plan needs a different budget, a smaller model or a pretrained starting point.

Takeaways

  • Training compute is about 6 × parameters × tokens.
  • Dividing by 40% of an A100’s peak speed turns FLOPs into GPU-days.
  • At a fixed tokens-per-parameter ratio, 10 times the parameters costs 100 times the compute.
  • The tiny GPT of Lab 3 is about 1/500,000 of a 7B run.

Next in the series (Part 7): Chinchilla, and why recent models are over-trained on purpose

This blog is from chapter 3, course-2-generative-ai of 4 world-class courses on aibits.ecubeanalytics.com
← Previous Article 6 of 8 in this series Next →