mem_pool_cfg

Applicability

Product

Supported

Atlas A3 training products/Atlas A3 inference products

√

Atlas A2 training products/Atlas A2 inference products

√

Atlas 200I/500 A2 inference products

x

Atlas inference products

x

Atlas training products

x

Note: For the Atlas A2 training products/Atlas A2 inference products, only the Atlas 800I A2 inference server, Atlas 300I A2 inference card, and A200I A2 Box heterogeneous components are supported.

Function Description

Configures memory pool parameters.

Prototype

1
mem_pool_cfg(mem_pool_cfg)

Parameters

Parameter

Data Type

Description

mem_pool_cfg

string

A string in JSON array format, including memory_size and page_shift.

Configuration Item

Optional/Mandatory

Description

memory_size

Mandatory

Size of the current memory pool, in bytes. The value is of the int type and is greater than 0.

page_shift

Optional

Offset of page_size, which is used to calculate page_size. The memory is aligned to a multiple of page_size during memory allocation. You need to set the memory size based on the site requirements.

The type is int. The value range is [10, 31).

For example, if page_shift is set to 16, the value of page_size is 1<<16 = 65536.

The default value is 16.

Example

1
2
3
from llm_datadist import LLMConfig
llm_config = LLMConfig()
llm_config.mem_pool_cfg= "{\"memory_size\": 18737418240, \"page_shift\": 16}"

Returns

In normal cases, no value is returned.

If a parameter is incorrect, a TypeError or ValueError may be thrown.

Restrictions

None