Home › Blog › AGI Researcher Foundations — Systems
AGI Researcher Foundations · Article 10 of 11 🖧

Systems: The Distributed Infrastructure Underneath Every Model in This Series

Article 1 named data, tensor, and pipeline parallelism as a self-assessment item; Article 2 asked whether you could explain the difference. This article delivers the actual mechanical explanation — how gradients synchronize across GPUs, why memory, not just compute, is the real bottleneck at scale, how the three parallelism strategies combine in real training runs, and what happens, concretely, when a 992-GPU job breaks.

FL
FrontierAGI Team

Why Every Article So Far Has Quietly Depended on This One

Every architecture in "How Each Network Architecture Actually Learned," every training technique in this series, and every open bet from "After Transformers" assumes something this article finally makes explicit: none of it runs on one machine. A frontier-scale model trains across hundreds or thousands of GPUs simultaneously, and making that work — keeping every GPU's copy of the model consistent, fitting a model far larger than any single GPU's memory, and recovering when hardware inevitably fails mid-run — is its own engineering discipline, with its own real, citable research literature.

This article picks up exactly where Article 1's compute section and Article 2's self-assessment item 5 left off, going from "know that these three parallelism strategies exist" to "understand mechanically what each one is actually doing."

992 GPUs used in Meta's public OPT-175B training run, previously cited in Article 1
~35 Manual restarts logged during that same 56-day run, revisited mechanically in Part 7
3 Parallelism strategies (data, tensor, pipeline) that combine in real frontier training runs
O(1) Per-GPU communication cost of ring-allreduce, regardless of how many GPUs are involved — the trick making data parallelism scale
Part 1 — Data Parallelism

The Simplest Strategy: Copy the Model, Split the Data

