Unit 7 of 13 · about 5 hours · derive

Bubble and imbalance cost, critical paths and overlap constraints

Cost categories and the Amdahl bound on end-to-end gain established why total work is not elapsed time. Composition makes the dependency graph and shared resources the planner's central objects.

You'll be able to

  • Derive ideal pipeline overhead and distinguish it from the idle fraction of elapsed time.
  • Compute makespan from a dependency graph with stage imbalance and communication resources.
  • Identify which transfers can overlap and which must finish before their consumers.

Covers

Pipeline bubble and stage-imbalance costCritical-path versus total-byte reasoningCommunication overlap and dependency constraints
1

Read

In this order, only the parts listed

0 of 2 done

  1. Bubble, microbatch size and composed schedulesEfficient Large-Scale Language Model Training on GPU Clusters Using Megatron-LM

    arXiv:2104.04473v5, Sections 2.2.1 to 2.2.2 and 3.1 to 3.4; Figures 3, 4 and 8

    Use the schedule and cost analysis. The A100 Selene results are source measurements, not targets for your machine.

  2. Where overlap assumptions enter the modelHow to Scale Your Model - Chapters 4 to 6

    Combining FSDP and Tensor Parallelism: forward/backward algorithm and the two assumptions before minimizing communication

    A maximum of costs is an ideal overlap bound, not a guarantee. Include first-layer gathers and last gradient reductions when constructing the full step.

2

Focus on

  • For balanced non-interleaved fill-drain with stages, microbatches, stage forward time and backward time , makespan is , ignoring transfers and update. Bubble overhead relative to ideal work is ; its elapsed-time fraction is .
  • Use the DT-6 event simulator with per-stage durations. The busiest stage limits steady-state throughput; embeddings, output projection and routed-expert skew can make equal layer counts unbalanced.
  • An asynchronous launch removes host waiting, not a tensor dependency. The consuming matmul waits for its gather or reduction. Overlap also needs independent resource capacity and enough ready compute.
  • The last gradient bucket can remain exposed even if earlier reductions overlap. Retaining parameters or adding prefetch can shorten waits while enlarging live memory.
Common mistakes · 3
  • Calling the paper's bubble-to-ideal-work ratio the fraction of elapsed step time. The denominators differ.
  • Replacing all compute and communication sums with a maximum. Dependent operations and shared links cannot overlap freely.
  • Charging bubble time twice, once in the simulator and again as an added analytic penalty.
3

Try it yourself

Closed-book, before checking anything

Simulate balanced fill-drain with four stages, eight microbatches, forward duration 1 time unit and backward duration 2 time units per stage, with zero transfer and update cost. Recover makespan 33, ideal work time 24 and bubble time 9. Then double one stage's durations and insert a positive receive dependency; recompute the makespan from events rather than reusing the balanced formula.
4

Quiz yourself

Answer first, then mark it. Missed ones go to Review.

0 got · 0 missed

  1. 1.What are the two bubble ratios in the synthetic balanced case?Answer

    Overhead relative to ideal work is , or 37.5%. The fraction of elapsed time is , about 27.3%.

  2. 2.Does non-interleaved 1F1B automatically remove the ideal fill-drain bubble?Answer

    No. Under the balanced ideal model it has the same bubble while reducing outstanding activation lifetimes.

  3. 3.A gather is shorter than total backward compute. Is that enough to hide it?Answer

    No. It needs ready independent compute in its own release-to-consumer window, sufficient buffers and uncongested resources.

You're done when

Your simulator reproduces the ideal case and explains an imbalance or blocked-transfer case through dependencies, without double-counting bubble or overlap.

Only when you can do this without notes.

Leads to

Notes

Resources · 2 for this unit, 11 more in the section
  • How to Scale Your Model - Chapters 4 to 6Google DeepMind · required

    Use Part 4 (transformer math), Part 5 (training parallelism) and Part 6 (LLaMA 3 case study) to independently estimate parameters, FLOPs, memory, communication, time and cost for one configuration, then the GPU rooflines in Part 12. Keep TPU constants labeled and compare its recommendation with the Playbook.

  • Efficient Large-Scale Language Model Training on GPU Clusters Using Megatron-LMNarayanan et al. (SC 2021) · required

    Read the composition of tensor, pipeline and data parallelism, the interleaved schedule and the performance analysis of parallel configurations. Check its guidance against your planner on one model and cluster.

Also in this section

  • The Ultra-Scale Playbook - 5D Parallelism and Finding the Best ConfigurationHugging Face · primary

    Study 5D Parallelism in a Nutshell, then Finding the Best Training Configuration (fitting a step in memory, reaching the global batch, optimizing throughput) at https://nanotron-ultrascale-playbook.static.hf.space/index.html#finding_the_best_training_configuration. Rebuild a small planner that enumerates legal DP, TP, CP, PP and EP degrees and ranks them by predicted memory and step time; its heatmaps are its own H100 cluster's results.

  • Picotron - 4D CompositionHugging Face · required

    Trace create_config.py, process_group_manager.py and train.py across DP, TP, PP and CP. Run the CPU 3D example or a smaller equivalent, assert group membership and compare observed event order with the planner.

  • First-Principles Video - Device Mesh Composition SegmentUmar Jamil · support

    Watch 08:37:34 on device meshes and combining pipeline with data parallelism. Reconstruct its rank-coordinate table and compare it with Picotron process groups and your planner output.

  • Distributed Training Guide - Chapter 7 FSDP plus TPLambda Labs · support

    Read the 2D FSDP plus TP path in 07-2d-parallel and explain why FSDP is applied after TP and what limits the TP degree. Running it needs several GPUs.

  • CS336 Assignment 2 (Spring 2026) - Section 8 Analyzing Parallelism StrategiesStanford University · required

    Solve data_parallel_calcs, fsdp_calcs, tp_calcs and fsdp_tp_calcs (Sections 8.2 to 8.5) with your planner, and reconcile any disagreement before trusting either.

  • Transformer Math 101 - Distributed TrainingEleutherAI · support

    Use the sharded-optimizer, 3D-parallelism and activation equations as a cross-check of your planner's memory terms.

  • TorchFeather - ParallelDims and Composition PlanTorchFeather · support

    Inspect distributed/parallel_dims.py and model/parallelize.py. Build the exact mesh product and divisibility table for one FSDP, TP, CP, PP and EP configuration, then identify ordering assumptions in its composition.

  • TensorTonic - Choose a Topology-Aware Parallel PlanTensorTonic · support

    Solve Choose a Topology-Aware Parallel Plan, then compare its memory and communication model with yours.

  • NanotronHugging Face · depth

    Inspect configuration, parallel context and trainer paths used by the Ultra-Scale benchmarks only after the planner works. Its "3D" means DP, TP and PP: there is no context or expert parallelism.

  • Bumblebee - Parallel State and CompositionBumblebee · depth

    Only as a possible capstone target: read primitive/parallel/ and the composition tests in a clean checkout to compare TP, EP, ETP, CP and PP contracts. Its multi-GPU paths are untested upstream.

  • HetPipe - Heterogeneous Partitioning and PlacementPark et al. · support

    Read arXiv:2005.14038v1 Section 4, Pipelined Model Parallelism Within a VW, for its Model Partitioning paragraph, Section 7, Partitioning Algorithm, and Section 8.1, Methodology, for resource allocation to virtual workers. Reuse device-specific compute, memory and placement constraints in a synchronous simulator; do not adopt its stale-weight update semantics or source speedups.