提交 b9c37112 编写于 作者: M Megvii Engine Team

refactor(mge/distributed): skip barrier when running with single node

GitOrigin-RevId: 6cd5a2e1e2447b9b41a9b842e2656121aac36308
上级 3bf73ff1
...@@ -173,5 +173,8 @@ def new_group(proc_ranks: List[int]) -> Group: ...@@ -173,5 +173,8 @@ def new_group(proc_ranks: List[int]) -> Group:
def group_barrier(group: Optional[Group] = WORLD) -> None: def group_barrier(group: Optional[Group] = WORLD) -> None:
"""Block until all ranks in the group reach this barrier.""" """Block until all ranks in the group reach this barrier."""
# if running with single node, skip it
if _sd is None:
return
assert isinstance(group, Group) assert isinstance(group, Group)
_sd.client.group_barrier(group.key, group.size) _sd.client.group_barrier(group.key, group.size)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册