Repository navigation
Release 2.0.0
What's Changed
Major updates:
- Structured pruning for PyTorch models: MCT now employs structured and hardware-aware pruning for PyTorch models in addition to Keras models.
- Additional details can be found here.
- Try our tutorial Structured Pruning of a Fully-Connected PyTorch Model
- API changes - The MCT "experimental" API has been formalized. Refer to the API documentation for details.
- Quantization parameters search is now faster! Enhanced vectorized search for per-channel threshold delivers quicker results.
General changes:
- Tensorflow 2.15 is now supported.
- Model Statistics Collector - Improved robustness to representative datasets:
- The mean estimator has been switched from IIR to standard mean.
- Activations merged histogram is now with a fixed bin width.
- PyTorch Model Export - the exporter API now includes an argument for specifying the ONNX OPSET version. View the updated API here. The default OPSET version was set to version 15.
- Target Platform Capabilities (TPC) - 'torch.squeeze' operation has been added to the TPC’s “no quantization” list.
- Mixed Precision - several modifications for improving mixed precision usability and stability:
- Hessian-based scores are now disabled by default (faster execution).
- A new API for enabling different weighting methods through the MixedPrecisionQuantizationConfiguration (MpDistanceWeighting enum).
- A rare numerical issue in distance metric computation has been fixed.
- MixedPrecisionQuantizationConfig is now initialized by default in CoreConfig.
- Internal representation of constants in a model has been modified, resolving issues #918 and #812 .
- MCT Troubleshooting and FAQ - check out the Quantization Troubleshooting for common pitfalls and some tools to improve quantization accuracy as well as the FAQ for common issues.
- MCT tutorials – additional tutorials have been added to provide insights of MCT features such as z-score threshold tutorial and quantization parameters search tutorial. In addition, a new tutorial demonstrating semantic segmentation model quantization has been added.
Breaking changes:
- API changes
- Removal of “experimental” from PTQ and GPTQ quantization facades
- keras_post_training_quantization_experimental -> keras_post_training_quantization.
- keras_gradient_post_training_quantization_experimental -> keras_gradient_post_training_quantization
- pytorch_post_training_quantization_experimental -> pytorch_post_training_quantization.
- pytorch_gradient_post_training_quantization_experimental -> pytorch_gradient_post_training_quantization
- Renaming QAT methods
- keras_quantization_aware_training_init -> keras_quantization_aware_training_init_experimental.
- keras_quantization_aware_training_finalize -> keras_quantization_aware_training_finalize_experimental.
- Renaming KPI to ResourceUtilization - this include changes to the KPI object class name, kpi_data facade and target_kpi argument to all the facades.
- Renaming Mixed Precision configuration and GPTQ configuration
- MixedPrecisionQuantizationConfigV2 -> MixedPrecisionQuantizationConfig.
- GradientPTQConfigV2 -> GradientPTQConfig.
- Renaming Keras data generation API
- tensorflow_data_generation_experimental -> keras_data_generation_experimental.
- get_tensorflow_data_generation_config -> get_keras_data_generation_config.
- Removal of “experimental” from PTQ and GPTQ quantization facades
- Weights Attributes Quantization – weights quantization is now extended to support additional attributes beside the “kernel”. This is considered an experimental feature and the default behavior is kept unchanged (i.e., only the kernel of linear layers will be quantized with weights quantizer). Enabling this feature for specific attributes requires creating a modified TPC.
weights_per_channel_thresholdwas removed from QuantizationConfig (since it is not used anymore, and can be configured in the TPC).- QuantizationMethod.KMEANS has been removed.
- Unused parameter
hessians_n_iterhas been removed from GPTQHessianScoresConfig. FolderImageLoaderhas been removed.
Bug fixes:
- Fixed Python 3.9 Windows file permission error in Fakely TFlite exporter - #865
- Fixed MCT fails for “torch.nn.functional.layer_norm - #921
- Fixed MCT fails for "dims" parameter of type List in “torch.permute - #935
New Contributors
Welcome @samuel-wj-chapman for his first contribution! PR #959
Full Changelog: v1.11.0...v2.0.0