pytorch / profiling / distributed

Profiling-Driven Training Optimisation

An optimisation ladder where every rung has to clear its own measured noise floor before it counts. Run on CPU, on a rented NVIDIA L4, and across two A40s over NCCL.

Measured

tests
32
ladder rungs
10
skipped
0
devices
3
speedup
4.66x

The ladder on an NVIDIA L4

rungsamples/sspreaddata-waitvs prevseparable
baseline789.80.795%
workers3146.471.279%+298%yes
+persistent3003.623.780%-4.5%yes
+prefetch3072.820.479%+2.3%yes
+pin_memory3121.082.281%+1.6%no
+tf323174.783.681%+1.7%no
+amp (bf16)3682.7655.279%+16.0%no
+channels_last3527.6771.079%-4.2%no
+batch1283644.1666.588%+3.3%no
+compile3257.8672.490%-10.6%no

Separable means the change clears the spread of its own repeats. Six of nine rungs do not, and are reported as unestablished rather than quietly counted.

What this project actually found

One rung is the entire speedup

workers alone is +298%. Everything after it sums to about +17%, and only three of eight later rungs clear their own spread.

The GPU is starved for the whole ladder

Data-wait never drops below 79%, starting at 95%. Compute got roughly four times faster on the L4 and the dataloader did not, which is why every kernel-level rung lands in the noise.

A 41% win that was not real

CPU pinning measured +41.3% on a laptop. On a quiet machine the noise floor fell from 11.8% to 1.0% and the effect became +0.6%. It had been contention all along.

Throughput was a lucky proxy, not a good one

On the L4 the cheapest route to target accuracy ranks 4th of 5 by throughput. On CPU it ranked first on both, so the CPU never exposed the disagreement.

A prediction that was written down, then tested

The scaling study predicted its shape would transfer to NCCL and its numbers would not. Both held: throughput moved 51x, efficiency stayed in band, and the comm fraction went from noise to a quarter of the step.