qbcompiler.configs.resource_management_config¶
ResourceManagementConfig¶
Configuration for resource management during model compilation.
Attributes¶
| Name | Description |
|---|---|
optional |
|
DEFAULTS |
|
py_to_cpp_name |
|
min_max_check |
|
weight_memory_methods |
optional¶
DEFAULTS¶
DEFAULTS = {
"weight_dtype": "float32",
"use_gpu_only_for_calibration": True,
"weight_memory_method": 0,
}
py_to_cpp_name¶
py_to_cpp_name = {
"weight_dtype": "weightDtype",
"use_gpu_only_for_calibration": "useGPUOnlyForCalibration",
"weight_memory_method": "weightMemoryMethod",
}
min_max_check¶
weight_memory_methods¶
Methods¶
| Name | Description |
|---|---|
__init__ |
Initialize the ResourceManagementConfig. |
default_config |
|
from_kwargs |
|
from_dict |
Create ResourceManagementConfig from dictionary (JSON structure) |
to_dict |
__init__¶
def __init__(
self,
weight_dtype: str,
use_gpu_only_for_calibration: bool,
weight_memory_method: int,
optional: bool = optional,
)
Initialize the ResourceManagementConfig.
Parameters
weight_dtype— str. Weight data type for calibration (e.g., "float32", "float16").use_gpu_only_for_calibration— bool. If True, use GPU only during the calibration phase.weight_memory_method— int. 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.optional— bool. Indicates whether this config is optional. Use the default value defined as a class variable.
default_config¶
from_kwargs¶
from_dict¶
Create ResourceManagementConfig from dictionary (JSON structure)
to_dict¶
Functions¶
| Name | Description |
|---|---|
get_resource_management_config |
Create ResourceManagementConfig with partial parameters merged with defaults. |
get_resource_management_config¶
Create ResourceManagementConfig with partial parameters merged with defaults.