qbcompiler.frontend.Model_Dict Class Reference#
|
Mobilint SDK qb Compiler v1.2
MCS002-EN
|
qbcompiler.frontend.Model_Dict Class Reference
Wrapper around the Mobilint compiler to support compilation and inference workflows. More...
Inheritance diagram for qbcompiler.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, exclude_first_subgraph=False, **kwargs) | |
| Initialize the Mobilint compiler wrapper. | |
| compile (self, int save_subgraph_type=0, output_subgraph_path="", CompileConfig compile_config=None, **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 452 of file frontend.py.
Constructor & Destructor Documentation
◆ __init__()
| qbcompiler.frontend.Model_Dict.__init__ | ( | self, | |
| model, | |||
| backend = "onnx", | |||
| device = "cpu", | |||
| feed_dict = None, | |||
| dynamic_axes = None, | |||
| in_dformats = None, | |||
| yolo_decode_include = False, | |||
| exclude_first_subgraph = 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.exclude_first_subgraph bool. Applies only when CPU offloading is enabled: exclude the first subgraph from the final graph if it is unsupported. kwargs dict. Additional compiler arguments.
Definition at line 462 of file frontend.py.
Member Function Documentation
◆ compile()
| qbcompiler.frontend.Model_Dict.compile | ( | self, | |
| int | save_subgraph_type = 0, | ||
| output_subgraph_path = "", | |||
| CompileConfig | compile_config = None, | ||
| ** | kwargs ) |
Compile the wrapped model into an MXQ artifact.
- Parameters
-
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.compile_config CompileConfig. Compile configuration object. kwargs dict. Additional arguments forwarded to the compiler.
Definition at line 500 of file frontend.py.
The documentation for this class was generated from the following file:
Generated by