Initialize
Applicability
Product |
Supported (Yes/No) |
|---|---|
Atlas 350 Accelerator Card |
No |
Yes |
|
Yes |
|
No |
|
No |
|
No |
Note: For the
Function Description
Initializes the LLM-DataDist instance.
Prototype
1 | Status Initialize(const std::map<AscendString, AscendString> &options) |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
options |
Input |
Initialization options. For details, see Table 1. |
Parameter |
Optional/Mandatory |
Description |
|---|---|---|
OPTION_LISTEN_IP_INFO |
Mandatory when the role is Prompt |
IP address and port number on the device. Example: "192.168.1.1:26000". In the single-process multi-device scenario, use semicolons (;) to separate multiple IP addresses. |
OPTION_DEVICE_ID |
Mandatory |
Device ID of the current process, for example, 0. In the single-process multi-device scenario, use semicolons (;) to separate multiple device IDs. |
OPTION_SYNC_CACHE_WAIT_TIME |
Optional |
Timeout interval of KV operations, in milliseconds. If the parameter is not configured, the default interval 1000 ms is used. The related APIs are as follows: |
OPTION_BUF_POOL_CFG |
Optional |
Memory pool size and level. Configure this option to optimize the memory allocation performance and utilization. The value is a JSON string. For details about the fields, see Table 2. Example: { "buf_cfg":[{"total_size":2097152,"blk_size":256,"max_buf_size":8192}], "buf_pool_size": 2147483648 } |
OPTION_ENABLE_SET_ROLE |
Optional |
Whether smooth role switchover is supported. The options are as follows:
Related API: SetRole |
Option |
Optional/Mandatory |
Description |
|---|---|---|
buf_cfg |
Optional |
Memory pool level. For details, see Table 3. |
buf_pool_size |
Optional |
Memory pool size, in bytes. |
Option |
Optional/Mandatory |
Description |
|---|---|---|
total_size |
Mandatory |
Size of the memory pool at the current level, in bytes. Note: The value of total_size must be a multiple of 2 MB and a multiple of blk_size. The maximum value is 0xFFFFFFFF. |
blk_size |
Mandatory |
Minimum memory that can be allocated at a time at the current level, in bytes. Note: The value must be 2n within the range of (0 MB, 2 MB], and less than or equal to the value of max_buf_size. |
max_buf_size |
Mandatory |
Maximum memory that can be allocated at a time at the current level, in bytes. Note: The value of max_buf_size must be less than that of total_size and values of max_buf_size must be strictly increasing across different levels. |
Returns
- LLM_SUCCESS: Success.
- LLM_PARAM_INVALID: Incorrect parameter.
- Other values: Failure.
Exception Handling
None