Skip to content

qubee.configs.llm_config

LlmConfig

class LlmConfig(ConfigABC)

Attributes

Name Description
py_to_cpp_name
min_max_check

py_to_cpp_name

py_to_cpp_name = {
    "max_data_len": "maxDataLen",
    "max_seq_len": "maxSeqLen",
    "max_cache_len": "maxCacheLen",
    "random_seq_len_calib": "randomSeqLenCalib",
    "use_full_seq_len_calib": "useFullSeqLenCalib",
    "use_custom_mask_input": "useCustomMaskInput",
    "start_dram_offset": "startDramOffset",
    "use_global_core": "useGlobalCore",
    "llm_batch_size": "llmBatchSize",
    "npu_core_ids": "npuCoreIds",
}

min_max_check

min_max_check = {
    "max_data_len": [0, None],
    "max_seq_len": [0, None],
    "max_cache_len": [0, None],
    "random_seq_len_calib": [0, None],
    "use_full_seq_len_calib": [0, 1],
    "use_custom_mask_input": [0, 1],
    "start_dram_offset": [0, None],
    "use_global_core": [0, 1],
    "llm_batch_size": [0, None],
}

Methods

Name Description
__init__
default_config
to_dict

__init__

def __init__(
    self,
    max_data_len: int,
    max_seq_len: int,
    max_cache_len: int,
    random_seq_len_calib: int,
    use_full_seq_len_calib: bool,
    use_custom_mask_input: bool,
    start_dram_offset: int,
    use_global_core: bool,
    llm_batch_size: int,
    npu_core_ids: list[int],
    optional: bool = True,
)

default_config

def default_config(cls)

to_dict

def to_dict(self)

Functions

Name Description
track_passed_args
get_llm_config

track_passed_args

def track_passed_args(fn)

get_llm_config

def get_llm_config(
    max_data_len: int = 4096,
    max_seq_len: int = 4096,
    max_cache_len: int = 4096,
    random_seq_len_calib: int = 80,
    use_full_seq_len_calib: bool = False,
    use_custom_mask_input: bool = False,
    start_dram_offset: int = 0,
    use_global_core: bool = False,
    llm_batch_size: int = 1,
    npu_core_ids: list[int] = [0],
) -> LlmConfig