[Conformance] TorchFX/OV backends Alignment
Changes
- Constant folding is applied to all TorchFX models before the quantization
- Some torchvision models (swin_v2_s, vit_16_b) are exported by
torch.export.exportbefore ov conversation - Moc transformations are applied to openvino compressed models after the compression
After the #2984
- Fixed
_compress_qdq_constant_transformationfor per tensor case
Reason for changes
- To align TorchFX/OV quantized models
Related tickets
#2766
Tests
post_training_quantization/504/ is finished successfully
Please rerun post_training_quantization build.
Please rerun post_training_quantization build.
/post_training_quantization/504/ is finished successfully
Please add unit tests for constant folding and docstrings.
Please add unit tests for constant folding and docstrings.
tested by test_models by swin_v2_s and vit_b_16 models. The same test approach is done for other transformation.
If you think we definitely need a unit test - let's create an issue for that
@alexsu52 i will not review PR that adding transformation that will applied for any model in nncf.quantize without unit tests and any documentation.
@AlexanderDokuchaev, please take a look
In the case where the user gives a model with already inserted Quantize-Dequantize or Quantize-random_nodes-Dequantize, shouldn't it be ignored by constant folding? cc @alexsu52
@anzr299, I fixed _compress_qdq_constant_transformation function in the per tensor case and tested it by test_compress_post_quantize_transformation, take a look
@anzr299, I fixed
_compress_qdq_constant_transformationfunction in the per tensor case and tested it bytest_compress_post_quantize_transformation, take a look
Oh, yes that implementation did not consider per_tensor quantization. Thank you for pointing it out!