SetReduceType

Function Usage

Sets the reduction operation type. This parameter is valid only for communication tasks that have reduction operations.

Prototype

1
uint32_t SetReduceType(uint32_t reduceType, uint8_t dstDataType = 0, uint8_t srcDataType = 0)

Parameters

Table 1 Parameters

Parameter

Input/Output

Description

reduceType

Input

Reduction operation type. This parameter is valid only for communication tasks that have reduction operations. The parameter is of the uint32_t type. The value is provided in Table 2.

dstDataType

Input

Data type of the output data in the communication task. The parameter is of the uint8_t type. For details about the value range, see Table 1.

For the Atlas 350 Accelerator Card, different communication tasks support different output data types. The details are as follows:

  • For AllReduce, AllGather, AllToAll, AllToAllV, and AllToAllVWrite communication tasks, the output data type must be the same as the input data type. For details about the input data types supported by all communication tasks, see srcDataType.
  • For the ReduceScatter communication task, if the input data type is int16_t, int32_t, half, float, or bfloat16_t, the output data type must be the same as the input data type. If the input data type is int8_t, hifloat8_t, fp8_e5m2_t or fp8_e4m3fn_t, the output data type must be half, bfloat16_t, or float.

For the Atlas A3 training product/Atlas A3 inference product, this parameter is not supported currently and does not take effect after being configured.

For the Atlas A2 training product/Atlas A2 inference product, this parameter is not supported currently and does not take effect after being configured.

srcDataType

Input

Data type of the input data in the communication task. The parameter is of the uint8_t type. For details about the value range, see Table 1.

For the Atlas 350 Accelerator Card, different communication tasks support the following input data types:

  • AllReduce communication task: supported input types are int16_t, half, bfloat16_t, int32_t, and float.
  • AllGather, AllToAll, AllToAllV, and AllToAllVWrite communication tasks: supported input types are int8_t, uint8_t, hifloat8_t, fp8_e5m2_t, fp8_e4m3fn_t, int16_t, uint16_t, half, bfloat16_t, int32_t, uint32_t, float, int64_t, and double.
  • ReduceScatter communication task: supported input types are int8_t, hifloat8_t, fp8_e5m2_t, fp8_e4m3fn_t, int16_t, half, bfloat16_t, int32_t, and float.

For the Atlas A3 training product/Atlas A3 inference product, this parameter is not supported currently and does not take effect after being configured.

For the Atlas A2 training product/Atlas A2 inference product, this parameter is not supported currently and does not take effect after being configured.

Returns

  • 0: Setting succeeded.
  • Other values: Setting failed.

Restrictions

None

Examples

For details about the calling example of this API, see Examples.