EHAT tensorflow runtime_error ai_generated partial

中止错误:HorovodAllreduce:操作 HorovodAllreduce 失败,错误:等待所有 ranks 加入超时

AbortedError: HorovodAllreduce: op HorovodAllreduce failed with error: Timed out waiting for all ranks to join

ID: tensorflow/horovod-allreduce-timeout

其他格式: JSON · Markdown 中文 · English
82%修复率
84%置信度
1证据数
2023-07-25首次发现

版本兼容性

版本状态引入弃用备注
Horovod 0.25.0 active
TensorFlow 2.8.0 active
OpenMPI 4.1.1 active

根因分析

在使用 Horovod 的分布式 TensorFlow 训练设置中,一个或多个工作进程在 allreduce 操作期间未能同步,通常是由于网络问题、进程崩溃或工作进程之间的批次大小不一致。

English

In a distributed TensorFlow training setup using Horovod, one or more worker processes failed to synchronize during an allreduce operation, typically due to network issues, process crashes, or inconsistent batch sizes across workers.

generic

官方文档

https://horovod.readthedocs.io/en/stable/troubleshooting.html

解决方案

  1. 检查所有工作进程是否正在运行,并且批次大小一致。使用 `hvd.allreduce(tf.constant(1))` 作为简单测试来验证通信。确保每个工作进程具有相同数量的批次。
  2. 通过向 mpirun 传递 `--mca btl_tcp_if_include eth0` 指定稳定的网络接口,并添加 `--mca oob_tcp_connect_timeout 30` 处理慢速连接,增加 MPI 的网络超时时间。
  3. 确保所有工作进程使用相同的数据集分片方法(例如,使用 hvd.DistributedOptimizer 和一致的分片)。验证数据集大小可被工作进程数整除。

无效尝试

常见但无效的做法:

  1. 80% 失败

    If the underlying issue is a dead worker or network partition, increasing timeout only delays the failure; the error will still occur.

  2. 70% 失败

    Reducing workers may mask the problem but does not fix the underlying synchronization issue; future runs may still fail.

  3. 60% 失败

    Disabling fusion changes communication patterns but does not address worker timeout due to crashes or network drops.