Skip to content

Feature/model conversion quantization - #278

Draft
PhilippvK wants to merge 5 commits into
developfrom
feature/model-conversion-quantization
Draft

PhilippvK wants to merge 5 commits into
developfrom
feature/model-conversion-quantization

Conversation

@PhilippvK

@PhilippvK PhilippvK commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

This pull request introduces comprehensive support for ONNX and TFLite quantization and conversion as configurable features within the MLonMCU pipeline. It enables users to insert ONNX/TFLite conversion and quantization stages into model pipelines via the new quant_onnx and quant_tflite features, with extensive configuration and calibration options. The documentation is significantly expanded to explain these new capabilities, and safeguards are added to ensure only one quantization feature is active per run. The changes also improve pipeline mutability and feature integration within the session and run management logic.

Major new features and enhancements:

Quantization and Conversion Features:

  • Introduced quant_onnx and quant_tflite as new RunFeatures, allowing users to insert ONNX and TFLite conversion and quantization stages into the model pipeline with a wide range of configuration options (e.g., quantization mode, calibration data, input/output layouts, etc.). These features can be enabled via the CLI or Python API, and are mutually exclusive per run to prevent conflicts. [1] [2] [3]

Pipeline Configuration and Mutation:

  • Added the get_pipeline method to the RunFeature base class, enabling features to programmatically modify the pipeline before execution. The pipeline is now safely mutable only before any stages have completed, preventing runtime inconsistencies. [1] [2]

Documentation:

  • Greatly expanded the documentation (custom_stages.rst) to detail the usage, configuration, and behavior of the new quantization and conversion features, including examples, calibration workflows, and integration with the Features API.

Session and Run Logic:

  • Updated session and run logic to recognize the new features, enforce mutual exclusivity, and ensure correct backend/model compatibility checks when conversion stages are present. [1] [2] [3]

Miscellaneous Improvements:

  • Improved artifact metadata handling for runs with multiple variants, and ensured optional dependencies for model transformations are loaded only when necessary. [1] [2]
  • Added str2dict import for configuration parsing.

These changes collectively provide robust, user-friendly support for ONNX and TFLite quantization and conversion within MLonMCU, while maintaining pipeline integrity and clear user guidance.

References:
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant