create_group
Applicability
Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
√ |
√ |
|
√ |
|
☓ |
|
√ |
|
√ |
For
For the
Function
Creates a custom group for collective communication.
If a custom group is created without calling this API, all devices involved in cluster training are created as a global hccl_world_group by default.
- hccl_world_group: default global group (created by HCCL automatically), including all ranks that participate in collective communication.
- Custom groups: a subset of process groups contained in hccl_world_group.
Prototype
1 | def create_group(group, rank_num, rank_ids) |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
group |
Input |
A string containing a maximum of 128 bytes, including the end character. The group name specifies the identifier of a collective communication group. It cannot be the default global group name hccl_world_group. Otherwise, the group fails to be created. |
rank_num |
Input |
An int. Number of ranks in a group. The maximum value is 32768. |
rank_ids |
Input |
A list. List of world_rank_ids that form the group. Different types of boards have different restrictions. For the
Atlas 300I Duo Inference Card: Only single-server scenarios are supported, and there is no restriction on rank_ids. Supplementary notes: It is recommended that rank_ids be sorted based on the physical connection sequence of devices, that is, devices that are physically close to each other are arranged together. For example, if device_ip is set in ascending order based on the physical connection sequence, you are advised to set rank_ids in ascending order. |
Returns
None
Constraints
- This API must be called after the initialization of collective communication is complete.
- The caller rank must be within the range defined by the group argument passed to this API call. Otherwise, the API call fails.
Call Example
1 2 | from hccl.manage.api import create_group create_group("myGroup", 4, [0, 1, 2, 3]) |