unlink_clusters
Applicability
Product |
Supported (Yes/No) |
|---|---|
Atlas 350 Accelerator Card |
No |
Yes |
|
Yes |
|
No |
|
No |
|
No |
Note: For the
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.
|
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