advanced25 min studyLesson 485 in Engineering

Hierarchical collectives and topology

Map local and cross-node phases onto real paths, shared links, and memory systems instead of treating accelerator connectivity as one uniform bandwidth.

On this page

What you’ll understand

  • Distinguish logical collective edges from physical link paths.
  • Apply an explicit bottleneck-cut transfer bound.
  • Budget local and inter-node phases without multiplying shared bandwidth incorrectly.

A training job can span fast local accelerator links, host bridges, NICs, switches, and several network rails. A hierarchy tries to exploit those differences by combining or distributing data locally before using expensive cross-node paths. Its benefit depends on the actual mapping and shared bottlenecks. Counting GPUs or adding advertised link rates is not enough to establish the bandwidth available to a collective.

Topology is a resource graph with shared paths

A logical neighbor exchange may traverse several physical links, and several logical edges may share one NIC or switch uplink. A rank-to-device placement determines which paths are used. Include GPU proximity to NICs, host NUMA placement, peer-access support, and routing policy when interpreting a slowdown. A topology diagram with many connections does not prove that all links can simultaneously sustain their individual headline rates. Direction, contention, protocol, and supported transport mechanisms determine which capacities can be combined.

For a chosen algorithm, count the data that must cross a specific cut or bottleneck in one direction. Dividing those bytes by the usable aggregate directional capacity gives a transfer lower bound. The counted D must match the selected schedule or a justified semantic lower bound; do not simply use the total tensor bytes resident in every GPU. In-network reduction, sharding, and local aggregation can change crossing traffic. Startup and local processing add time beyond this bandwidth bound, and multiple sequential bottlenecks may require a richer path model.

T≥DcutBcutT\ge\frac{D_{\rm cut}}{B_{\rm cut}}
D_cut is required bytes crossing a specified cut in the counted direction and B_cut its usable aggregate directional bytes/s for that traffic. The bound outputs seconds and assumes the byte accounting matches the algorithm. It excludes startup, reduction work, and other dependencies.↔ Scroll wide equations horizontally.

A hierarchy changes where work is performed

A simple hierarchical design reduces data within each node, performs an inter-node reduction among selected representatives, and distributes the final result locally. Other designs shard work across several representatives or rails. A single representative can simplify cross-node traffic but become limited by its own local memory or NIC path. More representatives do not create more external bandwidth if they share the same constrained uplink. Count both communication volume and the resources serving each phase before attributing a result solely to the word hierarchical.

The phases may execute sequentially, pipeline by chunks, or overlap in supported implementations. A sequential sum is a useful explicit model, while a pipelined design needs its critical-path and shared-resource analysis. Local reduction consumes accelerator memory bandwidth and arithmetic resources too. When an inter-node network is very fast, that local stage can become the dominant cost. Implementation and architecture versions matter: NCCL may choose different supported algorithms and transports depending on discovered topology and configuration, rather than following a hand-drawn two-level schedule.

Tsequential=Tlocal reduce+Tinter+Tlocal distributeT_{\rm sequential}=T_{\rm local\ reduce}+T_{\rm inter}+T_{\rm local\ distribute}
All terms use seconds for a stipulated nonoverlapped three-phase hierarchy. This is not a universal equality for NCCL: chunk pipelining, hardware assistance, shared paths, and overlap can change the critical path. Each phase needs its own supported cost model.↔ Scroll wide equations horizontally.

Separate local memory ceilings from network measurements

A communication-heavy application can still be limited by device memory movement while reducing or staging data. Measure that category separately from NIC bytes and protocol time. An optimization that lowers cross-node traffic can increase local reads, copies, or temporary storage. Record the selected rank mapping, network interfaces, library/runtime versions, and payload when comparing runs. Use hypothetical rates for teaching unless measured evidence supports a particular product claim; a vendor link label alone is not the sustained per-job bandwidth of a shared fabric.

