Package: ilit
Intel® Low Precision Optimization ToolIntel® Low Precision Optimization Tool is an open-source python library which is intended to deliver a unified low-precision inference interface cross multiple Intel optimized DL frameworks on both CPU and GPU. It supports automatic accuracy-driven tuning strategies, along with additional objectives like optimizing for performance, model size and memory footprint. It also provides the easy extension capability for new backends, tuning strategies, metrics and objectives.WARNINGGPU support is under development.InfrastructureWorkflowSupported Intel optimized DL frameworks are:Tensorflow*, including 1.15, 1.15UP1, 2.1, 2.2, 2.3PyTorch*, including 1.5.0+cpu, 1.6.0+cpuApache* MXNet, including 1.6.0, 1.7.0Supported tuning strategies are:BasicBayesianMSEExhaustiveRandomTPE - experimentalDocumentsIntroductionexplains the API of Intel® Low Precision Optimization Tool.Hello Worlddemonstrates the simple steps to utilize Intel® Low Precision Optimization Tool for quanitzation, which can help you quick start with the tool.Tutorialprovides comprehensive instructions of how to utilize diffrennt features of Intel® Low Precision Optimization Tool. Inexamples, there are a lot of examples to demonstrate the usage of Intel® Low Precision Optimization Tool in TensorFlow, PyTorch and MxNet for diffrent categories.Strategiesprovides comprehensive explanation on the details of how every tuning strategy works.PTQ and QATexplains how Intel® Low Precision Optimization Tool works with post-training quantization and quantization-ware training.Pruning on PyTorchexplains how Intel® Low Precision Optimization Tool works with magnitude pruning on PyTorch.Tensorboardexplains how Intel® Low Precision Optimization Tool helps developer to analyze tensor distribution and the impact to final accuracy during tuning process.Quantized Model Deployment on PyTorchexplains how Intel® Low Precision Optimization Tool quantizes a FP32 PyTorch model, save and deploy quantized model through ilit utils.BF16 Mix-Precision on TensorFlowexplains how Intel® Low Precision Optimization Tool supports INT8/BF16/FP32 mix precision model tuning on TensorFlow backend.Supported Model Types on TensorFlowexplains the TensorFlow model types supported by Intel® Low Precision Optimization Tool.Install from sourcegitclonehttps://github.com/intel/lp-opt-tool.gitcdlp-opt-tool
pythonsetup.pyinstallInstall from binary# install from pippipinstallilit# install from condacondainstallilit-cintel-cconda-forgeSystem RequirementsIntel® Low Precision Optimization Tool supports systems based onIntel 64 architecture or compatible processors, specially optimized for the following CPUs:Intel Xeon Scalable processor (formerly Skylake, Cascade Lake, and Cooper Lake)future Intel Xeon Scalable processor (code name Sapphire Rapids)Intel® Low Precision Optimization Tool requires to install Intel optimized framework version for TensorFlow, PyTorch, and MXNet.Validated Hardware/Software EnvironmentPlatformOSPythonFrameworkVersionCascade LakeCooper LakeSkylakeCentOS 7.8Ubuntu 18.043.63.7tensorflow2.2.01.15UP12.3.02.1.01.15.2pytorch1.5.0+cpumxnet1.7.01.6.0Model ZooIntel® Low Precision Optimization Tool provides a lot of examples to show promising accuracy loss with best performance gain.FrameworkversionmodeldatasetTOP-1   AccuracyPerformance SpeedupINT8 Tuning AccuracyFP32 Accuracy   BaselineAcc   Ratio[(INT8-FP32)/FP32]Realtime Latency Ratio[FP32/INT8]tensorflow2.2.0resnet50v1.0ImageNet73.80%74.30%-0.67%2.25xtensorflowresnet50v1.5ImageNet76.80%76.50%0.39%2.32xtensorflowresnet101ImageNet77.20%76.40%1.05%2.75xtensorflowinception_v1ImageNet70.10%69.70%0.57%1.56xtensorflowinception_v2ImageNet74.00%74.00%0.00%1.68xtensorflowinception_v3ImageNet77.20%76.70%0.65%2.05xtensorflowinception_v4ImageNet80.00%80.30%-0.37%2.52xtensorflowinception_resnet_v2ImageNet80.20%80.40%-0.25%1.75xtensorflowmobilenetv1ImageNet71.10%71.00%0.14%1.88xtensorflowssd_resnet50_v1Coco37.72%38.01%-0.76%2.88xtensorflowmask_rcnn_inception_v2Coco28.75%29.13%-1.30%4.14xtensorflowwide_deep_large_dscriteo-kaggle77.61%77.67%-0.08%1.41xtensorflowvgg16ImageNet72.10%70.90%1.69%3.71xtensorflowvgg19ImageNet72.30%71.00%1.83%3.78xtensorflowresnetv2_50ImageNet70.20%69.60%0.86%1.52xtensorflowresnetv2_101ImageNet72.50%71.90%0.83%1.59xtensorflowresnetv2_152ImageNet72.70%72.40%0.41%1.62xtensorflowdensenet121ImageNet72.60%72.90%-0.41%1.84xtensorflowdensenet161ImageNet76.10%76.30%-0.26%1.44xtensorflowdensenet169ImageNet74.40%74.60%-0.27%1.22xFrameworkVersionModelDatasetTOP-1 AccuracyPerformance SpeedupINT8 Tuning AccuracyFP32 Accuracy BaselineAcc Ratio[(INT8-FP32)/FP32]Realtime Latency Ratio[FP32/INT8]mxnet1.7.0resnet50v1ImageNet76.03%76.33%-0.39%3.18xmxnetinceptionv3ImageNet77.80%77.64%0.21%2.65xmxnetmobilenet1.0ImageNet71.72%72.22%-0.69%2.62xmxnetmobilenetv2_1.0ImageNet70.77%70.87%-0.14%2.89xmxnetresnet18_v1ImageNet69.99%70.14%-0.21%3.08xmxnetsqueezenet1.0ImageNet56.88%56.96%-0.14%2.55xmxnetssd-resnet50_v1VOC80.21%80.23%-0.02%4.16xmxnetssd-mobilenet1.0VOC74.94%75.54%-0.79%3.31xmxnetresnet152_v1ImageNet78.32%78.54%-0.28%3.16xKnown IssuesMSE tuning strategy doesn't work with PyTorch adaptor layer
MSE tuning strategy requires to compare FP32 tensor and INT8 tensor to decide which op has impact on final quantization accuracy. PyTorch adaptor layer doesn't implement this inspect tensor interface. So if the model to tune is a PyTorch model, please do not choose MSE tuning strategy.SupportPlease submit your questions, feature requests, and bug reports on theGitHub issuespage. You may also reach out toilit.maintainers@intel.com.ContributingWe welcome community contributions to Intel® Low Precision Optimization Tool. If you have an idea on how
to improve the library:For changes impacting the public API, submit anRFC pull request.Ensure that the changes are consistent with thecode contribution guidelinesandcoding style.Ensure that you can run all the examples with your patch.Submit apull request.For additional details, seecontribution guidelines.This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to theContributor Covenantcode of conduct.LicenseIntel® Low Precision Optimization Tool is licensed underApache License Version 2.0. This software includes components with separate copyright notices and license terms. Your use of the source code for these components is subject to the terms and conditions of the following licenses.Apache License Version 2.0:Intel TensorFlow Quantization ToolMIT License:bayesian-optimizationSee accompanyingLICENSEfile for full license text and copyright notices.Legal InformationCitingIf you use Intel® Low Precision Optimization Tool in your research or wish to refer to the tuning results published in theTuning Zoo, please use the following BibTeX entry.@misc{Intel® Low Precision Optimization Tool,
  author =       {Feng Tian, Chuanqi Wang, Guoming Zhang, Penghui Cheng, Pengxin Yuan, Haihao Shen, and Jiong Gong},
  title =        {Intel® Low Precision Optimization Tool},
  howpublished = {\url{https://github.com/intel/lp-opt-tool}},
  year =         {2020}
}