HcclReduceScatterV

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.

For the Atlas inference products, only the Atlas 300I Duo inference card is supported.

Function

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.

Prototype

1
HcclResult HcclReduceScatterV(void *sendBuf, const void *sendCounts, const void *sendDispls, void *recvBuf, uint64_t recvCount, HcclDataType dataType, HcclReduceOp op, HcclComm comm, aclrtStream stream)

Parameters

Parameter

Input/Output

Description

sendBuf

Input

Address of the send buffer.

sendCounts

Input

Size of data in sendBuf of each rank involved in the ReduceScatterV operation, which is an array of the uint64 type.

The ith element of this array indicates the data size to send to rank i.

sendDispls

Input

Offset of data of each rank in sendBuf involved in the ReduceScatterV operation (unit: dataType), which is an array of the uint64 type.

The ith element of this array indicates the offset in sendBuf for the data sent to rank i.

recvBuf

Output

Address of the buffer to receive collective communication results.

The addresses configured for recvBuf and sendBuf must be different.

recvCount

Input

Size of rank-specific data in recvBuf involved in the ReduceScatterV operation.

If the rank ID is i, the value of recvCount must be the same as that of the element with the index of i in the sendCounts array.

dataType

Input

Data type of the ReduceScatterV operation, which is of the HcclDataType type.

Atlas 350 Accelerator Card: The supported data types are int8, int16, int32, float16, float32, and bfp16.

Atlas A3 training product/Atlas A3 inference product: The supported data types are int8, int16, int32, int64, float16, float32, and bfp16.

Atlas A2 training product/Atlas A2 inference product: The supported data types are int8, int16, int32, float16, float32, and bfp16.

Atlas 300I Duo Inference Card: The supported data types are int16, float16, and float32.

op

Input

Reduction operation type.

Atlas 350 Accelerator Card: The supported operation types are sum, max, and min.

Atlas A3 training product/Atlas A3 inference product: The supported operation types are sum, max, and min.

Atlas A2 training product/Atlas A2 inference product: The supported operation types are sum, max, and min.

Atlas 300I Duo Inference Card: Only the sum operation type is supported.

comm

Input

Communicator where the operation is performed.

stream

Input

Stream of the rank.

Returns

HcclResult: HCCL_SUCCESS on success, or else failure.

Constraints

  • All ranks must have the same sendCounts, sendDispls, dataType, and op.
  • Atlas 350 Accelerator Card: Only the single-server scenario is supported, and operators must be expanded on CCU.
  • Atlas A3 training product/Atlas A3 inference product: Only the single-server scenario is supported.
  • Atlas A2 training product/Atlas A2 inference product: Only the symmetric multi-server distribution scenario is supported. The asymmetric distribution (that is, asymmetric number of devices) scenario is not supported.
  • Atlas 300I Duo Inference Card: Only the single-server scenario is supported, and a maximum of 2 Atlas 300I Duo Inference Cards (4 NPUs) can be deployed on a single server.
  • The input and output addresses (sendBuf and recvBuf) of the operator must meet the following alignment requirements based on different data types:
    • int8: 1-byte aligned
    • int16, float16, bfp16: 2-byte aligned
    • int32 and float32: 4-byte aligned
    • int64: 8-byte aligned