提交 371b3338 编写于 作者: Y yao_yf

support one node communication group

上级 7fbaf2f6
...@@ -334,8 +334,8 @@ def _create_group_helper(group, rank_ids, backend): ...@@ -334,8 +334,8 @@ def _create_group_helper(group, rank_ids, backend):
if not isinstance(rank_ids, list): if not isinstance(rank_ids, list):
raise TypeError("Rank_ids {} should be list".format(rank_ids)) raise TypeError("Rank_ids {} should be list".format(rank_ids))
rank_size = len(rank_ids) rank_size = len(rank_ids)
if rank_size < 2: if rank_size < 1:
raise ValueError("Rank_ids size {} should be large than 1".format(rank_size)) raise ValueError("Rank_ids size {} should be large than 0".format(rank_size))
if len(rank_ids) - len(list(set(rank_ids))) > 0: if len(rank_ids) - len(list(set(rank_ids))) > 0:
raise ValueError("List rank_ids in Group {} has duplicate data!".format(group)) raise ValueError("List rank_ids in Group {} has duplicate data!".format(group))
hccl.create_group(group, rank_size, rank_ids) hccl.create_group(group, rank_size, rank_ids)
......
...@@ -99,7 +99,7 @@ def test_raise_error_funcs(): ...@@ -99,7 +99,7 @@ def test_raise_error_funcs():
assert has_raise_error(create_backend, 'nccl') is False assert has_raise_error(create_backend, 'nccl') is False
assert has_raise_error(get_group_size_int, 123) is True 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_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_group2, [0,0,1]) is True
assert has_raise_error(create_group3, [0,1]) is True assert has_raise_error(create_group3, [0,1]) is True
assert has_raise_error(create_group4, [0,1]) is False 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.
先完成此消息的编辑!
想要评论请 注册