Skip to content
Calcrivo

Samples/sec Calculator

Calculate training throughput in samples processed per second.

Inputs

samples
seconds
samples

Used to estimate time per epoch. Set to 0 to skip.

Throughput

301.18samples/s

Steps per Epoch

3,907

Estimated Time per Epoch

55.35minutes

Step by step

  1. Samples/sec: batch size ÷ step time

    256 ÷ 0.85

    = 301.18 samples/s

  2. Steps per epoch: ⌈dataset size ÷ batch size⌉

    ⌈1,000,000 ÷ 256⌉

    = 3,907

  3. Epoch time: steps per epoch × step time

    3,907 × 0.85 s

    = 55.35 min

How it works

Training throughput in samples per second is the most direct measure of how fast a model trains: samples/s = batch_size / step_time_seconds. This figure directly determines how long a full epoch takes (steps_per_epoch × step_time), and is the metric most sensitive to hardware, batch size, model architecture, and data pipeline efficiency. Comparing samples/sec across different batch sizes or hardware configurations is the most practical way to evaluate real-world training speed improvements from optimizations like mixed precision, gradient checkpointing, or hardware upgrades.

Formula

samples_per_second = batch_size / step_time_seconds

batch_size
Number of samples per training step
step_time_seconds
Wall-clock time per step in seconds

Frequently Asked Questions

Why does increasing batch size sometimes increase samples/sec and sometimes not?

Larger batches improve GPU utilization up to a point (better parallelism per step), increasing samples/sec, but beyond the point where the GPU is already compute-saturated, step time grows roughly proportionally with batch size, causing samples/sec to plateau rather than keep increasing.

How do I use samples/sec to estimate total training time?

Divide your total training samples (dataset size × number of epochs) by samples/sec to get total training time in seconds — this is the same calculation used by the Training Time Calculator, just expressed through throughput instead of step count.

Does samples/sec account for multi-GPU training?

If step_time_seconds is measured for the full multi-GPU setup processing one global batch, then samples/sec already reflects the combined throughput of all GPUs — just ensure batch_size refers to the full global batch, not the per-GPU micro-batch, to avoid underestimating throughput.

You might also need