-
Notifications
You must be signed in to change notification settings - Fork 277
Aanuf/lut per layer merged #3684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Aanuf/lut per layer merged #3684
Conversation
2) Added extra advanced parameters for adapriva codebook.
src/nncf/quantization/algorithms/weight_compression/algorithm.py
Outdated
Show resolved
Hide resolved
src/nncf/quantization/algorithms/weight_compression/codebook_estimation.py
Show resolved
Hide resolved
src/nncf/quantization/algorithms/weight_compression/codebook_estimation.py
Outdated
Show resolved
Hide resolved
src/nncf/quantization/algorithms/weight_compression/codebook_estimation.py
Outdated
Show resolved
Hide resolved
src/nncf/quantization/algorithms/weight_compression/codebook_estimation.py
Outdated
Show resolved
Hide resolved
| reduction_axes: tuple[int, ...], | ||
| config: WeightCompressionConfig, | ||
| wp: WeightCompressionParameters, | ||
| ) -> Tensor: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong return type
src/nncf/quantization/algorithms/weight_compression/codebook_estimation.py
Outdated
Show resolved
Hide resolved
| if self._num_elements == config.get_numpy_codebook().size: | ||
| variants[0] = fns.tensor( | ||
| config.get_numpy_codebook().data, backend=weight.backend, dtype=TensorDataType.float16 | ||
| ) | ||
| variants[1] = fns.tensor( | ||
| list(range(-self._num_elements // 2, self._num_elements - self._num_elements // 2)), | ||
| backend=weight.backend, | ||
| dtype=TensorDataType.float16, | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add comments to this part (in calculate_codebook fn as well) to expain the logic behind this?
src/nncf/quantization/algorithms/weight_compression/codebook_estimation.py
Outdated
Show resolved
Hide resolved
| @pytest.mark.parametrize("value_type", [None, TensorDataType.float16, TensorDataType.f8e4m3, TensorDataType.int8]) | ||
| def test_adaptive_codebooks(value_type): | ||
| model = AWQMatmulModel().ov_model |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests with reference codebooks and in per_group / not_per_group woudl be nice
Changes
Implemented computation of codebook based on k-means algorithm.
Reason for changes
Related tickets
CVS-169609
Tests