Model Training Time Estimate Calculator

This calculator converts a dataset size, a per-device batch size and an epoch count into the number the scheduler cares about: wall-clock hours. It counts optimiser steps exactly, including the partial final batch, applies your measured single-device step rate, and then applies the scaling efficiency that makes eight GPUs deliver less than eight times the throughput of one. It also prices the job, so you can see when adding devices buys time at a cost you are willing to pay.

Calculator

This calculator runs in your browser. Enable JavaScript for live results — the inputs, formula and worked example below remain fully readable without it.

Inputs this calculator takes, with typical values
InputWhat to enterExample
Training samplesExamples in one pass over the training set — rows, images, or packed sequences, whichever unit your batch size counts.1000000 samples
EpochsComplete passes over the training set. Fractional values are allowed for runs specified as a partial epoch.3 passes
Batch size per deviceMicro-batch each device holds per optimiser step. If you use gradient accumulation, multiply the micro-batch by the accumulation count.32 samples
Number of devicesDevices running data-parallel replicas of the same model. Each holds the per-device batch above.8 GPUs
Optimiser steps per second on one deviceMeasured on a single device at the per-device batch size above. Run a hundred steps, divide by the elapsed seconds, and discard the first ten.4 steps/s
Scaling efficiencyAchieved step rate across all devices as a percentage of the single-device step rate. 100% means gradient synchronisation is completely hidden behind computation.85 %
Price per device-hourHourly cost of one accelerator, rented or amortised. Set it to zero to see time only.2.5 $

It returns

  • Training time — Wall-clock hours for the full run, excluding checkpoint restarts and evaluation.
  • Total optimiser steps
  • Effective (global) batch size
  • Sustained throughput
  • Speed-up vs one device
  • Total compute cost

The formula

t=SbGEfη
Beff=bG
C=tGr

In plain text: t = ceil(S / (b · G)) · E / (f · η)

  • tWall-clock training time (seconds)
  • STraining samples in one epoch (count)
  • bBatch size per device (samples)
  • GNumber of data-parallel devices (count)
  • EEpochs (count)
  • fOptimiser steps per second on one device at batch b (steps/s)
  • ηScaling efficiency, achieved step rate ÷ single-device step rate (fraction)

The ceiling accounts for the partial final batch, which still costs a full step. The model assumes pure data parallelism, where each device holds a full model replica and processes its own micro-batch, so adding devices increases the effective batch rather than shortening the step.

Updated Category Training & Fine-Tuning Compute Verified against published test cases Reading time 10 min

What governs how long a training job takes

Training time is an arithmetic problem with one measured input. The dataset size, batch size and epoch count determine exactly how many optimiser steps the job performs — that part is counting, not estimating. Everything uncertain collapses into a single number: how many steps per second one device sustains on your model at your batch size. Measure that once and the rest is division.

The step count is a ceiling, not a quotient, because the final batch of each epoch is usually partial and still costs a full step. With 1,000,000 samples and an effective batch of 256, an epoch is ceil(1,000,000 ÷ 256) = 3,907 steps, not 3,906.25. On a short job with many epochs this rounding is invisible; on a job with 200 epochs over a small dataset it adds up.

The second uncertainty is what happens when you add devices. In data parallelism each device holds a complete copy of the model, processes its own micro-batch, and then every device exchanges gradients before the optimiser update. That exchange is the tax. If it is fully overlapped with computation, the step rate is unchanged and eight devices process eight times the samples per step — a perfect eightfold speed-up. If the exchange is exposed, the step takes longer and the speed-up falls short. Scaling efficiency is the one number that captures the difference.

The formula, term by term, and why efficiency divides rather than multiplies

Start with the numerator. S ÷ (b · G) is samples divided by the effective batch, so it counts steps in one epoch; the ceiling covers the partial final batch; multiplying by E gives total steps. Nothing here depends on hardware.

The denominator is where hardware enters. f is the step rate you measured on one device at per-device batch b. Note the qualifier carefully: f must be measured at the same per-device batch you enter above. A step rate measured at batch 8 does not describe a job running at batch 64; larger micro-batches usually raise samples per second while lowering steps per second, so mixing the two produces an estimate that is wrong by roughly the batch ratio.

η is scaling efficiency: the step rate the whole cluster achieves divided by the step rate one device achieves. It divides the rate, which is why it multiplies the time. At η = 0.85, the job takes 1 ÷ 0.85 = 1.176 times as long as a perfectly scaling job with the same step count, and because you are paying for all G devices for that whole duration, the device-hours rise by the same 17.6%.

