openvinotoolkit / openvinotoolkit/nncf

[Good First Issue][NNCF][Tests]: Refactor weights compression tests into a template tests.

Open
#3,129 33 comments 0 reactions 1 assignee View on GitHub

@raghavx1 is already working on this.

Since Mar 20, 2025.

good first issue
Dominant language
Python
Stars
1.2k
Forks
305
Avg merge
1d 9h
Merged PRs (30d)
27

Description

Context

Majority of the NNCF PTQ tests are using templates: for example tests for Fast Bias Correction or MinMax algorithm.
The structure is following: there is a template file like this, and each backend implements abstract methods of the template file like this.

What needs to be done?

The task is to:
To extend the TemplateWeightCompression class and Refactor this files
** https://github.com/openvinotoolkit/nncf/blob/develop/tests/torch/ptq/test_weights_compression.py
** https://github.com/openvinotoolkit/nncf/blob/develop/tests/torch/fx/test_compress_weights.py
to implement the following common tests:

  • test_compress_weights
  • test_compress_shared_weights / test_compress_weights_shared_weights
  • test_compress_weights_functional_model / test_compress_weights_functional_model
  • test_raise_error_with_unsupported_params_for_int8
  • test_raise_error_with_unsupported_params_for_int4
  • test_raise_error_with_not_int8
  • test_raise_error_for_statistics_caching
  • test_get_dtype_attribute_of_parameter
  • test_model_devices_and_precisions

Please use this two template files as a reference:
https://github.com/openvinotoolkit/nncf/blob/develop/tests/torch/fx/test_fast_bias_correction.py
https://github.com/openvinotoolkit/nncf/blob/develop/tests/torch/ptq/test_fast_bias_correction.py

Example Pull Requests

https://github.com/openvinotoolkit/nncf/pull/2856

Resources
Contact points

@daniil-lyakhov

Ticket

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.