Enabled data-aware methods for int2-3.#4131
Open
andreyanufr wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Enables data-aware weight compression helpers (scale estimation, AWQ data collection, GPTQ scale estimation path, and LoRA correction applicability) for low-bitwidth modes below INT4 (INT2/INT3), aligning behavior with the intent of supporting all modes with bitwidth <= 4.
Changes:
- Broadened scale-estimation gating from INT4-only to
num_bits <= 4in Scale Estimation, AWQ, and GPTQ paths. - Enabled LoRA correction for INT2/INT3 and extended integer dequantization handling for these modes.
- Updated mode checks to include INT2/INT3 where needed.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/nncf/quantization/algorithms/weight_compression/scale_estimation.py | Allows scale estimation to run for integer modes with num_bits <= 4 instead of INT4-only. |
| src/nncf/quantization/algorithms/weight_compression/lora_correction.py | Enables LoRA correction for INT2/INT3 and expands supported integer modes in the low-rank computation path. |
| src/nncf/quantization/algorithms/weight_compression/gptq.py | Extends GPTQ’s optional scale-estimation path to run for num_bits <= 4. |
| src/nncf/quantization/algorithms/weight_compression/awq.py | Extends AWQ data collection to include modes with num_bits <= 4 (instead of INT4-only). |
Comment on lines
105
to
+106
| def is_applicable(self, wc_params: WeightCompressionParameters): | ||
| return wc_params.compression_config.num_bits == 4 | ||
| return wc_params.compression_config.num_bits <= 4 |
Comment on lines
169
to
+173
| mode = compression_config.mode | ||
| assert len(reduction_axes) == 1, "Assumed a single reduction axis" | ||
| reduction_axis = reduction_axes[0] if compression_config.group_size != -1 else -1 | ||
| if mode in (CompressWeightsMode.INT4_SYM, CompressWeightsMode.INT4_ASYM): | ||
| if mode in ( | ||
| CompressWeightsMode.INT4_SYM, |
Comment on lines
105
to
+106
| def is_applicable(self, wc_params: WeightCompressionParameters): | ||
| return wc_params.compression_config.num_bits == 4 | ||
| return wc_params.compression_config.num_bits <= 4 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Enabled data-aware methods for all bits <= 4.