horovod/horovod

Distributed training framework for TensorFlow, Keras, PyTorch, and Apache MXNet.

What it solves

Horovod 简化了将深度学习训练从单 GPU 扩展到多 GPU 和多主机的过程。它消除了分布式训练通常伴随的复杂性,例如管理参数服务器,提供了一种更直接的方式在集群上并行运行模型。

How it works

Horovod 使用基于 MPI(Message Passing Interface)的模型来处理工作节点之间的通信。它不使用中心服务器,而是采用 allreduce 等集合通信操作来对所有工作节点的梯度进行平均。它可与 TensorFlow、Keras、PyTorch 以及 Apache MXNet 等流行框架集成。实现时,用户需要初始化 Horovod、将 GPU 固定到特定进程、缩放学习率,并将 optimizer 包装为 DistributedOptimizer

Who it’s for

它面向需要在多 GPU 或多服务器上训练大模型和大数据集的机器学习工程师和基础设施团队,同时尽量减少扩展所需的代码改动。

Highlights

  • Multi-Framework Support: Works with TensorFlow, PyTorch, Keras, and MXNet.
  • Tensor Fusion: Improves performance by batching small allreduce operations and interleaving communication with computation.
  • High Scaling Efficiency: Demonstrates high efficiency (up to 90% for certain models) when scaling across hundreds of GPUs.
  • Autotuning: Includes a system to automatically optimize performance settings to reduce trial-and-error tuning.
  • Flexible Deployment: Can be run via horovodrun, Docker, Kubernetes, Spark, Ray, and various HPC clusters.