HCCL Tiling Constructor

Function Usage

Creates an Mc2CcTilingConfig object.

Prototype

1
Mc2CcTilingConfig(const std::string &groupName, uint32_t opType, const std::string &algConfig, uint32_t reduceType = 0, uint8_t dstDataType = 0, uint8_t srcDataType = 0, uint8_t commEngine = 0)

Parameters

Table 1 Parameters

Parameter

Input/Output

Description

groupName

Input

Communicator where the current communication task is located. The value is of the string type and can contain a maximum of 128 bytes.

opType

Input

Type of a communication task. The type is uint32_t. HCCL APIs provide the HcclCMDType enumeration definition as the value of this parameter. For details about the supported communication task types and values, see Table 2.

algConfig

Input

Communication algorithm configuration. The value is of the string type and can contain a maximum of 128 bytes.

For the Atlas 350 Accelerator Card, this parameter is reserved and does not take effect after being configured. By default, only the FullMesh algorithm is supported. The FullMesh algorithm implies full-mesh connections between NPUs, enabling data transmission between any two NPUs. For details, see Introduction to HCCL in .

For the Atlas A3 training product / Atlas A3 inference product , the following values are supported:

  • "AllReduce=level0:doublering": AllReduce communication task.
  • "AllGather=level0:doublering": AllGather communication task.
  • "ReduceScatter=level0:doublering": ReduceScatter communication task.
  • "AlltoAll=level0:fullmesh;level1:pairwise": AlltoAllV and AlltoAll communication tasks.
  • "BatchWrite=level0:fullmesh": BatchWrite communication task.

For the Atlas A2 training product / Atlas A2 inference product , this parameter is reserved and does not take effect after being configured. By default, only the FullMesh algorithm is supported. The FullMesh algorithm implies full-mesh connections between NPUs, enabling data transmission between any two NPUs. For details, see Introduction to HCCL in .

reduceType

Input

Reduction operation type. This parameter is valid only for communication tasks that have reduction operations. The value is of the uint32_t type. For details, see 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.

commEngine

Input

Communication engine. The value is of the uint8_t type. For details about the value range of this parameter, see hcclOpExpansionMode.

Table 2 HcclCMDType parameters

Data Type

Description

HcclCMDType

Type of a communication task.

For the Atlas 350 Accelerator Card, the supported communication task types are HCCL_CMD_ALLREDUCE, HCCL_CMD_ALLGATHER, HCCL_CMD_REDUCE_SCATTER, HCCL_CMD_ALLTOALL, HCCL_CMD_ALLTOALLV, and HCCL_CMD_HALF_ALLTOALLV.

For the Atlas A3 training product / Atlas A3 inference product , the supported communication task types are HCCL_CMD_ALLREDUCE, HCCL_CMD_ALLGATHER, HCCL_CMD_REDUCE_SCATTER, HCCL_CMD_ALLTOALL, HCCL_CMD_ALLTOALLV, and HCCL_CMD_BATCH_WRITE.

For the Atlas A2 training product / Atlas A2 inference product , the supported communication task types are HCCL_CMD_ALLREDUCE, HCCL_CMD_ALLGATHER, HCCL_CMD_REDUCE_SCATTER, HCCL_CMD_ALLTOALL, and HCCL_CMD_BATCH_WRITE.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
enum class HcclCMDType { 
    HCCL_CMD_INVALID = 0,
    HCCL_CMD_BROADCAST = 1,
    HCCL_CMD_ALLREDUCE,
    HCCL_CMD_REDUCE,
    HCCL_CMD_SEND,
    HCCL_CMD_RECEIVE,
    HCCL_CMD_ALLGATHER,
    HCCL_CMD_REDUCE_SCATTER,
    HCCL_CMD_ALLTOALLV,
    HCCL_CMD_ALLTOALLVC,
    HCCL_CMD_ALLTOALL,
    HCCL_CMD_GATHER,
    HCCL_CMD_SCATTER,
    HCCL_CMD_BATCH_SEND_RECV,
    HCCL_CMD_BATCH_PUT,
    HCCL_CMD_BATCH_GET,
    HCCL_CMD_ALLGATHER_V,
    HCCL_CMD_REDUCE_SCATTER_V,
    HCCL_CMD_BATCH_WRITE,
    HCCL_CMD_HALF_ALLTOALLV = 20,
    HCCL_CMD_ALL
};

Returns

None

Restrictions

None

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
const char *groupName = "testGroup";
uint32_t opType = HCCL_CMD_REDUCE_SCATTER;
std::string algConfig = "ReduceScatter=level0:fullmesh";
uint32_t reduceType = HCCL_REDUCE_SUM;
uint8_t dstDataType = HCCL_DATA_TYPE_FP16;
uint8_t srcDataType = HCCL_DATA_TYPE_FP16;
uint8_t commEngine = 0;
AscendC::Mc2CcTilingConfig mc2CcTilingConfig(groupName, opType, algConfig, reduceType, dstDataType, srcDataType, commEngine); // Constructor.
mc2CcTilingConfig.GetTiling(tiling->mc2InitTiling);  // tiling is the TilingData structure assembled by the operator.
mc2CcTilingConfig.GetTiling(tiling->reduceScatterTiling);