Unit 6 of 9 · about 4 hours · measure
Rank-aligned timelines, stragglers, congestion and partial failure
Multi-rank runs fail as one unit: the slowest rank sets collective time and one mismatched call hangs all ranks. Aligned timelines are the only evidence that separates a slow peer from a slow fabric.
You'll be able to
- Attribute a slow collective to a straggler, congestion, CPU affinity or an ordering failure from rank-aligned timeline evidence.
- Apply timeout, abort and retry contracts correctly, and mark the measurements a partial failure invalidates.
Covers
Read
In this order, only the parts listed
0 of 4 done
- NCCL failure modes and debuggingAI Systems Performance Engineering - Chapters 4, 15, 17 and 18
Chapter 4, Multinode Communication Pitfalls; NCCL Communicator Lifecycle and Environment Gotchas; Profiling and Debugging NCCL
- Logging and subsystem filtersNCCL
Logging levels with NCCL_DEBUG and filtering by subsystem (GRAPH, COLL, NET, TUNING): separate init hangs from network faults from performance issues
- Performance and affinity triageNCCL
Intra-node versus inter-node issues with CPU and memory affinity: pin NIC handling to the NUMA node beside the NIC and GPU before blaming the fabric
- Straggler injection demoAI Systems Performance Engineering companion code - Chapters 4, 15 and 17
barrier_straggler_multigpu.py: one slow rank stretches the collective; inspect how barrier timings isolate itInspect with two GPUs as an illustration. With one GPU, use the analytical straggler model checked against published nccl-tests results, or a recorded public trace, and label it simulation. Full straggler statistics need more ranks; the section mini-project runs them.
Focus on
- Correlate the same collective sequence across ranks: matching start-order with one late rank is a straggler, while all ranks slow together with switch counters rising is congestion. A barrier probe before the collective separates the two.
- Collective mismatch (different counts, datatypes or call order on some rank) hangs rather than errors. Check the matched-call contract before the network whenever all ranks stall at the same call.
- InfiniBand patience has a number:
NCCL_IB_TIMEOUT20 means about 4.3 seconds per attempt and 7 retries total about 30 seconds before a network error. Set timeouts from that product, not from habit. - In NCCL, asynchronous errors surface by polling
ncclCommGetAsyncError, and recovery goes throughncclCommAbortrather than reusing a suspect communicator; PyTorch wraps this behindTORCH_NCCL_ASYNC_ERROR_HANDLING. Timings collected across an abort are invalid results, not slow results.
Common mistakes · 3
- Averaging rank times into one number. The mean hides the straggler that sets collective time; report per-rank durations with the max identified.
- Blaming the fabric for an affinity fault. Unpinned NIC handling on the wrong NUMA node reproduces congestion-like symptoms with healthy links; the tuning page lists affinity before fabric claims.
- Retrying on a suspect communicator after a fault. Abort it and rebuild; a reused communicator can hang the retry and convert one failure into a full-job stall.
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.Seven ranks finish a collective in 4 ms and one takes 40 ms. Straggler or congestion?Answer
Straggler. Congestion slows ranks together with fabric counters rising; one late rank with the rest aligned points at that peer, confirmed by a barrier probe that shows the same skew without data movement.
2.What does
NCCL_DEBUG_SUBSYS=GRAPHshow thatWARNalone does not?AnswerThe detected topology graph and the ring and tree paths NCCL built. Algorithm and protocol choice is the TUNING subsystem, so enable both: WARN reports the failure, GRAPH and TUNING explain the plan behind it.
3.How long does NCCL wait on InfiniBand before raising a network error at defaults?Answer
About 30 seconds: timeout 20 gives about 4.3 seconds per attempt times 7 retries. Change either variable deliberately and record both.
4.All ranks hang inside the same all-reduce with healthy links. What do you check first?Answer
The matched-call contract: same count, datatype and call sequence on every rank. A mismatch hangs all ranks at that call with nothing wrong in the fabric.
You're done when
Given any slow-collective timeline you name straggler, congestion, affinity or mismatch with the confirming experiment, and no invalid post-abort timing survives in your results.
Only when you can do this without notes.
Leads to
Notes
Resources · 3 for this unit, 10 more in the 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 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 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.