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

Single-node and multi-node bandwidth, latency, clocks and raw-result contractAnalytical and CPU simulation when multiple GPUs are unavailable
1

Read

In this order, only the parts listed

0 of 4 done

  1. 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

  2. Bandwidth contract and expectationsAI Systems Performance Engineering companion code - Chapters 4, 15 and 17

    The bandwidth_benchmark_suite files with expectations JSON: preflight checks, clock capture, warmup separation and raw-trial storage through the harness

  3. Tuning and logging disciplineNCCL

    Intra-node versus inter-node triage with CPU and memory affinity; confirm NET/IB paths under NCCL_DEBUG=INFO before quoting any rate

  4. Single-host simulation stand-insAI Systems Performance Engineering companion code - Chapters 4, 15 and 17

    placement_sim.py with disaggregated_inference_single_common.py: analytical placement and single-host transfer projection when ranks are unavailable

2

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.
3

Try it yourself

Closed-book, before checking anything

From three sweep points, fit and by hand, predict the time at a fourth held-out size, and state the hardware, toolkit and clock setup the fit depends on.
4

Quiz yourself

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

0 got · 0 missed

  1. 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. 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. 3.What does NCCL_DEBUG=INFO confirm before a rate is quotable?Answer

    That 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. 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.

5

Practice

  • nccl-tests all_reduce_perf bounded sweep with latency-bandwidth fit

    Run build/all_reduce_perf -b 8 -e 256M -f 2 -g 2 with two GPUs; record the topology dump, NCCL version and clocks; fit the latency-bandwidth model and predict one held-out size

    With 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/ch15 and code/ch17 for 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.py cases and pytest files. It runs on CPU processes with Open MPI and mpi4py.

  • CS336 Assignment 2 - Section 8.1 Communication PrimitivesStanford University · support

    Work alternate_ring_all_reduce and 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.