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

Remove opset0 support and undesired passes from Interpreter backend #1469

Merged
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
133 commits
Select commit Hold shift + click to select a range
16e66e7
Move evaluate() interface from some OPs to Interpreter
Jun 17, 2020
8cdb2a2
commit
Aug 7, 2020
51e4d6e
Merge 'master' into evaluate_update
Aug 11, 2020
7a41458
Move shuffle channels reference to OP's evaluate
Aug 11, 2020
c0a43b6
Add some operations missed in evaluate_node
Aug 12, 2020
fa43065
Fix select references invocation from evaluate_node()
Aug 12, 2020
9cb9021
Activation refs (#2)
iefode Aug 17, 2020
8d225af
Merge upstream master
Aug 17, 2020
dc58f48
Rollback donwgrade passes delition
Aug 18, 2020
9a44221
Initial batch to space refs
Aug 21, 2020
4e0a3d4
Return opset1_upgrade
Aug 25, 2020
6c486cb
Merge upstreeam master
Aug 25, 2020
1e083c2
WIP: Add space to batch evaluate
Aug 26, 2020
af154ac
Fix space to batch
Aug 26, 2020
1776a53
add evaluates function in evaluates_map (#4)
antonzaycev96 Aug 26, 2020
19eabad
Merge branch 'update_evaluates' of github.com:mikhail-treskin/openvin…
Aug 26, 2020
41983a8
Add space to batch evaluate
Aug 26, 2020
dca1bba
Merge branch 'master' into update_evaluates
Aug 26, 2020
5a77ee2
Fix crop in batch to space references
Aug 27, 2020
a00a6b9
Remove vectors reallocation in evaluates for b2s and s2b
Aug 31, 2020
8e1a0e4
.
Sep 2, 2020
c57beab
Add SpaceToDepth evaluate
Sep 2, 2020
9e92e3b
Add depth to space evaluate
Sep 5, 2020
5794f2f
Remove code duplication depth to space evaluate
Sep 5, 2020
759f976
Fix some failed layer tests
Sep 5, 2020
d043403
merge upstream master
Sep 7, 2020
f80c325
Ngraph test (#3)
iefode Sep 7, 2020
3dab0d6
Enable cells refs in evaluate map
iefode Sep 8, 2020
1f42b8e
Fix some failed layer tests
Sep 10, 2020
7b06f04
Merge iefode/cells
Sep 10, 2020
f647cda
Merge upstreream/master
Sep 10, 2020
167073f
Some more fixes
Sep 10, 2020
d910235
Fix code style (#6)
iefode Sep 10, 2020
0ea28db
Merge branch 'update_evaluates' of github.com:mikhail-treskin/openvin…
Sep 10, 2020
fdd3c16
Tests (#7)
iefode Sep 15, 2020
4039a80
Fix one hot ref call
Sep 15, 2020
4eca370
Merge branch 'update_evaluates' of github.com:mikhail-treskin/openvin…
Sep 15, 2020
223f386
.
Sep 15, 2020
f0a5399
Select (#8)
iefode Sep 16, 2020
66425a3
Merge branch 'update_evaluates' of github.com:mikhail-treskin/openvin…
Sep 16, 2020
a5c32c1
ReverseSeq (#9)
iefode Sep 22, 2020
4660ca4
Merge branch 'update_evaluates' of github.com:mikhail-treskin/openvin…
Sep 22, 2020
7adf1c7
Add fake quantize reference
Sep 23, 2020
1bda367
Merge upstream master
Sep 23, 2020
631aa2f
Align convolution layer tests instantiations with updated definition
Sep 24, 2020
611ffdc
Disabled some failed LPT tests
Sep 28, 2020
7e5c5af
Merge branch 'master' into update_evaluates
Sep 28, 2020
c21484a
Disabled some failed LPT tests
Sep 28, 2020
86afce5
Remove undesired changes
Sep 28, 2020
1adbb2f
Update unit-test manifests + some code cleanup
Sep 28, 2020
dfa711d
Fix code style (#10)
iefode Sep 29, 2020
9938151
Normalize L2 refs support (from PR #2327)
Sep 29, 2020
d57c03e
Fix code style
Sep 29, 2020
cb96362
Apply review comments. Part 1 (#11)
iefode Oct 1, 2020
f37c347
Remove redundant reshape from shuffle_channels evaluate
Oct 1, 2020
7cd5ec6
Decompose GroupConvolution
Oct 6, 2020
0cf873b
[IE Ngraph] Fix some operation inheritance (#13)
iefode Oct 6, 2020
b6f95b8
Fix code style
Oct 6, 2020
ed8614f
[IE NGraph] Remove decompose op (#14)
iefode Oct 7, 2020
f8fc914
.
Oct 7, 2020
ecf96e5
Merge branch 'master' into update_evaluates
Oct 7, 2020
5233a09
Fix loosing control dependency in replace_node
Oct 7, 2020
1340aea
Fix loosing control dependency in replace_node
Oct 7, 2020
fc429b7
Merge branch 'master' into update_evaluates
Oct 8, 2020
1a47819
Fix code style
Oct 8, 2020
8480066
Fix FQ references build on windows
Oct 8, 2020
3463c9b
Merge remote-tracking branch 'origin/update_evaluates' into update_ev…
Oct 8, 2020
32dbaeb
Fix code style
Oct 8, 2020
a1a58ab
Apply comments (#15)
iefode Oct 8, 2020
d9092a8
Ci (#16)
iefode Oct 12, 2020
b83218a
Android fix (#17)
iefode Oct 12, 2020
6f301a9
fix failures
Oct 12, 2020
1fa4644
Fix code style
Oct 12, 2020
da4b5e3
Add (#18)
iefode Oct 12, 2020
7f66509
Merge branch 'master' into update_evaluates
Oct 12, 2020
c19bf49
Add in opset1 upgrade pass
Oct 12, 2020
e9729f3
Add in opset1 upgrade pass
Oct 12, 2020
083dcdb
Remove v0::Add, Reverted removing v0::Multiply (#19)
iefode Oct 13, 2020
83fc4c8
Remove overloaded math operators from PyNgraph
Oct 13, 2020
55ff773
Remove overloaded math operators from PyNgraph
Oct 13, 2020
f9760d8
Merge branch 'master' into update_evaluates
Oct 13, 2020
92c2c96
Fix gna tests (#20)
iefode Oct 13, 2020
620804f
Merge branch 'update_evaluates' of https://github.com/mikhail-treskin…
Oct 13, 2020
a9c338a
Merge upstream master
Oct 13, 2020
aec84b1
LRN Reference (#21)
iefode Oct 14, 2020
5b7afbd
Disable failed tests on ia32
Oct 14, 2020
b3cca60
Merge upstream master
Oct 14, 2020
0c892de
Remove redundant broadcast from MVN ref
Oct 14, 2020
58fb557
Merge branch 'update_evaluates' of https://github.com/mikhail-treskin…
Oct 14, 2020
fb1dc34
Fix missed GatherND in opset_int_tbl + code style
Oct 14, 2020
9389d24
Remove one extra temporary buffer from MVN ref
Oct 15, 2020
8e50854
Merge branch 'update_evaluates' of github.com:mikhail-treskin/openvin…
Oct 15, 2020
a5153c2
Merge master (#22)
iefode Oct 15, 2020
b3d514f
Merge remote-tracking branch 'upstream/master' into update_evaluates
Oct 15, 2020
d288aec
Merge remote-tracking branch 'upstream/master' into update_evaluates
iefode Oct 16, 2020
410f865
RegionYolo
iefode Oct 16, 2020
9d89220
Apply review comments
Oct 21, 2020
ed4e574
Merge remote-tracking branch 'upstream/master' into update_evaluates
Oct 21, 2020
cdbcbd2
Merge remote-tracking branch 'upstream/master' into update_evaluates
Oct 21, 2020
6f9a462
Merge remote-tracking branch 'origin/update_evaluates' into update_ev…
Oct 21, 2020
9ef2324
Apply code style
Oct 21, 2020
ba88b24
Apply comments
Oct 21, 2020
4c2e815
Merge branch 'update_evaluates' of github.com:mikhail-treskin/openvin…
Oct 21, 2020
5bf1ccb
Apply code style
Oct 21, 2020
061d97c
Fix RegionYolo evaluate redefinition
Oct 21, 2020
0435170
Removed defines from evaluates map
Oct 22, 2020
617ce58
Apply code style
Oct 22, 2020
ed8e562
Merge remote-tracking branch 'upstream/master' into update_evaluates
Oct 23, 2020
f116518
Fix MVN ref
Oct 23, 2020
c26efd3
Merge upstream master
Oct 29, 2020
13c5f14
rename select reference argument
Oct 30, 2020
1375188
Merge remote-tracking branch 'upstream/master' into update_evaluates
iefode Nov 2, 2020
941597d
Fix code style
iefode Nov 2, 2020
f6d2cc8
Merge remote-tracking branch 'upstream/master' into update_evaluates
iefode Nov 5, 2020
ad4d67e
Merge remote-tracking branch 'upstream/master' into update_evaluates
iefode Nov 24, 2020
18d52ed
Fix Fake Quantize references calculation (#24)
Nov 24, 2020
187fe80
Fix MVN ref
iefode Nov 24, 2020
015fe64
Fix MVN & adding NMS
iefode Nov 25, 2020
a798b60
Merge remote-tracking branch 'origin/update_evaluates' into update_ev…
iefode Nov 25, 2020
eb94ae7
Merge remote-tracking branch 'upstream/master' into update_evaluates
iefode Nov 25, 2020
4259a5b
Fix TI
iefode Nov 25, 2020
b32b601
Temporary relax comparison threshold for FQ SLT
Nov 27, 2020
7f8fd31
Fix GPU LPT Tests
Nov 27, 2020
fca0174
Merge remote-tracking branch 'upstream/master' into update_evaluates
Nov 27, 2020
9b3a687
Add explicit rounding mode seetting in FQ references
Nov 27, 2020
ed974ab
Merge remote-tracking branch 'upstream/master' into update_evaluates
Dec 1, 2020
70f603b
Apply code style
Dec 1, 2020
a7d897b
Rollback op_is test deletion
Dec 2, 2020
d93a4c7
Apply code style
Dec 2, 2020
de3987b
Merge remote-tracking branch 'upstream/master' into update_evaluates
Dec 2, 2020
282e54d
Merge remote-tracking branch 'upstream/master' into update_evaluates
Dec 3, 2020
9c23b70
Fix merge conflict resolving issues
Dec 3, 2020
0d84107
Apply code style
Dec 3, 2020
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 @@ -49,7 +49,7 @@ INSTANTIATE_TEST_CASE_P(GroupConvolution2D_ExplicitPadding, GroupConvolutionLaye
::testing::Combine(
groupConv2DParams_ExplicitPadding,
::testing::ValuesIn(netPrecisions),
::testing::Values(std::vector<size_t >({1, 16, 30, 30})),
::testing::Values(std::vector<size_t >({1, 16, 10, 10})),
::testing::Values(CommonTestUtils::DEVICE_CPU)),
GroupConvolutionLayerTest::getTestCaseName);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// Copyright (C) 2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//

#include <vector>
#include "single_layer_tests/prior_box_clustered.hpp"
#include "common_test_utils/test_constants.hpp"

using namespace LayerTestsDefinitions;
using namespace ngraph::helpers;

namespace {
// Common params
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP32,
};

const std::vector<std::vector<float>> widths = {
{ 5.12f, 14.6f, 13.5f },
{ 7.0f, 8.2f, 33.39f }
};

const std::vector<std::vector<float>> heights = {
{ 15.12f, 15.6f, 23.5f },
{ 10.0f, 16.2f, 36.2f }
};

const std::vector<float> step_widths = {
0.0f, 2.0f
};

const std::vector<float> step_heights = {
0.0f, 1.5f
};

const std::vector<float> offsets = {
0.5f
};

const std::vector<std::vector<float>> variances = {
{ 0.1f, 0.1f, 0.2f, 0.2f }
};

const std::vector<bool> clips = {
true, false
};

const auto layerSpeficParams = ::testing::Combine(
::testing::ValuesIn(widths),
::testing::ValuesIn(heights),
::testing::ValuesIn(clips),
::testing::ValuesIn(step_widths),
::testing::ValuesIn(step_heights),
::testing::ValuesIn(offsets),
::testing::ValuesIn(variances)
);

INSTANTIATE_TEST_CASE_P(PriorBoxClustered_Basic, PriorBoxClusteredLayerTest,
::testing::Combine(
layerSpeficParams,
::testing::ValuesIn(netPrecisions),
::testing::Values(std::vector<size_t>({ 4, 4 })),
::testing::Values(std::vector<size_t>({ 50, 50 })),
::testing::Values(CommonTestUtils::DEVICE_CPU)),
PriorBoxClusteredLayerTest::getTestCaseName
);

} // namespace
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// Copyright (C) 2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//

#include <vector>

#include "single_layer_tests/proposal.hpp"
#include "common_test_utils/test_constants.hpp"

using namespace ngraph::helpers;
using namespace LayerTestsDefinitions;

namespace {

/* ============= Proposal ============= */
const std::vector<base_size_type> base_size_ = {16};
const std::vector<pre_nms_topn_type> pre_nms_topn_ = {100};
const std::vector<post_nms_topn_type> post_nms_topn_ = {100};
const std::vector<nms_thresh_type> nms_thresh_ = {0.7f};
const std::vector<min_size_type> min_size_ = {1};
const std::vector<ratio_type> ratio_ = {{1.0f, 2.0f}};
const std::vector<scale_type> scale_ = {{1.2f, 1.5f}};
const std::vector<clip_before_nms_type> clip_before_nms_ = {false};
const std::vector<clip_after_nms_type> clip_after_nms_ = {false};

// empty string corresponds to Caffe framework
// Myriad plugin does not take this parameter; uses "" by default
const std::vector<framework_type> framework_ = {""};

const auto proposalParams = ::testing::Combine(
::testing::ValuesIn(base_size_),
::testing::ValuesIn(pre_nms_topn_),
::testing::ValuesIn(post_nms_topn_),
::testing::ValuesIn(nms_thresh_),
::testing::ValuesIn(min_size_),
::testing::ValuesIn(ratio_),
::testing::ValuesIn(scale_),
::testing::ValuesIn(clip_before_nms_),
::testing::ValuesIn(clip_after_nms_),
::testing::ValuesIn(framework_)
);

INSTANTIATE_TEST_CASE_P(Proposal_tests, ProposalLayerTest,
::testing::Combine(
proposalParams,
::testing::Values(CommonTestUtils::DEVICE_CPU)),
ProposalLayerTest::getTestCaseName
);

} // namespace
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@

namespace LayerTestsDefinitions {

typedef std::tuple<
InferenceEngine::SizeVector, // Input shapes
InferenceEngine::Precision, // Input precision
int64_t, // Axis
bool, // Exclusive
bool, // Reverse
std::string> cumSumParams; // Device name
typedef std::tuple<
mikhail-treskin marked this conversation as resolved.
Show resolved Hide resolved
InferenceEngine::SizeVector, // Input shapes
InferenceEngine::Precision, // Input precision
int64_t, // Axis
bool, // Exclusive
bool, // Reverse
std::string> cumSumParams; // Device name

class CumSumLayerTest : public testing::WithParamInterface<cumSumParams>, virtual public LayerTestsUtils::LayerTestsCommon {
public:
static std::string getTestCaseName(testing::TestParamInfo<cumSumParams> obj);

protected:
void SetUp() override;
};
protected:
void SetUp() override;
};

} // namespace LayerTestsDefinitions
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ void ActivationParamLayerTest::SetUp() {
std::tie(activationType, netPrecision, shapes, targetDevice) = GetParam();
auto ngPrc = FuncTestUtils::PrecisionUtils::convertIE2nGraphPrc(netPrecision);
auto params = ngraph::builder::makeParams(ngPrc, {shapes.first});
auto activationParams = createActivationParams(ngPrc);
auto activationParams = createActivationParams(ngPrc, shapes.second);
params[0]->set_friendly_name("Input");
params.insert(params.end(), activationParams.begin(), activationParams.end());
auto activation = ngraph::builder::makeActivation(params, ngPrc, activationType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ namespace LayerTestsDefinitions {
}

void SelectLayerTest::SetUp() {
SetRefMode(LayerTestsUtils::RefMode::CONSTANT_FOLDING);

std::vector<std::vector<size_t>> inputShapes(numOfInputs);
InferenceEngine::Precision inputPrecision;
ngraph::op::AutoBroadcastSpec broadcast;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,6 @@ std::vector<std::vector<std::uint8_t>> LayerTestsCommon::CalculateRefs() {
auto cloned_function = ngraph::clone_function(*function);

// todo: add functionality to configure the necessary transformations for each test separately
ngraph::pass::Manager m;
m.register_pass<ngraph::pass::ConvertSpaceToBatch>();
m.register_pass<ngraph::pass::ConvertBatchToSpace>();
m.run_passes(cloned_function);
expectedOutputs = ngraph::helpers::interpreterFunction(cloned_function, referenceInputs, convertType);
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ class LayerTestsCommon : public CommonTestUtils::TestsCommon {

template<class T>
void Compare(const T *expected, const T *actual, std::size_t size, T threshold) {
std::cout << std::endl;
mikhail-treskin marked this conversation as resolved.
Show resolved Hide resolved
std::cout << "EXPECTED: " << std::endl;
for (size_t i = 0; i < size; ++i) {
std::cout << expected[i] << " ";
}
std::cout << std::endl;
std::cout << "ACTUAL: " << std::endl;
for (size_t i = 0; i < size; ++i) {
std::cout << actual[i] << " ";
}
std::cout << std::endl;
for (std::size_t i = 0; i < size; ++i) {
const auto &ref = expected[i];
Expand Down
2 changes: 2 additions & 0 deletions ngraph/core/include/ngraph/op/batch_to_space.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ namespace ngraph
const Output<Node>& block_shape,
const Output<Node>& crops_begin,
const Output<Node>& crops_end);
bool evaluate(const HostTensorVector& outputs,
const HostTensorVector& inputs) const override;

void validate_and_infer_types() override;
std::shared_ptr<Node>
Expand Down
1 change: 1 addition & 0 deletions ngraph/core/include/ngraph/op/embedding_segments_sum.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ namespace ngraph
clone_with_new_inputs(const OutputVector& new_args) const override;

virtual bool visit_attributes(AttributeVisitor& visitor) override { return true; }

private:
static constexpr int EMB_TABLE = 0;
static constexpr int INDICES = 1;
Expand Down
1 change: 1 addition & 0 deletions ngraph/core/include/ngraph/op/mvn.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ namespace ngraph
bool get_normalize_variance() const { return m_normalize_variance; }
AxisSet get_reduction_axes() const { return m_reduction_axes; }
void set_reduction_axes(AxisSet axes) { m_reduction_axes = axes; }

private:
double m_eps = 1e-9;
bool m_across_channels;
Expand Down
1 change: 1 addition & 0 deletions ngraph/core/include/ngraph/op/shuffle_channels.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ namespace ngraph

int64_t get_axis() const { return m_axis; }
int64_t get_group() const { return m_group; }
bool evaluate(const HostTensorVector& outputs, const HostTensorVector& inputs) const override;
private:
/// \brief Generates a shape required to permute the data
///
Expand Down
60 changes: 60 additions & 0 deletions ngraph/core/include/ngraph/runtime/reference/mvn.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
//*****************************************************************************
// Copyright 2017-2020 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//*****************************************************************************

#pragma once

#include <cstddef>
#include <ngraph/shape.hpp>
#include <ngraph/runtime/reference/mean.hpp>
#include <ngraph/runtime/opt_kernel/broadcast.hpp>
#include <ngraph/runtime/reference/subtract.hpp>
#include <ngraph/runtime/reference/multiply.hpp>
#include <ngraph/runtime/reference/sum.hpp>
#include <ngraph/runtime/reference/sqrt.hpp>

namespace ngraph {
namespace runtime {
namespace reference {
template<typename T>
void mvn(const T *arg, T *out, const Shape &in_shape, bool normalize_variance, AxisSet reduction_axes,
double eps) {
auto reduced_shape = reduce(in_shape, reduction_axes);
std::vector<T> mean_val(shape_size(reduced_shape));
mean(arg, mean_val.data(), in_shape, reduction_axes);
std::vector<T> broadcast_mean_data(shape_size(in_shape));
mikhail-treskin marked this conversation as resolved.
Show resolved Hide resolved
broadcast(mean_val.data(), broadcast_mean_data.data(), reduced_shape, in_shape, reduction_axes);
subtract(arg, broadcast_mean_data.data(), out, shape_size(in_shape));

if (normalize_variance) {
std::vector<T> multiply_val(shape_size(in_shape));
multiply(out, out, multiply_val.data(),shape_size(in_shape));
std::vector<T> sum_val(shape_size(reduced_shape));
sum(multiply_val.data(), sum_val.data(), in_shape, reduction_axes);
std::vector<T> broadcast_sum(shape_size(in_shape));
mikhail-treskin marked this conversation as resolved.
Show resolved Hide resolved
broadcast(sum_val.data(), broadcast_sum.data(), reduced_shape, in_shape, reduction_axes);
T n = 1;
for (auto i : reduction_axes) {
n *= in_shape[i];
}
for (size_t i = 0; i < shape_size(in_shape); ++i) {
out[i] /= std::sqrt(broadcast_sum[i] / n) + eps;
mikhail-treskin marked this conversation as resolved.
Show resolved Hide resolved
}

}
}
} // namespace reference
} // namespace runtime
} // namespace ngraph
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ namespace ngraph
if (in_bounds || include_padding_in_avg_computation)
{
T v =
in_bounds ? arg[input_batch_transform.index(input_batch_coord)] : 0;
in_bounds ? arg[input_batch_transform.index(input_batch_coord)] : static_cast<T>(0);
result += v;
n_elements++;
}
Expand Down
Loading