![](/img/trans.png)
[英]Why is gradient clipping not supported with a distribution strategy in Tensorflow?
[英]Tensorflow Mirror Strategy and Horovod Distribution Strategy
我試圖了解 Tensorflow Mirror Strategy 和 Horovod Distribution Strategy 之間的基本區別是什么。
從文檔和源代碼調查中,我發現 Horovod ( https://github.com/horovod/horovod ) 正在使用消息傳遞協議 (MPI) 在多個節點之間進行通信。 具體來說,它使用 MPI 的 all_reduce、all_gather。
從我的觀察(我可能是錯的)鏡像策略也使用 all_reduce 算法( https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/distribute )。
他們都使用數據並行、同步的訓練方法。 所以我有點困惑它們有什么不同? 區別僅在於實現還是有其他(理論上的)區別?
以及與 horovod 相比,鏡像策略的性能如何?
鏡像策略有自己的 all_reduce 算法,該算法在后台使用遠程過程調用 (gRPC)。
就像你提到的 Horovod 使用 MPI/GLOO 在多個進程之間進行通信。
關於性能,我的一位同事在使用 4 個 Tesla V100 GPU 之前使用這里的代碼進行了實驗。 結果表明,3設置的工作情況最好的: replicated
與all_reduce_spec=nccl
, collective_all_reduce
與適當調諧allreduce_merge_scope
(例如32),和horovod
。 我沒有看到這 3 種之間的顯着差異。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.