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
The question for today
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.
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.
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.
Work it through
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.
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.
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.
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 transfer convention and the shared physical cut determine the bandwidth argument. Local stages remain part of the total operation.
The living notebook
Explore the model
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.
- Attainable ceiling
- 640 GFLOP/s
- Ridge intensity
- 12.5 FLOP/byte
- Ceiling regime
- Memory-bound ceiling
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.
Pause & reason
Check your understanding
Your turn
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.
Keep the idea
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.