HCCL_NPU_SOCKET_PORT_RANGE

Description

Configures the communication port used by HCCL on the NPU when the communicator is created based on root node information.

This environment variable can be set to a specific port, port range, or the string auto.
  • If a specific port number or port range is specified, it is recommended that the number of planned ports be greater than or equal to the number of HCCL processes on a single NPU. The port number ranges from [1, 65535]. Ensure that the specified port is not occupied by other processes. Note that ports [1, 1023] are reserved for the system. Avoid using these ports.

    The port number and port range can be used together. Use commas (,) to separate them. However, the port numbers and port ranges separated by commas (,) cannot overlap. For details about configuration, see Example.

  • If this environment variable is set to auto, the NPU port number used by HCCL is dynamically allocated by the OS.
  • If this environment variable is not set, the default communication port used by HCCL on the NPU is 16666.

Example

1
2
3
4
5
6
7
8
// Method 1: Set this environment variable to a port range.
export HCCL_NPU_SOCKET_PORT_RANGE="61000-61050"
// Method 2: Use a specific port number together with a port range, and separate them with commas (,).
export HCCL_NPU_SOCKET_PORT_RANGE="61000,61050-61100,61200-61210"
// Method 3: Specify port numbers, and separate them with commas (,).
export HCCL_NPU_SOCKET_PORT_RANGE="57000,57005,57007,58008,58100,58105,58107,58108"
// Method 4: The OS dynamically allocates port numbers.
export HCCL_NPU_SOCKET_PORT_RANGE="auto"

Constraints

  • In multi-device scenarios, if this environment variable needs to be configured, it must be configured for all devices within the same communicator.
  • If multiple service processes share one NPU, you are advised to configure this environment variable. Otherwise, the service may fail to run due to port conflicts. However, multiple processes affect resource overheads and communication performance.
  • For the Atlas A2 training product/Atlas A2 inference product, if there are MC² operators (such as AllGatherMatmul, MatmulReduceScatter, and AlltoAllAllGatherBatchMatMul) on the network, this environment variable cannot be configured.

Applicability

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product (For Atlas A2 training product/Atlas A2 inference product, only the Atlas 800T A2 training server, Atlas 900 A2 PoD cluster basic unit, and Atlas 200T A2 Box16 heterogeneous subrack are supported.)