APIs

HCCL provides communication operator APIs, communicator management APIs, and group call APIs to help framework developers implement distributed capabilities.
The HCCL API definition files are as follows:

Communication Operator APIs

API

Description

HcclBroadcast

Broadcasts the data of the root rank in the communicator to other ranks.

HcclAllGather

Re-sorts the inputs of all ranks in the communicator by rank ID, combines the inputs, and sends the results to the outputs of all ranks.

HcclAllGatherV

Re-sorts the inputs of all ranks in the communicator by rank ID, combines the inputs, and sends the results to the outputs of all ranks.

Unlike AllGather, the AllGatherV operator allows different data sizes to be configured for the input of different ranks in the communicator.

HcclReduce

Performs the sum operation (or other reduction operations) on the data of all ranks and sends the result to the specified position on the root rank.

HcclAllReduce

Adds the input data of all nodes in the communicator (or performs other reduction operations) and sends the result to the output buffer of all nodes. The reduction operation type is specified by the op parameter.

HcclScatter

Scatters data of the root rank to other ranks.

HcclReduceScatter

Functions as the operation API of the ReduceScatter operator to evenly divide the input data of all ranks in a communicator into rank size parts, perform reduction (sum, prod, max, and min) on 1/rank size part of data of each rank, and distributes the result to the output buffer of each rank based on the number.

HcclReduceScatterV

Functions as the operation API of the ReduceScatterV operator, which is similar to the ReduceScatter operation. The difference is that the ReduceScatterV operation supports the configuration of different data sizes for different ranks in a communicator. (The data size can be configured for different IDs in a rank, but the data size of the same ID in different ranks must be the same.) After the reduction operation (sum, prod, max, and min) is performed on data with the same ID in each rank, the result is distributed to the output buffer of each rank based on the ID.

HcclAlltoAll

Sends the same-sized data to all ranks in the communicator and receives the same-sized data from all ranks.

HcclAlltoAllV

Sends data (with customizable size) to all ranks in the communicator and receives data from all ranks.

HcclAlltoAllVC

Sends data (with customizable size) to all ranks in the communicator and receives data from all ranks. Unlike AlltoAllV, AlltoAllVC uses the input parameter sendCountMatrix to pass the RX and TX parameters of all ranks.

HcclSend

Sends the data at the specified location on the current rank to the specified location on the destination rank.

HcclRecv

Receives data from the source rank to the specified location on the current rank.

HcclBatchSendRecv

Completes sending and receiving tasks in batches on the current rank. The sending and receiving tasks of the current rank are asynchronous and do not block each other.

Communicator Management APIs

Group Call APIs

API

Description

HcclGroupStart

Starts a group call.

HcclGroupEnd

Ends a group call.