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 25 26 27 | 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]; char hcclBufferName[BUFFER_NAME_MAX_LENGTH]; uint32_t hcclQos; uint64_t hcclSymWinMaxMemSizePerRank; } HcclCommConfig; |
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 does not need to be enabled. However, if the model execution results are different or precision tuning is required, you can enable deterministic computing to assist debugging and optimization. Note that enabling deterministic computing will slow down operator execution and degrade performance.
The communicator name must be unique. If not specified, the name is generated by HCCL.
The following lists the values and meanings supported by different AI processors.
This value is applicable to Broadcast, Reduce, AllReduce, Scatter, ReduceScatter, AllGather, AlltoAll, AlltoAllV, and AlltoAllVC, Send, Recv, and BatchSendRecv.
In graph (Ascend IR) or graph capture (ACLGraph) mode, when the communication algorithm uses the AICPU mode, the number of concurrent graphs on a single device cannot exceed 6. Otherwise, the communication may be blocked because the AICPU cores are fully occupied.
If the number of Vector Cores allocated during service compilation fails to meet the algorithm orchestration requirements, HCCL will throw an error and prompt the minimum number of Vector Cores required.
In MS mode, the CCU on-chip memory slice serves as a transit to communicate with multiple remote ends, saving the memory read/write bandwidth. The MS features small size and fast speed. When CCU resources are insufficient, the system automatically switches to the AICPU mode (2).
In scheduling mode, the CCU serves as a scheduler to dispatch UB WQE tasks to the UB engine. The scheduling mode does not use the CCU on-chip MS. Instead, it performs on-chip memory to on-chip memory data transfer between two ranks.
For the AllReduce, ReduceScatter, and Reduce operators in single-server communication, when the data size exceeds a certain value, the system automatically switches to the AICPU mode (2) to prevent performance degradation. (The threshold is not fixed and may vary depending on factors such as the operator running mode and network scale.)
When CCU resources are insufficient, the system automatically switches to the AICPU mode (2).
If the number of Vector Cores allocated during service compilation fails to meet the algorithm orchestration requirements, HCCL will throw an error and prompt the minimum number of Vector Cores required.
This option supports only the AllGather, AlltoAll, AlltoAllV, and AlltoAllVC operators.
In graph (Ascend IR) or graph capture (ACLGraph) mode, when the communication algorithm uses the AICPU mode, the number of concurrent graphs on a single device cannot exceed 6. Otherwise, the communication may be blocked because the AICPU cores are fully occupied.
If the number of Vector Cores allocated during service compilation fails to meet the algorithm orchestration requirements, HCCL will throw an error and prompt the minimum number of Vector Cores required.
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 and 1 are fixed at 0, and bits 2 to 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 is invalid. The environment variable 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 is invalid. The environment variable 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 is invalid. The environment variable 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, rank count, 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-SuperPoD physical layers. Each layer supports two states: enabled and disabled. For details about the constraints, see the environment variable HCCL_OP_RETRY_ENABLE. The configuration method is hcclRetryEnable = "L1:1, L2:0". The parameter values are as follows:
Parameter |
Priority |
|---|---|
hcclBufferSize |
Parameter hcclBufferSize (communicator-granularity) > environment variable HCCL_BUFFSIZE (global) > default value 200 |
hcclDeterministic |
Parameter hcclDeterministic (communicator-granularity) > environment variable HCCL_DETERMINISTIC (global) > default value 0 (disabling deterministic computing) |
hcclOpExpansionMode |
Parameter hcclOpExpansionMode (communicator-granularity) > environment variable HCCL_OP_EXPANSION_MODE (global) > default value 0 |
hcclRdmaTrafficClass |
Parameter hcclRdmaTrafficClass (communicator-granularity) > environment variable HCCL_RDMA_TC (global) > default value 132 |
hcclRdmaServiceLevel |
Parameter hcclRdmaServiceLevel (communicator-granularity) > environment variable HCCL_RDMA_SL (global) > default value 4 |
hcclExecTimeOut |
Parameter hcclExecTimeOut (communicator-granularity) > environment variable HCCL_EXEC_TIMEOUT (global) > default value 1836 |
hcclAlgo |
Parameter hcclAlgo (communicator-granularity) > environment variable HCCL_ALGO (global) > default value |
hcclRetryEnable |
Parameter hcclRetryEnable (communicator-granularity) > environment variable HCCL_OP_RETRY_ENABLE (global) > default value |
hcclRetryParams |
Parameter hcclRetryParams (communicator-granularity configuration) > environment variable HCCL_OP_RETRY_PARAMS (global) > default value |