The roofline lab isolates a local numeric-kernel ceiling, with bytes counted between the last-level cache and main memory. Reset, set both I=0.5 FLOP/byte and B=100 GB/s, predict 50 GFLOP/s, then Play or Step. Separately Reset, set both I=0.5 and B=200, predict 100 GFLOP/s, then Play or Step. The compute roof remains a synthetic 1,000 GFLOP/s. This does not model NIC bandwidth, a topology, or a collective; it illustrates a possible local stage that must be measured separately from cross-node traffic.

A single NIC remains one shared external resource

A stipulated four-node hierarchy first reduces locally, then runs a representative ring with a 128 MiB input per node. Each node has one hypothetical effective 25 GiB/s directional network path. Local reduction takes two milliseconds and local final distribution another two. Ignore inter-node startup.

  1. For four representatives, the ring send volume per node is 2×3/4×128=192 MiB. Local aggregation means this count uses the representative's full 128 MiB summary, not four unrelated copies of the same summary.

  2. At 25×1,024 MiB/s, the modeled inter-node transfer is 192/25,600 s=7.5 ms. Adding more local senders sharing that one bottleneck does not multiply its capacity.

  3. Under the stipulated sequential hierarchy, total modeled time is 2+7.5+2=11.5 ms. Startup, local reduction details, multi-rail schedules, contention, and pipeline overlap would require additional terms or a different model.

The result

The transfer convention and the shared physical cut determine the bandwidth argument. Local stages remain part of the total operation.

Explore the model

Interactive lab

Interactive lab · roofline

A local reduction can have its own memory ceiling

Reset, set both I=0.5 FLOP/byte and B=100 GB/s, predict 50 GFLOP/s, then Play or Step. Separately Reset, set both I=0.5 and B=200, predict 100 GFLOP/s, then Play or Step. Both use a last-level-cache/main-memory boundary and fixed synthetic compute roof; this is not a fabric or collective solver.

A local reduction can have its own memory ceilingSynthetic roofline ceiling min(1000, B·I), in GFLOP/s, with B in decimal GB/s and I in FLOP/byte. Playback traces the roof without changing the selected kernel. This upper-bound model is not a measured throughput prediction, hardware comparison or price model. Current readings: Attainable ceiling: 640 GFLOP/s; Ridge intensity: 12.5 FLOP/byte; Ceiling regime: Memory-bound ceiling. All parameters are adjustable with the labeled controls below.Hypothetical roofline upper bound: 640 GFLOP per second at operational intensity 8 FLOP per byte and bandwidth 80 gigabytes per second.0.1110641101001000Operational intensity · FLOP/byte · log scaleCeiling · GFLOP/s · log scalePeak: 1000
Attainable ceiling / kernelBandwidth roof / traceCompute ceiling
Attainable ceiling
640 GFLOP/s
Ridge intensity
12.5 FLOP/byte
Ceiling regime
Memory-bound ceiling
t = 0 s

Synthetic roofline ceiling min(1000, B·I), in GFLOP/s, with B in decimal GB/s and I in FLOP/byte. Playback traces the roof without changing the selected kernel. This upper-bound model is not a measured throughput prediction, hardware comparison or price model. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forLocal memory work and network transfer are different resource boundaries and need separate evidence.

Check your understanding

Two GPUs send through the same single saturated NIC path. Why is adding their advertised GPU-link rates not a valid external-throughput estimate?

Try it yourself

A chosen schedule must send 300 MiB across a directional cut that can sustain 15 GiB/s for this job. Compute the transfer lower bound and name two excluded costs.

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

Convert the bandwidth to 15×1,024 MiB/s.

Compare with the solution

The bound is 300/15,360 s=0.01953125 s, or 19.53125 ms. Startup, reduction arithmetic, local device-memory movement, routing contention, and dependency waits can add time. The calculation is about the stipulated crossing traffic and available cut capacity, not an arbitrary product's measured collective performance.

Take it with you

  • Map logical communication onto shared physical resources.
  • Use matching directional byte counts and usable cut capacity.
  • Include local reduction and distribution work in a hierarchical critical path.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.