-
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.
int4 support for weight compression for OV backend (#2218)
### Changes - API is the same, just added 2 new modes: `CompressWeightsMode.INT4_SYM` (u4 weights with fake ZP=8) and `CompressWeightsMode.INT4_ASYM` (u4 weights with real ZP). Fake "ZP" is represented in IR by a single u4 value (8) in order to store weights in u4 format. Runtime claims it's faster to process u4 weights with -8 shift, rather than i4 without shift. - Changed mixed precision criteria from "nf4_error/int8_error" to "1/int8_error". ### Reason for changes Faster 4-bit format for LLM on CPU ### Related tickets 123382 ### Tests test_compare_compressed_weights test_quantization_error_calculation - [x] openvino pre-commit with nightly package (build#8) Accuracy, peak memory and elapsed time for compression with latest OV master: 2023.2.0-13001-7720135f58d ![image](https://github.com/openvinotoolkit/nncf/assets/4014476/40770809-f539-423c-b25c-eb240db6fa9e) INT4_ASYM with group size=3 ![image](https://github.com/openvinotoolkit/nncf/assets/4014476/84a27616-0a98-473c-a34e-027e66f46f45) INT4_SYM with group size=3 ![image](https://github.com/openvinotoolkit/nncf/assets/4014476/fe8d833b-ec6f-4a41-989b-c8f085ba7b65) INT8 per-channel ![image](https://github.com/openvinotoolkit/nncf/assets/4014476/65a5c8ae-8cbe-4cea-9264-6906bfd7930d)
- Loading branch information
1 parent
62e73f4
commit c732de0
Showing
22 changed files
with
1,076 additions
and
417 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
Oops, something went wrong.