Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CPU] Added improvements for StridedSlice #4248

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
f134121
[CPU] Added improvements for StridedSlice
a-sidorova Jan 26, 2021
3f95859
Refactoring code
a-sidorova Feb 15, 2021
35dbe02
Added fixes after first review
a-sidorova Mar 15, 2021
5a1b972
Added src and dst indices calculating
a-sidorova Mar 15, 2021
fddaa45
Added parallel for index calculating
a-sidorova Mar 16, 2021
e615bc4
Merge remote-tracking branch 'upstream/master' into feature/stridedslice
a-sidorova Mar 16, 2021
d4b077c
Fixed parallel
a-sidorova Mar 16, 2021
125b171
Merge remote-tracking branch 'upstream/master' into feature/stridedslice
a-sidorova Mar 16, 2021
31e8854
Fixes after second review without constant checking
a-sidorova Mar 19, 2021
22c6452
Added constant layer checking
a-sidorova Mar 19, 2021
3b614e5
Merge remote-tracking branch 'upstream/master' into feature/stridedslice
a-sidorova Mar 19, 2021
04a2923
Fixed build after merge
a-sidorova Mar 19, 2021
be9df7f
Removed failes after merge
a-sidorova Mar 19, 2021
42f372b
Fixed onnx ci and added minor fixes
a-sidorova Mar 20, 2021
afd3145
Merge remote-tracking branch 'upstream/master' into feature/stridedslice
a-sidorova Mar 22, 2021
4c35848
Merge remote-tracking branch 'upstream/master' into feature/stridedslice
a-sidorova Mar 25, 2021
0b51c02
Fixed build after merge master
a-sidorova Mar 25, 2021
8add2b2
Fxied throw exception
a-sidorova Mar 25, 2021
d305bfe
Merge remote-tracking branch 'upstream/master' into feature/stridedslice
a-sidorova Mar 25, 2021
b5e8ed1
Added minor fixes
a-sidorova Mar 25, 2021
61680c6
Added fixes for not constant parameters
a-sidorova Mar 25, 2021
bd7a682
Merge remote-tracking branch 'upstream/master' into feature/stridedslice
a-sidorova Mar 25, 2021
01b073f
Added minor fixes
a-sidorova Apr 5, 2021
14f5c9c
Merge remote-tracking branch 'upstream/master' into feature/stridedslice
a-sidorova Apr 5, 2021
de8ab17
Merge remote-tracking branch 'upstream/master' into feature/stridedslice
a-sidorova Apr 5, 2021
eed84ac
Fixed masks
a-sidorova Apr 5, 2021
a03c6c5
Merge remote-tracking branch 'upstream/master' into feature/stridedslice
a-sidorova Apr 5, 2021
ff92706
Fixed empty masks (opencv case)
a-sidorova Apr 5, 2021
51559de
Merge remote-tracking branch 'upstream/master' into feature/stridedslice
a-sidorova Apr 5, 2021
27d6c71
Removed one useless include and fixed end default value for inconstant
a-sidorova Apr 7, 2021
24478d6
Merge remote-tracking branch 'upstream/master' into feature/stridedslice
a-sidorova Apr 7, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,6 @@ bool MKLDNNExecNetwork::CanProcessDynBatch(const InferenceEngine::CNNNetwork &ne
type != Split &&
type != Concatenation &&
type != Eltwise &&
type != Crop &&
type != BatchNormalization &&
type != Copy) {
check_result = false;
Expand Down
4 changes: 2 additions & 2 deletions inference-engine/src/mkldnn_plugin/mkldnn_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include <nodes/mkldnn_batchnorm_node.h>
#include <nodes/mkldnn_concat_node.h>
#include <nodes/mkldnn_conv_node.h>
#include <nodes/mkldnn_crop_node.h>
#include <nodes/mkldnn_deconv_node.h>
#include <nodes/mkldnn_eltwise_node.h>
#include <nodes/mkldnn_gemm_node.h>
Expand All @@ -39,6 +38,7 @@
#include <nodes/mkldnn_tensoriterator_node.h>
#include <nodes/mkldnn_scatter_update_node.h>
#include <nodes/mkldnn_interpolate_node.h>
#include <nodes/mkldnn_strided_slice_node.h>
#include <mkldnn_types.h>
#include <dnnl_types.h>
#include "mkldnn_extension_utils.h"
Expand Down Expand Up @@ -93,7 +93,6 @@ static const InferenceEngine::details::caseless_unordered_map<std::string, Type>
{ "Eltwise", Eltwise },
{ "Mod", Eltwise },
{ "Power", Eltwise },
{ "Crop", Crop },
{ "Reshape", Reshape },
{ "Tile", Tile },
{ "SimplerNMS", SimplerNMS },
Expand All @@ -103,6 +102,7 @@ static const InferenceEngine::details::caseless_unordered_map<std::string, Type>
{ "Flatten", Flatten },
{ "Pad", Pad },
{ "Permute", Permute },
{ "StridedSlice", StridedSlice },
{ "Copy", Copy },
{ "LSTMCell", RNNCell },
{ "GRUCell", RNNCell },
Expand Down
6 changes: 3 additions & 3 deletions inference-engine/src/mkldnn_plugin/mkldnn_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ enum Type {
Concatenation,
Eltwise,
Gemm,
Crop,
Reshape,
Tile,
SimplerNMS,
Expand All @@ -58,6 +57,7 @@ enum Type {
Flatten,
Pad,
Permute,
StridedSlice,
Copy,
MemoryOutput,
MemoryInput,
Expand Down Expand Up @@ -122,8 +122,6 @@ static std::string NameFromType(Type type) {
return "Concatenation";
case Depthwise:
return "Depthwise";
case Crop:
return "Crop";
case Reshape:
return "Reshape";
case Tile:
Expand All @@ -142,6 +140,8 @@ static std::string NameFromType(Type type) {
return "Pad";
case Permute:
return "Permute";
case StridedSlice:
return "StridedSlice";
case Copy:
return "Copy";
case MemoryOutput:
Expand Down
2 changes: 2 additions & 0 deletions inference-engine/src/mkldnn_plugin/mkldnn_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <legacy/transformations/convert_opset1_to_legacy/reshape_fully_connected.hpp>
#include <legacy/transformations/convert_opset1_to_legacy/convert_nms_5_to_legacy.hpp>
#include <legacy/transformations/convert_opset1_to_legacy/convert_interpolate_to_interp_or_resample.hpp>
#include <legacy/transformations/convert_opset1_to_legacy/convert_strided_slice_to_crop.hpp>
#include <legacy/ngraph_ops/fully_connected.hpp>

#include <transformations/opset_conversions/convert_opset3_to_opset2.hpp>
Expand Down Expand Up @@ -333,6 +334,7 @@ static void Transformation(CNNNetwork& clonedNetwork, const Config& conf) {
legacyManager.register_pass<ngraph::pass::UnrollTensorIterator>();

auto legacyPassConfig = legacyManager.get_pass_config();
legacyPassConfig->disable<ngraph::pass::ConvertStridedSliceToCropMatcher>();

legacyPassConfig->set_callback<ngraph::pass::FakeQuantizeDecomposition>([](const_node_ptr &node) -> bool {
return !MKLDNNQuantizeNode::isNeedToDecompose(node);
Expand Down
1 change: 0 additions & 1 deletion inference-engine/src/mkldnn_plugin/nodes/list_tbl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ MKLDNN_EXTENSION_NODE(ReverseSequenceImpl, ReverseSequence);
MKLDNN_EXTENSION_NODE(DetectionOutputImpl, DetectionOutput);
MKLDNN_EXTENSION_NODE(ArgMaxImpl, ArgMax);
MKLDNN_EXTENSION_NODE(UnsqueezeImpl, Unsqueeze);
MKLDNN_EXTENSION_NODE(StridedSliceImpl, StridedSlice);
MKLDNN_EXTENSION_NODE(ExperimentalDetectronDetectionOutputImpl, ExperimentalDetectronDetectionOutput);
MKLDNN_EXTENSION_NODE(RegionYoloImpl, RegionYolo);
MKLDNN_EXTENSION_NODE(LogSoftmaxImpl, LogSoftmax);
Expand Down
194 changes: 0 additions & 194 deletions inference-engine/src/mkldnn_plugin/nodes/mkldnn_crop_node.cpp

This file was deleted.

35 changes: 0 additions & 35 deletions inference-engine/src/mkldnn_plugin/nodes/mkldnn_crop_node.h

This file was deleted.

10 changes: 6 additions & 4 deletions inference-engine/src/mkldnn_plugin/nodes/mkldnn_pad_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,12 @@ static inline size_t parallel_init(size_t start, size_t nDims, const SizeVector&
}

static inline void parallel_step(size_t nDims, const SizeVector& dims, SizeVector& indexes) {
for (int j = nDims - 1; j >= 0; j--) {
indexes[j] = (indexes[j] + 1) % dims[j];
if (indexes[j] != 0)
return;
for (int j = nDims - 1; j >= 0; --j) {
++indexes[j];
if (indexes[j] < dims[j])
break;
else
indexes[j] = 0;
}
}

Expand Down
Loading