Unit 10 of 10 · about 3 hours · measure
Throughput, latency and memory trade-offs across schedules
Throughput, latency and memory pull in different directions across schedules. This unit turns the section's derivations into a measurement discipline with stated setups.
You'll be able to
- Measure bubble, memory, transfer and step time across stages, microbatch counts and schedules on a stated setup.
- Explain why a smaller theoretical bubble can leave measured throughput flat.
- Keep analytical predictions and measured results distinct with residuals stated.
Covers
Read
In this order, only the parts listed
0 of 4 done
- Throughput scaling with microbatch countUltra-Scale Playbook - Pipeline Parallelism
Throughput scaling pages with FIG.L: microbatches at or below pipeline degree minus one hurt and fall with more stages, many more microbatches help low degrees, and the target global batch size caps the ratio; the plotted numbers are the authors' cluster results, read them as method
- Cluster recipes with pipeline degreesHow to Scale Your Model - Pipeline Parallelism in Chapter 5
Pipeline Parallelism examples: 16-way pipeline with 2-way ZeRO-1 data parallelism, and 8-way tensor plus 16-way pipeline plus 128-way ZeRO-1 data parallelism, as cited cluster recipes with stated batch sizes
- What the 20x claim comparesMemory-Efficient Pipeline-Parallel DNN Training
Abstract and Section 5 (arXiv:2006.09503v3): the up-to-20x figure is against non-pipelined model-parallel baselines (tensor model parallelism and inter-layer model parallelism) on up to 64 16-GB V100s, not a schedule-versus-schedule speedup; against GPipe the gain is up to 3.2x
- Measurement contract from the subsystem projectDistributed Training Subsystem - Pipeline Scheduler
Milestone E: predict versus measure bubbles and imbalance, compare candidate layouts on the available tier, and keep analytical and measured results distinct
Focus on
- Vary one thing at a time: stages, microbatch count, schedule or recompute, while the global batch, dtype and backend stay fixed and equivalence still passes.
- Report the full row per configuration: predicted bubble, peak live activations, transfer bytes, measured step time, and the equivalence result with its tolerance.
- Name the setup on every number: hardware, PyTorch version, backend, world size, stage and microbatch counts, schedule and settings.
- CPU gloo timings bound nothing about GPU links: they check schedule logic and equivalence, never interconnect behavior.
Common mistakes · 3
- Reporting CPU gloo step times as interconnect evidence. They say nothing about NVLink or InfiniBand behavior.
- Quoting paper or Playbook speedups as expected learner results. They are author-cluster numbers under fixed recipes.
- Tuning the microbatch count on the simulator and skipping the equivalence gate. A faster schedule with wrong gradients is a bug, not a trade-off.
Try it yourself
Closed-book, before checking anything
Quiz yourself
Answer first, then mark it. Missed ones go to Review.
0 got · 0 missed
1.Microbatches at or below pipeline degree minus one: what does the scaling plot show, and why?Answer
Low throughput that falls as stages grow. Too few microbatches leave the pipe mostly bubble, so extra stages add idle time without useful work.
2.What caps the microbatch count in practice?Answer
The target global batch size: microbatch size times microbatch count times data-parallel degree is fixed by the recipe.
3.A smaller theoretical bubble leaves measured throughput flat. What are the first three suspects?Answer
Point-to-point transfer sitting on the critical path, small-kernel launch overhead, and host or data starvation stalling the first stage.
4.What must every measurement entry name?Answer
Hardware, PyTorch version, backend, world size, stage and microbatch counts, schedule, dtype and settings. Measured numbers are labeled examples, never targets.
You're done when
Your table fills one full comparison with setups stated, residuals explained, and equivalence passing on every row.
Only when you can do this without notes.
Leads to
Notes
Resources · 4 for this unit, 8 more in the section
- Ultra-Scale Playbook - Pipeline ParallelismHugging Face · primary
Read Pipeline Parallelism through All forward, all backward, One forward, one backward, Interleaving stages and Zero bubble and DualPipe. Derive bubble fraction and peak activation count for your simulator before running any schedule.
- How to Scale Your Model - Pipeline Parallelism in Chapter 5Google DeepMind · support
Work the pipeline bubble and communication examples in Chapter 5. Use them to test your cost model under different stage counts, microbatch counts and imbalanced layers.
- Memory-Efficient Pipeline-Parallel DNN TrainingNarayanan et al. (ICML 2021) · support
Read the PipeDream-Flush (1F1B) schedule and its activation-memory bound. Compare its stashed-activation count with GPipe in your simulator.
- Distributed Training Subsystem - Pipeline SchedulerRoadmap-Final · support
Complete the scheduler, event trace, activation-lifetime accounting and failure injection required in Milestone B. Keep the simulator runnable without GPUs.
Also in this section
- Picotron - Pipeline ParallelismHugging Face · required
Read pipeline_parallel/pipeline_parallel.py and pp_communications.py beside the pipeline branch in train.py. Build a schedule event simulator first, then reproduce GPipe and 1F1B with shape, tag and ordering assertions.
- Picotron Tutorial - Steps 7 and 8Hugging Face · support
Read
step7_pipeline_parallel_afabandstep8_pipeline_parallel_1f1bwith their diffs; the video series stops before pipeline parallelism. - TorchFeather - Pipeline Minimal Example and RuntimeTorchFeather · required
Run
minimal_examples/pp_gpipe.pywith 8 Gloo processes on CPU (two stages by four replicas); it checks outputs and averaged gradients against a reference. Read its taggedisendandirecvcalls, thendistributed/pipeline_parallel.py, and compare the event order with Picotron. - First-Principles Video - Pipeline Parallelism SegmentUmar Jamil · support
Watch 06:06:17 for pipeline parallelism and 06:26:52 for GPipe, 1F1B and zero-bubble schedules. Stop after GPipe and 1F1B to draw and test those event traces; zero-bubble implementation remains depth work.
- PyTorch Pipeline Parallelism TutorialPyTorch · required
Complete the tutorial and compare
ScheduleGPipeandSchedule1F1B, then read https://docs.pytorch.org/docs/2.14/distributed.pipelining.html for the interleaved, looped, zero-bubble and DualPipeV schedules the tutorial omits. Preserve the model split, microbatch and loss contracts before adapting it. - GPipe: Efficient Training of Giant Neural Networks using Pipeline ParallelismHuang et al. (NeurIPS 2019) · support
Read the partitioning, microbatching and re-materialization design and the bubble overhead statement. Use it as the fill-drain specification your simulator reproduces.
- Zero Bubble Pipeline ParallelismQi et al. (ICLR 2024) · support
Read the split of backward into input and weight gradients and the handcrafted schedules. Optional vocabulary for zero-bubble and DualPipe schedules.
- TensorTonic - Pipeline Bubble UtilizationTensorTonic · support
Solve the pipeline bubble utilization problem, then extend its model to 1F1B and interleaved stages in your simulator.