Unit 1 of 9 · about 4 hours · explain, measure

Interconnects and topology: PCIe, NVLink, NVSwitch and RDMA

Every collective time in this section is bytes divided by the slowest link on its path plus latency. A wrong topology picture makes every later model wrong.

You'll be able to

  • Explain how PCIe, NVLink and NVSwitch paths differ in bandwidth, latency and CPU involvement, and where RDMA removes the CPU from the path.
  • Predict which hop bounds a stated exchange from a topology dump, and state the directional bandwidth assumption behind the prediction.
  • Detect a silent fallback from GPUDirect RDMA to TCP sockets from logs and module checks.

Covers

PCIe, NVLink, NVSwitch and intra-node topologyNICs, RDMA, InfiniBand or Ethernet and scale-out topologyDirectional bandwidth, latency, contention and topology assumptions
1

Read

In this order, only the parts listed

0 of 4 done

  1. Scale-up fabric: NVLink and NVSwitchAI Systems Performance Engineering - Chapters 4, 15, 17 and 18

    Chapter 2, NVLink and NVSwitch

  2. RDMA, NICs and multinode connectivityAI Systems Performance Engineering - Chapters 4, 15, 17 and 18

    Chapter 4, High-Speed, Low-Overhead Data Transfers with RDMA; Tuning Multinode Connectivity; Multinode Communication Pitfalls

  3. Topology detection and peer accessNCCL

    Topology detection and GPU-to-GPU communication: confirm peer access before trusting any bandwidth number

  4. Recording the topology NCCL sawNCCL

    NCCL_TOPO_DUMP_FILE and NCCL_TOPO_FILE: dump the detected graph with every measurement

2

Focus on

  • Bandwidth numbers are directional unless stated otherwise. An 800 Gb/s NIC is 100 GB/s of line rate in one direction before headers and congestion, and a Gen4 x16 link is about 32 GB/s per direction from lane arithmetic.
  • The book's hierarchy example (two NVLink pairs joined by PCIe) reduces on the fast pairs first so the slow link carries only a fraction of the data. Sketch which exchange crosses PCIe before running anything.
  • GPUDirect RDMA lets the NIC read and write GPU memory without CPU copies. A container without InfiniBand devices or with mismatched GIDs silently falls back to TCP sockets, which run far below the RDMA rate on the same fabric. Confirm NET/IB rather than sockets in the log before quoting any rate.
  • A Blackwell GPU advertises about 1.8 TB/s of NVLink aggregate across 18 links, which is bidirectional aggregate or 900 GB/s per direction. Per-direction phrasing of 100 GB/s per link contradicts that aggregate; use the aggregate and halve it.
Common mistakes · 3
  • Quoting 1.8 TB/s as per-direction NVLink bandwidth. It is bidirectional aggregate; per-direction peaks are half that, and sustained rates are lower under imbalance.
  • Assuming x16 width. A link negotiated at x8 has half the bandwidth of the same generation at x16, and links drop to a lower generation when idle. Read both under load with nvidia-smi --query-gpu=pcie.link.gen.current,pcie.link.width.current --format=csv; an RTX 3050 6 GB desktop board reported Gen4 x8 under a copy load and Gen1 when idle.
  • Trusting a bandwidth number while the path fell back to TCP. Check NCCL_DEBUG=INFO for NET/IB versus sockets and lsmod | grep nvidia_peermem for the peer-memory module.
3

Try it yourself

Closed-book, before checking anything

From a blank page, sketch the four-GPU hierarchy example (GPUs 0-1 on one NVLink pair, 2-3 on another, PCIe between pairs) and state which exchange crosses the slow link and why it carries only a fraction of the data. Then capture nvidia-smi topo -m on your hardware and label each GPU pair with its path.
4

Quiz yourself

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

0 got · 0 missed

  1. 1.GPUs 0-1 share NVLink, 2-3 share NVLink, and only PCIe joins the pairs. Where does a hierarchical all-reduce put most bytes?Answer

    On the two NVLink pairs first, then one exchange across PCIe per pair, then redistribution inside each pair. The slow link handles a fraction of the data rather than every byte.

  2. 2.What line rate in GB/s does an 800 Gb/s link imply, and why is it not a measurement?Answer

    800 divided by 8 is 100 GB/s of line rate. Headers, encoding, congestion and software overheads sit below it, so sustained goodput needs a measurement.

  3. 3.Which two checks expose a silent RDMA-to-TCP fallback?Answer

    NCCL_DEBUG=INFO showing socket transport instead of NET/IB paths, and a missing peer-memory module under lsmod | grep nvidia_peermem. Either one invalidates the RDMA bandwidth assumption.

  4. 4.A Gen4 x16 link is quoted at 64 GB/s. Is that per direction?Answer

    No. Lane arithmetic gives about 32 GB/s per direction (16 lanes at 16 GT/s with 128b/130b encoding). 64 GB/s is the bidirectional sum.

5

Practice

You're done when

Your sketch predicts the slow hop before you run, the dump confirms the path, and you can state every quoted rate as per-direction or bidirectional with its assumption.

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

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

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