SetRole

Applicable Products

Product

Supported (√/x)

Ascend 950PR/Ascend 950DT

√

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 products

x

Atlas training products

x

Note: For Atlas A2 training products/Atlas A2 inference products, only the Atlas 800I A2 inference server and A200I A2 Box heterogeneous subrack are supported.

Function Description

Sets the role of the LLM-DataDist.

Prototype

1
Status SetRole(LlmRole role, const std::map<AscendString, AscendString> &options = {})

Parameters

Parameter

Input/Output

Description

role

Input

Role type. For details about the options, see LlmRole.

options

Input

Role parameters. For details about the supported parameters, see Table 1.

Table 1 Configuration item

Configuration Item

Optional/Mandatory

Description

OPTION_LISTEN_IP_INFO

Optional

  • When the LLM-DataDist instance is initialized as a client, set this configuration item to the listening host IP address and port number only if a switch to the server role is required. A value example is "192.168.1.1:26000". Otherwise, do not set this configuration item.
  • When the LLM-DataDist instance is initialized as a server, omitting this configuration item indicates a switch to the client role. If this configuration item is set, the instance stays in the server role, and any port number differing from the one used during initialization will take precedence. A value example is "192.168.1.1:26001".
  • When this configuration item specifies the hixl backend, the listening port cannot be changed using SetRole.

Returns

  • LLM_SUCCESS: The role is set successfully.
  • LLM_PARAM_INVALID: Incorrect parameter.
  • LLM_EXIST_LINK: Residual link resources exist.
  • Other values: Failure.

Exception Handling

None

Constraints

Before using this API, disconnect the link from the current DataDist.