Skip to content

Commit

Permalink
[OpenVINO] Add Slice metatype (#2847)
Browse files Browse the repository at this point in the history
### Changes

Adds Slice operation -
https://docs.openvino.ai/2022.3/openvino_docs_ops_movement_Slice_8.html
As a result the performance for modnet_webcam_portrait_matting from DLB
was improved (local measurement)
from 44 FPS till 72 FPS.

![image](https://github.com/user-attachments/assets/579dab90-38d6-49e0-9aed-d643a61af5f2)



### Reason for changes

Fix incorrect quantization scheme due to unknown metatype

### Related tickets

144218

### Tests

Manually
  • Loading branch information
kshpv authored Jul 31, 2024
1 parent 655f296 commit f5aa90f
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions nncf/common/hardware/configs/cpu.json
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@
{"type": "Transpose"},
{"type": "Tile"},
{"type": "StridedSlice"},
{"type": "Slice"},
{"type": "ShuffleChannels"},
{"type": "Broadcast"},
{"type": "Pad"},
Expand Down
3 changes: 2 additions & 1 deletion nncf/common/hardware/configs/gpu.json
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@
{"type": "Crop"},
{"type": "Transpose"},
{"type": "Tile"},
{"type": "StridedSlice"}
{"type": "StridedSlice"},
{"type": "Slice"}
]
}
1 change: 1 addition & 0 deletions nncf/common/hardware/configs/npu.json
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@
{"type": "Transpose"},
{"type": "Tile"},
{"type": "StridedSlice"},
{"type": "Slice"},
{"type": "ShuffleChannels"},
{"type": "Broadcast"},
{"type": "Pad"},
Expand Down
1 change: 1 addition & 0 deletions nncf/common/hardware/opset.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class HWConfigOpName:
EMBEDDINGBAG = "EmbeddingBag"
PAD = "Pad"
STRIDEDSLICE = "StridedSlice"
SLICE = "Slice"
GELU = "Gelu"
LSTMSEQUENCE = "LSTMSequence"
GRUSEQUENCE = "GRUSequence"
Expand Down
1 change: 1 addition & 0 deletions nncf/openvino/graph/metatypes/groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
ov_metatypes.OVTransposeMetatype,
ov_metatypes.OVTileMetatype,
ov_metatypes.OVStridedSliceMetatype,
ov_metatypes.OVSliceMetatype,
ov_metatypes.OVShuffleChannelsMetatype,
ov_metatypes.OVBroadcastMetatype,
ov_metatypes.OVPadMetatype,
Expand Down
7 changes: 7 additions & 0 deletions nncf/openvino/graph/metatypes/openvino_metatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,13 @@ class OVStridedSliceMetatype(OVOpMetatype):
hw_config_names = [HWConfigOpName.STRIDEDSLICE]


@OV_OPERATOR_METATYPES.register()
class OVSliceMetatype(OVOpMetatype):
name = "SliceOp"
op_names = ["Slice"]
hw_config_names = [HWConfigOpName.SLICE]


@OV_OPERATOR_METATYPES.register()
class OVExpMetatype(OVOpMetatype):
name = "ExpOp"
Expand Down

0 comments on commit f5aa90f

Please sign in to comment.