This page looks best with JavaScript enabled

Ascend Environment Variable Configuration

 ·  ☕ 4 min read

HCCL_IF_IP

Configures the IP of the root communication NIC for HCCL initialization.

Priority: environment variable HCCL_IF_IP > environment variable HCCL_SOCKET_IFNAME > NICs other than docker/lo (in ascending lexicographic order of NIC name) > docker NIC > lo NIC.

1
export HCCL_IF_IP=10.0.0.1

HCCL_IF_BASE_PORT

Specifies the starting port number of the Host NIC. Once configured, the system occupies the 16 ports starting from this port by default for cluster information collection. The value range is [1024,65520].

1
export HCCL_IF_BASE_PORT=50000

HCCL_SOCKET_IFNAME

HCCL can obtain the Host IP through this NIC name.

The following formats are supported:

  • export HCCL_SOCKET_IFNAME=eth,enp, which means using all NICs whose names start with eth or enp.
  • export HCCL_SOCKET_IFNAME=^eth,enp, which means not using any NIC whose name starts with eth or enp.
  • export HCCL_SOCKET_IFNAME==eth0,enp0, which means using the eth0 NIC or the enp0 NIC.
  • export HCCL_SOCKET_IFNAME=^=eth0,enp0, which means not using the eth0 and enp0 NICs.

HCCL_SOCKET_FAMILY

Specifies the IP protocol used by the communication NIC.

1
2
export HCCL_SOCKET_FAMILY=AF_INET       #IPv4
export HCCL_SOCKET_FAMILY=AF_INET6      #IPv6

HCCL_CONNECT_TIMEOUT

Limits the timeout waiting time for the socket connection establishment process between different devices. The value range is [120,7200], and the default value is 120s.

1
export HCCL_CONNECT_TIMEOUT=200

HCCL_EXEC_TIMEOUT

Controls the synchronization waiting time between devices during execution. The value range differs across devices, and the default value is 1836s.

1
export HCCL_EXEC_TIMEOUT=1800

HCCL_INTRA_PCIE_ENABLE

Configures whether to use the PCIe loop for communication between multiple cards within a Server.

1
export HCCL_INTRA_PCIE_ENABLE=1

HCCL_INTRA_ROCE_ENABLE

Configures whether to use the RoCE loop for communication between multiple cards within a Server.

1
export HCCL_INTRA_ROCE_ENABLE=1

HCCL_WHITELIST_FILE

When the communication whitelist verification function has been enabled via HCCL_WHITELIST_DISABLE, this environment variable must be used to configure the path pointing to the HCCL communication whitelist configuration file. Only IP addresses in the communication whitelist are allowed to perform collective communication.

1
export HCCL_WHITELIST_FILE=/home/test/whitelist

File format { "host_ip": ["ip1", "ip2"], "device_ip": ["ip1", "ip2"] }

HCCL_WHITELIST_DISABLE

Configures whether to disable the communication whitelist when using HCCL. 1 means disable the whitelist, 0 means enable it, and the default value is 1.

1
export HCCL_WHITELIST_DISABLE=1

HCCL_RDMA_TC

Configures the traffic class of the RDMA NIC. The default value is 132.

1
export HCCL_RDMA_TC=100

HCCL_RDMA_SL

Configures the service level of the RDMA NIC. This value must be consistent with the PFC priority configured on the NIC; an inconsistent configuration may cause performance degradation. The value range is [0,7], and the default value is 4.

1
export HCCL_RDMA_SL=3

HCCL_BUFFSIZE

The size of the HCCL communication buffer.

By pre-allocating a certain amount of memory on the compute node for storing communication data, frequent memory allocation and release operations are avoided, thereby improving communication efficiency. The default value of HCCL_BUFFSIZE is 100 MB.

1
export HCCL_BUFFSIZE=200

HCCL_RDMA_TIMEOUT

Configures the coefficient timeout for the RDMA NIC retransmission timeout. The default value is 20.

1
export HCCL_RDMA_TIMEOUT=6

HCCL_RDMA_RETRY_CNT

Configures the number of retransmissions for the RDMA NIC. It must be configured as an integer. The value range is [1,7], and the default value is 7.

1
export HCCL_RDMA_RETRY_CNT=5

HCCL_BUFFSIZE

Controls the size of the buffer for sharing data between two NPUs. The unit is M, it must be configured as an integer, the value must be greater than or equal to 1, and the default value is 200M.

Calculation formula: (MircobatchSize SequenceLength hiddenSize sizeOf (DataType) )/(10241024), rounded up.

1
export HCCL_BUFFSIZE=200

HCCL_ALGO

Configures the cross-machine communication algorithm for collective communication between Servers. It supports two configuration methods: global algorithm type configuration and per-operator algorithm type configuration.

  • Global configuration
1
export HCCL_ALGO="level0:NA;level1:<algo>"

The value range of algo is ring, H-D_R, NHR, NHR_V1, NB, pipeline, pairwise.

  • Per-operator configuration
1
export HCCL_ALGO="<op0>=level0:NA;level1:<algo0>/<op1>=level0:NA;level1:<algo1>"

The value range of algo is op, algo.

HCCL_DIAGNOSE_ENABLE

Configures whether collective communication caches detailed information of some tasks, so that detailed logs can be printed when a task fails, for problem localization. 1 means enable, 0 means disable, and the default value is 0.

1
export HCCL_DIAGNOSE_ENABLE=1

HCCL_ENTRY_LOG_ENABLE

Controls how the collective communication operator invocation behavior logs are printed. 1 means print once per invocation, 0 means print in a unified way, and the default value is 0.

1
export HCCL_ENTRY_LOG_ENABLE=1

HCCL_OP_EXPANSION_MODE

Configures the orchestration expansion location of the communication algorithm. Value range:

  • AI_CPU, meaning the orchestration expansion location of the communication algorithm is the AI CPU compute unit on the Device side.
  • AIV, meaning the orchestration expansion location of the communication algorithm is the AI Vector Core compute unit of the Device.
  • The default is empty, keeping the original algorithm orchestration location.
1
export HCCL_OP_EXPANSION_MODE="AI_CPU"

HCCL_DETERMINISTIC

Configures whether to enable deterministic computation for reduction-type communication operators, where reduction-type communication operators include AllReduce, ReduceScatter, and Reduce. The default value is false, meaning it is not enabled.

1
export HCCL_DETERMINISTIC=true

微信公众号
WRITTEN BY
微信公众号