Unified compilation configuration for Mobilint MXQ compilation.
More...
|
| "CompileConfig" | with_uint8_input (self, **kwargs) |
| | Return a copy with uint8_input settings enabled.
|
| "CompileConfig" | with_preprocessing (self, **kwargs) |
| | Return a copy with preprocessing settings enabled.
|
| "CompileConfig" | with_optq (self, **kwargs) |
| | Return a copy with optq settings enabled.
|
| "CompileConfig" | with_mod (self, **kwargs) |
| | Return a copy with mod settings enabled.
|
| "CompileConfig" | with_llm (self, **kwargs) |
| | Return a copy with llm settings enabled.
|
| "CompileConfig" | with_search_weight_scale (self, **kwargs) |
| | Return a copy with search_weight_scale settings enabled.
|
| "CompileConfig" | with_load_scale (self, **kwargs) |
| | Return a copy with load_scale settings enabled.
|
| "CompileConfig" | with_save_sample (self, **kwargs) |
| | Return a copy with save_sample settings enabled.
|
| "CompileConfig" | from_file (cls, Union[str, Path] path) |
| | Load config from YAML or JSON file.
|
| "CompileConfig" | from_preset (cls, str name) |
| | Load config from a preset.
|
| None | to_file (self, Union[str, Path] path) |
| | Save config to YAML or JSON file.
|
|
| dict | _flatten_grouped_json (dict data) |
| | Flatten grouped JSON keys (e.g.
|
| dict | _group_to_json (dict data) |
| | Group flat keys back into nested JSON structure (inverse of _flatten_grouped_json).
|
Unified compilation configuration for Mobilint MXQ compilation.
Definition at line 1580 of file models.py.
◆ with_uint8_input()
| "CompileConfig" qbcompiler.configs.models.CompileConfig.with_uint8_input |
( |
| self, |
|
|
** | kwargs ) |
Return a copy with uint8_input settings enabled.
Definition at line 1689 of file models.py.
◆ with_preprocessing()
| "CompileConfig" qbcompiler.configs.models.CompileConfig.with_preprocessing |
( |
| self, |
|
|
** | kwargs ) |
Return a copy with preprocessing settings enabled.
Definition at line 1695 of file models.py.
◆ with_optq()
| "CompileConfig" qbcompiler.configs.models.CompileConfig.with_optq |
( |
| self, |
|
|
** | kwargs ) |
Return a copy with optq settings enabled.
Definition at line 1701 of file models.py.
◆ with_mod()
| "CompileConfig" qbcompiler.configs.models.CompileConfig.with_mod |
( |
| self, |
|
|
** | kwargs ) |
Return a copy with mod settings enabled.
Definition at line 1707 of file models.py.
◆ with_llm()
| "CompileConfig" qbcompiler.configs.models.CompileConfig.with_llm |
( |
| self, |
|
|
** | kwargs ) |
Return a copy with llm settings enabled.
Definition at line 1713 of file models.py.
◆ with_search_weight_scale()
| "CompileConfig" qbcompiler.configs.models.CompileConfig.with_search_weight_scale |
( |
| self, |
|
|
** | kwargs ) |
Return a copy with search_weight_scale settings enabled.
Definition at line 1719 of file models.py.
◆ with_load_scale()
| "CompileConfig" qbcompiler.configs.models.CompileConfig.with_load_scale |
( |
| self, |
|
|
** | kwargs ) |
Return a copy with load_scale settings enabled.
Definition at line 1725 of file models.py.
◆ with_save_sample()
| "CompileConfig" qbcompiler.configs.models.CompileConfig.with_save_sample |
( |
| self, |
|
|
** | kwargs ) |
Return a copy with save_sample settings enabled.
Definition at line 1731 of file models.py.
◆ from_file()
| "CompileConfig" qbcompiler.configs.models.CompileConfig.from_file |
( |
| cls, |
|
|
Union[str, Path] | path ) |
Load config from YAML or JSON file.
Definition at line 1738 of file models.py.
◆ _flatten_grouped_json()
| dict qbcompiler.configs.models.CompileConfig._flatten_grouped_json |
( |
dict | data | ) |
|
|
staticprotected |
Flatten grouped JSON keys (e.g.
quantization.calibration) to flat structure.
Definition at line 1750 of file models.py.
◆ from_preset()
| "CompileConfig" qbcompiler.configs.models.CompileConfig.from_preset |
( |
| cls, |
|
|
str | name ) |
Load config from a preset.
Definition at line 1774 of file models.py.
◆ _group_to_json()
| dict qbcompiler.configs.models.CompileConfig._group_to_json |
( |
dict | data | ) |
|
|
staticprotected |
Group flat keys back into nested JSON structure (inverse of _flatten_grouped_json).
Definition at line 1781 of file models.py.
◆ to_file()
| None qbcompiler.configs.models.CompileConfig.to_file |
( |
| self, |
|
|
Union[str, Path] | path ) |
Save config to YAML or JSON file.
Definition at line 1810 of file models.py.
◆ model_config
| qbcompiler.configs.models.CompileConfig.model_config |
|
static |
Initial value:= ConfigDict(
populate_by_name=True,
extra="forbid",
)
Definition at line 1583 of file models.py.
◆ model_paths
| List qbcompiler.configs.models.CompileConfig.model_paths |
|
static |
Initial value:= Field(
default=[], alias="modelPaths", description="Paths to model files"
)
Definition at line 1588 of file models.py.
◆ calib_data_path
| List qbcompiler.configs.models.CompileConfig.calib_data_path |
|
static |
Initial value:= Field(
default=[], alias="calibDataPaths", description="Paths to calibration datasets"
)
Definition at line 1591 of file models.py.
◆ save_paths
| List qbcompiler.configs.models.CompileConfig.save_paths |
|
static |
Initial value:= Field(
default=["./tmp.mxq"],
alias="savePaths",
description="Output MXQ filename/paths",
)
Definition at line 1594 of file models.py.
◆ use_random_calib
| bool qbcompiler.configs.models.CompileConfig.use_random_calib |
|
static |
Initial value:= Field(
default=False, alias="useRandomCalib", description="Use random calibration"
)
Definition at line 1599 of file models.py.
◆ save_msgpack_name
| Optional qbcompiler.configs.models.CompileConfig.save_msgpack_name |
|
static |
Initial value:= Field(
default=None,
alias="saveMsgpackName",
description="Name of the msgpack file to save",
)
Definition at line 1602 of file models.py.
◆ inference_scheme
| str qbcompiler.configs.models.CompileConfig.inference_scheme |
|
static |
Initial value:= Field(
default="single", alias="inferenceScheme", description="NPU inference scheme"
)
Definition at line 1607 of file models.py.
◆ cpu_offload
| bool qbcompiler.configs.models.CompileConfig.cpu_offload |
|
static |
Initial value:= Field(
default=False,
alias="cpuOffload",
description="Enable CPU offload for unsupported operators",
)
Definition at line 1610 of file models.py.
◆ force_npu_input_reposition
| bool qbcompiler.configs.models.CompileConfig.force_npu_input_reposition |
|
static |
Initial value:= Field(
default=False,
alias="forceNpuInputReposition",
description="Force input reposition operations to run on NPU instead of CPU",
)
Definition at line 1615 of file models.py.
◆ force_npu_output_reposition
| bool qbcompiler.configs.models.CompileConfig.force_npu_output_reposition |
|
static |
Initial value:= Field(
default=False,
alias="forceNpuOutputReposition",
description="Force output reposition operations to run on NPU instead of CPU",
)
Definition at line 1620 of file models.py.
◆ optimize_option
| int qbcompiler.configs.models.CompileConfig.optimize_option |
|
static |
Initial value:= Field(
default=1,
alias="optimizeOption",
description="Compiler optimization selector",
ge=0,
)
Definition at line 1625 of file models.py.
◆ buffer_mode
| int qbcompiler.configs.models.CompileConfig.buffer_mode |
|
static |
Initial value:= Field(
default=1, alias="bufferMode", description="Buffer serialization mode"
)
Definition at line 1631 of file models.py.
◆ input_shape_dict
| Any qbcompiler.configs.models.CompileConfig.input_shape_dict |
|
static |
Initial value:= Field(
default={}, alias="inputShapeDict", description="Dictionary of input shapes"
)
Definition at line 1634 of file models.py.
◆ device
| str qbcompiler.configs.models.CompileConfig.device = Field(default="gpu", description="Device for computation") |
|
static |
◆ dtype
| str qbcompiler.configs.models.CompileConfig.dtype = Field(default="float", description="Data type for computation") |
|
static |
◆ debug
| bool qbcompiler.configs.models.CompileConfig.debug = Field(default=False, description="Enable debug mode") |
|
static |
◆ trace
| bool qbcompiler.configs.models.CompileConfig.trace = Field(default=False, description="Enable trace mode") |
|
static |
◆ image_channels
| int qbcompiler.configs.models.CompileConfig.image_channels |
|
static |
Initial value:= Field(
default=0,
alias="imageChannels",
description="Number of image channels (0 for auto-detect)",
)
Definition at line 1641 of file models.py.
◆ config_version
| str qbcompiler.configs.models.CompileConfig.config_version |
|
static |
Initial value:= Field(
default="1.0.0", alias="configVersion", description="Config schema version"
)
Definition at line 1646 of file models.py.
◆ split_blocks
| List qbcompiler.configs.models.CompileConfig.split_blocks |
|
static |
Initial value:= Field(
default=[],
alias="splitBlocks",
description="Multi-MXQ split points by transformer block index",
)
Definition at line 1649 of file models.py.
◆ split_parts
| int qbcompiler.configs.models.CompileConfig.split_parts |
|
static |
Initial value:= Field(
default=0,
alias="splitParts",
description="Evenly split transformer blocks into N MXQ parts",
)
Definition at line 1654 of file models.py.
◆ uint8_input
Initial value:= Field(
default_factory=Uint8InputConfig, alias="uint8Input"
)
Definition at line 1660 of file models.py.
◆ preprocessing
◆ resource_management
Initial value:= Field(
default_factory=ResourceManagementConfig, alias="resourceManagement"
)
Definition at line 1664 of file models.py.
◆ calibration
◆ bit
◆ optq
◆ mod
◆ llm
◆ moe
◆ equivalent_transformation
Initial value:= Field(
default_factory=EquivalentTransformationConfig, alias="equivalentTransformation"
)
Definition at line 1673 of file models.py.
◆ search_weight_scale
Initial value:= Field(
default_factory=SearchWeightScaleConfig, alias="searchWeightScale"
)
Definition at line 1676 of file models.py.
◆ load_scale
Initial value:= Field(
default_factory=LoadScaleConfig, alias="loadScale"
)
Definition at line 1679 of file models.py.
◆ runtime_options
| RuntimeOptions qbcompiler.configs.models.CompileConfig.runtime_options |
|
static |
Initial value:= Field(
default_factory=RuntimeOptions, alias="runtimeOptions"
)
Definition at line 1682 of file models.py.
◆ save_sample
Initial value:= Field(
default_factory=SaveSampleConfig, alias="saveSample"
)
Definition at line 1685 of file models.py.
The documentation for this class was generated from the following file: