openvinotoolkit / nncf

Neural Network Compression Framework for enhanced OpenVINO™ inference
Apache License 2.0
905 stars 227 forks source link

[Good First Issue][NNCF]: [TorchFX] Test PTQ quantizer config #2874

Open daniil-lyakhov opened 1 month ago

daniil-lyakhov commented 1 month ago

Greetings🐱! As a part of https://github.com/openvinotoolkit/nncf/issues/2766 TorchFX PTQ backend support, we are gladly presenting to you following issue:

Implement TemplateTestQuantizerConfig as it done for other backends(example: https://github.com/openvinotoolkit/nncf/blob/develop/tests/torch/ptq/test_quantizer_config.py)

Example Pull Requests

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

Resources

Contact points

@daniil-lyakhov

Ticket

2766

anzr299 commented 1 month ago

@rk119

rk119 commented 1 month ago

.take

github-actions[bot] commented 1 month ago

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

rk119 commented 1 month ago

Hi @daniil-lyakhov,

I am encountering an issue with the test_depthwise_conv_default_quantizer_config test case in test_quantizer_config.py. The test is failing because the length of q_setup is 1 instead of the expected 2.

Upon further investigation, I found that the get_weight_nodes function for Torch FX min_max does not include the PTDepthwiseConv2dSubtype metatype in its list of recognized metatypes. As a result, the weight nodes variable in _get_quantizer_setup is empty, leading to the failure.

Could you please confirm if the PTDepthwiseConv2dSubtype metatype should be included in the list? If so, that should resolve the issue. Else, I'd appreciate some guidance.

daniil-lyakhov commented 1 month ago

Hi @daniil-lyakhov,

I am encountering an issue with the test_depthwise_conv_default_quantizer_config test case in test_quantizer_config.py. The test is failing because the length of q_setup is 1 instead of the expected 2.

Upon further investigation, I found that the get_weight_nodes function for Torch FX min_max does not include the PTDepthwiseConv2dSubtype metatype in its list of recognized metatypes. As a result, the weight nodes variable in _get_quantizer_setup is empty, leading to the failure.

Could you please confirm if the PTDepthwiseConv2dSubtype metatype should be included in the list? If so, that should resolve the issue. Else, I'd appreciate some guidance.

Hi @rk119, Thank you for your investigation! You are right, I've forgot to include all metatypes for nodes with weights, good catch! Please replace current weighted metatypes list with this list.

Thanks a lot!

daniil-lyakhov commented 3 weeks ago

Hi, @rk119 , do you still plan to contribute?

rk119 commented 3 weeks ago

Hi, @rk119 , do you still plan to contribute?

Hi @daniil-lyakhov, yes I do, I'll be opening a PR for this issue by next week. I'm just a little busy with other commitments.