SetRole

Applicability

Product

Supported (√/x)

Atlas 350 Accelerator Card

x

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

x

Atlas inference product

x

Atlas training product

x

Note: For Atlas A2 training product/Atlas A2 inference product, 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.

Example

Click Gitee, download the sample package of the matching version based on the tag name, and obtain the sample from the cplusplus/level1_single_api/11_llm_data_dist directory.

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

Restrictions

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