nncf icon indicating copy to clipboard operation
nncf copied to clipboard

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

Open daniil-lyakhov opened this issue 1 year ago • 23 comments

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

daniil-lyakhov avatar Dec 03 '24 17:12 daniil-lyakhov

CC: AHB102

daniil-lyakhov avatar Dec 03 '24 17:12 daniil-lyakhov

Hi @AHB102,

Are you working on this issue? :)

rk119 avatar Dec 07 '24 16:12 rk119

@rk119 Yeah.

AHB102 avatar Dec 07 '24 16:12 AHB102

@rk119 Yeah.

Alright!

rk119 avatar Dec 07 '24 16:12 rk119

.take

AHB102 avatar Dec 07 '24 18:12 AHB102

Thank you for looking into this issue! Please let us know if you have any questions or require any help.

github-actions[bot] avatar Dec 07 '24 18:12 github-actions[bot]

Hi @AHB102,

Are you still working on this issue?

rk119 avatar Jan 17 '25 11:01 rk119

@rk119 I've started on this, but I'm tied up with other things at the moment. Could you please take care of this? Sorry for the inconvenience.

AHB102 avatar Jan 17 '25 18:01 AHB102

@AHB102 it's alright. I presume that this issue is complete in another PR already :)

rk119 avatar Jan 17 '25 18:01 rk119

@AHB102 it's alright. I presume that this issue is complete in another PR already :)

@AHB102 @rk119 #3179 doesn't resolve the issue completely. There are still duplicated tests to make template ones.

ljaljushkin avatar Jan 31 '25 13:01 ljaljushkin

@ljaljushkin Okay then, I would like to work on this issue as well :) if it's alright

rk119 avatar Feb 02 '25 21:02 rk119

@rk119 I've started on this, but I'm tied up with other things at the moment. Could you please take care of this? Sorry for the inconvenience.

@AHB102 can I reassign it to @rk119 then?

ljaljushkin avatar Feb 03 '25 08:02 ljaljushkin

@ljaljushkin @rk119 @AHB102 May I help out on this issue?

shumaari avatar Feb 03 '25 08:02 shumaari

@ljaljushkin @rk119 @AHB102 May I help out on this issue?

@shumaari I'm afraid not, issue is quite straightforward for splitting. Feel free to take brand-new GFI https://github.com/openvinotoolkit/nncf/issues/3249

ljaljushkin avatar Feb 04 '25 11:02 ljaljushkin

@ljaljushkin thank you, will take #3249 instead.

shumaari avatar Feb 04 '25 17:02 shumaari

Let's unassign that task due to current assignee's inactivity.

p-wysocki avatar Mar 05 '25 12:03 p-wysocki

@ljaljushkin Feel free to leave this issue open to other potential contributors as I have other commitments to attend to presently :)

rk119 avatar Mar 20 '25 11:03 rk119

.take

raghavx1 avatar Mar 20 '25 11:03 raghavx1

Thank you for looking into this issue! Please let us know if you have any questions or require any help.

github-actions[bot] avatar Mar 20 '25 11:03 github-actions[bot]

Hi @ljaljushkin @alexsu52 I have started working on the problem and have prepared a starting version of the template can you please have a look and check if I'm going in the right direction.

Link to changes: https://github.com/openvinotoolkit/nncf/compare/develop...raghavx1:nncf:develop

Thank You Raghav Sharma

raghavx1 avatar Mar 22 '25 20:03 raghavx1

Hi @ljaljushkin @alexsu52 I have started working on the problem and have prepared a starting version of the template can you please have a look and check if I'm going in the right direction.

Link to changes: develop...raghavx1:nncf:develop

Thank You Raghav Sharma

+ @daniil-lyakhov

ljaljushkin avatar Mar 24 '25 09:03 ljaljushkin

hi @daniil-lyakhov

raghavx1 avatar Mar 31 '25 10:03 raghavx1

Hello, @raghavx1! Sorry for a long delay. I've updated the description to reflect the latest changes in the code base.

daniil-lyakhov avatar Apr 22 '25 10:04 daniil-lyakhov