Skip to content

Commit

Permalink
[TESTS] add ignored scope for mobielenet_v3 torchvision (#2947)
Browse files Browse the repository at this point in the history
### Changes

Add ignored scope mobielenet_v3 torchvision

### Reason for changes

Ignore SE block

### Related tickets

150204
150952
  • Loading branch information
kshpv authored Sep 9, 2024
1 parent a75b47a commit 20ecaed
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tests/post_training/data/ptq_reference_data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ torchvision/resnet18_backend_FX_TORCH:
torchvision/mobilenet_v3_small_BC_backend_FP32:
metric_value: 0.6766
torchvision/mobilenet_v3_small_BC_backend_OV:
metric_value: 0.6669
metric_value: 0.6677
torchvision/mobilenet_v3_small_BC_backend_ONNX:
metric_value: 0.6654
metric_value: 0.6679
torchvision/mobilenet_v3_small_BC_backend_FX_TORCH:
metric_value: 0.6679
torchvision/vit_b_16_backend_FP32:
Expand Down
55 changes: 54 additions & 1 deletion tests/post_training/model_scope.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
from nncf.quantization.advanced_parameters import AdvancedQuantizationParameters
from nncf.quantization.advanced_parameters import AdvancedScaleEstimationParameters
from nncf.quantization.advanced_parameters import AdvancedSmoothQuantParameters
from nncf.scopes import IgnoredScope
from nncf.scopes import Subgraph
from tests.post_training.pipelines.base import ALL_PTQ_BACKENDS
from tests.post_training.pipelines.base import NNCF_PTQ_BACKENDS
from tests.post_training.pipelines.base import BackendType
Expand Down Expand Up @@ -97,7 +99,58 @@
"fast_bias_correction": False,
"preset": QuantizationPreset.MIXED,
},
"backends": [BackendType.FX_TORCH, BackendType.OV, BackendType.ONNX],
"backends": [BackendType.FX_TORCH, BackendType.ONNX],
"batch_size": 128,
},
{ # TODO(kshpv): changes from #2947 should be reverted after implement ticket 150952
"reported_name": "torchvision/mobilenet_v3_small_BC",
"model_id": "mobilenet_v3_small",
"pipeline_cls": ImageClassificationTorchvision,
"compression_params": {
"fast_bias_correction": False,
"preset": QuantizationPreset.MIXED,
"ignored_scope": IgnoredScope(
subgraphs=[
Subgraph(
inputs=["__module.features.1.block.1.avgpool/aten::adaptive_avg_pool2d/Reshape"],
outputs=["__module.features.1.block.1.scale_activation/aten::hardsigmoid/HSigmoid"],
),
Subgraph(
inputs=["__module.features.4.block.2.avgpool/aten::adaptive_avg_pool2d/Reshape"],
outputs=["__module.features.4.block.2.scale_activation/aten::hardsigmoid/HSigmoid"],
),
Subgraph(
inputs=["__module.features.5.block.2.avgpool/aten::adaptive_avg_pool2d/Reshape"],
outputs=["__module.features.5.block.2.scale_activation/aten::hardsigmoid/HSigmoid"],
),
Subgraph(
inputs=["__module.features.6.block.2.avgpool/aten::adaptive_avg_pool2d/Reshape"],
outputs=["__module.features.6.block.2.scale_activation/aten::hardsigmoid/HSigmoid"],
),
Subgraph(
inputs=["__module.features.7.block.2.avgpool/aten::adaptive_avg_pool2d/Reshape"],
outputs=["__module.features.7.block.2.scale_activation/aten::hardsigmoid/HSigmoid"],
),
Subgraph(
inputs=["__module.features.8.block.2.avgpool/aten::adaptive_avg_pool2d/Reshape"],
outputs=["__module.features.8.block.2.scale_activation/aten::hardsigmoid/HSigmoid"],
),
Subgraph(
inputs=["__module.features.9.block.2.avgpool/aten::adaptive_avg_pool2d/Reshape"],
outputs=["__module.features.9.block.2.scale_activation/aten::hardsigmoid/HSigmoid"],
),
Subgraph(
inputs=["__module.features.10.block.2.avgpool/aten::adaptive_avg_pool2d/Reshape"],
outputs=["__module.features.10.block.2.scale_activation/aten::hardsigmoid/HSigmoid"],
),
Subgraph(
inputs=["__module.features.11.block.2.avgpool/aten::adaptive_avg_pool2d/Reshape"],
outputs=["__module.features.11.block.2.scale_activation/aten::hardsigmoid/HSigmoid"],
),
]
),
},
"backends": [BackendType.OV],
"batch_size": 128,
},
{
Expand Down

0 comments on commit 20ecaed

Please sign in to comment.