qubee.frontend.Model_Dict Class Reference

qubee.frontend.Model_Dict Class Reference#

Mobilint SDK qb Compiler: qubee.frontend.Model_Dict Class Reference
Mobilint SDK qb Compiler v0.11.0.1
MCS002-EN
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
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.
kwargsdict. 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_pathstring. Calibration dataset directory or meta file (.txt/.json) listing NumPy samples.
save_pathstring. Output MXQ filename.
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.
model_nicknamestring. Friendly name stored in qubee for faster recompile.
save_samplebool. Persists inputs/outputs for debugging in ./sampleInOut.
use_random_calibbool. Uses randomly generated calibration samples when True.
inference_schemestring. NPU inference configuration ("single", "multi", "global", etc.).
cpu_offloadbool. Enables CPU offload for unsupported groups.
singlecore_compilebool. Forces single-core compilation for large DRAM usage.
optimize_optionint. Compiler optimization selector.
sample_dtypestring. Data type used for saved sample outputs.
preprocess_dictdict. Additional preprocessing metadata.
buffer_modeint. Buffer serialization mode (0 naive, 1 mmap).
quant_configQuantConfig. Quantization configuration object.
kwargsdict. 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: