Performance
Measured throughput, step times, I/O and serving latency for every stage, on the laptop, one H100 and 8×H100, and where the time went, each number sourced.
This page collects every speed I measured: throughput, step times, I/O, serving latency, and profiles of where the time went. The metrics are defined in the metrics glossary, and the settings behind each run are in configs and flags. Every number is from one run unless a row says otherwise.
The hardware and its ceilings
- The 8×H100 node: 8 × H100 80GB HBM3, with NVLink NV18 on all 28 GPU pairs and 18 of 18 links up per GPU.
- Its measured compute: a matmul burn test gave a median of 682.3 TFLOP/s per GPU, 69% of the H100 SXM’s dense BF16 peak of 989.
- One H100 ran the rehearsal and the control run.
- The laptop: an RTX 3060 with 6 GB, capped at 60 W, where the SM clock sat at about 1.18 of 2.1 GHz under load.
All-to-all bandwidth (nccl-tests, 8 GPUs; bus bandwidth, out of place):
| Message size | NVLink on | NVLink off (NCCL_P2P_DISABLE=1) |
|---|---|---|
| 8 MB | 56.1 GB/s | 12.2 GB/s |
| 32 MB | 224.6 GB/s | 8.2 GB/s |
| 128 MB | 286.4 GB/s | 8.6 GB/s |
| 512 MB | 314.6 GB/s | 10.8 GB/s |
| 2 GB | 341.1 GB/s | 11.4 GB/s |
| 8 GB | 346.2 GB/s | not run |
| Average | 261.8 GB/s | 10.1 GB/s |
At 2 GB, NVLink carries about 30 times the all-to-all bandwidth of the path without it. The NVLink-off training arm was not run; this table is the communication lesson.
Pretraining throughput
The balancing study (40 steps per MoE arm)
Medians over iterations 11–40 (dense: 11–120). Every arm shares the model, data order, optimizer and seed.
| Arm | Step time | TFLOP/s per GPU | MFU (Megatron / 6·P_active) | Peak allocated |
|---|---|---|---|---|
| Dense baseline (FFN 8,192, no experts) | 5.70 s | 373.1 | 37.7% / 34.0% | 50.9 GiB |
| MoE, forced-even routing (speed ceiling) | 10.69 s | 199.0 | 20.1% / 18.1% | 58.8 GiB |
| MoE, aux-loss router (collapsed) | 17.63 s | 120.7 | 12.2% / 11.0% | 58.8 GiB |
| MoE, V4 router, bias rate 1e-3 (collapsed) | 17.80 s | 119.6 | 12.1% / 10.9% | 58.8 GiB |
| MoE, V4 router, bias rate 1e-2 (collapsed) | 17.37 s | 122.5 | 12.4% / 11.2% | — |
| MoE, V4 scores + quantile balancing | 17.04 s | 124.9 | 12.6% / 11.4% | — |
| MoE, V4 + communication overlap | out of memory at step 1 | 78.8 of 79.2 GiB |
- The MoE at perfect balance ran at 0.533× the dense model’s throughput (step time 1.875×). The handbook measured 13–15% MFU for its MoE on H100; balanced, mine gave 18–20%.
- A collapsed router puts every token on the GPUs that hold the same 8 experts. Those GPUs do all the expert work, so the step takes 16.6–18.5 s against forced-even’s 10.6–10.9 s.
The main pretraining run
| Steps | Step time | TFLOP/s per GPU | Training loss |
|---|---|---|---|
| 1–50 | 17.32 s | 130.5 | 8.438 |
| 51–100 | 12.45 s | 177.6 | 7.023 |
| 101–150 | 11.17 s | 190.6 | 6.506 |
| 151–200 | 11.09 s | 192.0 | 6.067 |
| 201–250 | 11.06 s | 192.5 | 5.632 |
| 251–276 | 11.04 s | 192.8 | 5.322 |
The first 50 steps ran slowly while quantile balancing pulled the router out of its collapse. By step 276 the run was at 97% of the forced-even ceiling.
Over the whole run, 1,240 steps took 4.09 h (14,715 s). The median step was 10.93 s (mean 11.16), at 194.7 TFLOP/s per GPU and 1.92×10⁵ tokens/s on the 8 GPUs. That is 0.522× the dense model’s throughput.
The tokens per second follow from the step time:
Here \(B\) is the global batch in sequences, \(S\) the sequence length and \(t_{\text{step}}\) the median step time.
In words: one step trains 512 sequences of 4,096 tokens, so the throughput is those 2,097,152 tokens over the step time.
The two MFU figures then follow:
Here \(1.22 \times 10^{9}\) is the active parameter count per token, 8 the GPUs, and 989.4 TFLOP/s the dense BF16 peak per GPU used by the report script.
In words: the 6P estimate counts six FLOPs per active parameter per token and leaves attention out; Megatron’s count includes attention and the logits, so it reads higher.
Where the time goes
Pretraining: the balancing study’s profiles (steps 36–37)
| Arm | Communication | GEMMs | All-to-all per step | All-to-all per op | Idle |
|---|---|---|---|---|---|
| Forced-even (balanced) | 30.8% of the step | 29.3% | 3.04 s | 3.96 ms | 1.4% |
| Aux loss (collapsed) | 52.8% | 20.8% | 8.95 s | 11.65 ms | — |
| V4 (collapsed; nsys, share of kernel time) | 57.6% | 18.7% | — | — | — |
The reference expected about 2–3 ms per all-to-all and under 10% of the step in communication on one NVLink node. Neither held, because the overlap that would hide the all-to-all did not fit in memory.
Pretraining: the main run’s own profile (steps 50–52)
The PyTorch Profiler captured steps 50–52 on rank 0. These steps ran at about 13.0 s (median 13,029.7 ms), while the step time was still falling from the collapsed start toward its settled 11.0 s.
| Share of the 13,029.7 ms median step | Value |
|---|---|
| Communication (any NCCL kernel running), all of it exposed | 45.3% |
| All-to-all | 5,593.2 ms per step, 1,152 kernels; 7.28 ms per layer, direction and micro-batch |
| All-gather | 127.2 ms per step |
| GEMMs | 21.8% |
| Memory-bound operations | 24.6% (permute, sort and top-k alone: 9.9%) |
| Attention | 6.1% |
| GPU idle | 1.1% |
Only 0.063% of the communication overlapped with compute: the all-to-all ran exposed.
RL: generation dominates the step
- Main run, 8×H100: GSPO-A’s 44 complete steps took a median of 111 s. Each step is one rollout iteration (generation, grading, scoring and the first update), then three more updates of about 8.5 s each.
- Generation and grading were 57.5% of the logged time; scoring took 11.8% and the four updates 30.7%. My first reading said 80–90%, because it counted the whole rollout iteration on the long early steps. In synchronous, colocated RL the trainer waits through generation, which runs until the longest of the step’s 512 answers ends.
- The laptop showed the same: generation took 91–93% of step time, and 89% over steps 21–120 of Run 3, where the median answer was only 10 tokens.
- The timers account for the run: GSPO-A’s 177 iterations’ timers sum to 5,133 s of the run’s 5,277 s.
RL generation throughput
| Run | Answers | Generated tokens | Mean answer | Longest answer per step (median) | Wall time |
|---|---|---|---|---|---|
| GSPO-A | 23,040 | 2,078,901 | 90.2 tokens | 865 tokens (max 1,512) | 5,277 s |
| GSPO-B | 23,552 | 2,010,594 | 85.4 tokens | 597 tokens | 5,182 s |
In words: GSPO-A generated about 49 tokens per second on each GPU, counted over the whole run.
The numbers are GSPO-A’s generated tokens, its wall time and the GPU count. PocketRL’s 7B generated about 2,000 tokens per second on one H100, so mine was about 40× slower per GPU.
The causes I have numbers for:
- synchronous rollouts wait for the longest answer: a median of 865 tokens per step, while the average answer was 90 tokens;
- decoding ran without CUDA graphs: 68 ms per token at batch 1;
- an 8-way all-to-all for a model whose RL state would fit without it, by an unmeasured estimate (~51 GB per GPU);
- the training forward runs on rows padded to 1,536 tokens.
The control run, one H100, with CUDA graphs. Decoding took about 6 ms per engine step with graphs, against about 43 ms without. An update of 16 prompts × 8 answers took about 70 s over updates 1–50; the first took 147 s, start-up included. The gradient spike’s update took 85 s instead of about 65 s, because Megatron re-ran it to check it. The whole GSPO stage took 7,681 s: 100 updates, the evaluations at updates 50 and 100, a repeat evaluation and two saves.
Evaluation and SFT
| Job | Size | Time |
|---|---|---|
| SFT, 3 epochs | 104 steps | 651 s; median 3.2 s per step |
| SFT, 6 epochs | 208 steps | 988 s |
| Before-SFT evaluation (subset pass) | 1,430 problems, answers to the ~1,500-token stop | 686.7 s (start-up 228.9 s) |
| After-SFT evaluation, subset | 1,380 problems, greedy + 8 samples | 597 s |
| After-SFT evaluation, SVAMP and ASDiv whole | 707 problems | 550 s |
| Difficulty filter pass | 1,905 problems × 17 answers (about 80 tokens each) | 824 s |
| Control run, MATH-500 | 500 problems, greedy + 8 samples | 586 s |
| Control run, five other sets | 1,047 problems, greedy + 8 samples | 1,012 s (base), 923 s (update 100) |
The filter pass took half the 28 minutes I had estimated from the after-SFT evaluation’s rate of about 19 answers per second: its answers were short and batched well. In the control run’s five-set evaluation, the engine ran full at 128 requests, at about 6.6 ms per decode step.
Serving (8×H100, the GSPO-A model)
Greedy decoding in bf16, 256 tokens per answer with EOS off, 512 GSM8K test prompts.
| Mode | Requests | Time to first token | Time per output token | Throughput |
|---|---|---|---|---|
| One at a time (1 GPU, expert parallel 1) | 16 | 149 ms (p50) | 68.3 ms | 14.6 tokens/s |
| All at once (8 GPUs, expert parallel 8) | 512 | p50 6.5 s, p90 37.4 s (two groups of first tokens; cause open) | p50 271 ms | 1,731 tokens/s (216 per GPU) |
- KV cache: 16 KB per token in bf16 (16 layers × K and V × 4 KV heads × 64 dims × 2 bytes), in 256-token blocks of 4 MB. The engine had 5,119 usable blocks, room for 2,559 two-block requests; the batch was capped at the configured 512.
- Why batch 1 is slow: 68 ms per token is slow for a model with 1.22B active parameters on an H100. This path ran without CUDA graphs, so kernel launches are the likely cause; no step was profiled.
- Why the concurrent mode is slow per token: its 271 ms per token, at 64 requests per GPU, is not explained: the all-to-all and the experts’ grouped GEMMs at 8-way expert parallelism are candidates, and no step was profiled.
- The rehearsal’s shrunk model served at a 137 ms first token and 71.2 ms per token at batch 1; a 2-layer model says nothing about the full one.
Storage and I/O
| Measurement | Result |
|---|---|
| Training data on network storage, then in RAM | 19.15 s per step (123.3 TFLOP/s) against 5.74 s (371.6 TFLOP/s): 3.3× |
| The cause | Opening and closing the data file for every read, about 150 ms per close |
| RL log appends, one line at a time | 11.1 ms a line on the network volume, against 0.046 ms through one held handle: about 11 s per GSPO step |
| Full checkpoint, with optimizer state | 89.46 GiB in 44.6–54.3 s, about 1.8 GB/s |
| Weights-only checkpoint | 13.7 GB in 9.4–11.9 s, 1.2–1.5 GB/s |
| Pretraining data preparation, on the laptop | 2.6B tokens in 910.6 s, 2.86M training tokens/s |
With the data on network storage, one sample found 5 of the 8 GPUs at 0% utilization: they were waiting on the host. The rehearsal never showed this, because its volume was not this storage.
The laptop (RTX 3060, 6 GB)
| Measurement | Result |
|---|---|
| Generation, 128 answers at up to 256 tokens | About 9.25 s per step (of about 10 s) at every learning rate, set by the longest answer |
| fp32 against bf16 generation | 9.25 s against 5.60 s per 128-answer batch (1.65×) |
| Generated tokens per second when answers hit the 256 cap | From about 1,500 down to about 650 |
| Deterministic mode, on identical rollouts | 1.20× per step (generation 1.23×, update 1.04×) |
| Activation recomputation | +0.7% time per step; training peak 3,087 → 1,578 MiB |
| MoE (198M) against dense (64M) GSPO step | 18.2 s against 10.2 s |
What these numbers do not show
- One run each. No speed here was repeated across seeds or nodes.
- Rank 0 only. The PyTorch profiles cover one GPU of eight.
- No CUDA graphs on the main run. Megatron refuses full recomputation with CUDA graphs, so the MoE would need a different recomputation setting to use them.
- PocketRL’s 2,000 tokens per second comes from their 100-step profile, with answer lengths of about 1,000 tokens read off their Fig. 8.