# 本章小结

本章系统介绍了大规模分布式训练的核心技术。

**数据并行**通过在多 GPU 上复制模型并同步梯度来扩展吞吐量，其数学正确性由梯度的线性可加性保证。

**ZeRO 优化**通过将模型状态（优化器状态、梯度、参数）分片存储到多张 GPU 上，消除了数据并行中的显存冗余，使数据并行能够训练远超单卡容量的模型。

**张量并行**将单层权重矩阵切分到多 GPU 协同计算，适合节点内高带宽互连场景。**流水线并行**将不同层分配到不同 GPU，通过微批量调度减少空闲气泡。

**3D 并行**组合以上策略，匹配硬件拓扑的层次化通信特性——节点内用张量并行、跨节点用流水线并行、再叠加数据并行。

**混合精度训练**用 FP16/BF16 在几乎不损失精度的情况下将训练速度提升一倍以上。BF16 因其与 FP32 相同的数值范围（不需要损失缩放）而成为当前首选。

**检查点管理**和**容错机制**确保长时间训练任务的可靠完成。检查点平均是一种零成本提升最终模型性能的有效技巧。

下一章将讨论预训练之后的关键步骤——如何通过微调和对齐技术让模型变得有用且安全。

***

> 📝 **发现错误或有改进建议？** 欢迎提交 [Issue](https://github.com/yeasy/llm_internals/issues) 或 [PR](https://github.com/yeasy/llm_internals/pulls)。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://yeasy.gitbook.io/llm_internals/di-er-bu-fen-xun-lian-pian/07_distributed_training/summary.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
