> ## Content Index
> Fetch the complete content index at: https://globalfeed.ai/llms.txt
> Use this file to discover other available public pages before exploring further.

# 跨城市数据中心训练一个模型：谷歌 Streaming DiLoCo 如何运作
- URL: https://globalfeed.ai/zh/kua-cheng-shi-shu-ju-zhong-xin-xun-lian-yi-ge-mo-xing-gu-ge-streaming-diloco-ru-he-yun-zuo/
- Published: 2026-11-20T11:16:36.000Z
- Updated: 2026-11-20T11:16:36.000Z
- Description: 谷歌 MaxText 团队介绍 Streaming DiLoCo：在10 Gbps 链路上，Qwen3-32B 单步时间从55.11秒降到5.76秒。
- Author: GlobalFeed Editor
- Tags: Streaming DiLoCo, 谷歌, MaxText, 分布式训练, TPU, dil-zh, elle

谷歌 MaxText 团队于11月19日发表[文章](https://developers.googleblog.com/distributed-llm-training-across-metros-streaming-diloco-in-maxtext/?ref=globalfeed.ai)，介绍了让两座城市的数据中心共同训练同一个模型的方法 Streaming DiLoCo。按文中测量，在两组 TPU 之间仅有每秒10吉比特链路时，训练 Qwen3-32B 的单步时间从55.11秒降到5.76秒，比常规数据并行快9.57倍；两组之间的流量从4,258.8 GB降到67 GB。

## 问题在哪

数据并行训练中，每一步结束时所有副本都要通过 all-reduce 交换梯度。按谷歌的例子，Qwen3-32B 每步约交换65.5 GB，需要约85 Gbps 的持续带宽；在10 Gbps 链路上一次传输就要50秒以上，芯片只能等待。

## DiLoCo 与 Streaming

DiLoCo 来自 Google DeepMind 2023年的[论文](https://arxiv.org/abs/2311.08105?ref=globalfeed.ai)：每个“岛”用 AdamW 独立训练 H 步，然后计算参数的位移（伪梯度），取平均后用 Nesterov 动量的外层优化器更新共享模型，通信减少 H 倍。[Streaming DiLoCo](https://arxiv.org/abs/2501.18512?ref=globalfeed.ai) 再把模型切成片段，每步只同步一个片段，避免一次性传输整个模型。在 MaxText 中片段数为层数加一，Qwen3-32B 为65个，每步流量约1 GB，所需带宽约1.3 Gbps。

## 结果与试用

测试使用两组 TPU v5p-32，链路用 Linux tc 限速。在10 Gbps 下数据并行每步55.11秒，普通 DiLoCo 7.55秒，Streaming DiLoCo 5.76秒，与不限速时基本一致。谷歌称在 Qwen3-32B 上损失与同步基线一致；在 Qwen3-30B-A3B 和 Gemma4-26B-A4B 的4,000步测试中验证损失保持甚至略有改善。该功能见于 MaxText v0.2.5 及以后版本，按[教程](https://github.com/AI-Hypercomputer/maxtext/blob/main/docs/tutorials/diloco%5Fpretraining.md?ref=globalfeed.ai)在配置中加入 `enable_diloco: true` 与 `enable_streaming_diloco: true` 即可，`dcn_bandwidth_limit` 可模拟慢速链路。文档也指出，在高速链路上 DiLoCo 不会带来加速。

来源： [Google Developers 文章](https://developers.googleblog.com/distributed-llm-training-across-metros-streaming-diloco-in-maxtext/?ref=globalfeed.ai), [MaxText DiLoCo 教程](https://github.com/AI-Hypercomputer/maxtext/blob/main/docs/tutorials/diloco%5Fpretraining.md?ref=globalfeed.ai), [DiLoCo 论文](https://arxiv.org/abs/2311.08105?ref=globalfeed.ai), [Streaming DiLoCo 论文](https://arxiv.org/abs/2501.18512?ref=globalfeed.ai)