qbcompiler.frontend.Model_Dict Class Reference

qbcompiler.frontend.Model_Dict Class Reference#

Mobilint SDK qb Compiler: 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
modelstring or model instance. Model path or in-memory model to compile.
backendstring. Framework identifier for the model (for example "onnx"). Defaults to "onnx".
devicestring. Target device for inference ("cpu" or "gpu"). Defaults to "cpu".
feed_dictdict. Example inputs for shape resolution.
dynamic_axesdict. Marks model axes as dynamic.
in_dformatsdict. Describes input data formats.
yolo_decode_includebool. Runs YOLO decode on NPU when True.
exclude_first_subgraphbool. Applies only when CPU offloading is enabled: exclude the first subgraph from the final graph if it is unsupported.
kwargsdict. 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_typeint. 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_pathstring. Destination for exported .mblt when save_subgraph_type is 1–4.
compile_configCompileConfig. Compile configuration object.
kwargsdict. 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: