Accelerators and Networking
An accelerator specification does not predict application performance. Peak arithmetic, memory capacity, and link rates are ceilings for particular operations under particular conventions. A useful performance claim must also name the workload, tensor shape, precision, software stack, topology, and measurement method. Change any of them and the bottleneck may move.
This chapter builds the hardware model needed to reason about that movement. It starts inside one accelerator, follows data through memory and interconnects, then shows how to measure the complete system. Parallel algorithms are covered in Chapter 10; cluster control, checkpointing, and the data plane belong to Chapter 65.
What an accelerator actually accelerates
An accelerator is not one large arithmetic unit. A host CPU starts the program, manages operating-system work, and launches device kernels. The device combines general-purpose parallel lanes, memory controllers, caches, and specialized matrix engines. On NVIDIA GPUs, groups of threads execute through the single-instruction, multiple-thread (SIMT) programming model. Other vendors use different names and execution details, so SIMT should not be treated as a universal accelerator instruction set (NVIDIA 2026).
A matrix engine performs tiled matrix multiply-accumulate operations. The tile shape, accepted input formats, accumulation precision, and instruction semantics vary by architecture. A systolic array is one possible dataflow design in which values move rhythmically through a grid of processing elements. Google's first TPU used a documented systolic matrix unit, but that fact does not establish the physical implementation of every GPU matrix engine or later accelerator (Kung 1982; Jouppi et al. 2017).
The kernel is the executable unit that turns this hardware into useful work. Performance depends on whether its tensor dimensions fit the available tile shapes, memory accesses coalesce, branches diverge, and enough independent work exists to occupy the device. Lower-precision inputs can reduce storage and traffic, and native low-precision matrix instructions can raise peak arithmetic. Those gains require compatible kernels and shapes. Casts, scaling, non-matrix operations, and numerical safeguards remain real costs (Micikevicius et al. 2022). Likewise, a structured sparsity peak applies only when the required sparsity pattern and supported instruction path are actually used. Dense and sparse peaks are not interchangeable.
The roofline is a bound, not a diagnosis
The roofline model relates arithmetic to data movement at one named memory boundary (Williams et al. 2009), where denotes the number of floating-point operations performed by a kernel and denotes the bytes transferred across that boundary. Their ratio is
where represents arithmetic intensity in FLOPs per byte. Here, denotes peak arithmetic throughput for the chosen instruction and precision, while denotes sustainable bandwidth at the same boundary. The resulting bound is
Here, the two ceilings meet at the ridge point
Below , data movement bounds throughput; above it, arithmetic can become the tighter bound. This does not make runtime equal to the bound. Launch cost, dependencies, occupancy, cache misses, imbalance, power limits, and unsupported tile shapes can all lower achieved throughput.
The byte count also needs a boundary. A kernel may have high intensity when traffic is counted at high-bandwidth memory (HBM), but low intensity at a cache level. Report whether means HBM traffic, host-device traffic, or network traffic, and use a measured sustainable bandwidth rather than silently substituting the vendor peak.
Capacity, bandwidth, latency, and traffic
Inside a typical GPU, data can move among registers, software-managed shared memory, cache, and device memory. The high-bandwidth memory (HBM), high-bandwidth memory packaged beside the accelerator, provides the large device-memory pool. These levels do different jobs:
- Capacity decides whether weights, gradients, optimizer states, activations, temporary workspaces, collective buffers, and allocator headroom fit at all. Serving adds the KV cache described in Chapter 31.
- Bandwidth limits how many bytes can cross a boundary per second under a given access pattern.
- Latency is the delay before a dependent access can be used. Parallelism can hide some latency, but not an unmet dependency.
- Traffic is the number of bytes the program actually causes to move. Kernel fusion, recomputation, sharding, caching, and layout can change it without changing a link's rated bandwidth.
Capacity is not bandwidth, and neither is utilization. A workload can fit in HBM yet run slowly because it repeatedly streams data. Another can be compute-bound even on a machine with the same HBM. State explicitly where traffic is counted before comparing results.
The same caution applies as data moves outward. The interactive below shows the conceptual hierarchy, not measured ratios. Actual systems differ in domain size, directionality, endpoint injection, and sustained throughput.
An interconnect is a stack
“The network” hides three separate design layers:
- Physical topology. Links and switches determine hop count, path diversity, failure domains, endpoint injection, bisection bandwidth, and oversubscription. A fast endpoint link does not make an oversubscribed fabric non-blocking.
- Transport. PCIe and NVLink move data within some systems; InfiniBand or Ethernet with RoCE move it across a scale-out fabric. The physical domain of each transport is product-specific. Some NVSwitch systems connect a small server, while newer designs can extend an NVLink domain across a rack (NVIDIA 2026).
- Collective library. Software such as NCCL maps logical operations onto available paths and algorithms. It is topology-aware, but it cannot create bisection bandwidth or repair a poor rank placement (NVIDIA 2026).
remote direct memory access (RDMA), remote direct memory access, lets a network adapter transfer data between registered memory regions without putting the host CPU on the data path. RoCE supplies RDMA semantics over Ethernet; InfiniBand supplies them in its own network stack. GPU-direct variants can expose GPU memory to a peer device, but memory registration, PCIe placement, drivers, and synchronization still matter (NVIDIA 2026). “Bypasses the CPU” describes the data path, not a system with no CPU setup or control work.
Scale-up and scale-out are therefore useful descriptions, not fixed synonyms for “inside a node” and “outside a node.” Record the actual endpoints and switches. Do not compare a bidirectional aggregate NVLink figure with a one-direction NIC rate, or an aggregate switch number with per-device injection.
Collectives have semantics and algorithms
A collective describes what a group of ranks receives:
- broadcast: copy one root's buffer to every rank;
- all-reduce: combine values across ranks and return the result to every rank;
- all-gather: concatenate every rank's shard at every rank;
- reduce-scatter: combine values and leave each rank with one result shard;
- all-to-all: send a distinct shard from every rank to every other rank.
These semantics do not choose the algorithm. An all-reduce may use a ring, a tree, a hierarchical composition, or another schedule. The library can also split one semantic operation into phases; reduce-scatter followed by all-gather is equivalent to all-reduce for matching reductions and layouts (NVIDIA 2026).
A simple latency-bandwidth model makes the trade-off visible. For a message of bytes,
where is the per-message startup latency and is seconds per byte, the reciprocal of effective bandwidth. Under an idealized ring with ranks, equal links, no contention, and no overlap, a large all-reduce is approximately
The ring is bandwidth-efficient for large messages because each rank transfers about bytes, but its phases make startup expensive for small messages (Patarasuk and Yuan 2009). A tree changes the latency term and traffic pattern. Real results also include protocol choice, chunking, reduction work, routing, congestion, and unequal links.
Communication overlaps compute only when the dependency graph exposes independent work and the runtime schedules both successfully. Bucket size, kernel duration, stream priority, memory pressure, and concurrent traffic alter the overlap window. Here, denotes isolated compute time, denotes isolated communication time, and denotes their overlap. The accounting identity is
makes the condition explicit. A profile may show a collective fully hidden in one model shape and exposed after a batch-size, placement, or software change.
Place a communication graph, not an acronym
Each parallelism method creates a different communication graph. The table gives common patterns, not fixed operation counts.
| Method | Common traffic | Placement question |
|---|---|---|
| Tensor parallelism | Layer-local all-reduce, reduce-scatter, all-gather, or point-to-point traffic, depending on the formulation | Can the frequent activation traffic fit the measured scale-up domain without making small-message latency dominant? |
| Sequence parallelism | Activation shards exchanged around operations that span the sequence dimension | Does the memory saved repay the extra collectives and layout changes? |
| Context parallelism | Attention key/value or partial-result exchange across context shards | How do sequence length, causal load balance, and ring or all-to-all traffic map to the topology? |
| Expert parallelism | Dispatch and combine all-to-all traffic | Can placement and capacity absorb skewed expert loads and bursty bisection demand? |
| Data parallelism | Bucketed gradient reductions, often overlapped | Is one replicated model affordable, and which buckets expose communication? |
| Fully sharded data parallelism | Parameter all-gathers and gradient reduce-scatters, with optimizer state sharded | Does lower memory use justify repeated parameter traffic and prefetch buffers? |
| Pipeline parallelism | Forward activations and backward gradients for every microbatch at stage boundaries | Do stage balance, boundary tensor size, and the pipeline bubble justify more stages? |
The original Megatron tensor-parallel layout is an important example, not a universal law: its transformer formulation uses two all-reduces in the forward pass and corresponding reductions in backward for each layer (Shoeybi et al. 2019). Later compositions change the operations and overlap schedule. Data-parallel systems may use all-reduce, or reduce-scatter and all-gather under ZeRO and fully sharded designs (Rajbhandari et al. 2020). Pipeline traffic repeats with microbatches rather than appearing as one hand-off per step (Narayanan et al. 2021). Expert parallelism and its all-to-all behavior are developed in Chapter 9.
A practical mapper measures or estimates bytes, frequency, latency sensitivity, memory saved, and available overlap for every edge. It then maps the heaviest or most latency-sensitive mesh dimensions onto the fastest adequate physical dimensions. “TP inside, DP outside” is often a useful starting heuristic. It is not a proof, especially on rack-scale fabrics, asymmetric networks, or workloads whose context and expert traffic dominate.
TPU v4 as one bounded case study
The tensor processing unit (TPU) pod, a cluster of Google tensor processing units, illustrates why topology claims need a generation. TPU v4 used an inter-chip interconnect (ICI), the inter-chip interconnect joining TPU chips, plus optical circuit switches to configure three-dimensional torus slices. A twisted torus was one supported choice; the switches also helped reconfigure around unavailable components (Jouppi et al. 2023). This is a TPU v4 statement, not a claim that every TPU pod uses the same torus.
GSPMD is a compiler partitioning system. It propagates user sharding annotations through a computation graph and targets a logical device mesh (Xu et al. 2021). It does not by itself make a physical topology fast or remove multi-hop communication. Similarly, a graphics processing unit (GPU) cluster, a cluster that uses graphics processors as accelerators, may expose several logical meshes over PCIe, NVLink, InfiniBand, or Ethernet. In both cases, the compiler and runtime need an accurate physical map.
The lesson is generation-specific: accelerator architecture, logical sharding, and physical topology must be read together.
Precision and portability are separate contracts
Precision changes more than one number. Input storage, multiplication, accumulation precision, output format, scaling policy, and reduction precision may all differ. FP8, for example, defines E4M3 and E5M2 interchange formats, but an accurate training recipe also chooses which tensors use them and where wider accumulation or scaling is required (Micikevicius et al. 2022). Compare peak rates only for the same dense or structured sparsity convention and an instruction path the workload actually uses. Chapter 34 covers the numerical and kernel consequences.
Portability also has layers: source compatibility, numerical correctness, feature availability, and performance portability. A framework backend may run the same model on two accelerator families while custom kernels, collective algorithms, supported formats, and best tensor shapes still differ. Keep model and sharding intent above vendor adapters, isolate custom kernels, and repeat the same correctness and performance matrix on every target.
MFU is an accounting ratio
Model FLOPs utilization (MFU) compares an analytical estimate of useful model work with a selected hardware peak (Chowdhery et al. 2023), where denotes estimated useful model FLOPs per global step, denotes the number of accelerators, denotes the per-device theoretical peak FLOP/s for the declared precision and dense or sparse path, and denotes measured seconds per step. The ratio is
Publish the FLOP-count convention, global batch and sequence shape, advertised precision used for the peak, accelerator count, and timing boundary. An MFU computed with a dense peak is not directly comparable with one computed using a structured-sparse peak. Sparse and mixture-of-experts models also need an explicit active-parameter and routed-token convention.
Hardware FLOPs utilization (HFU) uses an estimate of executed arithmetic in the numerator, which can include rematerialization, also called activation recomputation. With consistent accounting, rematerialization can make HFU higher than MFU because the hardware repeats forward work. Neither ratio is a hardware counter, and MFU is not a diagnosis. Low MFU can come from memory traffic, exposed collectives, pipeline bubbles, small kernels, input stalls, thermal throttling, failures, or an inconsistent FLOP estimate. Pair it with tokens per second, step-time distributions, achieved memory and collective bandwidth, kernel timelines, power, clocks, and error telemetry.
Measure from components to the run
Use a ladder of evidence. A full-model benchmark alone tells you that something changed; component measurements locate the changed boundary.
For every benchmark, record hardware SKU and revision; driver and firmware; compiler, framework, and collective-library version; precision and sparsity mode; tensor dimensions; batch and sequence distribution; message size; physical topology and oversubscription; rank placement; algorithm and protocol; warm-up and measured iterations; one-way or bidirectional accounting; p50, p95, and p99; concurrent flows; and power and temperature. A single-node microbenchmark does not establish cluster scaling.
The operating record should preserve enough context to reproduce and compare a result:
accelerator_system:
hardware: {device: ..., count: ..., memory: ..., power_limit: ...}
software: {driver: ..., firmware: ..., compiler: ..., framework: ..., collective_library: ...}
workload: {model_revision: ..., batch: ..., sequence_distribution: ..., precision: ..., flop_convention: ...}
topology: {scale_up_domain: ..., scale_out_fabric: ..., oversubscription: ..., rank_placement: ...}
measurements: {window: ..., warmup: ..., repetitions: ..., throughput: ..., mfu: ..., latency_percentiles: ...}
health: {link_errors: ..., ecc: ..., device_errors: ..., clocks: ..., power: ..., temperature: ...}
Correlate those records with synchronized job, rank, node, accelerator, NIC, switch, rack-power, and cooling-domain identifiers. A collective timeout may be a software ordering bug, a failed rank, a degraded link, or congestion. One utilization counter cannot distinguish them. Reliability and silent failures are treated in Chapter 69; facility power and cooling constraints are treated in Chapter 68.
Regression scenarios
- Small-message latency: reduce message sizes until startup dominates and verify that the selected collective algorithm and p99 remain acceptable.
- Large-message bandwidth: sweep beyond cache and confirm sustained, not peak, bandwidth without assuming linear cluster scaling.
- Oversubscribed uplink: place communicating ranks across the constrained cut and verify admission, routing, and performance alarms.
- Degraded link: lower or remove one path and confirm topology discovery, rerouting behavior, and the resulting tail latency.
- Rank-placement change: permute ranks over the same hardware and detect a performance regression caused by a larger communication cut.
- Collective timeout: stop one rank or violate collective ordering in a test job and verify bounded failure, diagnosis, and cleanup.
- Silent data corruption: inject a detectable fault and verify end-to-end checks, quarantine, and recovery rather than relying only on a device alarm.
- Thermal throttling: run a soak or controlled power cap and verify that clock, power, temperature, throughput, and scheduler evidence stay linked.
- Software change: alter one driver, compiler, kernel, or collective-library version and rerun the same shapes, placements, and statistical comparison.
- Capacity edge: approach the memory budget, including temporary buffers and allocator headroom, and verify deterministic admission or failure. This connects to Chapter 32.
The scale-up boundary is moving. Rack-scale fabrics can enlarge the domain in which frequent model-parallel traffic is affordable, but they also change cost, power density, failure domains, and software assumptions. Scale-out fabrics are also improving, while parallelism methods reduce, reshape, or overlap traffic. There is no timeless device count at which tensor parallelism must stop. The answer is a measured property of a workload and a deployed system.
Hardware does constrain the algorithm above it, but through a vector rather than one bandwidth ratio: usable memory, sustainable local traffic, collective latency, bisection bandwidth, topology, power, and failure domains. The mapping chosen in Chapter 10 must fit all of them. The operating system and scheduler must then preserve device locality and memory headroom, as Chapter 32 explains. A paper parallelism plan is only a hypothesis until the measured communication graph fits the physical machine.
The durable method is simple: name the boundary, define the accounting, measure the real shape, and preserve the context. Peak FLOPs, link rate, and MFU are useful only after those four steps make their meaning explicit.
Further reading
- Williams et al., “Roofline: An Insightful Visual Performance Model for Multicore Architectures,” 2009. osti.govRoofline relates attainable performance to operational intensity, peak arithmetic rate, and sustainable memory bandwidth.
- Kung, “Why Systolic Architectures?,” 1982. eecs.harvard.eduKung explains systolic architectures as regular arrays that rhythmically move data through processing elements to exploit parallelism and locality.
- Jouppi et al., “In-Datacenter Performance Analysis of a Tensor Processing Unit,” 2017. research.googleThis paper documents the first production TPU, including its software-managed memory and 256 by 256 matrix multiply unit.
- NVIDIA, “CUDA Programming Guide” (Official programming-model documentation; continuously updated), 2026. docs.nvidia.comThe CUDA guide defines the host-device model, SIMT execution, memory spaces, and architecture-specific accelerator features.
- Micikevicius et al., “FP8 Formats for Deep Learning,” 2022. arXiv:2209.05433The paper specifies E4M3 and E5M2 FP8 interchange formats and evaluates training recipes across several neural-network families.
- Patarasuk & Yuan, “Bandwidth Optimal All-Reduce Algorithms for Clusters of Workstations,” 2009. cs.fsu.eduThe paper derives a communication lower bound and a bandwidth-optimal ring all-reduce for large messages under stated topology assumptions.
- NVIDIA, “NCCL User Guide: Collective Operations” (Official collective-semantics documentation; continuously updated), 2026. docs.nvidia.comThe NCCL guide defines GPU collective semantics, including all-reduce, all-gather, reduce-scatter, broadcast, and all-to-all.
- NVIDIA, “GPUDirect RDMA Documentation” (Official documentation for GPU peer-device DMA paths and memory registration), 2026. docs.nvidia.comThe guide describes direct peer-device access to GPU memory and the required registration, topology, driver, and synchronization conditions.
- NVIDIA, “NVL72 AI Factory: System Hardware and Components” (Official reference architecture for a rack-scale NVLink domain), 2026. docs.nvidia.comThe reference architecture documents a 72-GPU rack-scale NVLink domain, showing that scale-up is not necessarily confined to one server.
- Shoeybi et al., “Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelism,” 2019. arXiv:1909.08053Megatron-LM presents an intra-layer tensor-parallel formulation for Transformer training and measures its communication and scaling behavior.
- Narayanan et al., “Efficient Large-Scale Language Model Training on GPU Clusters Using Megatron-LM,” 2021. arXiv:2104.04473The paper composes tensor, pipeline, and data parallelism and analyzes pipeline schedules for large Transformer training.
- Rajbhandari et al., “ZeRO: Memory Optimizations Toward Training Trillion Parameter Models,” 2020. arXiv:1910.02054ZeRO partitions optimizer state, gradients, and parameters to remove memory redundancy from data-parallel training while changing communication schedules.
- Xu et al., “GSPMD: General and Scalable Parallelization for ML Computation Graphs,” 2021. arXiv:2105.04663GSPMD propagates tensor-sharding annotations through a computation graph and emits a partitioned single-program, multiple-data program.
- Jouppi et al., “TPU v4: An Optically Reconfigurable Supercomputer for Machine Learning with Hardware Support for Embeddings,” 2023. arXiv:2304.01433TPU v4 uses optical circuit switches to configure and reconfigure a large accelerator interconnect.
- Chowdhery et al., “PaLM: Scaling Language Modeling with Pathways,” 2023. jmlr.orgThe PaLM paper defines model FLOPs utilization as a model-level efficiency measure that excludes rematerialization from the useful-work convention.
Comments
Log in to comment