콘텐츠로 이동

qubee.configs.compile_config

CompileConfig

class CompileConfig(ConfigABC)

Attributes

Name Description
py_to_cpp_name
min_max_check
inference_scheme_types
sample_dtypes

py_to_cpp_name

py_to_cpp_name = {
    "calib_data_path": "calibData",
    "save_path": "savePath",
    "model_nickname": "modelNickname",
    "save_msgpack_name": "saveMsgpackName",
    "model_path": "modelPath",
    "inference_scheme": "inferenceScheme",
    "save_sample": "saveSample",
    "cpu_offload": "cpuOffload",
    "singlecore_compile": "singlecoreCompile",
    "optimize_option": "optimizeOption",
    "sample_dtype": "sampleDtype",
    "preprocess_dict": "preprocess",
    "version": "version",
}

min_max_check

min_max_check = {"optimize_option": [0, None]}

inference_scheme_types

inference_scheme_types = ["single", "multi", "global", "global4", "global8"]

sample_dtypes

sample_dtypes = ["float", "int8"]

Methods

Name Description
__init__
default_config
check_valid_str_configs
to_dict

__init__

def __init__(
    self,
    calib_data_path: str | None,
    use_random_calib: bool,
    save_path: str,
    model_nickname: str,
    save_msgpack_name: str | None,
    model_path: str | None,
    inference_scheme: str,
    save_sample: bool,
    cpu_offload: bool,
    singlecore_compile: bool,
    optimize_option: int,
    sample_dtype: str,
    preprocess_dict: dict | None,
    buffer_mode: int,
    version: str,
    quant_config: QuantConfig,
    optional: bool = False,
)

default_config

def default_config(cls)

check_valid_str_configs

def check_valid_str_configs(self)

to_dict

def to_dict(self)

Functions

Name Description
get_compile_config

get_compile_config

def get_compile_config(
    calib_data_path=None,
    use_random_calib=False,
    save_path="./tmp.mxq",
    save_msgpack_name=None,
    model_nickname="temporary",
    model_path=None,
    inference_scheme="single",
    save_sample=False,
    cpu_offload=False,
    singlecore_compile=False,
    optimize_option=0,
    sample_dtype="float",
    preprocess_dict=None,
    buffer_mode=1,
    quant_config=QuantConfig.default_config(),
    version=__version__,
)