🧠 MirroredStrategy 实战
30章 · 多机多卡
🎒 友好 · 分布式入门
1
分布式训练概述
为什么需要分布式 · 核心概念 · 策略概览
2
MirroredStrategy原理
同步数据并行 · All-Reduce · NCCL
3
单机多卡环境搭建
GPU · NVLink · CUDA · 验证多卡
4
MirroredStrategy基础API
创建 · scope · strategy.run()
5
数据加载与分发
tf.data · DistributedDataset · batch_size
6
模型构建与编译
strategy.scope · Keras API 注意事项
7
训练循环实战
GradientTape · strategy.run · 梯度累积
8
模型保存与加载
SavedModel · Checkpoint · 分布式恢复
9
性能监控与调优
TensorBoard · 瓶颈分析 · batch size
10
常见错误与调试
OOM · NCCL超时 · 梯度爆炸
11
多机多卡架构
PS vs All-Reduce · InfiniBand
12
多机环境配置
SSH · NFS · TF_CONFIG · 环境变量
13
MultiWorkerMirroredStrategy
与Mirrored区别 · TF_CONFIG
14
多机数据加载策略
避免重复 · TFRecord · 分片
15
多机训练实战
启动 · worker故障 · 动态添加
16
混合精度训练
FP16/FP32 · mixed_precision · Loss Scaling
17
梯度压缩与通信优化
压缩算法 · 梯度压缩实现 · 计算重叠
18
大规模Batch Size训练
线性缩放 · Warmup · BN调整
19
分布式评估与推理
评估策略 · 模型并行推理 · 部署
20
Horovod与TensorFlow集成
Horovod原理 · 对比 · 混合使用
21
TPU与MirroredStrategy
TPU架构 · TPUStrategy · 差异
22
ParameterServerStrategy
异步训练 · PS配置 · 对比
23
自定义分布式策略
继承DistributedStrategy · 自定义All-Reduce
24
分布式训练中的数据处理
预处理加速 · tf.data.service · 管道优化
25
模型并行与流水线并行
模型切分 · 流水线实现 · GSPMD
26
分布式超参数搜索
分布式框架 · Ray Tune · 异步搜索
27
生产环境部署
Kubernetes · TFJob · 弹性训练
28
案例一:图像分类 ResNet-50
ImageNet 分布式训练
29
案例二:NLP模型 BERT
分布式预训练
30
案例三:推荐系统 DCN
大规模分布式训练