4/11
Part 2 of 7 · Data parallel and sharded statesLearn

The traffic can hide behind the compute

Training costs about 6 operations per parameter per token: the scaling book counts 2 in the forward pass and 4 in the backward pass. Compare that with the network for one step of 4 million tokens on 64 GPUs. Each 8-GPU node has 400 GB/s into the InfiniBand network, 50 GB/s for each GPU, and the dense bf16 peak from the latency lesson is 989 TFLOPS.

# 400 GB/s into InfiniBand per 8-GPU node: 50 GB/s a GPU
gpus, ib = 64, 50e9
# tokens in one training step
tokens = 4e6
# 6 operations per parameter per token, at 40% of the dense peak
compute = 6 * params * tokens / (gpus * 989e12 * 0.40)
for stage, factor in ((2, 1.0), (3, 1.5)):
    # 2 values a parameter each step, 2 bytes each, 1.5 times at stage 3
    moved = factor * 2 * params * 2
    print(f"stage {stage}: {moved / 1e9:,.0f} GB a GPU, {moved / ib:.1f} s on the network, {compute:.0f} s of compute")
Predict

Stage 3 moves 420 GB a GPU each step, at 50 GB/s. Is the network the bottleneck?

Pick one to see what it prints.
Pick an answer above to see the rest