buf_pool_cfg
Applicability
Product |
Supported (Yes/No) |
|---|---|
Atlas 350 Accelerator Card |
No |
Yes |
|
Yes |
|
No |
|
No |
|
No |
Note: For the
Function Description
Specifies the memory level configuration to improve memory allocation performance and utilization.
Prototype
1 | buf_pool_cfg(buf_pool_cfg) |
Parameters
Parameter |
Data Type |
Description |
|---|---|---|
buf_pool_cfg |
string |
Character string in JSON array format, including the total_size, blk_size, and max_buf_size nodes. |
Configuration Item |
Optional/Mandatory |
Description |
|---|---|---|
total_size |
Mandatory |
Size of the memory pool at the current level, in bytes. Constraints: The value of total_size is a multiple of 2 MB, and the value of total_size is a multiple of blk_size. The maximum value cannot exceed the value of 0xFFFFFFFF. |
blk_size |
Mandatory |
Minimum memory that can be allocated at a time at the current level, in bytes. Constraints: The value must be 2n within a range of (0, 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. Constraints: The value must be less than that of total_size. If multiple levels are configured, the max_buf_size values must be strictly increasing across levels. |
Example
1 2 3 | from llm_datadist import LLMConfig llm_config = LLMConfig() llm_config.buf_pool_cfg= '{"buf_cfg": [{"total_size":2097152,"blk_size":256,"max_buf_size":8192},{"total_size": 10485760,"blk_size": 8192,"max_buf_size": 8388608},{"total_size": 69206016,"blk_size": 8192,"max_buf_size": 67108864}]}' |
Returns
In normal cases, no value is returned.
If a parameter is incorrect, a TypeError or ValueError may be thrown.
Constraints
None