This commit is contained in:
Efode, Irina
2021-10-14 01:27:24 +03:00
parent 49633d43c6
commit fadf43ecb7
7 changed files with 196 additions and 64 deletions

View File

@@ -0,0 +1,131 @@
// Copyright (C) 2018-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include <vector>
#include "single_layer_tests/eltwise.hpp"
#include "common_test_utils/test_constants.hpp"
using namespace ov::test::subgraph;
namespace {
std::vector<std::vector<ov::Shape>> inShapesStatic = {
{{2}},
{{2, 200}},
{{10, 200}},
{{1, 10, 100}},
{{4, 4, 16}},
{{1, 1, 1, 3}},
{{2, 17, 5, 4}, {1, 17, 1, 1}},
{{2, 17, 5, 1}, {1, 17, 1, 4}},
{{1, 2, 4}},
{{1, 4, 4}},
{{1, 4, 4, 1}},
{{1, 1, 1, 1, 1, 1, 3}},
{{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}},
};
std::vector<ov::test::InputShapes> inShapesDynamic = {
{{{ngraph::Dimension(1, 10), 200}, {ngraph::Dimension(1, 10), 200}},
{{{2, 200}, {2, 200}}, {{1, 200}, {5, 200}}}},
};
std::vector<ov::test::ElementType> netPrecisions = {
ov::element::f32,
ov::element::f16,
ov::element::i32,
};
std::vector<ngraph::helpers::InputLayerType> secondaryInputTypes = {
ngraph::helpers::InputLayerType::CONSTANT,
ngraph::helpers::InputLayerType::PARAMETER,
};
std::vector<ngraph::helpers::InputLayerType> secondaryInputTypesDynamic = {
ngraph::helpers::InputLayerType::PARAMETER,
};
std::vector<CommonTestUtils::OpType> opTypes = {
CommonTestUtils::OpType::SCALAR,
CommonTestUtils::OpType::VECTOR,
};
std::vector<CommonTestUtils::OpType> opTypesDynamic = {
CommonTestUtils::OpType::VECTOR,
};
std::vector<ngraph::helpers::EltwiseTypes> eltwiseOpTypes = {
ngraph::helpers::EltwiseTypes::ADD,
ngraph::helpers::EltwiseTypes::MULTIPLY,
ngraph::helpers::EltwiseTypes::SUBTRACT,
ngraph::helpers::EltwiseTypes::DIVIDE,
ngraph::helpers::EltwiseTypes::FLOOR_MOD,
ngraph::helpers::EltwiseTypes::SQUARED_DIFF,
ngraph::helpers::EltwiseTypes::POWER,
ngraph::helpers::EltwiseTypes::MOD
};
std::vector<ngraph::helpers::EltwiseTypes> eltwiseOpTypesDynamic = {
ngraph::helpers::EltwiseTypes::ADD,
ngraph::helpers::EltwiseTypes::MULTIPLY,
ngraph::helpers::EltwiseTypes::SUBTRACT,
};
ov::test::Config additional_config = {};
const auto multiply_params = ::testing::Combine(
::testing::ValuesIn(ov::test::static_shapes_to_test_representation(inShapesStatic)),
::testing::ValuesIn(eltwiseOpTypes),
::testing::ValuesIn(secondaryInputTypes),
::testing::ValuesIn(opTypes),
::testing::ValuesIn(netPrecisions),
::testing::Values(ov::element::Type_t::undefined),
::testing::Values(ov::element::Type_t::undefined),
::testing::Values(CommonTestUtils::DEVICE_TEMPLATE),
::testing::Values(additional_config));
const auto multiply_params_dynamic = ::testing::Combine(
::testing::ValuesIn(inShapesDynamic),
::testing::ValuesIn(eltwiseOpTypesDynamic),
::testing::ValuesIn(secondaryInputTypesDynamic),
::testing::ValuesIn(opTypesDynamic),
::testing::ValuesIn(netPrecisions),
::testing::Values(ov::element::Type_t::undefined),
::testing::Values(ov::element::Type_t::undefined),
::testing::Values(CommonTestUtils::DEVICE_TEMPLATE),
::testing::Values(additional_config));
INSTANTIATE_TEST_SUITE_P(smoke_CompareWithRefs_static, EltwiseLayerTest, multiply_params, EltwiseLayerTest::getTestCaseName);
INSTANTIATE_TEST_SUITE_P(smoke_CompareWithRefs_dynamic, EltwiseLayerTest, multiply_params_dynamic, EltwiseLayerTest::getTestCaseName);
std::vector<std::vector<ov::Shape>> inShapesSingleThread = {
{{1, 2, 3, 4}},
{{2, 2, 2, 2}},
{{2, 1, 2, 1, 2, 2}},
};
std::vector<ngraph::helpers::EltwiseTypes> eltwiseOpTypesSingleThread = {
ngraph::helpers::EltwiseTypes::ADD,
ngraph::helpers::EltwiseTypes::POWER,
};
std::map<std::string, std::string> additional_config_single_thread = {
{"CPU_THREADS_NUM", "1"}
};
const auto single_thread_params = ::testing::Combine(
::testing::ValuesIn(ov::test::static_shapes_to_test_representation(inShapesSingleThread)),
::testing::ValuesIn(eltwiseOpTypesSingleThread),
::testing::ValuesIn(secondaryInputTypes),
::testing::ValuesIn(opTypes),
::testing::ValuesIn(netPrecisions),
::testing::Values(ov::element::Type_t::undefined),
::testing::Values(ov::element::Type_t::undefined),
::testing::Values(CommonTestUtils::DEVICE_TEMPLATE),
::testing::Values(additional_config_single_thread));
INSTANTIATE_TEST_SUITE_P(smoke_SingleThread, EltwiseLayerTest, single_thread_params, EltwiseLayerTest::getTestCaseName);
} // namespace

