HCCL Template Parameters

Applicability

Product

Supported

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas 200I/500 A2 inference products

x

Atlas inference product's AI Core

x

Atlas inference product's Vector Core

x

Atlas training products

x

Function

The template parameter needs to be passed when an HCCL object is created.

Prototype

The HCCL class is defined as follows. For details about the template parameters, see Table 1 HCCL class template parameters.

1
2
template <HcclServerType serverType = HcclServerType::HCCL_SERVER_TYPE_AICPU, const auto &config = DEFAULT_CFG>
class Hccl;

Parameters

Table 1 HCCL class template parameters

Parameter

Description

serverType

Supported server type. The HcclServerType type is defined as follows:

For the Atlas A2 training products/Atlas A2 inference products, only HCCL_SERVER_TYPE_AICPU is supported currently.

For the Atlas A3 training products/Atlas A3 inference products, only HCCL_SERVER_TYPE_AICPU is supported currently.

1
2
3
4
enum HcclServerType {
HCCL_SERVER_TYPE_AICPU = 0,
HCCL_SERVER_TYPE_END // Reserved.
}

config

Specifies the core that delivers tasks to the server. The type is HcclServerConfig, which is defined as follows. The default value is DEFAULT_CFG = {CoreType::DEFAULT, 0}.

1
2
3
4
struct HcclServerConfig {
    CoreType type; // Type of the core that delivers tasks to the server.
    int64_t blockId; // ID of the core that delivers tasks to the server.
};

CoreType is defined as follows:

1
2
3
4
5
enum class CoreType: uint8_t {
    DEFAULT,  // No AIC or AIV core is specified.
    ON_AIV,     // AIV core is specified.
    ON_AIC     // AIC core is specified.
};

Returns

None

Restrictions

None

Example

Create an HCCL object by passing the template parameter config. Specify that the HCCL client sends communication messages to the server only on core 10 of AIV, instead of specifying the running core by calling the GetBlockIdx API.
1
2
3
static constexpr HcclServerConfig HCCL_CFG = {CoreType::ON_AIV, 10};
// Select AI CPU as the server.
Hccl<HcclServerType::HCCL_SERVER_TYPE_AICPU, HCCL_CFG> hccl;