Unit 9 of 9 · about 4 hours · implement, measure
Communication measurement contracts and analytical or CPU simulation
One timed all-reduce proves nothing: clocks drift, fabrics are shared and algorithm bandwidth is not link rate. The contract makes a communication number reproducible; simulation keeps work moving when ranks are missing.
You'll be able to
- Run a bandwidth and latency sweep contract with topology, clocks, warmup and raw trials recorded, and fit the latency-bandwidth model to it.
- Build an analytical or CPU simulation of a collective or transfer path, and label exactly what it cannot prove without ranks.
Covers
Read
In this order, only the parts listed
0 of 4 done
- Sweep harness and the two bandwidthsNCCL
README Tests section: clone nccl-tests and run
build/all_reduce_perf -b 8 -e 256M -f 2 -g <ngpus>; report algorithm bandwidth beside bus bandwidth with the topology dump - Bandwidth contract and expectationsAI Systems Performance Engineering companion code - Chapters 4, 15 and 17
The
bandwidth_benchmark_suitefiles with expectations JSON: preflight checks, clock capture, warmup separation and raw-trial storage through the harness - Tuning and logging disciplineNCCL
Intra-node versus inter-node triage with CPU and memory affinity; confirm
NET/IBpaths underNCCL_DEBUG=INFObefore quoting any rate - Single-host simulation stand-insAI Systems Performance Engineering companion code - Chapters 4, 15 and 17
placement_sim.pywithdisaggregated_inference_single_common.py: analytical placement and single-host transfer projection when ranks are unavailable
Focus on
- Record the full contract with every sweep: message sizes, ranks, topology dump, NCCL version, clocks with power and thermal state, warmup, interleaved repeated trials with raw samples, and medians. Boost clocks drift with temperature, so one best timing is not evidence.
- Fit and to wire bytes per rank (for ring all-reduce ), never to . Predict one held-out size and report the error; a fit that cannot predict is a description, not a model.
- Algorithm bandwidth is over time; bus bandwidth corrects for the collective's wire factor. Quote both with the factor stated, and never present either as the link rate without the correction.
- Simulation (analytical projection,
placement_sim, single-host handoff, CPU MPI from the earlier unit) proves indexing, volumes and crossover logic. It cannot prove contention, stragglers, affinity or failure behaviour; label those as unmeasured.
Common mistakes · 3
- Quoting bus bandwidth as achieved link rate. The correction factor runs the other way: back out wire bytes first, then compare against the directional peak with contention noted.
- Benchmarking once at a cold clock and keeping the best run. Interleave repeated trials across configurations and report medians with spread; drift between first and last trial is a finding, not noise to delete.
- Publishing cluster-scale numbers from a single host. Numbers for hardware without ranks are derivations with stated assumptions or cited vendor peaks for named hardware, never measurements.
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.A sweep reports algorithm bandwidth 60 GB/s for an 8-rank ring all-reduce. What was the per-rank wire rate?Answer
Wire bytes per rank are , so the wire rate is GB/s of bytes on the wire per rank. Compare that, not 60, against the directional peak.
2.Why interleave trials across configurations instead of running each once?Answer
Clocks, temperature and shared-fabric load drift over minutes. Interleaving spreads the drift across configurations so medians compare states fairly; single runs compare different machines in effect.
3.What does
NCCL_DEBUG=INFOconfirm before a rate is quotable?AnswerThat the intended transport is active: NET/IB paths for RDMA rather than socket fallback, the topology NCCL detected, and the algorithm and protocol selected.
4.What can a single-host analytical simulation establish, and what can it not?Answer
It establishes volumes, crossover logic, placement feasibility and indexing correctness. It cannot establish contention, straggler tails, affinity effects or failure handling, which need ranks.
Practice
- nccl-tests
all_reduce_perfbounded sweep with latency-bandwidth fitRun
build/all_reduce_perf -b 8 -e 256M -f 2 -g 2with two GPUs; record the topology dump, NCCL version and clocks; fit the latency-bandwidth model and predict one held-out sizeWith one GPU, run the ch04 single-host bandwidth baseline with the analytical projection checked against published nccl-tests results instead and label it simulation.
You're done when
Your sweep predicts the held-out size within your stated error with the full contract attached, and every simulated number is labelled with what ranks would change.
Only when you can do this without notes.
Leads to
Notes
Resources · 2 for this unit, 11 more in the section
- AI Systems Performance Engineering companion code - Chapters 4, 15 and 17Chris Fregly · support
Use compatible examples from
code/ch04,code/ch15andcode/ch17for NCCL, topology, overlap and disaggregated inference. Run preflight checks, lock and record clocks through the harness, and mark unsupported transport or topology paths as explicit blockers. - NCCLNVIDIA · required
Study the collective API, communicator and topology behavior, then run a bounded nccl-tests message-size sweep when multiple GPUs are available. Correlate algorithm bandwidth, bus bandwidth and rank timelines with the - model.
Also in this section
- AI Systems Performance Engineering - Chapters 4, 15, 17 and 18Chris Fregly · primary
Read Chapter 4 on distributed networking communication, the parallelism parts of Chapter 15, and Chapters 17 and 18 on disaggregated prefill and decode and KV-cache transfer. Re-derive every volume and crossover for the hardware you actually have.
- AI Performance Engineering - Distributed InferenceWafer · reference
A curated index. Use Section 5 only to find primary papers for a communication mechanism you are measuring.
- UCSD CSE 291A/DSC 291 (Spring 2026) PA2 Part 2 - Tensor Parallel CommunicationUC San Diego · required
Build all-reduce and all-to-all from point-to-point MPI calls (Section 2.1), then the data split, layer initialization and naive model-parallel forward and backward communication (Sections 2.2 to 2.5) against the provided
mpi-test.pycases and pytest files. It runs on CPU processes with Open MPI andmpi4py. - CS336 Assignment 2 - Section 8.1 Communication PrimitivesStanford University · support
Work
alternate_ring_all_reduceand the communication-volume reasoning in Section 8.1 as a written check on your cost model. - TensorTonic Language Modeling from Scratch - collective problemsTensorTonic · support
Solve Simulate Distributed Collectives, Calculate Collective Effective Bandwidth, Synchronize Data-Parallel Gradients and Reconstruct a Column-Parallel MLP Layer after the collective units.
- GPU MODE - Collective CommunicationGPU MODE · support
Use Lectures 17, 67, 70 and 78 for NCCL, NVSHMEM, fault-tolerant collectives and multi-GPU Triton. Implement or inspect one communication mechanism only after the volume and topology model is written.
- DistServeDistServe Authors · required
Study prefill-decode interference, phase-specific parallelism and goodput optimization. Build a small simulator or measured two-pool experiment and test the key-value transfer crossover rather than reproducing the complete serving system.
- NVIDIA Inference Xfer LibraryNVIDIA · support
Inspect memory registration, transfer backends and metadata APIs as the state-movement layer for disaggregation. Run only supported local transports and compare measured transfer setup and steady-state cost with the model.
- DeepEPDeepSeek · depth
Reconstruct expert dispatch and combine paths, low-latency versus high-throughput modes and hardware assumptions. Test a small supported path only after a standard collective baseline and load-skew model exist.
- Splitwise: Efficient Generative LLM Inference Using Phase SplittingMicrosoft Research · support
Read arXiv:2311.18677v2 (ISCA 2024) for the phase characterization and the homogeneous and heterogeneous cluster designs. Test the throughput, cost and power claims as hardware-specific results, and compare its placement with DistServe on your workload.
- Mooncake: Trading More Storage for Less ComputationUSENIX FAST 25 · support
Study the KVCache-centric disaggregated architecture, the global cache with its transfer engine, and the prefill scheduling with early rejection. Test the effective-capacity claims as trace-specific results.