Skip to content

Commit

Permalink
[OV] Add adaptive poolings metatypes (#2988)
Browse files Browse the repository at this point in the history
### Changes

Add
https://docs.openvino.ai/2024/documentation/openvino-ir-format/operation-sets/operation-specs/pooling/adaptive-max-pool-8.html
and
https://docs.openvino.ai/2024/documentation/openvino-ir-format/operation-sets/operation-specs/pooling/adaptive-avg-pool-8.html

Based on the description of the operations I make their treatments for
quantization the same as for AvgPool and MaxPool. I checked the correct
quantization scheme with this PR for litehernet from ticket 150502
  • Loading branch information
kshpv authored Sep 25, 2024
1 parent b840385 commit f274cf5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nncf/openvino/graph/metatypes/groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

QUANTIZE_AGNOSTIC_OPERATIONS = [
ov_metatypes.OVMaxPoolMetatype,
ov_metatypes.OVAdaptiveMaxPoolMetatype,
ov_metatypes.OVReduceMaxMetatype,
ov_metatypes.OVReshapeMetatype,
ov_metatypes.OVSqueezeMetatype,
Expand Down Expand Up @@ -62,6 +63,7 @@
ov_metatypes.OVMaximumMetatype,
ov_metatypes.OVMinimumMetatype,
ov_metatypes.OVAvgPoolMetatype,
ov_metatypes.OVAdaptiveAvgPoolMetatype,
ov_metatypes.OVReduceMeanMetatype,
ov_metatypes.OVMVNMetatype,
ov_metatypes.OVNormalizeL2Metatype,
Expand Down
14 changes: 14 additions & 0 deletions nncf/openvino/graph/metatypes/openvino_metatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,27 @@ class OVAvgPoolMetatype(OVOpMetatype):
hw_config_names = [HWConfigOpName.AVGPOOL]


@OV_OPERATOR_METATYPES.register()
class OVAdaptiveAvgPoolMetatype(OVOpMetatype):
name = "AdaptiveAvgPoolOp"
op_names = ["AdaptiveAvgPool"]
hw_config_names = [HWConfigOpName.AVGPOOL]


@OV_OPERATOR_METATYPES.register()
class OVMaxPoolMetatype(OVOpMetatype):
name = "MaxPoolOp"
op_names = ["MaxPool"]
hw_config_names = [HWConfigOpName.MAXPOOL]


@OV_OPERATOR_METATYPES.register()
class OVAdaptiveMaxPoolMetatype(OVOpMetatype):
name = "AdaptiveMaxPoolOp"
op_names = ["AdaptiveMaxPool"]
hw_config_names = [HWConfigOpName.MAXPOOL]


@OV_OPERATOR_METATYPES.register()
class OVConstantMetatype(OVOpMetatype):
name = "ConstantOp"
Expand Down

0 comments on commit f274cf5

Please sign in to comment.