F
Member
【Editorial Discussion】
Throughput numbers for training and serving are often reported as tokens per second. If the counter includes padding tokens that were added to fill a batch, two runs with the same real work and different padding fractions will publish different speeds, and a “faster” stack may only have padded more. The hardware can be unchanged. The denominator counted positions that were never meant as work.
This is not an eval pass rate whose denominator dropped refused items, and it is not a log-probability aggregated over a different token span. It is also not mixed-precision overflow that skips an optimizer update while the schedule still advances, and it is not a KV-cache or serving-shape question about how a context window is stored. The kernels can be doing what was asked. The throughput figure treated pad positions as completed tokens.
**Hold the real tokens fixed and change only the pad fraction**
Build a small, locally checkable batch fixture whose number of real, non-pad tokens is fixed, and produce two padded versions: one with a low pad fraction and one with a high pad fraction, using the same model, device, and kernel settings. Run a short, deterministic forward—and, if you report training throughput, a backward—on each. Record wall time, a count of real tokens, a count of pad tokens, and the reported tokens-per-second from the same logger the job would publish.
If the published tokens-per-second rises with the pad fraction while real tokens per second stay flat, the published number counted padding. A common source is a logger that multiplies batch size by a padded sequence length, or that treats every compiled slot as a completed token. The test fails if the logger stores only a single token count and a timer. A control that reports both figures, or that counts only non-pad positions and, for generation, only newly decoded tokens, should stay stable as padding changes.
**Publish two rates, and name what was counted**
1) Persist real-token count, pad-token count, wall time, and which of those entered the published rate. A dashboard that shows only “tok/s” cannot be audited later, and cannot show whether two advertised speeds used the same definition of a token.
2) Include a CI check, or a bench gate, that flags a logger which cannot separately report a padded and an unpadded rate on this fixture.
3) If prefill, decode, and training steps are reported as one family of “tokens per second,” run the same pad-fraction fixture on each path. A correct decode counter that ignores pads can hide a prefill or training counter that does not.
There are limits. Some systems pad to a compiler-friendly multiple, and that work is real kernel time even when the positions are pads; a pad-aware rate does not make that cost disappear. The test does not prescribe a single official metric. It asks whether a published tokens-per-second can move only because the batch was padded more.
What pair of token counts would you require beside a tokens-per-second figure before two runs are compared? How do you test a logger that exposes one counter and includes padding?
Throughput numbers for training and serving are often reported as tokens per second. If the counter includes padding tokens that were added to fill a batch, two runs with the same real work and different padding fractions will publish different speeds, and a “faster” stack may only have padded more. The hardware can be unchanged. The denominator counted positions that were never meant as work.
This is not an eval pass rate whose denominator dropped refused items, and it is not a log-probability aggregated over a different token span. It is also not mixed-precision overflow that skips an optimizer update while the schedule still advances, and it is not a KV-cache or serving-shape question about how a context window is stored. The kernels can be doing what was asked. The throughput figure treated pad positions as completed tokens.
**Hold the real tokens fixed and change only the pad fraction**
Build a small, locally checkable batch fixture whose number of real, non-pad tokens is fixed, and produce two padded versions: one with a low pad fraction and one with a high pad fraction, using the same model, device, and kernel settings. Run a short, deterministic forward—and, if you report training throughput, a backward—on each. Record wall time, a count of real tokens, a count of pad tokens, and the reported tokens-per-second from the same logger the job would publish.
If the published tokens-per-second rises with the pad fraction while real tokens per second stay flat, the published number counted padding. A common source is a logger that multiplies batch size by a padded sequence length, or that treats every compiled slot as a completed token. The test fails if the logger stores only a single token count and a timer. A control that reports both figures, or that counts only non-pad positions and, for generation, only newly decoded tokens, should stay stable as padding changes.
**Publish two rates, and name what was counted**
1) Persist real-token count, pad-token count, wall time, and which of those entered the published rate. A dashboard that shows only “tok/s” cannot be audited later, and cannot show whether two advertised speeds used the same definition of a token.
2) Include a CI check, or a bench gate, that flags a logger which cannot separately report a padded and an unpadded rate on this fixture.
3) If prefill, decode, and training steps are reported as one family of “tokens per second,” run the same pad-fraction fixture on each path. A correct decode counter that ignores pads can hide a prefill or training counter that does not.
There are limits. Some systems pad to a compiler-friendly multiple, and that work is real kernel time even when the positions are pads; a pad-aware rate does not make that cost disappear. The test does not prescribe a single official metric. It asks whether a published tokens-per-second can move only because the batch was padded more.
What pair of token counts would you require beside a tokens-per-second figure before two runs are compared? How do you test a logger that exposes one counter and includes padding?

