HCCL Tiling Constructor

Function

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 A3 training products / Atlas A3 inference products , 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 AlltoAllcommunication tasks.
  • "BatchWrite=level0:fullmesh": BatchWrite communication task.

For the Atlas A2 training products / Atlas A2 inference products , this parameter is reserved and does not take effect after being configured. By default, only the FullMesh algorithm is supported. Full-mesh algorithm. Full-mesh connections are established between NPUs, that is, data can be directly transmitted between any two NPUs. For details about the algorithm of "Collective Communication Algorithm Introduction" 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 a communication task. The parameter is of the uint8_t type. For details about the value range, see Table 1.

Atlas A3 training products / Atlas A3 inference products . This parameter is not supported currently and does not take effect after being configured.

Atlas A2 training products / Atlas A2 inference products . 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.

Atlas A3 training products / Atlas A3 inference products . This parameter is not supported currently and does not take effect after being configured.

Atlas A2 training products / Atlas A2 inference products . 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 (Table 2).

Table 2 HcclCMDType parameter

Data Type

Description

HcclCMDType

Communication task type.

For the Atlas A3 training products / Atlas A3 inference products , 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 products / Atlas A2 inference products , 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

Example

 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);