epoch.training← the field guide

Field Guide · Part III — The modern stack · 20

// the whole job

Finding the bottleneck you actually have

Everyone's instinct is to make the compute faster. Almost always, the compute isn't the problem. The bottleneck is somewhere you didn't look — and the only way to find it is to measure before you touch anything.

This is the last page, and it's the one that ties the other nineteen together. Everything this guide has covered — the scheduler, the parallel filesystem, the interconnect, the GPUs, memory bandwidth, quantization, agents — is a potential bottleneck. On any real job exactly one of them is the constraint at any given moment, and it is rarely the one you'd guess. The whole discipline of making things fast reduces to a single habit: find the actual bottleneck before you optimize anything. Optimize the wrong thing and you spend a week making the fast part faster while the slow part sets your wall-clock unchanged.

Why intuition is usually wrong

Programmers assume the bottleneck is compute because compute is what they wrote. But a modern node can do arithmetic far faster than it can feed itself data. The real limit is usually elsewhere:

Leiserson et al., in their 2020 Science survey of where post-Moore performance comes from, make the structural version of this point: with the transistor free-lunch over, the gains now live at the "Top" of the stack — software, algorithms, and how well work maps to hardware — not the "Bottom." Which is to say: the bottleneck moved into your code and your data movement. You have to go find it.

Measure first — the numbers overrule the story

The cardinal rule is that a measurement beats an argument every time. Before changing a line, profile: use perf to sample where CPU time goes, iostat and dstat to watch disk and network, and a timeline profiler like NVIDIA's Nsight Systems (nsys) to see CPU, GPU, CUDA calls, and memory traffic on one timeline. The timeline is where the truth lives — you can literally see the GPU sitting idle while a data-loader thread does all the work.

# Where is a GPU job actually spending time? Capture a timeline:
$ nsys profile -o run python train.py

# A common, damning result:
   GPU compute (kernels)  ......  22%   <-- what you tried to speed up
   Idle, waiting on input ......  61%   <-- the REAL bottleneck
   Host<->Device copies    ......  17%

# Conclusion: don't touch the kernel. Fix the data pipeline —
# prefetch, more loader workers, keep the GPU fed.
A profile that overrules intuition. The compute you wanted to optimize is 22% of the time; the job is starved on input 61% of the time. The fix is the data path, not the math.

Notice the arithmetic: even if you made those kernels infinitely fast, you'd cut only 22% of the wall-clock. Fix the 61% idle and you nearly triple throughput. That ratio — how much of the total does this part even represent — is the first question to ask of any optimization, and profiling is the only way to answer it honestly.

Why it matters: this is the through-line of the whole guide, and it's what separates people who run big machines from people who merely have access to them. A GPU cluster is a chain of subsystems — scheduler, storage, network, memory, compute — and the chain runs at the speed of its slowest link. The engineer who wins is not the one who knows the most about GPUs; it's the one who measures the whole job, finds the one link that's actually binding, and fixes that. Learn to profile before you optimize, and you'll never again waste a week speeding up the fast part.

Sources & where to go deeper

C. E. Leiserson, N. C. Thompson, J. S. Emer, B. C. Kuszmaul, B. W. Lampson, D. Sanchez & T. B. Schardl, "There's plenty of room at the Top: What will drive computer performance after Moore's law?", Science 368(6495), eaam9744, 2020 — where performance comes from once the transistors stop shrinking.
NVIDIA, Nsight Systems User Guide, NVIDIA Developer Documentation — system-wide timeline profiling of CPU, GPU, I/O, and memory traffic.

That's the field guide — twenty pages.

The workshops go deep on the real thing — scheduling, storage, interconnect, GPUs, and finding the bottleneck that's actually limiting your job — hands-on, on real infrastructure, from someone who's run these machines at national scale.

See the trainings →