AbortedError: HorovodAllreduce: op HorovodAllreduce failed with error: Timed out waiting for all ranks to join
ID: tensorflow/horovod-allreduce-timeout
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| Horovod 0.25.0 | active | — | — | — |
| TensorFlow 2.8.0 | active | — | — | — |
| OpenMPI 4.1.1 | active | — | — | — |
Root Cause
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中文
在使用 Horovod 的分布式 TensorFlow 训练设置中,一个或多个工作进程在 allreduce 操作期间未能同步,通常是由于网络问题、进程崩溃或工作进程之间的批次大小不一致。
Official Documentation
https://horovod.readthedocs.io/en/stable/troubleshooting.htmlWorkarounds
-
90% success Check that all worker processes are running and have consistent batch sizes. Use `hvd.allreduce(tf.constant(1))` as a simple test to verify communication. Ensure that each worker has the same number of batches.
Check that all worker processes are running and have consistent batch sizes. Use `hvd.allreduce(tf.constant(1))` as a simple test to verify communication. Ensure that each worker has the same number of batches.
-
85% success Increase the network timeout for MPI by passing `--mca btl_tcp_if_include eth0` to mpirun to specify a stable network interface, and add `--mca oob_tcp_connect_timeout 30` to handle slow connections.
Increase the network timeout for MPI by passing `--mca btl_tcp_if_include eth0` to mpirun to specify a stable network interface, and add `--mca oob_tcp_connect_timeout 30` to handle slow connections.
-
80% success Ensure all workers use the same dataset sharding method (e.g., using hvd.DistributedOptimizer with consistent sharding). Verify that the dataset size is divisible by the number of workers.
Ensure all workers use the same dataset sharding method (e.g., using hvd.DistributedOptimizer with consistent sharding). Verify that the dataset size is divisible by the number of workers.
中文步骤
检查所有工作进程是否正在运行,并且批次大小一致。使用 `hvd.allreduce(tf.constant(1))` 作为简单测试来验证通信。确保每个工作进程具有相同数量的批次。
通过向 mpirun 传递 `--mca btl_tcp_if_include eth0` 指定稳定的网络接口,并添加 `--mca oob_tcp_connect_timeout 30` 处理慢速连接,增加 MPI 的网络超时时间。
确保所有工作进程使用相同的数据集分片方法(例如,使用 hvd.DistributedOptimizer 和一致的分片)。验证数据集大小可被工作进程数整除。
Dead Ends
Common approaches that don't work:
-
80% fail
If the underlying issue is a dead worker or network partition, increasing timeout only delays the failure; the error will still occur.
-
70% fail
Reducing workers may mask the problem but does not fix the underlying synchronization issue; future runs may still fail.
-
60% fail
Disabling fusion changes communication patterns but does not address worker timeout due to crashes or network drops.