Data parallelism is the most intuitive of the three: put a full copy of the model on every GPU, split each training batch into chunks (one chunk per GPU), and have every GPU compute its own forward and backward pass (Article 4's Era 2 mechanics) on its chunk independently and simultaneously. The catch: after this, every GPU has computed a slightly different gradient (based on its own chunk of data), and all copies need to end up with the exact same, averaged gradient before taking an optimizer step — otherwise the model copies would drift apart and stop being the same model.

The mechanism that makes this efficient is ring-allreduce (popularized by Baidu's 2017 engineering work applying it to deep learning): arrange the GPUs in a logical ring, and have each one pass a piece of its gradient to its neighbor while receiving a piece from the other side, repeating until every GPU has the full, summed gradient. Its key property: the communication cost per GPU stays roughly constant no matter how many GPUs are in the ring — a critical scalability property, since a naive "send everything to one central GPU" approach would create a communication bottleneck that gets worse as you add more GPUs.

GPU 1 GPU 2 GPU 3 GPU 4 GPU 5
Ring-allreduce: each GPU only ever talks to its two ring neighbors, passing gradient pieces around until every GPU holds the full sum — no central bottleneck, regardless of ring size.
Part 2 — When Data Parallelism Isn't Enough: ZeRO

The Real Bottleneck Is Memory, Not Just Compute

Data parallelism's core assumption — a full copy of the model fits on every GPU — breaks down for genuinely large models: the model's weights, its gradients, and its optimizer state (Adam, Article 3, keeps extra per-parameter bookkeeping) together can far exceed a single GPU's memory, long before compute becomes the limiting factor. Rajbhandari et al.'s ZeRO paper (previously cited in Article 1) solves this by partitioning — rather than fully replicating — the optimizer state, gradients, and eventually the weights themselves across the data-parallel GPUs, with three increasingly aggressive stages:

ZeRO StageWhat's Partitioned Across GPUsMemory Saved
Stage 1Optimizer state onlyModerate — optimizer state (e.g., Adam's extra bookkeeping) is often the single largest memory consumer
Stage 2Optimizer state + gradientsLarger — each GPU only ever holds the gradient shard relevant to its parameter shard
Stage 3Optimizer state + gradients + the model weights themselvesLargest — approaches the theoretical minimum memory per GPU, at the cost of more communication to reassemble full weights when needed for computation

This is a direct, practical illustration of a general systems principle: there's rarely a free lunch — ZeRO's memory savings come at the cost of additional communication to reconstruct the full weights or gradients when a GPU actually needs them for its local computation, an explicit memory-versus-communication tradeoff a systems-literate researcher needs to reason about directly.

Part 3 — Tensor Parallelism

Splitting a Single Layer's Math Across GPUs

Even with ZeRO, some individual layers in the largest models are themselves too large to compute on one GPU. Shoeybi et al.'s Megatron-LM (previously cited in Article 1) introduces tensor parallelism: split a single layer's weight matrix itself — column-wise or row-wise — across multiple GPUs, so each GPU computes only its slice of a matrix multiplication, then the partial results are combined (via another collective communication step, similar in spirit to Part 1's allreduce) to produce the layer's true output.

The key tradeoff: tensor parallelism requires communication within every single layer's forward and backward pass (not just once per batch, as in data parallelism's gradient sync), which demands very high-bandwidth, low-latency interconnects between GPUs — this is why tensor parallelism is typically used only within a single physical machine's tightly-connected GPUs, rather than across machines connected by slower networking.

Part 4 — Pipeline Parallelism

Splitting the Network's Layers Across GPUs

Huang et al.'s GPipe (2019) introduced the other major way to split a too-large model: assign different consecutive layers to different GPUs (GPU 1 holds layers 1–10, GPU 2 holds layers 11–20, and so on), so an input flows through the GPUs in sequence, pipeline-style. The naive version of this has a serious efficiency problem — a "pipeline bubble," where GPU 2 sits idle waiting for GPU 1 to finish layers 1–10 on the first input before it has anything to do, and this idle time recurs at the start and end of every batch. GPipe's fix is to split each batch into smaller "micro-batches" and feed them through the pipeline in a staggered, overlapping sequence, similar in principle to how an actual factory assembly line keeps every station busy by having multiple items in progress simultaneously rather than processing one item fully before starting the next.

Part 5 — Combining All Three: 3D Parallelism

Real Frontier Training Runs Use All Three at Once

Narayanan et al.'s "Efficient Large-Scale Language Model Training on GPU Clusters" (2021) — often called the "PTD-P" paper — demonstrates that real large-scale training combines all three strategies simultaneously, each applied at the layer of the hardware hierarchy it suits best: tensor parallelism within a single machine's tightly-connected GPUs (Part 3's high-bandwidth requirement), pipeline parallelism across machines within a cluster, and data parallelism across separate groups of machines entirely (Part 1's more relaxed, less frequent communication requirement). This "3D parallelism" isn't a theoretical nicety — it's the actual production strategy behind most of the frontier-scale training runs referenced throughout this series.

Part 6 — Inference Systems

Serving a Trained Model Is Its Own Systems Problem

Everything above concerns training; serving a trained model to real users at scale is a related but distinct systems challenge. Kwon et al.'s vLLM/PagedAttention paper (2023, previously referenced via vLLM in Article 1) identifies a specific memory-management inefficiency in naive LLM serving: each ongoing conversation's "attention cache" (intermediate values needed to continue generating text) was typically allocated as one large, contiguous memory block per request, wasting substantial memory to fragmentation and over-allocation — genuinely analogous to how an operating system manages memory in fixed-size pages rather than large contiguous blocks, which is exactly the analogy the paper's name invokes. This single systems insight is a major reason vLLM became the dominant serving engine referenced in "After Transformers."

Part 7 — Fault Tolerance

Revisiting the OPT-175B Logbook, Mechanically

Article 1's Scenario B cited Meta's public OPT-175B training logbook as evidence that distributed training is dominated by infrastructure firefighting. With this article's vocabulary, that claim becomes mechanically specific: a single failed GPU in a 992-GPU 3D-parallel job (Part 5) can stall the entire pipeline or data-parallel group it belongs to, since tensor- and pipeline-parallel groups (Parts 3–4) are tightly synchronized by design — there's no way for the rest of the group to simply continue without the failed GPU's shard of the model. This is precisely why the logbook records ~35 manual restarts: each hardware failure or network communication error (NCCL failures, in the terminology of Part 1's collective communication) required stopping, diagnosing, and resuming from the most recent saved checkpoint, not a graceful degradation.

A 992-GPU training job isn't "992 computers doing the same thing" — it's 992 computers locked into a tightly synchronized dance defined by whichever mix of data, tensor, and pipeline parallelism the run uses, where one dancer stumbling can freeze the whole group until someone intervenes.
Part 8 — Papers & Courses

Key Papers to Read First

PaperWhy It's FoundationalLink
Rajbhandari et al. — ZeRO (2019, previously cited)Solves the memory bottleneck data parallelism alone can'tarXiv:1910.02054
Shoeybi et al. — Megatron-LM (2019, previously cited)Introduces tensor parallelism for individual layers too large for one GPUarXiv:1909.08053
Huang et al. — GPipe (2019)Introduces pipeline parallelism and the micro-batching fix for pipeline bubblesarXiv:1811.06965
Narayanan et al. — "Efficient Large-Scale LM Training" — PTD-P (2021)Shows how real frontier runs combine all three parallelism strategiesarXiv:2104.04473
Kwon et al. — vLLM / PagedAttention (2023)The systems insight behind the dominant LLM serving enginearXiv:2309.06180

Courses to Complete

Part 9 — Real Scenarios

Real Scenario Walkthroughs

🧮Scenario A — Choosing a Parallelism Strategy for a Specific Model
Applying Parts 1–5 directly: a model that fits comfortably on one GPU, trained on a large dataset, needs only data parallelism (Part 1). A model whose individual layers are too large for one GPU needs tensor parallelism within a machine (Part 3). A model too large to fit on one machine at all needs pipeline parallelism across machines (Part 4), typically combined with the other two (Part 5). Working through this decision tree explicitly is exactly the systems-design judgment a research engineer (Article 1's Lane 1 profile) exercises before a training run even starts.
The lesson: parallelism strategy isn't one-size-fits-all — it's a direct, mechanical consequence of where your specific model's size exceeds specific hardware limits.
📉Scenario B — Diagnosing Why Adding More GPUs Stopped Helping
A common real frustration: doubling the GPU count doesn't halve training time. Part 1's ring-allreduce keeps per-GPU communication roughly constant, but Part 3's tensor parallelism requires per-layer communication that gets relatively more expensive as more GPUs are added within that group, especially if network bandwidth between them is limited — a mechanical, diagnosable reason for diminishing returns, not a vague "distributed training is just hard."
The lesson: understanding which parallelism strategy is used where lets you predict, not just observe, where scaling efficiency will start to degrade.

Self-Assessment Checklist

1
Can you explain ring-allreduce well enough to draw it, and explain why its per-GPU cost doesn't grow with the number of GPUs?
2
Can you explain what each of ZeRO's three stages partitions, and why Stage 3 costs more communication than Stage 1?
3
Can you explain why tensor parallelism needs faster interconnects than data parallelism, in terms of when communication happens?
4
Can you explain what a "pipeline bubble" is and how micro-batching addresses it?
5
Given the OPT-175B logbook, can you explain mechanically why one failed GPU can stall an entire large training run, rather than just being "bad luck"?

⚠️ What's Missing

This article does not cover: the detailed networking hardware layer (InfiniBand, NVLink specifics), storage and data-loading pipeline engineering at scale, or the full mathematical derivation of communication-cost formulas for each parallelism strategy — those belong in the hands-on DeepSpeed/Megatron-LM documentation linked above, not a foundational conceptual article. The power and carbon costs of the infrastructure described here are covered in this site's separate Power Bottleneck investigation, deliberately not duplicated here.

Where This Series Goes Next

Article 11, the capstone, ties every foundational concept from all ten prior articles — the technical stack, self-assessment, math, deep learning concepts, generalization theory, RL, interpretability, alignment, world models, and this article's systems layer — back into one unified map, showing how they connect into a coherent picture of what a working AGI researcher actually needs to know.

🎥 Recommended Videos

🧭 Closing — Distributed Training Is a Systems Discipline, Not an Afterthought

🎯 The Bottom Line
Every frontier model referenced across this series was trained using some combination of data, tensor, and pipeline parallelism — not as an incidental implementation detail, but as a set of deliberate, well-researched engineering tradeoffs between memory, compute, and communication bandwidth. Understanding these mechanics is what separates treating a training run as a black box you wait on, from being able to diagnose why it's slow, why it stalled, or how to scale it further — the exact distributed-systems literacy this series' Article 1 named as a self-assessment item, now fully explained rather than just referenced.