Blog
A place to share and bookmark notes on GPU scheduling, capacity planning for AI workloads, and the infrastructure behind large-scale ML.
All opinions are my own and do not represent those of my employer.
Part 0 — Foundations: The Utilization Problem and a Map of the Stack
- 0.0 · Compute: the Crown Jewel of AI InfrastructureCompute is expensive and scarce, but paid GPUs are not automatically useful GPUs. This series looks at the capacity and scheduling systems that close that gap.
- 0.1 · The 4-Layer Mental Model for AI ComputeA simple model that splits a compute cluster into four layers: reservation, provisioning, scheduling, and workload. The model turns 'my pod is Pending' into a diagnosis instead of a three-team argument.
- 0.2 · Why Is My Pod Stuck Pending? Looking into the failure pathThe same 'Pending' can come from any of the four layers. The scheduler often prints the same line for all of them, so the message alone won't tell you which one is broken.
Part 1 — Anatomy of a Compute Unit: What One GPU Server Gives You
- 1.1 · Compute: FLOPs, Precision, and the 10× Hidden in a Spec SheetThe same chip delivers a ~10× range of throughput depending on precision. The spec-sheet number is a ceiling, and most workloads never touch it.
- 1.2 · Memory: HBM Capacity and BandwidthThe second thing inside the accelerator: its memory. Two numbers — capacity (does it fit) and bandwidth (can you feed the compute) — and which one limits you depends on the workload, not the chip. This is why the FLOPs ceiling from 1.1 is rarely your speed.
- 1.3 · Intra-Node Fabric: NVLink and NVSwitchThe third component: the links between the GPUs inside one box. On a p5.48xlarge, 8 GPUs aren't 8 independent cards — NVLink wires them into one unit. The catch is that your software has to actually use that fast lane, or it silently falls back to a path ~14× slower.
- 1.4 · The Host: Everything Around the Accelerator1.1–1.3 were the accelerator itself; this is the machine around it — the CPU, system RAM, and local NVMe that feed the GPUs across a thin PCIe straw. We walk one training step through the host and see where each stage can stall.
- 1.5 · Inter-Node Fabric: Beyond the HostThe last piece: once a job outgrows a single box it crosses the datacenter network — a leaf-spine tree, not a flat wire. Two GPUs one leaf apart are a few switch hops closer than two GPUs across the spine, and a collective runs at the speed of its worst hop. So placement is a throughput decision.
Part 2 — Sharing Within One GPU: Small Jobs Like Inference
- 2.1 · One GPU, Many Jobs: The Case for SharingA whole accelerator handed to a job that uses a sliver of it is the most common waste; the fork between splitting in space and sharing in time.
- 2.2 · Sharing in Space: MIGCarve one physical H100 into isolated instances so two workloads run at once on a card a single job would hog — a step-by-step MIG demo, then the rigidity cost.
- 2.3 · Sharing in Time: MPS and Time-SlicingPack several sub-saturating jobs onto one GPU — MPS runs them truly concurrently, time-slicing rotates turns — with a step-by-step MPS-vs-time-slicing demo, then the shared-fault-domain cost.
- 2.4 · When Sharing Backfires: Isolation and InterferenceSharing only pays off if one job can't steal another's memory or tail latency; where each sharing mode's isolation breaks.
Part 3 — Placing Jobs Across the Cluster: Multi-GPU Training
- 3.1 · How a Scheduler Decides: Watch → Filter → Score → BindThe four-phase loop that places every GPU job — and where gang scheduling, fragmentation, and topology-aware placement all live inside it.
- 3.2 · Whole-Job Placement for Distributed Training: Gang SchedulingA distributed training job needs every piece placed simultaneously — partial placement deadlocks and wastes every GPU it grabbed.
- 3.3 · Keeping Big Jobs Placeable: Fragmentation and Bin-PackingFree GPUs you can't use because they're scattered: how placement policy decides whether big jobs ever fit.
- 3.4 · Lower Communication Cost for Multi-GPU Jobs: Topology-Aware PlacementWhere a job's ranks land on the fabric decides whether collectives ride NVLink or crawl across spine switches — topology-aware scheduling claims the fast path.
Part 4 — Sharing the Cluster Across Teams and Time: Reclaiming Idle Capacity
- 4.1 · Fair Shares: Quotas, Borrowing, and ReclaimGuaranteeing each team a floor without letting the cluster sit idle behind that guarantee — lend the spare, take it back on demand.
- 4.2 · Priority and Preemption: Who Yields When the Cluster Is FullNot enough to go around — who gets evicted, how, and why evicting too eagerly costs more than it saves.
- 4.3 · Co-locating Online and Offline WorkServing is provisioned for peak and idle most of the day; backfill it with batch without hurting latency.
- 4.4 · Riding the Daily Tide: Lend Off-Peak, Reclaim on DemandDemand has a daily rhythm; ride it instead of provisioning for peak and paying for the trough.
- 4.5 · Elastic Jobs: Grow and Shrink With Available CapacityJobs that expand into idle GPUs and contract when demand returns — absorbing the spare instead of leaving it idle.
Part 5 — Failure Recovery: Keeping Placed Work Alive
- 5.1 · Checkpointing: How Often to SaveSaving progress cheaply so an interruption costs minutes, not days — and the tradeoff between checkpoint overhead and lost work.
- 5.2 · Surviving Interruption: Reclaim, Preemption, and Graceful DrainGiving capacity back without losing work — spot reclaim, preemption, and the orderly cordon → drain → evict dance.
- 5.3 · Catching Bad Hardware Fast: Stragglers and Fail-SlowAt scale, hardware fails and slows constantly; detecting the fail-slow node before it burns a whole run's cycles.
Part 6 — Measurement and Economics: What Utilization Is and What Idle Costs
- 6.1 · Utilization Isn't One Number: Allocation vs Occupancy vs MFUThree numbers people all call 'utilization' that disagree — and which one tells you you're wasting money.
- 6.2 · The Cost of IdleA dollar figure on a single idle percentage point at fleet scale — the number that justifies the whole series.
- 6.3 · The Right Buying Mix: Reserved, On-Demand, and SpotWhy a paid commitment must run hot to beat on-demand, and when spot wins.
- 6.4 · Forecasting Demand to Size ReservationsHow much to reserve is a prediction problem; sizing committed capacity against forecast demand instead of guessing.
Part 7 — Synthesis