init
Applicability
Product |
Supported (Yes/No) |
|---|---|
Atlas 350 Accelerator Card |
No |
Yes |
|
Yes |
|
No |
|
No |
|
No |
Note: For the
Function Description
Initializes an LLM-DataDist instance. Unilateral link establishment is used, where the client initiates the link to the server. The Prompt side acts as the server, and the Decode side acts as the client. Data transmission is restricted such that only the Decode side can pull KVs from the Prompt side.
Prototype
1 | init(options: Dict[str, str]) |
Parameters
Parameter |
Data Type |
Description |
|---|---|---|
options |
Dict[str, str] |
Configuration options. The input options can be generated using LLMConfig. Mandatory fields: device_id and listen_ip_info (mandatory for the Prompt side (server) but not required for the Decode side (client)) |
Example
1 2 3 4 5 6 7 | from llm_datadist import LLMDataDist, LLMRole, LLMConfig llm_datadist = LLMDataDist(LLMRole.PROMPT, 0) llm_config = LLMConfig() llm_config.listen_ip_info = "192.168.1.1:26000" llm_config.device_id = 0 engine_options = llm_config.generate_options() llm_datadist.init(engine_options) |
Returns
In normal cases, no value is returned.
If an exception occurs, an LLMException is thrown.
If a parameter is incorrect, a TypeError or ValueError may be thrown.
Constraints
After the initialization is successful, you need to call finalize before the system exits.