The speed-up figure reported above compares two complete runs rather than assuming G · η: it recomputes the step count for a single device (a much larger number, since the effective batch is G times smaller) and divides the two wall-clock times. That is why the reported speed-up is not exactly 8 × 0.85 = 6.80 in every case — the two ceilings round differently.

The scaling model here is deliberately simple, and it is the data-parallel analogue of Amdahl's argument: a fixed serial fraction of each step caps the achievable speed-up no matter how many devices you add. If you want the general form of that limit, the Amdahl's law speed-up calculator derives it.

Worked example: 1,000,000 samples on 8 GPUs for 3 epochs

You are fine-tuning on 1,000,000 samples with a per-device batch of 32, on 8 accelerators, for 3 epochs. A pilot run on one device sustains 4.0 optimiser steps per second at batch 32. Your cluster achieves 85% scaling efficiency, and the devices cost $2.50 each per hour.

  1. Effective batch. 32 × 8 = 256 samples per optimiser step.
  2. Steps per epoch. 1,000,000 ÷ 256 = 3,906.25, and the partial batch still costs a step, so ceil(3,906.25) = 3,907 steps.
  3. Total steps. 3,907 × 3 = 11,721 steps.
  4. Achieved step rate. 4.0 × 0.85 = 3.4 steps per second.
  5. Wall-clock time. 11,721 ÷ 3.4 = 3,447.35 seconds = 57.5 minutes = 0.958 hours.
  6. Throughput. 256 × 3.4 = 870.4 samples per second.
  7. Cost. 0.958 h × 8 devices × $2.50 = $19.15.

Now compare against one device. There the effective batch is 32, so an epoch is ceil(1,000,000 ÷ 32) = 31,250 steps, three epochs is 93,750 steps, and at 4.0 steps per second that is 23,437.5 seconds = 6.510 hours. The speed-up is 23,437.5 ÷ 3,447.35 = 6.80× on eight devices.

The cost comparison is the part worth pausing on. The single-device run costs 6.510 h × 1 × $2.50 = $16.28; the eight-device run costs $19.15. You bought a 5.55-hour reduction in wall-clock time for $2.87 — and the extra spend is exactly the 1 ÷ 0.85 = 17.6% efficiency loss applied to the base cost: $16.28 × 1.176 = $19.15.

How to read the result and what scaling efficiency to expect

Read total steps first, because the learning-rate schedule is defined against it. Warm-up is usually specified as a step count or a fraction of total steps, and cosine or linear decay schedules need the total to be known in advance. If you change the device count and leave the schedule alone, the step count changes underneath it and the run decays at the wrong rate.

Read the effective batch second. It is the number that governs optimisation behaviour, and it changes whenever the device count changes even though the per-device batch does not. A recipe tuned at effective batch 256 will not transfer unchanged to effective batch 2,048. The common adjustments — linear or square-root learning-rate scaling with a longer warm-up — are heuristics, not guarantees, and they need validating on your own loss curve.

Scaling efficiency is the figure to be sceptical about. Within a single node connected by NVLink, well-tuned data parallelism on a compute-heavy model commonly holds above 90%. Across nodes over Ethernet, on a small model where the gradient exchange is large relative to the arithmetic, it can fall well below 70%. The only reliable way to know is to measure: run the same job on 1, 2 and 4 devices, record the achieved step rate, and divide. The efficiency table above lets you see how much the answer moves before you commit.

Finally, treat the hours figure as a lower bound on calendar time. It excludes dataset loading and shuffling on the first epoch, checkpoint writes, mid-training evaluation, queue waits and node failures. Long runs need resumable checkpoints; the warning above fires past two weeks for exactly that reason.

Steps per epoch by dataset size and effective batch

Each cell is ceil(samples ÷ effective batch). Multiply by epochs for total steps, then divide by your achieved step rate for seconds.
SamplesEffective batch 32Effective batch 128Effective batch 512Effective batch 2,048
50,0001,5633919825
200,0006,2501,56339198
1,000,00031,2507,8131,954489
10,000,000312,50078,12519,5324,883

Effective batch is per-device batch times device count. The ceiling matters most in the right-hand columns, where the partial final batch is a larger share of an epoch.

