forked from mindspore-Ecosystem/mindspore
support one node communication group
This commit is contained in:
parent
7fbaf2f629
commit
371b3338b6
|
@ -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():
|
||||||
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
|
||||||
|
|
Loading…
Reference in New Issue