HcclGroupEnd

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product

Atlas training product

For Atlas A2 training product/Atlas A2 inference product, only the Atlas 800T A2 training server, Atlas 900 A2 PoD cluster basic unit, and Atlas 200T A2 Box16 heterogeneous subrack are supported.

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:

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();