qubee.frontend.Model_Dict Class Reference#
|
Mobilint SDK qb Compiler v0.11.0.1
MCS002-KR
|
qubee.frontend.Model_Dict Class Reference
Wrapper around the Mobilint compiler to support compilation and inference workflows. More...
Inheritance diagram for qubee.frontend.Model_Dict:
Public Member Functions | |
| __init__ (self, model, backend="onnx", device="cpu", feed_dict=None, dynamic_axes=None, in_dformats=None, yolo_decode_include=False, **kwargs) | |
| Initialize the Mobilint compiler wrapper. | |
| compile (self, str calib_data_path=None, str save_path=None, int save_subgraph_type=0, output_subgraph_path="", str model_nickname=None, save_sample=False, use_random_calib=False, inference_scheme="single", cpu_offload=False, singlecore_compile=False, optimize_option=0, str sample_dtype="float", preprocess_dict=None, buffer_mode=1, quant_config=QuantConfig.default_config(), **kwargs) | |
| Compile the wrapped model into an MXQ artifact. | |
Detailed Description
Wrapper around the Mobilint compiler to support compilation and inference workflows.
Capabilities include:
- Compilation of models into MXQ artifacts runnable on Mobilint NPUs.
- Inference using the full-precision high-level compiled model on CPU or GPU.
- Inference with the quantized model on CPU or GPU.
Definition at line 23 of file frontend.py.
Constructor & Destructor Documentation
◆ __init__()
| qubee.frontend.Model_Dict.__init__ | ( | self, | |
| model, | |||
| backend = "onnx", | |||
| device = "cpu", | |||
| feed_dict = None, | |||
| dynamic_axes = None, | |||
| in_dformats = None, | |||
| yolo_decode_include = False, | |||
| ** | kwargs ) |
Initialize the Mobilint compiler wrapper.
- Parameters
-
model string or model instance. Model path or in-memory model to compile. backend string. Framework identifier for the model (for example "onnx"). Defaults to "onnx". device string. Target device for inference ("cpu" or "gpu"). Defaults to "cpu". feed_dict dict. Example inputs for shape resolution. dynamic_axes dict. Marks model axes as dynamic. in_dformats dict. Describes input data formats. yolo_decode_include bool. Runs YOLO decode on NPU when True.kwargs dict. Additional compiler arguments.
Definition at line 33 of file frontend.py.
Member Function Documentation
◆ compile()
| qubee.frontend.Model_Dict.compile | ( | self, | |
| str | calib_data_path = None, | ||
| str | save_path = None, | ||
| int | save_subgraph_type = 0, | ||
| output_subgraph_path = "", | |||
| str | model_nickname = None, | ||
| save_sample = False, | |||
| use_random_calib = False, | |||
| inference_scheme = "single", | |||
| cpu_offload = False, | |||
| singlecore_compile = False, | |||
| optimize_option = 0, | |||
| str | sample_dtype = "float", | ||
| preprocess_dict = None, | |||
| buffer_mode = 1, | |||
| quant_config = QuantConfig.default_config(), | |||
| ** | kwargs ) |
Compile the wrapped model into an MXQ artifact.
- Parameters
-
calib_data_path string. Calibration dataset directory or meta file (.txt/.json) listing NumPy samples. save_path string. Output MXQ filename. save_subgraph_type int. Controls optional MBLT exports: 0 disables; 1 saves graph structure; 2 saves structure and weights; 3 splits structure into multiple subgraphs; 4 splits structure and weights. output_subgraph_path string. Destination for exported .mblt when save_subgraph_typeis 1–4.model_nickname string. Friendly name stored in qubee for faster recompile. save_sample bool. Persists inputs/outputs for debugging in ./sampleInOut. use_random_calib bool. Uses randomly generated calibration samples when True.inference_scheme string. NPU inference configuration ("single", "multi", "global", etc.). cpu_offload bool. Enables CPU offload for unsupported groups. singlecore_compile bool. Forces single-core compilation for large DRAM usage. optimize_option int. Compiler optimization selector. sample_dtype string. Data type used for saved sample outputs. preprocess_dict dict. Additional preprocessing metadata. buffer_mode int. Buffer serialization mode (0 naive, 1 mmap). quant_config QuantConfig. Quantization configuration object. kwargs dict. Additional arguments forwarded to the compiler.
Definition at line 67 of file frontend.py.
The documentation for this class was generated from the following file:
Generated by