SetRole

Applicability

Product

Supported (Yes/No)

Atlas 350 Accelerator Card

No

Atlas A3 training product/Atlas A3 inference product

Yes

Atlas A2 training product/Atlas A2 inference product

Yes

Atlas 200I/500 A2 inference product

No

Atlas inference product

No

Atlas training product

No

Note: For the 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 instance. You are advised to use it only when PagedAttention is enabled.

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 Options

Option

Optional/Mandatory

Description

OPTION_LISTEN_IP_INFO

Mandatory when the role is Prompt

IP address and port number of the device, for example, "192.168.1.1:26000".

Returns

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

Exception Handling

None

Constraints

This API can be used only when OPTION_ENABLE_SET_ROLE is set to 1 during LLM-DataDist initialization.