Transformer Training Compute and Schedule Planner

Enter layers, width, heads and vocabulary, training tokens and data, batch sizes, GPUs, peak TFLOPS, utilisation and learning rate, and get compute and schedule.

يعمل في متصفحك. ملفاتك لا تغادر جهازك أبدًا. شاهد كيف تتحقق

…

كيف تفعل ذلك

  1. 1
    Enter architecture

    Layers, width, heads, vocab.

  2. 2
    Enter data

    Tokens or examples.

  3. 3
    Set batches

    Micro-batch, GPUs, target.

  4. 4
    Enter hardware

    Peak TFLOPS and MFU.

  5. 5
    Read compute and schedule

    And the LR table.

عن هذه الأداة

Planning a training run means answering practical questions before spending money: how many parameters will the model have, how much compute will training take, how many GPU-hours and days is that, how should batches be split across GPUs, and how should the learning rate change over time? Widely used approximations answer them. A decoder transformer has about 12 × layers × width² parameters plus embeddings; training costs about 6 floating-point operations per parameter per token; and compute-optimal training uses about 20 tokens per parameter. This planner brings these together.

Who this is for

Machine learning engineers, researchers, students and technical managers budgeting experiments.

Parameters

Each transformer layer has attention (about 4d²) and feed-forward (about 8d²) weights, so N ≈ 12 L d² plus V × d for the embeddings. A 24-layer model with width 2,048 and a 50,000-token vocabulary has about 1.3 billion parameters.

Training compute

Training FLOPs ≈ 6 × N × D: 2 for the forward pass and 4 for the backward pass per parameter per token. GPU-hours = FLOPs / (peak FLOPS × model FLOPs utilisation). Utilisation of 30% to 50% is typical for well-tuned large runs.

Compute-optimal data

The Chinchilla study found that, for a fixed compute budget, models should see about 20 tokens per parameter. Many modern models train far longer to make inference cheaper.

Batches and steps

Global batch = micro-batch per GPU × GPUs × gradient accumulation steps. Optimiser steps = tokens / (global batch × sequence length). For fine-tuning on a dataset, steps per epoch = examples / global batch.

Learning-rate schedule

A short linear warmup avoids early instability; a cosine decay to about 10% of the peak is common afterwards. The table shows the learning rate at points through training.

A worked example

The 1.3 B model trained on 50 B tokens needs about 3.9 × 10²⁰ FLOPs. On 8 GPUs at 312 TFLOPS peak and 40% utilisation, that is about 875 GPU-hours, roughly 4.6 days. Compute-optimal data would be about 26 B tokens.

## Attention compute The 6ND rule counts the matrix multiplications in the weights. Attention scores add about 6 × layers × sequence length × width FLOPs per token, which matters when sequences are long compared with the model width. The calculator shows this share so you can judge whether the simple rule is close enough.

Budget checks

Before a long run, train a small version for a few hundred steps to measure real throughput, then compare it with the estimate here. If measured utilisation is far below the planned figure, look at data loading, communication between GPUs and the micro-batch size before scaling up. Save checkpoints often enough that a failure costs hours, not days.

## Fine-tuning For fine-tuning on a labelled dataset, enter the number of examples to see steps per epoch. Two to four epochs are common; more often overfits small datasets.

Limits

These are planning approximations that ignore attention FLOPs at long contexts, communication overheads and restarts. Not a guarantee of training time.

مثال محلول

A 1.3 B model on 50 B tokens needs about 875 GPU-hours on 312 TFLOPS GPUs at 40% utilisation.

حقائق سريعة

الأسئلة الشائعة

How many FLOPs does training take?

About 6 × parameters × tokens.

What is MFU?

Model FLOPs utilisation: the share of peak compute actually used.

What is the Chinchilla ratio?

About 20 training tokens per parameter for compute-optimal training.

How do I reach a large batch on few GPUs?

With gradient accumulation.

Why warm up the learning rate?

It stabilises early training.

Is my data stored?

No. It stays in your browser.

مجاني تمامًابلا تكلفة وبلا تسجيل
ملفات خاصةكل شيء يعمل في متصفحك
سهل بلغتكمتوفر بلغات كثيرة