-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support backup precision option for WC (#2978)
### Changes Add functionality to determine the backup precision to be used for layers that are not quantized to the primary precision, which is set to INT8_ASYM by default. Example: Compress weights to INT4_ASYM channel-wise (group size=-1), except embeddings, convolutions and last linear layers - they are remain in original floating-point precision. ```python from nncf import compress_weights, BackupMode, CompressWeightsMode compressed_model = compress_weights(model, mode=CompressWeightsMode.INT4_ASYM, group size=-1, backup_mode=BackupMode.NONE) # model is openvino.Model object ``` ![image](https://github.com/user-attachments/assets/b99ce421-af1c-4a9d-83ad-a97841b44e41) statistics: ![image](https://github.com/user-attachments/assets/744f177c-f212-456c-b426-ba60ec747183) For mode=CompressWeightsMode.INT4_ASYM, backup_mode=BackupMode.INT8_ASYM, and a non-empty ignored_scope, the statistics string contains three different precisions: ![image](https://github.com/user-attachments/assets/abab1a1b-c932-4001-9c84-858d10e23cda) ### Reason for changes To define backup mode for compress_weight ### Related tickets * 152056 ### Tests * test_data_free_compression_with_backup_mode * test_data_based_compression_with_backup_mode * tinyllama_awq_backup_mode_none
- Loading branch information
Showing
17 changed files
with
305 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.