From: Andrew Bakalin Date: Tue, 23 Jun 2020 12:03:50 +0000 (+0300) Subject: [VPU] Fix eltwise broadcast (#1001) X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=36fd61f2c946a11dfe51bcaeb3c6d9de78f8b7c9;p=platform%2Fupstream%2Fdldt.git [VPU] Fix eltwise broadcast (#1001) * [VPU][Tests] Extend eltwise test cases * [VPU] Fix Myriad2 * [VPU] Update firmware * [VPU] Review fixes * [VPU] Update old deprecated tests --- diff --git a/inference-engine/cmake/vpu_dependencies.cmake b/inference-engine/cmake/vpu_dependencies.cmake index 626a819..8cab213 100644 --- a/inference-engine/cmake/vpu_dependencies.cmake +++ b/inference-engine/cmake/vpu_dependencies.cmake @@ -19,7 +19,7 @@ set(VPU_SUPPORTED_FIRMWARES usb-ma2450 usb-ma2x8x pcie-ma248x) # Default packages # -set(FIRMWARE_PACKAGE_VERSION 1237) +set(FIRMWARE_PACKAGE_VERSION 1239) set(VPU_CLC_MA2X8X_VERSION "movi-cltools-20.02.0") # diff --git a/inference-engine/tests/functional/plugin/myriad/CMakeLists.txt b/inference-engine/tests/functional/plugin/myriad/CMakeLists.txt index 62daa07..19aba37 100644 --- a/inference-engine/tests/functional/plugin/myriad/CMakeLists.txt +++ b/inference-engine/tests/functional/plugin/myriad/CMakeLists.txt @@ -10,6 +10,8 @@ disable_deprecated_warnings() addIeTargetTest( NAME ${TARGET_NAME} ROOT ${CMAKE_CURRENT_SOURCE_DIR} + INCLUDES + ${CMAKE_CURRENT_SOURCE_DIR} DEPENDENCIES myriadPlugin LINK_LIBRARIES diff --git a/inference-engine/tests/functional/plugin/myriad/shared_tests_instances/single_layer_tests/eltwise.cpp b/inference-engine/tests/functional/plugin/myriad/shared_tests_instances/single_layer_tests/eltwise.cpp index a7fed61..af8b893 100644 --- a/inference-engine/tests/functional/plugin/myriad/shared_tests_instances/single_layer_tests/eltwise.cpp +++ b/inference-engine/tests/functional/plugin/myriad/shared_tests_instances/single_layer_tests/eltwise.cpp @@ -2,20 +2,28 @@ // SPDX-License-Identifier: Apache-2.0 // -#include #include "single_layer_tests/eltwise.hpp" #include "common_test_utils/test_constants.hpp" +#include "common/myriad_common_test_utils.hpp" +#include + +#include using namespace LayerTestsDefinitions; using namespace LayerTestsDefinitions::EltwiseParams; namespace { + +typedef std::map Config; + std::vector>> 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 netPrecisions = { @@ -39,7 +47,14 @@ std::vector eltwiseOpTypes = { ngraph::helpers::EltwiseTypes::ADD }; -std::map additional_config = {}; +Config getConfig() { + Config config; + config[VPU_CONFIG_KEY(DETECT_NETWORK_BATCH)] = CONFIG_VALUE(NO); + if (CommonTestUtils::vpu::CheckMyriad2()) { + config[VPU_CONFIG_KEY(DISABLE_REORDER)] = CONFIG_VALUE(YES); + } + return config; +} const auto multiply_params = ::testing::Combine( ::testing::ValuesIn(inShapes), @@ -48,7 +63,8 @@ const auto multiply_params = ::testing::Combine( ::testing::ValuesIn(opTypes), ::testing::ValuesIn(netPrecisions), ::testing::Values(CommonTestUtils::DEVICE_MYRIAD), - ::testing::Values(additional_config)); + ::testing::Values(getConfig())); INSTANTIATE_TEST_CASE_P(CompareWithRefs, EltwiseLayerTest, multiply_params, EltwiseLayerTest::getTestCaseName); + } // namespace diff --git a/inference-engine/tests/functional/plugin/myriad/subgraph_tests/dsr_tests_common.hpp b/inference-engine/tests/functional/plugin/myriad/subgraph_tests/dsr_tests_common.hpp index 2905eff..6eab25e 100644 --- a/inference-engine/tests/functional/plugin/myriad/subgraph_tests/dsr_tests_common.hpp +++ b/inference-engine/tests/functional/plugin/myriad/subgraph_tests/dsr_tests_common.hpp @@ -4,7 +4,7 @@ #pragma once -#include "../common/myriad_common_test_utils.hpp" +#include "common/myriad_common_test_utils.hpp" #include #include diff --git a/inference-engine/tests/functional/plugin/myriad/subgraph_tests/nonzero_broadcast.cpp b/inference-engine/tests/functional/plugin/myriad/subgraph_tests/nonzero_broadcast.cpp index 3cc1704..bd983be 100644 --- a/inference-engine/tests/functional/plugin/myriad/subgraph_tests/nonzero_broadcast.cpp +++ b/inference-engine/tests/functional/plugin/myriad/subgraph_tests/nonzero_broadcast.cpp @@ -6,7 +6,7 @@ #include "vpu/private_plugin_config.hpp" -#include "../common/myriad_common_test_utils.hpp" +#include "common/myriad_common_test_utils.hpp" #include #include diff --git a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_eltwise_test.hpp b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_eltwise_test.hpp index c420120..c15e165 100644 --- a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_eltwise_test.hpp +++ b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_eltwise_test.hpp @@ -191,18 +191,18 @@ SizeVector convertDims(SizeVector dims) { SizeVector ret(4); if (dims.size() == 1) { - ret[0] = dims[0]; - ret[1] = 1; + ret[0] = 1; + ret[1] = dims[0]; ret[2] = 1; ret[3] = 1; return ret; } if (dims.size() == 2) { - ret[0] = dims[1]; - ret[1] = 1; - ret[2] = 1; - ret[3] = dims[0]; + ret[0] = 1; + ret[1] = dims[1]; + ret[2] = dims[0]; + ret[3] = 1; return ret; } @@ -337,7 +337,12 @@ protected: GTEST_SKIP_("Please look at #-19681"); // inpt[2].resize(2); } else { - inpt[rand()%count].resize(rand()%ndims + 1); + const auto inputToResize = rand() % count; + const auto newSize = rand() % ndims + 1; + inpt[inputToResize].resize(newSize); + for (int i = 0; i < newSize; i++) { + inpt[inputToResize][newSize - i - 1] = dims[ndims - i - 1]; + } } for (int i = 0; i < count; ++i) { for (int j = 0; j < inpt[i].size(); j++) { @@ -352,6 +357,9 @@ protected: SetOutputTensors({dims}); _config[VPU_CONFIG_KEY(DETECT_NETWORK_BATCH)] = CONFIG_VALUE(NO); + if (!CheckMyriadX()) { + _config[VPU_CONFIG_KEY(DISABLE_REORDER)] = CONFIG_VALUE(YES); + } ASSERT_NO_FATAL_FAILURE(makeSingleLayerNetwork(LayerInitParams("Eltwise").params(_params))); ASSERT_TRUE(Infer());