Multi-GPU Communication and Distributed Inference Performance
Beyond one GPU, topology, collective algorithms, transfer paths and load balance determine whether kernel gains survive. This stage models communication, profiles overlap and studies distributed inference mechanisms without duplicating full training or serving-platform ownership.
Section 9 of 10 · 9 units · about 40 hours
By the end you can Model and measure one collective or key-value transfer path across message sizes and topology, align multi-rank traces, quantify exposed communication or disaggregation crossover, and retain a single-GPU analytical route when hardware blocks execution.
Units
- Interconnects and topology: PCIe, NVLink, NVSwitch and RDMA4h
- Collective contracts and the latency-bandwidth cost model4h
- Ring and tree all-reduce, all-gather and reduce-scatter volume6h
- NCCL algorithms, protocols, channels and rank placement4h
- Compute-communication overlap and communication streams4h
- Rank-aligned timelines, stragglers, congestion and partial failure4h
- All-to-all and MoE dispatch, combine and load balance5h
- Prefill-decode disaggregation and KV transfer5h
- Communication measurement contracts and analytical or CPU simulation4h
Build it
Mini project · about 10 to 14 hours
Collectives, overlap and disaggregation across GPUs
Model collectives, sweep message sizes and prove overlap with two GPUs. With one GPU, fit an analytical model checked against published results instead, and label every such number as derived.
- 1Capture
nvidia-smi topo -mand label each GPU pair with its path. With two GPUs run the staging pair andnccl_benchmark.py; with one GPU fit an analytical model checked against published nccl-tests results, recording blockers with dumps in both cases. - 2Derive bytes and step counts for ring all-gather, reduce-scatter and all-reduce, with the latency-bandwidth crossover, then build
myAllreduceandmyAlltoallfrom point-to-point calls. Check them with the CPU MPI cases plus pytest, and solve the TensorTonic collective, bandwidth, gradient-average and column-parallel MLP problems. - 3Build nccl-tests against your PyTorch NCCL and run
all_reduce_perfwith two GPUs across algorithms and protocols, predicting each point first. Record the NCCL version and a topology dump per number, and set anyNCCL_ALGOorNCCL_PROTOoverride before the communicator is created. - 4Derive the exposed time for bucketed overlap under the dependency you state. With two GPUs run
ddp_overlap.pyagainstddp_no_overlap.pyundertorchrun, attributing the gap from rank-aligned timelines. - 5Collect rank-aligned timelines for one collective, name the straggler and its waiting cost, and confirm with a barrier experiment. Inject a straggler and a partial failure with two GPUs, record the abort procedure, and separate congestion from affinity with a placement swap.
- 6Derive per-layer dispatch and combine bytes with per-expert capacity under a stated factor, and show how one hot expert changes the maximum. Measure hot-expert behavior, apply the capacity policy, and record the rebalancing decision.
- 7Derive KV transfer time against TTFT and TPOT slack to call the disaggregation crossover. Fit latency and bandwidth terms from sweep points, predict one held-out size, and state the setup the fit depends on.
What you hand in
- Topology dumps with labeled paths, collective derivations with the crossover, and CPU MPI checks.
- The NCCL sweep with version and dump per number, overlap attribution and straggler runs with abort records.
- The MoE volume and rebalancing decision, the disaggregation crossover and the held-out fit prediction.
How to check it
- Self-grade with the rubric below
- CSE 291A PA2 Part 2 MPI tests
Run the
mpi-test.pycases and pytest files on CPU with Open MPI andmpi4py; keep thediscussion2-1.txttiming comparison.
How it's graded
Model before link claims
Pass: Ring derivations give bytes and steps with the crossover stated, the NCCL sweep names version and topology per number, and single-GPU runs are labeled simulation.
Great: The hierarchy sketch names which exchange crosses the slow link and why it carries less data.
Overlap and straggler proof
Pass: The exposed-time derivation states its dependency, overlap is attributed from aligned timelines, and the straggler with its waiting cost is confirmed by a barrier experiment.
Great: The partial-failure run records how the failure was detected and how the job aborted.
Skew and crossover decisions
Pass: MoE dispatch and combine volumes with the capacity policy support the rebalancing decision, and the crossover calls disaggregation against stated slack with transfer math.
Great: The held-out prediction is checked against measurement with the setup stated.
Resources
- AI Systems Performance Engineering - Chapters 4, 15, 17 and 18Chris Fregly
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.
- NCCLNVIDIA
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.
- UCSD CSE 291A/DSC 291 (Spring 2026) PA2 Part 2 - Tensor Parallel CommunicationUC San Diego
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. - DistServeDistServe Authors
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.
- AI Systems Performance Engineering companion code - Chapters 4, 15 and 17Chris Fregly
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. - CS336 Assignment 2 - Section 8.1 Communication PrimitivesStanford University
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
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
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.
- NVIDIA Inference Xfer LibraryNVIDIA
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.
- Splitwise: Efficient Generative LLM Inference Using Phase SplittingMicrosoft Research
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
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.
- DeepEPDeepSeek
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.
- AI Performance Engineering - Distributed InferenceWafer
A curated index. Use Section 5 only to find primary papers for a communication mechanism you are measuring.