Connect
Applicable Products
|
Product |
Supported (√/x) |
|---|---|
|
|
√ |
|
|
√ |
|
|
√ |
|
|
x |
|
|
x |
|
|
x |
Note: For
Function Description
Establishes a link with the remote HIXL instance.
Prototype
1
|
Status Connect(const AscendString &remote_engine, int32_t timeout_in_millis = 1000) |
Parameters
|
Parameter |
Input/Output |
Description |
|---|---|---|
|
remote_engine |
Input |
Unique identifier of the remote HIXL instance. |
|
timeout_in_millis |
Input |
Link establishment timeout interval, in milliseconds. The default value is 1000. |
Example
Click GitCode, select the matching version, and obtain the sample from the examples/cpp directory.
Returns
- SUCCESS: Success.
- PARAM_INVALID: Incorrect parameter.
- TIMEOUT: Link establishment timeout.
- ALREADY_CONNECTED: Duplicate link establishment.
- Other values: Failure.
Exception Handling
None
Constraints
- This API must be called after the Initialize API is called on the client and server to complete initialization.
- The maximum number of communication links that can be created is 512; creating too many links may lead to OOM errors and performance degradation during KV cache transmission. This restriction applies to the following products:
Atlas A2 training products /Atlas A2 inference products Atlas A3 training products /Atlas A3 inference products
- You are advised to set the timeout interval longer than 200 ms. If TLS is enabled, it is recommended that the timeout period be set to a value greater than 2000 ms. Run the following command to query the TLS status:
- Before calling this API, register all local and remote memories. Otherwise, memories registered after link establishment will not support remote access.
- In container scenarios, you must map the /etc/hccn.conf file into the container or ensure that hccn_tool exists in the default path /usr/local/Ascend/driver/tools. If neither condition is met, you need to add the directory containing hccn_tool to the PATH environment variable. A configuration example is provided below, where hccn_tool_install_path indicates the directory containing hccn_tool.
export PATH=$PATH:${hccn_tool_install_path}This restriction applies to the following products:Atlas A2 training products /Atlas A2 inference products Atlas A3 training products /Atlas A3 inference products
- This API and Initialize must run in the same thread. If you need to switch threads to call this API, first call aclrtGetCurrentContext in the thread where Initialize is running to obtain the context. Then, in the new thread, call aclrtSetCurrentContext to set the context.