Defines the configurations (including the buffer size, deterministic computing switch, and communicator name) of a communicator during initialization.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
const uint32_t HCCL_COMM_CONFIG_INFO_BYTES = 24; const uint32_t COMM_NAME_MAX_LENGTH = 128; const uint32_t BUFFER_NAME_MAX_LENGTH = 128; const uint32_t UDI_MAX_LENGTH = 128; const uint32_t HCCL_COMM_ALGO_MAX_LENGTH = 1600; const uint32_t HCCL_COMM_RETRY_ENABLE_MAX_LENGTH = 50; const uint32_t HCCL_COMM_RETRY_PARAMS_MAX_LENGTH = 128; typedef struct HcclCommConfigDef { char reserved[HCCL_COMM_CONFIG_INFO_BYTES]; /* Reserved field, which cannot be modified. */ uint32_t hcclBufferSize; uint32_t hcclDeterministic; char hcclCommName[COMM_NAME_MAX_LENGTH]; char hcclUdi[UDI_MAX_LENGTH]; uint32_t hcclOpExpansionMode; uint32_t hcclRdmaTrafficClass; uint32_t hcclRdmaServiceLevel; uint32_t hcclWorldRankID; uint64_t hcclJobID; uint8_t aclGraphZeroCopyEnable; int32_t hcclExecTimeOut; char hcclAlgo[HCCL_COMM_ALGO_MAX_LENGTH]; char hcclRetryEnable[HCCL_COMM_RETRY_ENABLE_MAX_LENGTH]; char hcclRetryParams[HCCL_COMM_RETRY_PARAMS_MAX_LENGTH]; } HcclCommConfig; |
|
Value |
Description |
|---|---|
|
0 |
Disables deterministic computing. This is the default value. |
|
1 |
Enables deterministic computing for reduction communication operators. |
|
2 |
Enables strict deterministic computing for a reduction communication operator, that is, the order-preserving function (ensuring that the reduction sequence of all bits is consistent on the basis of determinism). To set the parameter to this value, the following conditions must be met:
|
If deterministic computing is disabled, the results of multiple executions may be different. This is generally caused by asynchronous multi-thread executions during operator implementation, which changes the accumulation sequence of floating-point numbers. When deterministic computing is enabled, the same output is generated if an operator is executed for multiple times with the same hardware and input.
By default, deterministic computing or order preserving does not need to be enabled. However, if the model execution results for multiple times are different or the accuracy is to be optimized, you can enable deterministic computing or order preserving to assist debugging and optimization. However, after deterministic computing or order preserving is enabled, the operator execution becomes slow, resulting in performance deterioration.
The specified communicator name must be unique. If not specified, a name is generated by HCCL automatically.
|
Value |
Description |
|---|---|
|
0 |
Indicates to use the default algorithm orchestration expansion location.
|
|
1 |
Indicates to use the CPU on the host as the location for expanding the orchestration of the communication algorithm.
|
|
2 |
Indicates to use the AI CPU compute unit on the device as the location for expanding the orchestration of the communication algorithm.
|
|
3 |
Indicates to use the Vector Core compute unit on the device as the location for expanding the orchestration of the communication algorithm. This configuration supports only the symmetric networking and inference features.
In this configuration, if the data size does not meet the running requirements of the Vector Core, some operators are automatically switched to the default mode.
|
|
4 |
Indicates to use the Vector Core compute unit on the device as the location for expanding the orchestration of the communication algorithm. This configuration supports only the symmetric networking and inference features. In this configuration, the mode is not switched with the data size change. The Vector Core is always used for computing. If the running conditions of the Vector Core are not met, an error is reported and the system exits.
|
In the RoCE V2 protocol, this parameter corresponds to the Type of Service (ToS) field in the IP packet header. This parameter consists of 8 bits in total. Bits [0, 1] are fixed at 0, and bits [2, 7] represent the DSCP value (calculated by dividing this parameter value by 4).
Note:
0xFFFFFFFF is used as the priority judgment identifier. When this parameter is set to 0xFFFFFFFF, the communicator configuration is invalid. The environment variable configuration or the default value 132 is used based on the priority.
The value must be an unsigned integer ranging from 0 to 7.
Note:
0xFFFFFFFF is used as the priority judgment identifier. When this parameter is set to 0xFFFFFFFF, the communicator configuration is invalid. The environment variable configuration or the default value 4 is used based on the priority.
Note:
0xFFFFFFFF is used as the priority judgment identifier. When this parameter is set to 0xFFFFFFFF, the communicator configuration is invalid. The environment variable configuration or the default value 1836 is used based on the priority.
hcclAlgo = "level0:NA;level1:H-D_R"
# The AllReduce operator uses the Ring algorithm and the AllGather operator uses the RHD algorithm. Other operators automatically select a communication algorithm based on the product form, number of ranks, and data size. hcclAlgo = "allreduce=level0:NA;level1:ring/allgather=level0:NA;level1:H-D_R"
You can use this parameter to configure whether to enable the retry feature in the communicators of the inter-server and inter-supernode physical layers. Each layer supports two states: enabled and disabled. For details about the restrictions, see the environment variable HCCL_OP_RETRY_ENABLE. The configuration method is as follows: hcclRetryEnable = "L1:1, L2:0". The parameter values are as follows:
|
Parameter |
Configuration Priority |
|---|---|
|
hcclBufferSize |
Parameter hcclBufferSize (communicator-granularity configuration) > environment variable HCCL_BUFFSIZE (global configuration) > default value 200 |
|
hcclDeterministic |
Parameter hcclDeterministic (communicator-granularity configuration) > environment variable HCCL_DETERMINISTIC (global configuration) > default value 0 (disabling deterministic computing) |
|
hcclOpExpansionMode |
Parameter hcclOpExpansionMode (communicator-granularity configuration) > environment variable HCCL_OP_EXPANSION_MODE (global configuration) > default value 0 |
|
hcclRdmaTrafficClass |
Parameter hcclRdmaTrafficClass (communicator-granularity configuration) > environment variable HCCL_RDMA_TC (global configuration) > default value 132 |
|
hcclRdmaServiceLevel |
Parameter hcclRdmaServiceLevel (communicator-granularity configuration) > environment variable HCCL_RDMA_SL (global configuration) > default value 4 |
|
hcclExecTimeOut |
Parameter hcclExecTimeOut (communicator-granularity configuration) > environment variable HCCL_EXEC_TIMEOUT (global configuration) > default value 1836 |
|
hcclAlgo |
Parameter hcclAlgo (communicator-granularity configuration) > environment variable HCCL_ALGO (global configuration) > default value |
|
hcclRetryEnable |
Parameter hcclRetryEnable (communicator-granularity configuration) > environment variable HCCL_OP_RETRY_ENABLE (global configuration) > default value |
|
hcclRetryParams |
Parameter hcclRetryParams (communicator-granularity configuration) > environment variable HCCL_OP_RETRY_PARAMS (global configuration) > default value |