View File

@@ -6,23 +6,23 @@
#include "single_layer_tests/eltwise.hpp"
#include "common_test_utils/test_constants.hpp"
using namespace LayerTestsDefinitions;
using namespace ov::test::subgraph;
namespace {
std::vector<std::pair<std::vector<ngraph::PartialShape>, std::vector<std::vector<ngraph::Shape>>>> inShapes = {
{{}, {{{2}}}},
{{}, {{{8}}}},
{{}, {{{1, 200}}}},
{{}, {{{1, 1, 1, 3}}}},
{{}, {{{1, 2, 4}}}},
{{}, {{{1, 4, 4}}}},
{{}, {{{1, 4, 4, 1}}}}
std::vector<std::vector<ov::Shape>> inShapes = {
{{2}},
{{8}},
{{1, 200}},
{{1, 1, 1, 3}},
{{1, 2, 4}},
{{1, 4, 4}},
{{1, 4, 4, 1}},
};
std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP32,
InferenceEngine::Precision::FP16,
std::vector<ov::test::ElementType> netPrecisions = {
ov::element::f32,
ov::element::f16,
};
std::vector<ngraph::helpers::InputLayerType> secondaryInputTypes = {
@@ -48,14 +48,13 @@ std::map<std::string, std::string> additional_config = {
};
const auto multiply_params = ::testing::Combine(
::testing::ValuesIn(inShapes),
::testing::ValuesIn(ov::test::static_shapes_to_test_representation(inShapes)),
::testing::ValuesIn(eltwiseOpTypes),
::testing::ValuesIn(secondaryInputTypes),
::testing::ValuesIn(opTypes),
::testing::ValuesIn(netPrecisions),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(ov::element::undefined),
::testing::Values(ov::element::undefined),
::testing::Values(CommonTestUtils::DEVICE_GNA),
::testing::Values(additional_config));

View File

@@ -54,6 +54,8 @@ std::vector<std::string> disabledTestPatterns() {
// TODO: Issue: 29577
R"(.*QueryNetwork.*)",
// TODO: GNA plugin does not support ExecGraph
R"(.*ExecGraphTests.*)"
R"(.*ExecGraphTests.*)",
// Issue connected with OV2.0
R"(.*EltwiseLayerTest.*NetType=f16.*)",
};
}

View File

@@ -6,29 +6,29 @@
#include "single_layer_tests/eltwise.hpp"
#include "common_test_utils/test_constants.hpp"
using namespace LayerTestsDefinitions;
using namespace ov::test::subgraph;
namespace {
std::vector<std::pair<std::vector<ngraph::PartialShape>, std::vector<std::vector<ngraph::Shape>>>> inShapes = {
{{}, {{{2}}}},
{{}, {{{2, 200}}}},
{{}, {{{10, 200}}}},
{{}, {{{1, 10, 100}}}},
{{}, {{{4, 4, 16}}}},
{{}, {{{1, 1, 1, 3}}}},
{{}, {{{2, 17, 5, 4}, {1, 17, 1, 1}}}},
{{}, {{{2, 17, 5, 1}, {1, 17, 1, 4}}}},
{{}, {{{1, 2, 4}}}},
{{}, {{{1, 4, 4}}}},
{{}, {{{1, 4, 4, 1}}}},
{{}, {{{1, 4, 3, 2, 1, 3}}}},
{{}, {{{1, 3, 1, 1, 1, 3}, {1, 3, 1, 1, 1, 1}}}},
std::vector<std::vector<ov::Shape>> inShapes = {
{{2}},
{{2, 200}},
{{10, 200}},
{{1, 10, 100}},
{{4, 4, 16}},
{{1, 1, 1, 3}},
{{2, 17, 5, 4}, {1, 17, 1, 1}},
{{2, 17, 5, 1}, {1, 17, 1, 4}},
{{1, 2, 4}},
{{1, 4, 4}},
{{1, 4, 4, 1}},
{{1, 4, 3, 2, 1, 3}},
{{1, 3, 1, 1, 1, 3}, {1, 3, 1, 1, 1, 1}},
};
std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP32,
InferenceEngine::Precision::FP16,
InferenceEngine::Precision::I64,
std::vector<ov::test::ElementType> netPrecisions = {
ov::element::f32,
ov::element::f16,
ov::element::i64,
};
std::vector<ngraph::helpers::InputLayerType> secondaryInputTypes = {
@@ -55,14 +55,13 @@ std::vector<ngraph::helpers::EltwiseTypes> eltwiseOpTypes = {
std::map<std::string, std::string> additional_config = {};
const auto multiply_params = ::testing::Combine(
::testing::ValuesIn(inShapes),
::testing::ValuesIn(ov::test::static_shapes_to_test_representation(inShapes)),
::testing::ValuesIn(eltwiseOpTypes),
::testing::ValuesIn(secondaryInputTypes),
::testing::ValuesIn(opTypes),
::testing::ValuesIn(netPrecisions),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(ov::element::undefined),
::testing::Values(ov::element::undefined),
::testing::Values(CommonTestUtils::DEVICE_GPU),
::testing::Values(additional_config));

View File

@@ -74,5 +74,8 @@ std::vector<std::string> disabledTestPatterns() {
R"(.*smoke_PrePostProcess_GPU.*convert_element_type_and_mean.*)",
// TODO: Issue 67408
R"(.*smoke_LSTMSequenceCommonClip.*LSTMSequenceTest.*CompareWithRefs.*)",
R"(.*EltwiseLayerTest.*OpType=FloorMod.*NetType=i64.*)",
// Issue connected with OV2.0
R"(.*EltwiseLayerTest.*OpType=Pow.*NetType=i64.*)",
};
}

View File

@@ -9,29 +9,29 @@
#include <vector>
using namespace LayerTestsDefinitions;
using namespace ov::test::subgraph;
namespace {
typedef std::map<std::string, std::string> Config;
std::vector<std::pair<std::vector<ngraph::PartialShape>, std::vector<std::vector<ngraph::Shape>>>> inShapes = {
{{}, {{{2}}}},
{{}, {{{1, 1, 1, 3}}}},
{{}, {{{1, 2, 4}}}},
{{}, {{{1, 4, 4}}}},
{{}, {{{1, 4, 4, 1}}}},
{{}, {{{16, 16, 96}, {96}}}},
{{}, {{{52, 1, 52, 3, 2}, {2}}}}
std::vector<std::vector<ov::Shape>> inShapes = {
{{2}},
{{1, 1, 1, 3}},
{{1, 2, 4}},
{{1, 4, 4}},
{{1, 4, 4, 1}},
{{16, 16, 96}, {96}},
{{52, 1, 52, 3, 2}, {2}},
};
std::vector<InferenceEngine::Precision> fpTypes = {
InferenceEngine::Precision::FP32,
InferenceEngine::Precision::FP16,
std::vector<ov::test::ElementType> fpTypes = {
ov::element::f32,
ov::element::f16,
};
std::vector<InferenceEngine::Precision> intTypes = {
InferenceEngine::Precision::I32,
std::vector<ov::test::ElementType> intTypes = {
ov::element::i32,
};
std::vector<CommonTestUtils::OpType> opTypes = {
@@ -58,14 +58,13 @@ std::vector<ngraph::helpers::EltwiseTypes> eltwiseMathTypesINT = {
INSTANTIATE_TEST_SUITE_P(smoke_EltwiseMathFP,
EltwiseLayerTest,
::testing::Combine(
::testing::ValuesIn(inShapes),
::testing::ValuesIn(ov::test::static_shapes_to_test_representation(inShapes)),
::testing::ValuesIn(eltwiseMathTypesFP),
::testing::Values(ngraph::helpers::InputLayerType::PARAMETER),
::testing::ValuesIn(opTypes),
::testing::ValuesIn(fpTypes),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(ov::element::undefined),
::testing::Values(ov::element::undefined),
::testing::Values(CommonTestUtils::DEVICE_MYRIAD),
::testing::Values(Config{{InferenceEngine::MYRIAD_DETECT_NETWORK_BATCH, CONFIG_VALUE(NO)}})),
EltwiseLayerTest::getTestCaseName);
@@ -73,14 +72,13 @@ INSTANTIATE_TEST_SUITE_P(smoke_EltwiseMathFP,
INSTANTIATE_TEST_SUITE_P(smoke_EltwiseMathInt,
EltwiseLayerTest,
::testing::Combine(
::testing::ValuesIn(inShapes),
::testing::ValuesIn(ov::test::static_shapes_to_test_representation(inShapes)),
::testing::ValuesIn(eltwiseMathTypesINT),
::testing::Values(ngraph::helpers::InputLayerType::PARAMETER),
::testing::ValuesIn(opTypes),
::testing::ValuesIn(intTypes),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(ov::element::undefined),
::testing::Values(ov::element::undefined),
::testing::Values(CommonTestUtils::DEVICE_MYRIAD),
::testing::Values(Config{{InferenceEngine::MYRIAD_DETECT_NETWORK_BATCH, CONFIG_VALUE(NO)}})),
EltwiseLayerTest::getTestCaseName);

View File

@@ -69,7 +69,7 @@ private:
std::vector<ov::runtime::Tensor> get_plugin_outputs();
};
static std::vector<InputShape> static_shapes_to_test_representation(const std::vector<ov::Shape>& staticShapes) {
inline std::vector<InputShape> static_shapes_to_test_representation(const std::vector<ov::Shape>& staticShapes) {
std::vector<InputShape> result;
for (const auto& staticShape : staticShapes) {
result.push_back({{}, {staticShape}});
@@ -77,7 +77,7 @@ static std::vector<InputShape> static_shapes_to_test_representation(const std::v
return result;
}
static std::vector<InputShapes> static_shapes_to_test_representation(const std::vector<std::vector<ov::Shape>>& staticShapes) {
inline std::vector<InputShapes> static_shapes_to_test_representation(const std::vector<std::vector<ov::Shape>>& staticShapes) {
std::vector<InputShapes> result;
for (const auto& staticShape : staticShapes) {
result.push_back({{}, {staticShape}});