Distributed Training Glossary: 16 Terms You Will Hear in Every AI Infra Meeting

1268 字
6 分钟
Distributed Training Glossary: 16 Terms You Will Hear in Every AI Infra Meeting

Why This List#

Yesterday’s passage was about serving — KV cache, batching, throughput. This one covers the other half of AI Infra: training at scale. These are the words people in the field actually use every day — in design reviews, in the related-work sections of every paper, and in the post-mortem of every GPU-outage incident. None of them are in a CET-6 word list, all of them are in a random AI Infra meeting.

Each term below comes with a Chinese gloss, an English definition, and a real-world context sentence adapted from the paper or documentation where you would actually meet the term. Sources are listed at the end.

Parallelism: Splitting the Work#

The first question in any training-scale discussion is: does the model fit on one GPU, and if not, how do we split it?

Term中文释义English definitionReal-world context
data parallelism (DP)数据并行Replicating the full model on every GPU and splitting the batch among them; the GPUs average their gradients with an all-reduce at each step.”Data parallelism replicates the model on each GPU and shards the data batch across the GPUs — still the most common way to scale training.” (Megatron-LM)
model parallelism (MP)模型并行Any scheme that splits the model itself across devices because one GPU cannot hold it; tensor and pipeline parallelism are its two main forms.”When the model does not fit on a single GPU, model parallelism partitions the model across devices instead of replicating it.” (Megatron-LM)
tensor parallelism (TP)张量并行Splitting each layer’s weight matrices across GPUs so that one layer’s computation runs on several devices at once.”Megatron-LM splits the weight matrices of every transformer layer across 8 GPUs, so each layer is computed jointly by all 8.” (Megatron-LM)
pipeline parallelism (PP)流水线并行Splitting the model by groups of layers (“stages”); each stage lives on a different GPU, and activations flow through the stages in sequence.”GPipe divides a model into layer stages; micro-batches flow through the pipeline one stage after another so that every GPU stays busy.” (GPipe)
ZeRO零冗余优化器Sharding the optimizer state, gradients, and parameters across data-parallel ranks so no GPU stores redundant copies — the technique behind DeepSpeed.”ZeRO eliminates memory redundancies in data- and model-parallel training by partitioning model states across devices.” (ZeRO)
offloading卸载(把数据放到 CPU 内存)Moving part of the training state — usually the optimizer state — to host CPU memory when the GPU is full.”ZeRO-Offload moves the optimizer memory and its computation from the GPU to the host CPU, and performs the weight update on the CPU.” (DeepSpeed)
gradient accumulation梯度累积Delaying the optimizer step until gradients from several micro-batches have been summed, to simulate a larger batch size than GPU memory allows.”With gradient accumulation we update the weights only every N steps, summing the gradients of the previous N mini-batches.” (HF docs)
gradient checkpointing梯度检查点(重计算)Discarding most intermediate activations during the forward pass and recomputing them during the backward pass — less memory, more compute.”Instead of storing every intermediate activation, gradient checkpointing recomputes them in the backward pass, trading compute for memory.” (PyTorch docs)

Communication and Numerics: The Plumbing#

Even with the perfect split, nothing works unless the GPUs can talk to each other — and unless the numbers survive being stored in 16 bits.

Term中文释义English definitionReal-world context
all-reduce全归约A collective operation that reduces a tensor across GPUs (sum or average) and returns the result to every participant; the final step of every data-parallel update.”Each data-parallel step ends in an all-reduce: every GPU contributes its local gradient and receives the averaged gradient back.” (NCCL docs)
NCCLNVIDIA 集合通信库NVIDIA’s library of collective operations — all-reduce, broadcast, all-gather — tuned for GPU topologies such as NVLink and InfiniBand.”The NVIDIA Collective Communications Library (NCCL) provides communication primitives for multi-GPU and multi-node communication, optimized for NVIDIA GPUs and networking.” (NCCL)
straggler掉队的慢节点The slowest worker in a synchronous run; since all-reduces wait for everyone, one straggler throttles the whole job.”As the MapReduce paper put it, a straggler is ‘a machine that takes an unusually long time’ to finish its share of the work.” (MapReduce)
mixed precision混合精度Training with FP16 (or BF16) forward and backward passes while keeping a master copy of the weights in FP32.”Mixed precision keeps master weights in FP32, runs the forward and backward passes in FP16, and stores an FP32 copy of the gradients.” (Mixed Precision Training)
bf16bfloat16A 16-bit format with FP32’s exponent range but only 7 mantissa bits — the same range as FP32 at half the memory, so it rarely overflows.”bfloat16 keeps the exponent range of FP32 while cutting the mantissa to 7 bits, which made it the default training format on modern accelerators.” (Bfloat16)
loss scaling损失缩放Multiplying the loss by a large factor before backpropagation so that small FP16 gradients do not underflow to zero; the scale is divided back out before the update.”Loss scaling multiplies the loss by a large factor before the backward pass so that small FP16 gradients do not underflow.” (Mixed Precision Training)
warmup学习率预热Starting the learning rate near zero and ramping it up to its peak over the first few thousand steps, which keeps the early updates from destabilizing the weights.”Goyal et al. proposed linear warmup: increase the learning rate from a small value to its target over the first few epochs, then decay it.” (Large Minibatch SGD)
loss spike损失尖峰A sudden jump in the training loss — often the first warning of an unstable learning rate, or of a corrupted batch from the data pipeline.”A loss spike in the curve is usually the first sign that the learning rate is too high — or that the data loader served a bad batch.” (common usage)

How the Pieces Fit Together#

flowchart LR M["Model doesn't fit on one GPU"] --> TP["Tensor parallel<br/>split each layer's weights"] M --> PP["Pipeline parallel<br/>split layers into stages"] B["Batch is too big / too slow"] --> DP["Data parallel + ZeRO<br/>split data, shard the optimizer state"] TP --> A["8 GPUs cooperate on one training step"] PP --> A DP --> A

In production the three strategies are rarely used alone. A typical 8-GPU node trains with tensor parallelism inside the node (NVLink makes intra-node communication cheap), pipeline parallelism when the model spans many layers, and data parallelism across nodes with ZeRO sharding the optimizer state — a combination colloquially called 3D parallelism. Add mixed precision with bf16 and loss scaling on top, and you have described, in one paragraph, the training setup of most open-weight LLMs. That is the point of this glossary: each word names a knob that a real system has to turn.

Sources#

The context sentences above are adapted (or, where quoted, quoted) from the following real sources:

评论区

Profile Image of the Author
平昊阳
乘长风,破巨浪, 展鸿图于未央!
--
总访问量
--
访客数
公告
欢迎来到我的个人博客!欢迎关注交流吖!
更多相关公告,见
社交-留言」。
音乐
封面

音乐

暂未播放

0:000:00
暂无歌词
站点统计
文章
118
分类
20
标签
164
总字数
1,050,769
运行时长
0
最后活动
0 天前

文章目录