APIs

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

Communication Operator APIs

API

Description

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.

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.

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

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 and then perform reduction (sum, prod, max, and min) on 1/rank size part of data of each rank. Finally, the result is distributed to the output buffer of each rank based on the rank ID.

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.

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.

HcclAlltoAll

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

HcclAlltoAllV

Sends data (whose size can be customized) to all ranks in the communicator and receives data from all ranks.

HcclAlltoAllVC

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

HcclScatter

Scatters data of the root rank to other 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