Resource Management Configuration

Resource Management Configuration#

Mobilint SDK qb Compiler: Resource Management Configuration
Mobilint SDK qb Compiler v1.0
MCS002-EN
Resource Management Configuration

Resource Management configuration definitions used by Mobilint compiler for model quantization. More...

Classes

class  qbcompiler.configs.resource_management_config.ResourceManagementConfig
 Configuration for resource management during model compilation. More...

Functions

 qbcompiler.configs.resource_management_config.ResourceManagementConfig.__init__ (self, str weight_dtype, bool use_gpu_only_for_calibration, int weight_memory_method, bool optional=optional)
 Initialize the ResourceManagementConfig.
 qbcompiler.configs.resource_management_config.ResourceManagementConfig.default_config (cls)
 qbcompiler.configs.resource_management_config.ResourceManagementConfig.from_kwargs (cls, **kwargs)
 qbcompiler.configs.resource_management_config.ResourceManagementConfig.from_dict (cls, dict config_dict)
 Create ResourceManagementConfig from dictionary (JSON structure)
 qbcompiler.configs.resource_management_config.ResourceManagementConfig.to_dict (self)
ResourceManagementConfig qbcompiler.configs.resource_management_config.get_resource_management_config (**kwargs)
 Create ResourceManagementConfig with partial parameters merged with defaults.

Variables

bool qbcompiler.configs.resource_management_config.ResourceManagementConfig.optional = False
dict qbcompiler.configs.resource_management_config.ResourceManagementConfig.DEFAULTS
dict qbcompiler.configs.resource_management_config.ResourceManagementConfig.py_to_cpp_name
dict qbcompiler.configs.resource_management_config.ResourceManagementConfig.min_max_check
list qbcompiler.configs.resource_management_config.ResourceManagementConfig.weight_memory_methods
 qbcompiler.configs.resource_management_config.ResourceManagementConfig.weight_dtype = weight_dtype
 qbcompiler.configs.resource_management_config.ResourceManagementConfig.use_gpu_only_for_calibration = use_gpu_only_for_calibration
 qbcompiler.configs.resource_management_config.ResourceManagementConfig.weight_memory_method = weight_memory_method

Detailed Description

Resource Management configuration definitions used by Mobilint compiler for model quantization.

Function Documentation

◆ __init__()

qbcompiler.configs.resource_management_config.ResourceManagementConfig.__init__ ( self,
str weight_dtype,
bool use_gpu_only_for_calibration,
int weight_memory_method,
bool optional = optional )

Initialize the ResourceManagementConfig.

Parameters
weight_dtypestr. Weight data type for calibration (e.g., "float32", "float16").
use_gpu_only_for_calibrationbool. If True, use GPU only during the calibration phase.
weight_memory_methodint. Weight memory management method index.
0: DeleteFloat - Delete float weights after quantization.
1: SaveFloat - Save float weights to disk.
2: MoveFloat - Move float weights to CPU.
3: KeepFloat - Keep float weights in memory.
4: KeepAll - Keep all weights in memory.
optionalbool. Indicates whether this config is optional. Use the default value defined as a class variable.

Definition at line 41 of file resource_management_config.py.

◆ default_config()

qbcompiler.configs.resource_management_config.ResourceManagementConfig.default_config ( cls)

Definition at line 67 of file resource_management_config.py.

◆ from_kwargs()

qbcompiler.configs.resource_management_config.ResourceManagementConfig.from_kwargs ( cls,
** kwargs )

Definition at line 71 of file resource_management_config.py.

◆ from_dict()

qbcompiler.configs.resource_management_config.ResourceManagementConfig.from_dict ( cls,
dict config_dict )

Create ResourceManagementConfig from dictionary (JSON structure)

Definition at line 87 of file resource_management_config.py.

◆ to_dict()

qbcompiler.configs.resource_management_config.ResourceManagementConfig.to_dict ( self)

Definition at line 105 of file resource_management_config.py.

◆ get_resource_management_config()

ResourceManagementConfig qbcompiler.configs.resource_management_config.get_resource_management_config ( ** kwargs)

Create ResourceManagementConfig with partial parameters merged with defaults.

Definition at line 118 of file resource_management_config.py.

Variable Documentation

◆ optional

bool qbcompiler.configs.resource_management_config.ResourceManagementConfig.optional = False
static

Definition at line 16 of file resource_management_config.py.

◆ DEFAULTS

qbcompiler.configs.resource_management_config.ResourceManagementConfig.DEFAULTS
static
Initial value:
= {
"weight_dtype": "float32",
"use_gpu_only_for_calibration": True,
"weight_memory_method": 0,
}

Definition at line 17 of file resource_management_config.py.

◆ py_to_cpp_name

dict qbcompiler.configs.resource_management_config.ResourceManagementConfig.py_to_cpp_name
static
Initial value:
= {
"weight_dtype": "weightDtype",
"use_gpu_only_for_calibration": "useGPUOnlyForCalibration",
"weight_memory_method": "weightMemoryMethod",
}

Definition at line 23 of file resource_management_config.py.

◆ min_max_check

dict qbcompiler.configs.resource_management_config.ResourceManagementConfig.min_max_check
static
Initial value:
= {
"weight_memory_method": [0, 4],
}

Definition at line 29 of file resource_management_config.py.

◆ weight_memory_methods

qbcompiler.configs.resource_management_config.ResourceManagementConfig.weight_memory_methods
static
Initial value:
= [
"DeleteFloat",
"SaveFloat",
"MoveFloat",
"KeepFloat",
"KeepAll",
]

Definition at line 33 of file resource_management_config.py.

◆ weight_dtype

qbcompiler.configs.resource_management_config.ResourceManagementConfig.weight_dtype = weight_dtype

Definition at line 61 of file resource_management_config.py.

◆ use_gpu_only_for_calibration

qbcompiler.configs.resource_management_config.ResourceManagementConfig.use_gpu_only_for_calibration = use_gpu_only_for_calibration

Definition at line 62 of file resource_management_config.py.

◆ weight_memory_method

qbcompiler.configs.resource_management_config.ResourceManagementConfig.weight_memory_method = weight_memory_method

Definition at line 63 of file resource_management_config.py.