HcclGroupEnd
Applicability
Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
☓ |
√ |
|
√ |
|
☓ |
|
☓ |
|
☓ |
For
Function
Ends a group call.
Multiple functions are called between HcclGroupStart and HcclGroupEnd and executed collectively as a single unit. Group call supports the following scenarios:
- Single-process multi-thread NPU management: The communicator management APIs HcclCommInitClusterInfo, HcclCommInitClusterInfoConfig, HcclCommInitRootInfo, HcclCommInitRootInfoConfig and HcclCommDestroy can be called.
- Grouping multiple collective communication operations
- Grouping multiple point-to-point communication operations
Prototype
1 | HcclResult HcclGroupEnd() |
Parameters
None.
Returns
HcclResult: HCCL_SUCCESS on success, or else failure.
Constraints
- Using the group call APIs for communicator management is exclusively supported in single-node environments.
- In a group call, mixing communicator management, collective communication, and point-to-point communication APIs is not allowed.
- Calling the HcclBatchSendRecv API is not supported when grouping multiple point-to-point communications.
- The HcclGroupStart and HcclGroupEnd APIs must be used in pairs, with HcclGroupStart preceding HcclGroupEnd.
Call Example
- Example 1: Single-process multi-thread NPU management
HcclComm hccl_comms[devCount]; HcclGroupStart(); for(int i = 0; i < ndev; i++){ // aclrtSetDevice(i); HcclCommInitRootInfo(devCount, &rootInfo, global_rank, &(hccl_comms[i])); } HcclGroupEnd(); - Example 2: Grouping multiple collective communication operations
HcclGroupStart(); HCCLCHECK(HcclReduceScatter(sendBuf, recvBuf, 1, HCCL_DATA_TYPE_FP32, HCCL_REDUCE_SUM, hcclComm, stream)); HCCLCHECK(HcclAllGather(recvBuf, sendBuf, 1, HCCL_DATA_TYPE_FP32, hcclComm, stream)); HcclGroupEnd(); - Example 3: Grouping multiple point-to-point communication operations
HcclGroupStart(); for(int i = 0; i < devCount; i++){ HCCLCHECK(HcclSend(sendBuf[i], count, HCCL_DATA_TYPE_FP32, i, hcclComm, stream)); } for(int i = 0; i < devCount; i++){ HCCLCHECK(HcclRecv(recvBuf[i], count, HCCL_DATA_TYPE_FP32, i, hcclComm, stream)); } HcclGroupEnd();
Parent topic: Group Call