oneflow icon indicating copy to clipboard operation
oneflow copied to clipboard

Optimize broadcast strategy

Open Pang-GJ opened this issue 1 year ago • 0 comments

relate: https://github.com/Oneflow-Inc/OneTeam/issues/1952

n 机 k 卡,只要 n <= k ,经过测试使用 local_rank_0 代理会更优 如果是 8 机 8 卡,我们可以做成 7次 master -> local_rank_0 + local_rank_0 到 local_rank_n,这个是优于 master -> local_rank_k + othre_rank_k 到 local_rank_n 的。

利用 issue 里的模拟同步工具,测试 2 机 8 rank 结果:

  • https://github.com/Oneflow-Inc/OneTeam/issues/1952#issuecomment-1495248180
  • https://github.com/Oneflow-Inc/OneTeam/issues/1952#issuecomment-1495264311

总耗时减少大概 50 %。

缺点: 这种方案只适用于机器数少的情况,机器数多了,master负载会太高

Pang-GJ avatar Apr 04 '23 07:04 Pang-GJ