提交 3b083d07 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!550 support one node communication group

Merge pull request !550 from yao_yf/support_one_node_communication_group
......@@ -334,8 +334,8 @@ def _create_group_helper(group, rank_ids, backend):
if not isinstance(rank_ids, list):
raise TypeError("Rank_ids {} should be list".format(rank_ids))
rank_size = len(rank_ids)
if rank_size < 2:
raise ValueError("Rank_ids size {} should be large than 1".format(rank_size))
if rank_size < 1:
raise ValueError("Rank_ids size {} should be large than 0".format(rank_size))
if len(rank_ids) - len(list(set(rank_ids))) > 0:
raise ValueError("List rank_ids in Group {} has duplicate data!".format(group))
hccl.create_group(group, rank_size, rank_ids)
......
......@@ -99,7 +99,7 @@ def test_raise_error_funcs():
assert has_raise_error(create_backend, 'nccl') is False
assert has_raise_error(get_group_size_int, 123) is True
assert has_raise_error(create_group0, (0,1)) is True
assert has_raise_error(create_group1, [0]) is True
assert has_raise_error(create_group1, [0]) is False
assert has_raise_error(create_group2, [0,0,1]) is True
assert has_raise_error(create_group3, [0,1]) is True
assert has_raise_error(create_group4, [0,1]) is False
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册