SetReduceDataTypeAbility (Deprecated)

This API has been deprecated and will be removed in later versions. Do not use this API. Use SetReduceType instead.

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

x

Atlas A2 training product/Atlas A2 inference product

x

Atlas 200I/500 A2 inference product

x

Atlas inference product AI Core

x

Atlas inference product Vector Core

x

Atlas training product

x

Function Usage

Sets the Reduce operation type, destination data type, and source data type. This function takes effect only for communication tasks that have reduction operations.

Prototype

1
__aicore__ inline bool SetReduceDataTypeAbility(HcclReduceOp op, HcclDataType dstDataType, HcclDataType srcDataType)

Parameters

Table 1 API parameters

Parameter

Input/Output

Description

op

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.

Different communication tasks support different output data types. The details are as follows:

  • For AllReduce, AllGather, 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.

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.

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 and AlltoAllV 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.
  • AlltoAllvWrite communication task: 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.

Returns

Returns whether the setting is successful.

Constraints

None

Examples

1
2
3
4
5
6
7
8
9
Hccl<HcclServerType::HCCL_SERVER_TYPE_CCU> hccl;
GM_ADDR contextGM = GetHcclContext<HCCL_GROUP_ID_0>();
hccl.InitV2(contextGM, &tilingData);
auto ret = hccl.SetCcTilingV2(offsetof(AllReduceCustomTilingData, mc2CcTiling));
if (ret) {
    return;
}

hccl.SetReduceDataTypeAbility(HcclReduceOp::HCCL_REDUCE_RESERVED, AscendC::HcclDataType::HCCL_DATA_TYPE_BFP16, AscendC::HcclDataType::HCCL_DATA_TYPE_BFP16);