unlink_clusters

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

Disconnects a link.

Prototype

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

Parameters

Parameter

Data Type

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.

  • In forcible disconnection, only the local link is forcibly disconnected, therefore, this function needs to be called at 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 two-element tuple is returned. The first element is the return value of the API, of type LLMStatusCode. The second element is a list of link establishment results of each cluster, also of type LLMStatusCode.

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

Constraints

None