* Added convert_to_fp16 param in MO. * Deprecated data_type. * Renamed param, made value optional. * Docs update. * Docs update. * Docs update. * Changed param description. * Conflict fixed. * Apply suggestions from code review Co-authored-by: Sergey Lyalin <sergey.lyalin@intel.com> * Param description correction. * Corrected docs. * Apply suggestions from code review Co-authored-by: Pavel Esir <pavel.esir@gmail.com> * Fixed docs. * Small correction. * Update docs/MO_DG/prepare_model/FP16_Compression.md Co-authored-by: Tatiana Savina <tatiana.savina@intel.com> * Update docs/MO_DG/prepare_model/FP16_Compression.md Co-authored-by: Tatiana Savina <tatiana.savina@intel.com> * Update docs/MO_DG/Deep_Learning_Model_Optimizer_DevGuide.md Co-authored-by: Tatiana Savina <tatiana.savina@intel.com> * Update tools/mo/openvino/tools/mo/utils/cli_parser.py Co-authored-by: Tatiana Savina <tatiana.savina@intel.com> * Update docs/MO_DG/prepare_model/Model_Optimizer_FAQ.md Co-authored-by: Tatiana Savina <tatiana.savina@intel.com> * Update docs/get_started/get_started_demos.md Co-authored-by: Tatiana Savina <tatiana.savina@intel.com> * Update docs/MO_DG/prepare_model/Model_Optimizer_FAQ.md Co-authored-by: Tatiana Savina <tatiana.savina@intel.com> Co-authored-by: Sergey Lyalin <sergey.lyalin@intel.com> Co-authored-by: Pavel Esir <pavel.esir@gmail.com> Co-authored-by: Andrei Kochin <andrei.kochin@intel.com> Co-authored-by: Tatiana Savina <tatiana.savina@intel.com>
1.1 KiB
Compressing a Model to FP16
Model Optimizer can convert all floating-point weights to FP16 data type. The resulting IR is called
compressed FP16 model. The resulting model will occupy about twice as less space in the file system,
but it may have some accuracy drop. For most models, the accuracy drop is negligible.
To compress the model, use the --compress_to_fp16 option:
Note
: Starting from the 2022.3 release, option --data_type is deprecated. Instead of --data_type FP16 use --compress_to_fp16. Using
--data_type FP32will give no result and will not forceFP32precision in the model. If the model hasFP16constants, such constants will haveFP16precision in IR as well.
mo --input_model INPUT_MODEL --compress_to_fp16
For details on how plugins handle compressed FP16 models, see Working with devices.
Note
:
FP16compression is sometimes used as the initial step forINT8quantization. Refer to the Post-training optimization guide for more information about that.