unlink_clusters

Applicable Products

Product

Supported (Yes/No)

Ascend 950PR/Ascend 950DT

No

Atlas A3 training products/Atlas A3 inference products

Yes

Atlas A2 training products/Atlas A2 inference products

Yes

Atlas 200I/500 A2 inference products

No

Atlas inference products

No

Atlas training products

No

Note: For the 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

Disconnects a link.

Prototype

1
unlink_clusters(clusters: Union[List[LLMClusterInfo], Tuple[LLMClusterInfo]], timeout=3000, force=False)

Parameters

Parameter

Data Type

Value Description

clusters

Union[List[LLMClusterInfo], Tuple[LLMClusterInfo]]

Cluster list.

timeout

int

Timeout interval, in milliseconds. The default timeout interval is 3000 ms.

force

bool

Whether to forcibly disconnect the link. The default value is False. True indicates forcible disconnection.

  • For forcible link disconnection, only the local link is forcibly disconnected; therefore, this API must be called on both ends.
  • Non-forcible disconnection is initiated by the Decode.
    • If no fault occurs, both ends of the link are disconnected.
    • If a fault occurs, a disconnection operation needs to be initialed by the Prompt.

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
from llm_datadist import LLMDataDist, LLMRole, LLMStatusCode, LLMClusterInfo
llm_datadist = LLMDataDist(LLMRole.DECODER, 0)
cluster = LLMClusterInfo()
cluster.remote_cluster_id = 1
cluster.append_local_ip_info("1.1.1.1", 26000)
cluster.append_remote_ip_info("1.1.1.1", 26000)
ret, rets = llm_datadist.unlink_clusters([cluster], 5000)
if ret != LLMStatusCode.LLM_SUCCESS:
    raise Exception("unlink failed.")
for cluster_i in range(len(rets)):
    unlink_ret = rets[cluster_i]
    if unlink_ret != LLMStatusCode.LLM_SUCCESS:
        print(f"{cluster_i} unlink failed.")

Returns

In normal cases, a tuple of two values is returned. The first value is the return value of the API, and the type is LLMStatusCode. The second value is the list of link setup results of each cluster, and the type is LLMStatusCode.

If a parameter is incorrect, a TypeError or ValueError may be thrown.

Constraints

None