Skip to content

Commit

Permalink
[PTQ] Avg pool is added as ignored metatype for TRANSFORMER model_type (
Browse files Browse the repository at this point in the history
#2228)

### Changes

[PTQ] Avg pool is added as ignored metatype for TRANSFORMER model_type
in TORCH/OV/ONNX backends

### Reason for changes

* To align PTQ backends as for example TORCH avg_pool is mapping to
reduce_mean in OV, for timm/visformer_small in particular

### Related tickets

110985
119910

### Tests
  • Loading branch information
daniil-lyakhov authored Oct 27, 2023
1 parent 218cb6b commit 729f6cc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nncf/quantization/algorithms/min_max/onnx_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ def get_ignored_metatypes(model_type: ModelType, device: TargetDevice) -> List[O
om.ONNXPowMetatype,
om.ONNXSqueezeMetatype,
om.ONNXSubMetatype,
om.ONNXAveragePoolMetatype,
om.ONNXGlobalAveragePoolMetatype,
om.ONNXReduceMeanMetatype,
om.ONNXReduceL2Metatype,
om.ONNXReduceSumMetatype,
Expand Down
1 change: 1 addition & 0 deletions nncf/quantization/algorithms/min_max/openvino_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ def get_ignored_metatypes(model_type: ModelType, device: TargetDevice) -> List[O
om.OVPowerMetatype,
om.OVSqueezeMetatype,
om.OVSubtractMetatype,
om.OVAvgPoolMetatype,
om.OVReduceMeanMetatype,
om.OVReduceL2Metatype,
om.OVSumMetatype,
Expand Down
2 changes: 2 additions & 0 deletions nncf/quantization/algorithms/min_max/torch_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,8 @@ def get_ignored_metatypes(model_type: ModelType, device: TargetDevice) -> List[O
om.PTAddMetatype,
om.PTPowerMetatype,
om.PTSubMetatype,
om.PTAvgPool2dMetatype,
om.PTAvgPool3dMetatype,
om.PTMeanMetatype,
om.PTSumMetatype,
om.PTReduceL2,
Expand Down

0 comments on commit 729f6cc

Please sign in to comment.