Service Configuration

Register

Description

Receives and processes client registration requests, performing initialization preparations for subscribing to related service configurations.

Prototype

rpc Register(ClientInfo) returns (Status) {}

Input Parameters

ParameterType (Protobuf Definition)Description
ClientInfo

message ClientInfo{

string jobId = 1;

string role = 2;

}

ClientInfo.jobId: Job ID.

ClientInfo.role: Client role.

Return Value

Return ValueType (Protobuf Definition)Description
Status

message Status{

int32 code = 1;

string info =2;

}

Status.code: Return code.

  • 0: successful registration.
  • Other values: registration failure.

Status.info: Return information.

SubscribeRankTable

Description

Receives a client's request to subscribe to the RankTable. The server assigns a message queue to each job and listens for pending messages in the queue. If messages are present, they are sent to the client via a gRPC stream.

Prototype

rpc SubscribeRankTable(ClientInfo) returns (stream RankTableStream) {}

Input Parameters

ParameterType (Protobuf Definition)Description
ClientInfo

message ClientInfo{

string jobId = 1;

string role = 2;

}

ClientInfo.jobId: Job ID.

ClientInfo.role: Client role.

Return Value

Return ValueType (Protobuf Definition)Description
streamgrpc stream
  • This API returns a gRPC stream (the specific data structure of the return value depends on the programming language selected by the client).
  • The client can call the stream's Receive method (the specific method name depends on the programming language selected by the client) to receive data pushed by the server.

Sending Data Description

Return ValueType (Protobuf Definition)Description
RankTableStream

message RankTableStream{

string jobId = 1;

string rankTable = 2;

}

RankTableStream.jobId: Job ID.

RankTableStream.rankTable: RankTable information. For detailed descriptions of each field, see Table 1.

global-ranktable Description

ClusterD generates global-ranktable in the RankTable field as the return message. Some fields in global-ranktable come from the hccl.json file. For details about the hccl.json file, see hccl.json File Description.

  • Example:

    {
        "version": "1.0",
        "status": "completed",
        "server_group_list": [
            {
                "group_id": "2",
                "deploy_server": "0",
                "server_count": "1",
                "server_list": [
                    {
                        "device": [
                            {
                                "device_id": "x",
                                "device_ip": "xx.xx.xx.xx",
                                "device_logical_id": "x",
                                "rank_id": "x"
                            }
                        ],
                        "server_id": "xx.xx.xx.xx",
                        "server_ip": "xx.xx.xx.xx"
                    }
                ]
            }
        ]
    }
  • Example (Atlas A3 Training Series Products):

    {
        "version": "1.2",
        "status": "completed",
        "server_group_list": [
            {
                "group_id": "2",
                "deploy_server": "1",
                "server_count": "1",
                "server_list": [
                    {
                        "device": [
                            {
                                "device_id": "0",
                                "device_ip": "xx.xx.xx.xx",
                                "super_device_id": "xxxxx",
                                "device_logical_id": "0",
                                "rank_id": "0"
                            }
                        ],
                        "server_id": "xx.xx.xx.xx",
                        "server_ip": "xx.xx.xx.xx"
                    }
                ],
                "super_pod_list": [
                    {
                        "super_pod_id": "0",
                        "server_list": [
                            {
                                "server_id": "xx.xx.xx.xx"
                            }
                        ]
                    }
                ]
            }
        ]
    }

Table 1 global-ranktable description

FieldDescription
versionVersion
statusStatus
server_group_listServer group list
group_idJob group ID
server_countNumber of servers
server_listServer list
server_idAI Server identifier, globally unique
server_ipPod IP
device_idNPU device ID
device_ipNPU device IP
super_device_idUnique identifier of the NPU within the Atlas A3 Training Series Products/SuperPoD
rank_idTraining rank ID corresponding to the NPU
device_logical_idLogical ID of the NPU
super_pod_listSuperPoD list
super_pod_idLogical SuperPoD ID