What makes a training-time estimate wrong

  • Measuring the step rate at a different batch size. Steps per second falls as the micro-batch grows. A rate measured at batch 8 applied to a job at batch 64 understates the time by close to the batch ratio.
  • Timing the first ten steps. Compilation, kernel autotuning, memory-allocator warm-up and the first dataset shuffle all land in the opening seconds. Discard them before computing a rate.
  • Assuming scaling efficiency holds as the cluster grows. Gradient exchange grows with device count while per-device arithmetic does not, so the efficiency you measured on 8 devices is an upper bound for 64.
  • Forgetting gradient accumulation. If you accumulate over 4 micro-batches before stepping, the effective batch is 4 times larger and the step rate is roughly 4 times lower. Enter the accumulated batch, not the micro-batch.
  • Leaving evaluation out. A validation pass every 500 steps on a large held-out set can add 10% or more to the calendar; the exact figure is your eval-set size divided by inference throughput, times the number of passes.
  • Ignoring the data pipeline. If the loader cannot keep 8 devices fed, the achieved step rate is set by disk and CPU, not by the accelerator, and adding devices changes nothing at all.

When to use a different estimate instead

This calculator works from a measured step rate, which makes it the right tool once you have a job running or a comparable one to benchmark. When you have neither — you are sizing a pre-training run that does not exist yet — work from arithmetic instead: the LLM training compute calculator applies C = 6ND to get total FLOPs and divides by sustained hardware throughput, which needs no step-rate measurement at all. The two agree when both are calibrated honestly, and disagreeing is a useful signal that one of your assumptions is wrong.

For model-parallel and pipeline-parallel jobs, the model here breaks down. Those strategies split a single model across devices rather than replicating it, so adding devices does not increase the effective batch and the bottleneck becomes pipeline bubbles and activation transfer rather than gradient all-reduce. Most large runs combine all three forms of parallelism, in which case the scaling efficiency you enter should be measured end to end on the real topology.

Before you can run anything you have to fit it in memory, which is a separate constraint entirely: the GPU VRAM requirement calculator sizes weights, gradients, optimiser states and activations, and the quantisation memory savings calculator shows what lower precision buys. Once you have both the hours from this page and a device count, the GPU-hours cost calculator turns them into an invoice across instance types and commitment terms.

Frequently asked questions

How do I measure steps per second properly?

Run at least 100 optimiser steps on a single device at your real per-device batch size, discard the first ten, and divide the remaining step count by the elapsed wall-clock seconds. The first steps include compilation, kernel autotuning and allocator warm-up and are unrepresentative. Use the same sequence length, precision and gradient-accumulation setting as the real job, because all three change the number.

Why does doubling the number of GPUs not halve the time?

Because every optimiser step now requires all devices to exchange gradients before updating. If that exchange is fully overlapped with computation the step rate is unchanged and you do get the full halving; if it is not, the step takes longer. Scaling efficiency is the ratio between the two. Interconnect bandwidth, model size relative to batch size, and whether the devices sit in one node all determine where it lands.

Does gradient accumulation change the estimate?

Yes, and you must enter the accumulated figure. If each device processes 4 micro-batches of 16 before stepping, its batch for this calculator is 64, and the single-device step rate you measure will be roughly a quarter of the micro-batch rate. Getting this wrong in one place and not the other is the most common way this estimate ends up out by a factor of four.

What is a normal scaling efficiency?

Above 90% is achievable within a single node over NVLink on a model large enough that computation dominates communication. Across nodes over standard Ethernet, or on a small model where the gradient is large relative to the arithmetic per step, values in the 60–80% range are common. There is no universal number: measure it by running the same job at 1, 2 and 4 devices and dividing the achieved step rates.

Should more devices always cost more?

Whenever scaling efficiency is below 100%, yes. Device-hours equal wall-clock hours times device count, and the efficiency loss inflates them by exactly 1 ÷ η. At 85% efficiency, the same job costs 17.6% more on any number of devices greater than one than it would with perfect scaling. You are buying calendar time with money, and the efficiency figure is the exchange rate.

Does this work for fine-tuning as well as pre-training?

Yes — the arithmetic is identical, and fine-tuning is where it is most useful, because the datasets are small enough that a pilot measurement is cheap. Parameter-efficient methods such as LoRA change the step rate (slightly faster, since there is less optimiser state to update and fewer gradients to synchronise) but not the structure of the calculation. Measure the step rate with your adapters attached.

Why is the reported speed-up not exactly devices × efficiency?

Because the step counts round differently. The single-device run has a smaller effective batch and therefore many more steps, and each epoch's ceiling rounds independently. With 1,000,000 samples the single-device run is 93,750 steps and the eight-device run is 11,721 — not exactly one eighth, since 11,721 × 8 = 93,768. The calculator divides the two real wall-clock times rather than assuming the product.

What is missing from the time estimate?

Dataset loading and shuffling, checkpoint writes, mid-training evaluation passes, scheduler queue time, and restarts after node failures. On a short job these are noise. On a two-week run they routinely add 10–20% to the calendar, and a failure without resumable checkpoints can cost the entire run. Treat the hours figure as the arithmetic floor and add operational slack on top.

References