Skip to content

Conversation

@andreyanufr
Copy link
Collaborator

Changes

Implemented computation of codebook based on k-means algorithm.

Reason for changes

Related tickets

CVS-169609

Tests

alexsu52 and others added 30 commits September 2, 2024 13:22
@andreyanufr andreyanufr marked this pull request as ready for review January 7, 2026 08:41
@andreyanufr andreyanufr requested a review from a team as a code owner January 7, 2026 08:41
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Jan 9, 2026
2) Added extra advanced parameters for adapriva codebook.
@github-actions github-actions bot added the NNCF OpenVINO Pull requests that updates NNCF OpenVINO label Jan 12, 2026
reduction_axes: tuple[int, ...],
config: WeightCompressionConfig,
wp: WeightCompressionParameters,
) -> Tensor:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong return type

Comment on lines +321 to +329
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,
)
Copy link
Collaborator

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?

Comment on lines 2456 to 2458
@pytest.mark.parametrize("value_type", [None, TensorDataType.float16, TensorDataType.f8e4m3, TensorDataType.int8])
def test_adaptive_codebooks(value_type):
model = AWQMatmulModel().ov_model
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API Public API-impacting changes documentation Improvements or additions to documentation NNCF OpenVINO Pull requests that updates NNCF OpenVINO

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants