From f07cee8d9976a69c584e42a47627efd2a3334d58 Mon Sep 17 00:00:00 2001 From: Anton Voronov Date: Wed, 12 May 2021 15:39:45 +0300 Subject: [PATCH] fixes after rebase and review fixes --- .../cpu/single_layer_tests/convolution.cpp | 14 +- .../convolution_backprop_data.cpp | 140 +++++++--------- .../single_layer_tests/group_convolution.cpp | 3 +- .../group_convolution_backprop_data.cpp | 151 ++++++++---------- .../include/ngraph_functions/builders.hpp | 12 +- .../ngraph_functions/src/convolution.cpp | 13 +- .../src/convolution_backprop_data.cpp | 13 +- .../src/group_convolution_backprop_data.cpp | 13 +- 8 files changed, 146 insertions(+), 213 deletions(-) diff --git a/inference-engine/tests/functional/plugin/cpu/single_layer_tests/convolution.cpp b/inference-engine/tests/functional/plugin/cpu/single_layer_tests/convolution.cpp index c7436f669524b2..f327b51dd9b847 100755 --- a/inference-engine/tests/functional/plugin/cpu/single_layer_tests/convolution.cpp +++ b/inference-engine/tests/functional/plugin/cpu/single_layer_tests/convolution.cpp @@ -138,7 +138,8 @@ const std::vector fusingParamsSet{ fusingFakeQuantizePerChannelRelu, fusingSumEluFQ, fusingSum, - fusingPRelu1D + fusingPRelu1D, + fusingAddPerChannel }; const std::vector fusingParamsSetBF16{ @@ -153,7 +154,8 @@ const std::vector fusingParamsSetBF16{ // other patterns fusingReluAdd, fusingReluScaleShift, - fusingSum + fusingSum, + fusingAddPerChannel }; const std::vector fusingParamsSetI8{ @@ -163,18 +165,20 @@ const std::vector fusingParamsSetI8{ fusingElu, fusingSigmoid, fusingClamp, - fusingPRelu, + fusingPReluPerChannel, // todo: [antonvor] not supported yet // fusingSwish, fusingHSwish, fusingMish, // other patterns - fusingReluScaleShift, + // todo: [antonvor] not supported yet +// fusingReluScaleShift, fusingFakeQuantizePerTensorRelu, fusingFakeQuantizePerChannelRelu, // todo: [antonvor] not supported yet // fusingSumEluFQ, -// fusingSum +// fusingSum, +// fusingAddPerChannel }; const std::map cpuEmptyPluginConfig; diff --git a/inference-engine/tests/functional/plugin/cpu/single_layer_tests/convolution_backprop_data.cpp b/inference-engine/tests/functional/plugin/cpu/single_layer_tests/convolution_backprop_data.cpp index 53c71ef5993f13..b28deef0f07620 100755 --- a/inference-engine/tests/functional/plugin/cpu/single_layer_tests/convolution_backprop_data.cpp +++ b/inference-engine/tests/functional/plugin/cpu/single_layer_tests/convolution_backprop_data.cpp @@ -19,7 +19,6 @@ using LayerTestsDefinitions::convBackpropDataLayerTestParamsSet; typedef std::tuple< convBackpropDataLayerTestParamsSet, - bool, CPUSpecificParams, fusingSpecificParams, std::map > deconvLayerCPUTestParamsSet; @@ -29,17 +28,15 @@ class DeconvolutionLayerCPUTest : public testing::WithParamInterface obj) { convBackpropDataLayerTestParamsSet basicParamsSet; - bool withBiases; CPUSpecificParams cpuParams; fusingSpecificParams fusingParams; std::map additionalConfig; - std::tie(basicParamsSet, withBiases, cpuParams, fusingParams, additionalConfig) = obj.param; + std::tie(basicParamsSet, cpuParams, fusingParams, additionalConfig) = obj.param; std::ostringstream result; result << LayerTestsDefinitions::ConvolutionBackpropDataLayerTest::getTestCaseName(testing::TestParamInfo( basicParamsSet, 0)); - result << "_withBiases=" << withBiases; result << CPUTestsBase::getTestCaseName(cpuParams); result << CpuTestWithFusing::getTestCaseName(fusingParams); @@ -56,11 +53,10 @@ class DeconvolutionLayerCPUTest : public testing::WithParamInterface additionalConfig; - std::tie(basicParamsSet, withBiases, cpuParams, fusingParams, additionalConfig) = this->GetParam(); + std::tie(basicParamsSet, cpuParams, fusingParams, additionalConfig) = this->GetParam(); configuration.insert(additionalConfig.begin(), additionalConfig.end()); @@ -101,7 +97,7 @@ class DeconvolutionLayerCPUTest : public testing::WithParamInterface>()); - if (withBiases) - additionalPasses.push_back(std::make_shared>()); } } }; @@ -179,7 +173,6 @@ INSTANTIATE_TEST_CASE_P(smoke_Deconv_2D_Planar_FP32, DeconvolutionLayerCPUTest, ::testing::Values(Layout::ANY), ::testing::Values(std::vector({ 2, 12, 7, 7 })), ::testing::Values(CommonTestUtils::DEVICE_CPU)), - ::testing::Values(false), ::testing::ValuesIn(filterCPUInfoForDevice({conv_gemm_2D})), ::testing::ValuesIn(fusingParamsSet), ::testing::Values(cpuEmptyPluginConfig)), @@ -196,7 +189,6 @@ INSTANTIATE_TEST_CASE_P(smoke_Deconv_2D_Planar_BF16, DeconvolutionLayerCPUTest, ::testing::Values(Layout::ANY), ::testing::Values(std::vector({ 2, 12, 7, 7 })), ::testing::Values(CommonTestUtils::DEVICE_CPU)), - ::testing::Values(false), ::testing::ValuesIn(filterCPUInfoForDevice({conv_gemm_2D})), ::testing::ValuesIn(fusingParamsSet), ::testing::Values(cpuBF16PluginConfig)), @@ -230,7 +222,6 @@ INSTANTIATE_TEST_CASE_P(smoke_Deconv_2D_I8, DeconvolutionLayerCPUTest, ::testing::Values(Layout::ANY), ::testing::Values(std::vector({ 2, 12, 7, 7 })), ::testing::Values(CommonTestUtils::DEVICE_CPU)), - ::testing::Values(false, true), ::testing::ValuesIn(filterCPUInfoForDevice({conv_avx512_2D_I8})), ::testing::Values(emptyFusingSpec), ::testing::Values(cpuEmptyPluginConfig)), @@ -258,7 +249,6 @@ INSTANTIATE_TEST_CASE_P(smoke_Deconv_3D_Planar_FP32, DeconvolutionLayerCPUTest, ::testing::Values(Layout::ANY), ::testing::Values(std::vector({ 2, 12, 7, 7, 7 })), ::testing::Values(CommonTestUtils::DEVICE_CPU)), - ::testing::Values(false), ::testing::ValuesIn(filterCPUInfoForDevice({conv_gemm_3D})), ::testing::ValuesIn(fusingParamsSet), ::testing::Values(cpuEmptyPluginConfig)), @@ -275,45 +265,44 @@ INSTANTIATE_TEST_CASE_P(smoke_Deconv_3D_Planar_BF16, DeconvolutionLayerCPUTest, ::testing::Values(Layout::ANY), ::testing::Values(std::vector({ 2, 12, 7, 7, 7 })), ::testing::Values(CommonTestUtils::DEVICE_CPU)), - ::testing::Values(false), ::testing::ValuesIn(filterCPUInfoForDevice({conv_gemm_3D})), ::testing::ValuesIn(fusingParamsSet), ::testing::Values(cpuBF16PluginConfig)), DeconvolutionLayerCPUTest::getTestCaseName); /* ============= Deconvolution params I8 (3D) ============= */ -const std::vector kernels3di8 = { {3, 3, 3} }; -const std::vector strides3di8 = { {1, 1, 1}, {2, 2, 2} }; -const std::vector> padBegins3di8 = { {0, 0, 0}, {1, 1, 1} }; -const std::vector> padEnds3di8 = { {0, 0, 0}, {1, 1, 1} }; -const std::vector dilations3di8 = { {1, 1, 1}/*, {2, 2, 2}*/ }; - -const auto deconvParams_3D_I8 = ::testing::Combine( - ::testing::ValuesIn(kernels3di8), - ::testing::ValuesIn(strides3di8), - ::testing::ValuesIn(padBegins3di8), - ::testing::ValuesIn(padEnds3di8), - ::testing::ValuesIn(dilations3di8), - ::testing::ValuesIn(numOutChannels_Planar), - ::testing::Values(ngraph::op::PadType::EXPLICIT) -); - -INSTANTIATE_TEST_CASE_P(smoke_Deconv_3D_I8, DeconvolutionLayerCPUTest, - ::testing::Combine( - ::testing::Combine( - deconvParams_3D_I8, - ::testing::Values(Precision::FP32), - ::testing::Values(Precision::U8, Precision::I8), - ::testing::Values(Precision::FP32, Precision::I32), - ::testing::Values(Layout::ANY), - ::testing::Values(Layout::ANY), - ::testing::Values(std::vector({ 2, 12, 7, 7, 7 })), - ::testing::Values(CommonTestUtils::DEVICE_CPU)), - ::testing::Values(false, true), - ::testing::ValuesIn(filterCPUInfoForDevice({conv_avx512_3D_I8})), - ::testing::Values(emptyFusingSpec), - ::testing::Values(cpuEmptyPluginConfig)), - DeconvolutionLayerCPUTest::getTestCaseName); +//const std::vector kernels3di8 = { {3, 3, 3} }; +//const std::vector strides3di8 = { {1, 1, 1}, {2, 2, 2} }; +//const std::vector> padBegins3di8 = { {0, 0, 0}, {1, 1, 1} }; +//const std::vector> padEnds3di8 = { {0, 0, 0}, {1, 1, 1} }; +//const std::vector dilations3di8 = { {1, 1, 1}/*, {2, 2, 2}*/ }; +// +//const auto deconvParams_3D_I8 = ::testing::Combine( +// ::testing::ValuesIn(kernels3di8), +// ::testing::ValuesIn(strides3di8), +// ::testing::ValuesIn(padBegins3di8), +// ::testing::ValuesIn(padEnds3di8), +// ::testing::ValuesIn(dilations3di8), +// ::testing::ValuesIn(numOutChannels_Planar), +// ::testing::Values(ngraph::op::PadType::EXPLICIT) +//); +// +//INSTANTIATE_TEST_CASE_P(smoke_Deconv_3D_I8, DeconvolutionLayerCPUTest, +// ::testing::Combine( +// ::testing::Combine( +// deconvParams_3D_I8, +// ::testing::Values(Precision::FP32), +// ::testing::Values(Precision::U8, Precision::I8), +// ::testing::Values(Precision::FP32, Precision::I32), +// ::testing::Values(Layout::ANY), +// ::testing::Values(Layout::ANY), +// ::testing::Values(std::vector({ 2, 12, 7, 7, 7 })), +// ::testing::Values(CommonTestUtils::DEVICE_CPU)), +// ::testing::Values(false, true), +// ::testing::ValuesIn(filterCPUInfoForDevice({conv_avx512_3D_I8})), +// ::testing::Values(emptyFusingSpec), +// ::testing::Values(cpuEmptyPluginConfig)), +// DeconvolutionLayerCPUTest::getTestCaseName); /* ============= GroupDeconvolution (Blocked 2D) ============= */ const auto convParams_ExplicitPadding_Blocked_2D = ::testing::Combine( @@ -337,7 +326,6 @@ INSTANTIATE_TEST_CASE_P(smoke_Deconv_2D_Blocked_FP32, DeconvolutionLayerCPUTest, ::testing::Values(Layout::ANY), ::testing::Values(std::vector({ 2, 67, 7, 7 })), ::testing::Values(CommonTestUtils::DEVICE_CPU)), - ::testing::Values(false), ::testing::ValuesIn(filterCPUInfoForDevice({conv_avx512_2D})), ::testing::ValuesIn(fusingParamsSet), ::testing::Values(cpuEmptyPluginConfig)), @@ -354,7 +342,6 @@ INSTANTIATE_TEST_CASE_P(smoke_Deconv_2D_Blocked_BF16, DeconvolutionLayerCPUTest, ::testing::Values(Layout::ANY), ::testing::Values(std::vector({ 2, 67, 7, 7 })), ::testing::Values(CommonTestUtils::DEVICE_CPU)), - ::testing::Values(false), ::testing::ValuesIn(filterCPUInfoForDevice({conv_avx512_2D})), ::testing::ValuesIn(fusingParamsSet), ::testing::Values(cpuBF16PluginConfig)), @@ -382,7 +369,6 @@ INSTANTIATE_TEST_CASE_P(smoke_Deconv_3D_Blocked_FP32, DeconvolutionLayerCPUTest, ::testing::Values(Layout::ANY), ::testing::Values(std::vector({ 2, 67, 7, 7, 7 })), ::testing::Values(CommonTestUtils::DEVICE_CPU)), - ::testing::Values(false), ::testing::ValuesIn(filterCPUInfoForDevice({conv_avx512_3D})), ::testing::ValuesIn(fusingParamsSet), ::testing::Values(cpuEmptyPluginConfig)), @@ -399,7 +385,6 @@ INSTANTIATE_TEST_CASE_P(smoke_Deconv_3D_Blocked_BF16, DeconvolutionLayerCPUTest, ::testing::Values(Layout::ANY), ::testing::Values(std::vector({ 2, 67, 7, 7, 7 })), ::testing::Values(CommonTestUtils::DEVICE_CPU)), - ::testing::Values(false), ::testing::ValuesIn(filterCPUInfoForDevice({conv_avx512_3D})), ::testing::ValuesIn(fusingParamsSet), ::testing::Values(cpuBF16PluginConfig)), @@ -428,7 +413,6 @@ INSTANTIATE_TEST_CASE_P(smoke_Deconv_2D_1x1_FP32, DeconvolutionLayerCPUTest, ::testing::Values(Layout::ANY), ::testing::Values(std::vector({ 2, 67, 7, 7 })), ::testing::Values(CommonTestUtils::DEVICE_CPU)), - ::testing::Values(false), ::testing::ValuesIn(filterCPUInfoForDevice({conv_avx512_2D_1x1})), ::testing::ValuesIn(fusingParamsSet), ::testing::Values(cpuEmptyPluginConfig)), @@ -445,7 +429,6 @@ INSTANTIATE_TEST_CASE_P(smoke_Deconv_2D_1x1_BF16, DeconvolutionLayerCPUTest, ::testing::Values(Layout::ANY), ::testing::Values(std::vector({ 2, 67, 7, 7 })), ::testing::Values(CommonTestUtils::DEVICE_CPU)), - ::testing::Values(false), ::testing::ValuesIn(filterCPUInfoForDevice({conv_avx512_2D_1x1})), ::testing::ValuesIn(fusingParamsSet), ::testing::Values(cpuBF16PluginConfig)), @@ -462,7 +445,6 @@ INSTANTIATE_TEST_CASE_P(smoke_Deconv_2D_1x1_I8, DeconvolutionLayerCPUTest, ::testing::Values(Layout::ANY), ::testing::Values(std::vector({ 2, 67, 7, 7 })), ::testing::Values(CommonTestUtils::DEVICE_CPU)), - ::testing::Values(false, true), ::testing::ValuesIn(filterCPUInfoForDevice({conv_avx512_2D_1x1_I8})), ::testing::Values(emptyFusingSpec), ::testing::Values(cpuEmptyPluginConfig)), @@ -470,32 +452,32 @@ INSTANTIATE_TEST_CASE_P(smoke_Deconv_2D_1x1_I8, DeconvolutionLayerCPUTest, /* ============= Kernel_1x1 (3D) ============= */ -const auto convParams_ExplicitPadding_1x1_3D = ::testing::Combine( - ::testing::Values(SizeVector({1, 1, 1})), - ::testing::Values(SizeVector({1, 1, 1})), - ::testing::Values(std::vector({0, 0, 0})), - ::testing::Values(std::vector({0, 0, 0})), - ::testing::Values(SizeVector({1, 1, 1})), - ::testing::ValuesIn(numOutChannels_Blocked), - ::testing::Values(ngraph::op::PadType::EXPLICIT) -); - -INSTANTIATE_TEST_CASE_P(smoke_Deconv_3D_1x1_I8, DeconvolutionLayerCPUTest, - ::testing::Combine( - ::testing::Combine( - convParams_ExplicitPadding_1x1_3D, - ::testing::Values(Precision::FP32), - ::testing::Values(Precision::U8, Precision::I8), - ::testing::Values(Precision::FP32, Precision::I32), - ::testing::Values(Layout::ANY), - ::testing::Values(Layout::ANY), - ::testing::Values(std::vector({ 2, 67, 7, 7, 7 })), - ::testing::Values(CommonTestUtils::DEVICE_CPU)), - ::testing::Values(false, true), - ::testing::ValuesIn(filterCPUInfoForDevice({conv_avx512_3D_1x1_I8})), - ::testing::Values(emptyFusingSpec), - ::testing::Values(cpuEmptyPluginConfig)), - DeconvolutionLayerCPUTest::getTestCaseName); +//const auto convParams_ExplicitPadding_1x1_3D = ::testing::Combine( +// ::testing::Values(SizeVector({1, 1, 1})), +// ::testing::Values(SizeVector({1, 1, 1})), +// ::testing::Values(std::vector({0, 0, 0})), +// ::testing::Values(std::vector({0, 0, 0})), +// ::testing::Values(SizeVector({1, 1, 1})), +// ::testing::ValuesIn(numOutChannels_Blocked), +// ::testing::Values(ngraph::op::PadType::EXPLICIT) +//); +// +//INSTANTIATE_TEST_CASE_P(smoke_Deconv_3D_1x1_I8, DeconvolutionLayerCPUTest, +// ::testing::Combine( +// ::testing::Combine( +// convParams_ExplicitPadding_1x1_3D, +// ::testing::Values(Precision::FP32), +// ::testing::Values(Precision::U8, Precision::I8), +// ::testing::Values(Precision::FP32, Precision::I32), +// ::testing::Values(Layout::ANY), +// ::testing::Values(Layout::ANY), +// ::testing::Values(std::vector({ 2, 67, 7, 7, 7 })), +// ::testing::Values(CommonTestUtils::DEVICE_CPU)), +// ::testing::Values(false, true), +// ::testing::ValuesIn(filterCPUInfoForDevice({conv_avx512_3D_1x1_I8})), +// ::testing::Values(emptyFusingSpec), +// ::testing::Values(cpuEmptyPluginConfig)), +// DeconvolutionLayerCPUTest::getTestCaseName); /* ========= */ diff --git a/inference-engine/tests/functional/plugin/cpu/single_layer_tests/group_convolution.cpp b/inference-engine/tests/functional/plugin/cpu/single_layer_tests/group_convolution.cpp index 17a7d79036c5cc..c1f2a2695eb147 100644 --- a/inference-engine/tests/functional/plugin/cpu/single_layer_tests/group_convolution.cpp +++ b/inference-engine/tests/functional/plugin/cpu/single_layer_tests/group_convolution.cpp @@ -138,7 +138,8 @@ std::vector fusingParamsSet { fusingFakeQuantizePerChannelRelu, fusingSumEluFQ, fusingSum, - fusingPRelu1D + fusingPRelu1D, + fusingAddPerChannel }; diff --git a/inference-engine/tests/functional/plugin/cpu/single_layer_tests/group_convolution_backprop_data.cpp b/inference-engine/tests/functional/plugin/cpu/single_layer_tests/group_convolution_backprop_data.cpp index c006acaadef1a6..b672eeded996b5 100755 --- a/inference-engine/tests/functional/plugin/cpu/single_layer_tests/group_convolution_backprop_data.cpp +++ b/inference-engine/tests/functional/plugin/cpu/single_layer_tests/group_convolution_backprop_data.cpp @@ -16,7 +16,6 @@ using groupConvBackpropDataSpecificParams = LayerTestsDefinitions::groupConvBack typedef std::tuple< groupConvBackpropDataLayerTestParamsSet, - bool, CPUSpecificParams, fusingSpecificParams, std::map> groupDeconvLayerCPUTestParamsSet; @@ -26,17 +25,15 @@ class GroupDeconvolutionLayerCPUTest : public testing::WithParamInterface obj) { groupConvBackpropDataLayerTestParamsSet basicParamsSet; - bool withBiases; CPUSpecificParams cpuParams; fusingSpecificParams fusingParams; std::map additionalConfig; - std::tie(basicParamsSet, withBiases, cpuParams, fusingParams, additionalConfig) = obj.param; + std::tie(basicParamsSet, cpuParams, fusingParams, additionalConfig) = obj.param; std::ostringstream result; result << LayerTestsDefinitions::GroupConvBackpropDataLayerTest::getTestCaseName(testing::TestParamInfo( basicParamsSet, 0)); - result << "_withBiases=" << withBiases; result << CPUTestsBase::getTestCaseName(cpuParams); result << CpuTestWithFusing::getTestCaseName(fusingParams); @@ -54,11 +51,10 @@ class GroupDeconvolutionLayerCPUTest : public testing::WithParamInterface additionalConfig; - std::tie(basicParamsSet, withBiases, cpuParams, fusingParams, additionalConfig) = this->GetParam(); + std::tie(basicParamsSet, cpuParams, fusingParams, additionalConfig) = this->GetParam(); configuration.insert(additionalConfig.begin(), additionalConfig.end()); @@ -98,10 +94,8 @@ class GroupDeconvolutionLayerCPUTest : public testing::WithParamInterface( - ngraph::builder::makeGroupConvolutionBackpropDataRelaxed(paramOuts[0], weiPrc, outElementType, kernel, - stride, padBegin, padEnd, dilation, padType, convOutChannels, numGroups)); + auto groupDeconvNode = ngraph::builder::makeGroupConvolutionBackpropDataRelaxed(paramOuts[0], weiPrc, outElementType, kernel, + stride, padBegin, padEnd, dilation, padType, convOutChannels, numGroups); function = makeNgraphFunction(element::f32, inputParams, groupDeconvNode, "groupConvolutionBackpropData"); if (inPrc == Precision::U8 || inPrc == Precision::I8) { @@ -110,8 +104,6 @@ class GroupDeconvolutionLayerCPUTest : public testing::WithParamInterface>()); - if (withBiases) - additionalPasses.push_back(std::make_shared>()); } } }; @@ -129,6 +121,7 @@ namespace { std::vector fusingParamsSet { emptyFusingSpec, fusingScaleShift, + fusingAddPerChannel }; const std::map cpuEmptyPluginConfig; const std::map cpuBF16PluginConfig = { { PluginConfigParams::KEY_ENFORCE_BF16, PluginConfigParams::YES } }; @@ -185,7 +178,6 @@ INSTANTIATE_TEST_CASE_P(smoke_GroupDeconv_2D_Planar_FP32, GroupDeconvolutionLaye ::testing::Values(InferenceEngine::Layout::ANY), ::testing::Values(std::vector({ 2, 12, 7, 7 })), ::testing::Values(CommonTestUtils::DEVICE_CPU)), - ::testing::Values(false), ::testing::ValuesIn(filterCPUInfoForDevice({conv_gemm_2D})), ::testing::ValuesIn(fusingParamsSet), ::testing::Values(cpuEmptyPluginConfig)), @@ -202,7 +194,6 @@ INSTANTIATE_TEST_CASE_P(smoke_GroupDeconv_2D_Planar_BF16, GroupDeconvolutionLaye ::testing::Values(InferenceEngine::Layout::ANY), ::testing::Values(std::vector({ 2, 12, 7, 7 })), ::testing::Values(CommonTestUtils::DEVICE_CPU)), - ::testing::Values(false), ::testing::ValuesIn(filterCPUInfoForDevice({conv_gemm_2D})), ::testing::ValuesIn(fusingParamsSet), ::testing::Values(cpuBF16PluginConfig)), @@ -231,7 +222,6 @@ INSTANTIATE_TEST_CASE_P(smoke_GroupDeconv_3D_Planar_FP32, GroupDeconvolutionLaye ::testing::Values(InferenceEngine::Layout::ANY), ::testing::Values(std::vector({ 2, 12, 7, 7, 7 })), ::testing::Values(CommonTestUtils::DEVICE_CPU)), - ::testing::Values(false), ::testing::ValuesIn(filterCPUInfoForDevice({conv_gemm_3D})), ::testing::ValuesIn(fusingParamsSet), ::testing::Values(cpuEmptyPluginConfig)), @@ -248,7 +238,6 @@ INSTANTIATE_TEST_CASE_P(smoke_GroupDeconv_3D_Planar_BF16, GroupDeconvolutionLaye ::testing::Values(InferenceEngine::Layout::ANY), ::testing::Values(std::vector({ 2, 12, 7, 7, 7 })), ::testing::Values(CommonTestUtils::DEVICE_CPU)), - ::testing::Values(false), ::testing::ValuesIn(filterCPUInfoForDevice({conv_gemm_3D})), ::testing::ValuesIn(fusingParamsSet), ::testing::Values(cpuBF16PluginConfig)), @@ -277,7 +266,6 @@ INSTANTIATE_TEST_CASE_P(smoke_GroupDeconv_2D_Blocked_FP32, GroupDeconvolutionLay ::testing::Values(InferenceEngine::Layout::ANY), ::testing::Values(std::vector({ 2, 64, 7, 7 })), ::testing::Values(CommonTestUtils::DEVICE_CPU)), - ::testing::Values(false), ::testing::ValuesIn(filterCPUInfoForDevice({conv_avx512_2D})), ::testing::ValuesIn(fusingParamsSet), ::testing::Values(cpuEmptyPluginConfig)), @@ -294,7 +282,6 @@ INSTANTIATE_TEST_CASE_P(smoke_GroupDeconv_2D_Blocked_BF16, GroupDeconvolutionLay ::testing::Values(InferenceEngine::Layout::ANY), ::testing::Values(std::vector({ 2, 64, 7, 7 })), ::testing::Values(CommonTestUtils::DEVICE_CPU)), - ::testing::Values(false), ::testing::ValuesIn(filterCPUInfoForDevice({conv_avx512_2D})), ::testing::ValuesIn(fusingParamsSet), ::testing::Values(cpuBF16PluginConfig)), @@ -329,7 +316,6 @@ INSTANTIATE_TEST_CASE_P(smoke_GroupDeconv_2D_I8, GroupDeconvolutionLayerCPUTest, ::testing::Values(Layout::ANY), ::testing::Values(std::vector({ 2, 64, 7, 7 })), ::testing::Values(CommonTestUtils::DEVICE_CPU)), - ::testing::Values(false, true), ::testing::ValuesIn(filterCPUInfoForDevice({conv_avx512_2D_I8})), ::testing::Values(emptyFusingSpec), ::testing::Values(cpuEmptyPluginConfig)), @@ -358,7 +344,6 @@ INSTANTIATE_TEST_CASE_P(smoke_GroupDeconv_1x1_2D_I8, GroupDeconvolutionLayerCPUT ::testing::Values(Layout::ANY), ::testing::Values(std::vector({ 2, 64, 7, 7 })), ::testing::Values(CommonTestUtils::DEVICE_CPU)), - ::testing::Values(false, true), ::testing::ValuesIn(filterCPUInfoForDevice({conv_avx512_2D_1x1_I8})), ::testing::Values(emptyFusingSpec), ::testing::Values(cpuEmptyPluginConfig)), @@ -387,7 +372,6 @@ INSTANTIATE_TEST_CASE_P(smoke_GroupDeconv_3D_Blocked_FP32, GroupDeconvolutionLay ::testing::Values(InferenceEngine::Layout::ANY), ::testing::Values(std::vector({ 2, 64, 7, 7, 7 })), ::testing::Values(CommonTestUtils::DEVICE_CPU)), - ::testing::Values(false), ::testing::ValuesIn(filterCPUInfoForDevice({conv_avx512_3D})), ::testing::ValuesIn(fusingParamsSet), ::testing::Values(cpuEmptyPluginConfig)), @@ -404,75 +388,74 @@ INSTANTIATE_TEST_CASE_P(smoke_GroupDeconv_3D_Blocked_BF16, GroupDeconvolutionLay ::testing::Values(InferenceEngine::Layout::ANY), ::testing::Values(std::vector({ 2, 64, 7, 7, 7 })), ::testing::Values(CommonTestUtils::DEVICE_CPU)), - ::testing::Values(false), ::testing::ValuesIn(filterCPUInfoForDevice({conv_avx512_3D})), ::testing::ValuesIn(fusingParamsSet), ::testing::Values(cpuBF16PluginConfig)), GroupDeconvolutionLayerCPUTest::getTestCaseName); /* ============= GroupDeconvolution params I8 (3D) ============= */ -const std::vector kernels3di8 = { {3, 3, 3} }; -const std::vector strides3di8 = { {1, 1, 1}, {2, 2, 2} }; -const std::vector> padBegins3di8 = { {0, 0, 0}, {1, 1, 1} }; -const std::vector> padEnds3di8 = { {0, 0, 0}, {1, 1, 1} }; -const std::vector dilations3di8 = { {1, 1, 1} }; - -const auto groupDeconvParams_3D_I8 = ::testing::Combine( - ::testing::ValuesIn(kernels3di8), - ::testing::ValuesIn(strides3di8), - ::testing::ValuesIn(padBegins3di8), - ::testing::ValuesIn(padEnds3di8), - ::testing::ValuesIn(dilations3di8), - ::testing::ValuesIn(numOutChannels_Blocked), - ::testing::ValuesIn(numGroups_Blocked), - ::testing::Values(ngraph::op::PadType::EXPLICIT) -); - -INSTANTIATE_TEST_CASE_P(smoke_GroupDeconv_3D_I8, GroupDeconvolutionLayerCPUTest, - ::testing::Combine( - ::testing::Combine( - groupDeconvParams_3D_I8, - ::testing::Values(Precision::FP32), - ::testing::Values(Precision::U8, Precision::I8), - ::testing::Values(Precision::FP32, Precision::I32), - ::testing::Values(Layout::ANY), - ::testing::Values(Layout::ANY), - ::testing::Values(std::vector({ 2, 64, 7, 7, 7 })), - ::testing::Values(CommonTestUtils::DEVICE_CPU)), - ::testing::Values(false, true), - ::testing::ValuesIn(filterCPUInfoForDevice({conv_avx512_3D_I8})), - ::testing::Values(emptyFusingSpec), - ::testing::Values(cpuEmptyPluginConfig)), - GroupDeconvolutionLayerCPUTest::getTestCaseName); +//const std::vector kernels3di8 = { {3, 3, 3} }; +//const std::vector strides3di8 = { {1, 1, 1}, {2, 2, 2} }; +//const std::vector> padBegins3di8 = { {0, 0, 0}, {1, 1, 1} }; +//const std::vector> padEnds3di8 = { {0, 0, 0}, {1, 1, 1} }; +//const std::vector dilations3di8 = { {1, 1, 1} }; +// +//const auto groupDeconvParams_3D_I8 = ::testing::Combine( +// ::testing::ValuesIn(kernels3di8), +// ::testing::ValuesIn(strides3di8), +// ::testing::ValuesIn(padBegins3di8), +// ::testing::ValuesIn(padEnds3di8), +// ::testing::ValuesIn(dilations3di8), +// ::testing::ValuesIn(numOutChannels_Blocked), +// ::testing::ValuesIn(numGroups_Blocked), +// ::testing::Values(ngraph::op::PadType::EXPLICIT) +//); +// +//INSTANTIATE_TEST_CASE_P(smoke_GroupDeconv_3D_I8, GroupDeconvolutionLayerCPUTest, +// ::testing::Combine( +// ::testing::Combine( +// groupDeconvParams_3D_I8, +// ::testing::Values(Precision::FP32), +// ::testing::Values(Precision::U8, Precision::I8), +// ::testing::Values(Precision::FP32, Precision::I32), +// ::testing::Values(Layout::ANY), +// ::testing::Values(Layout::ANY), +// ::testing::Values(std::vector({ 2, 64, 7, 7, 7 })), +// ::testing::Values(CommonTestUtils::DEVICE_CPU)), +// ::testing::Values(false, true), +// ::testing::ValuesIn(filterCPUInfoForDevice({conv_avx512_3D_I8})), +// ::testing::Values(emptyFusingSpec), +// ::testing::Values(cpuEmptyPluginConfig)), +// GroupDeconvolutionLayerCPUTest::getTestCaseName); /* ============= GroupDeconvolution params 1x1 I8 (3D) ============= */ -const auto groupDeconvParams_1x1_3D_I8 = ::testing::Combine( - ::testing::Values(SizeVector({1, 1, 1})), - ::testing::Values(SizeVector({1, 1, 1})), - ::testing::Values(std::vector({0, 0, 0})), - ::testing::Values(std::vector({0, 0, 0})), - ::testing::Values(SizeVector({1, 1, 1})), - ::testing::ValuesIn(numOutChannels_Blocked), - ::testing::ValuesIn(numGroups_Blocked), - ::testing::Values(ngraph::op::PadType::EXPLICIT) -); - -INSTANTIATE_TEST_CASE_P(smoke_GroupDeconv_1x1_3D_I8, GroupDeconvolutionLayerCPUTest, - ::testing::Combine( - ::testing::Combine( - groupDeconvParams_1x1_3D_I8, - ::testing::Values(Precision::FP32), - ::testing::Values(Precision::U8, Precision::I8), - ::testing::Values(Precision::FP32, Precision::I32), - ::testing::Values(Layout::ANY), - ::testing::Values(Layout::ANY), - ::testing::Values(std::vector({ 2, 64, 7, 7, 7 })), - ::testing::Values(CommonTestUtils::DEVICE_CPU)), - ::testing::Values(false, true), - ::testing::ValuesIn(filterCPUInfoForDevice({conv_avx512_3D_1x1_I8})), - ::testing::Values(emptyFusingSpec), - ::testing::Values(cpuEmptyPluginConfig)), - GroupDeconvolutionLayerCPUTest::getTestCaseName); +//const auto groupDeconvParams_1x1_3D_I8 = ::testing::Combine( +// ::testing::Values(SizeVector({1, 1, 1})), +// ::testing::Values(SizeVector({1, 1, 1})), +// ::testing::Values(std::vector({0, 0, 0})), +// ::testing::Values(std::vector({0, 0, 0})), +// ::testing::Values(SizeVector({1, 1, 1})), +// ::testing::ValuesIn(numOutChannels_Blocked), +// ::testing::ValuesIn(numGroups_Blocked), +// ::testing::Values(ngraph::op::PadType::EXPLICIT) +//); +// +//INSTANTIATE_TEST_CASE_P(smoke_GroupDeconv_1x1_3D_I8, GroupDeconvolutionLayerCPUTest, +// ::testing::Combine( +// ::testing::Combine( +// groupDeconvParams_1x1_3D_I8, +// ::testing::Values(Precision::FP32), +// ::testing::Values(Precision::U8, Precision::I8), +// ::testing::Values(Precision::FP32, Precision::I32), +// ::testing::Values(Layout::ANY), +// ::testing::Values(Layout::ANY), +// ::testing::Values(std::vector({ 2, 64, 7, 7, 7 })), +// ::testing::Values(CommonTestUtils::DEVICE_CPU)), +// ::testing::Values(false, true), +// ::testing::ValuesIn(filterCPUInfoForDevice({conv_avx512_3D_1x1_I8})), +// ::testing::Values(emptyFusingSpec), +// ::testing::Values(cpuEmptyPluginConfig)), +// GroupDeconvolutionLayerCPUTest::getTestCaseName); /* ============= GroupConvolution (DW 2D) ============= */ const auto groupConvParams_ExplicitPadding_DW_2D = ::testing::Combine( @@ -497,7 +480,6 @@ INSTANTIATE_TEST_CASE_P(smoke_GroupDeconv_2D_DW_FP32, GroupDeconvolutionLayerCPU ::testing::Values(InferenceEngine::Layout::ANY), ::testing::Values(std::vector({ 2, 32, 7, 7 })), ::testing::Values(CommonTestUtils::DEVICE_CPU)), - ::testing::Values(false), ::testing::ValuesIn(filterCPUInfoForDevice({conv_avx512_dw_2D})), ::testing::ValuesIn(fusingParamsSet), ::testing::Values(cpuEmptyPluginConfig)), @@ -514,7 +496,6 @@ INSTANTIATE_TEST_CASE_P(smoke_GroupDeconv_2D_DW_BF16, GroupDeconvolutionLayerCPU ::testing::Values(InferenceEngine::Layout::ANY), ::testing::Values(std::vector({ 2, 32, 7, 7 })), ::testing::Values(CommonTestUtils::DEVICE_CPU)), - ::testing::Values(false), ::testing::ValuesIn(filterCPUInfoForDevice({conv_avx512_dw_2D})), ::testing::ValuesIn(fusingParamsSet), ::testing::Values(cpuBF16PluginConfig)), @@ -543,7 +524,6 @@ INSTANTIATE_TEST_CASE_P(smoke_GroupDeconv_2D_DW_I8, GroupDeconvolutionLayerCPUTe ::testing::Values(Layout::ANY), ::testing::Values(std::vector({ 2, 32, 7, 7 })), ::testing::Values(CommonTestUtils::DEVICE_CPU)), - ::testing::Values(false, true), ::testing::ValuesIn(filterCPUInfoForDevice({conv_avx512_2D_I8})), ::testing::Values(emptyFusingSpec), ::testing::Values(cpuEmptyPluginConfig)), @@ -572,7 +552,6 @@ INSTANTIATE_TEST_CASE_P(smoke_GroupDeconv_DW_1x1_2D_I8, GroupDeconvolutionLayerC ::testing::Values(Layout::ANY), ::testing::Values(std::vector({ 2, 32, 7, 7 })), ::testing::Values(CommonTestUtils::DEVICE_CPU)), - ::testing::Values(false, true), ::testing::ValuesIn(filterCPUInfoForDevice({conv_avx512_2D_I8})), ::testing::Values(emptyFusingSpec), ::testing::Values(cpuEmptyPluginConfig)), diff --git a/inference-engine/tests/ngraph_helpers/ngraph_functions/include/ngraph_functions/builders.hpp b/inference-engine/tests/ngraph_helpers/ngraph_functions/include/ngraph_functions/builders.hpp index b711d18dfef509..2253eb0aedadda 100644 --- a/inference-engine/tests/ngraph_helpers/ngraph_functions/include/ngraph_functions/builders.hpp +++ b/inference-engine/tests/ngraph_helpers/ngraph_functions/include/ngraph_functions/builders.hpp @@ -100,9 +100,7 @@ std::shared_ptr makeConvolutionRelaxed(const ngraph::Output const std::vector &dilations, const op::PadType &autoPad, size_t numOutChannels, - bool addBiases = false, - const std::vector &filterWeights = {}, - const std::vector &biasesWeights = {}); + const std::vector &filterWeights = {}); std::shared_ptr makeGroupConvolution(const ngraph::Output &in, const element::Type &type, @@ -163,9 +161,7 @@ std::shared_ptr makeConvolutionBackpropDataRelaxed(const ngraph::O const std::vector &dilations, const op::PadType &autoPad, size_t numOutChannels, - bool addBiases = false, - const std::vector &filterWeights = {}, - const std::vector &biasesWeights = {}); + const std::vector &filterWeights = {}); std::shared_ptr makeCTCGreedyDecoder( const ngraph::Output& inputData, @@ -232,9 +228,7 @@ std::shared_ptr makeGroupConvolutionBackpropDataRelaxed(const ngraph::Outp const op::PadType &autoPad, size_t numOutChannels, size_t numGroups, - bool addBiases = false, - const std::vector &filterWeights = {}, - const std::vector &biasesWeights = {}); + const std::vector &filterWeights = {}); std::shared_ptr makeBinaryConvolution(const ngraph::Output &in, const std::vector &filterSize, diff --git a/inference-engine/tests/ngraph_helpers/ngraph_functions/src/convolution.cpp b/inference-engine/tests/ngraph_helpers/ngraph_functions/src/convolution.cpp index ba4ae779d8ecaa..be9f006381de55 100644 --- a/inference-engine/tests/ngraph_helpers/ngraph_functions/src/convolution.cpp +++ b/inference-engine/tests/ngraph_helpers/ngraph_functions/src/convolution.cpp @@ -48,9 +48,7 @@ std::shared_ptr makeConvolutionRelaxed(const ngraph::Output &in, const std::vector &dilations, const op::PadType &autoPad, size_t numOutChannels, - bool addBiases, - const std::vector &filterWeights, - const std::vector &biasesWeights) { + const std::vector &filterWeights) { auto inputParamsFP32 = ngraph::builder::makeParams(ngraph::element::f32, { in.get_shape() }); auto paramOutsFP32 = ngraph::helpers::convert2OutputVector(ngraph::helpers::castOps2Nodes(inputParamsFP32)); @@ -68,14 +66,7 @@ std::shared_ptr makeConvolutionRelaxed(const ngraph::Output &in, auto newConvolution = convolutionNodeRelaxed->copy_with_new_inputs( {in, filterWeightsNode}); - if (addBiases) { - bool randomBiases = biasesWeights.empty(); - auto biasesWeightsNode = makeConstant(element::f32, {1, numOutChannels , 1, 1}, biasesWeights, randomBiases); - auto add = std::make_shared(newConvolution, biasesWeightsNode); - return add; - } else { - return newConvolution; - } + return newConvolution; } } // namespace builder diff --git a/inference-engine/tests/ngraph_helpers/ngraph_functions/src/convolution_backprop_data.cpp b/inference-engine/tests/ngraph_helpers/ngraph_functions/src/convolution_backprop_data.cpp index 50b07be1ac9255..bc7550ee3b8957 100644 --- a/inference-engine/tests/ngraph_helpers/ngraph_functions/src/convolution_backprop_data.cpp +++ b/inference-engine/tests/ngraph_helpers/ngraph_functions/src/convolution_backprop_data.cpp @@ -63,9 +63,7 @@ std::shared_ptr makeConvolutionBackpropDataRelaxed(const ngraph::Output &dilations, const op::PadType &autoPad, size_t numOutChannels, - bool addBiases, - const std::vector &filterWeights, - const std::vector &biasesWeights) { + const std::vector &filterWeights) { auto inputParamsFP32 = ngraph::builder::makeParams(ngraph::element::f32, { in.get_shape() }); auto paramOutsFP32 = ngraph::helpers::convert2OutputVector(ngraph::helpers::castOps2Nodes(inputParamsFP32)); @@ -83,14 +81,7 @@ std::shared_ptr makeConvolutionBackpropDataRelaxed(const ngraph::Outputcopy_with_new_inputs( {in, filterWeightsNode}); - if (addBiases) { - bool randomBiases = biasesWeights.empty(); - auto biasesWeightsNode = makeConstant(outType, {}, biasesWeights, randomBiases); - auto add = std::make_shared(newDeconvolution, biasesWeightsNode); - return add; - } else { - return newDeconvolution; - } + return newDeconvolution; } } // namespace builder diff --git a/inference-engine/tests/ngraph_helpers/ngraph_functions/src/group_convolution_backprop_data.cpp b/inference-engine/tests/ngraph_helpers/ngraph_functions/src/group_convolution_backprop_data.cpp index 098aa9a33054d7..fe7ff92235ba14 100644 --- a/inference-engine/tests/ngraph_helpers/ngraph_functions/src/group_convolution_backprop_data.cpp +++ b/inference-engine/tests/ngraph_helpers/ngraph_functions/src/group_convolution_backprop_data.cpp @@ -69,9 +69,7 @@ std::shared_ptr makeGroupConvolutionBackpropDataRelaxed(const ngraph::Outp const op::PadType &autoPad, size_t numOutChannels, size_t numGroups, - bool addBiases, - const std::vector &filterWeights, - const std::vector &biasesWeights) { + const std::vector &filterWeights) { auto inputParamsFP32 = ngraph::builder::makeParams(ngraph::element::f32, { in.get_shape() }); auto paramOutsFP32 = ngraph::helpers::convert2OutputVector(ngraph::helpers::castOps2Nodes(inputParamsFP32)); @@ -92,14 +90,7 @@ std::shared_ptr makeGroupConvolutionBackpropDataRelaxed(const ngraph::Outp auto newGroupDeconvolution = groupDeconvolutionNodeRelaxed->copy_with_new_inputs( {in, filterWeightsNode}); - if (addBiases) { - bool randomBiases = biasesWeights.empty(); - auto biasesWeightsNode = makeConstant(outType, {}, biasesWeights, randomBiases); - auto add = std::make_shared(newGroupDeconvolution, biasesWeightsNode); - return add; - } else { - return newGroupDeconvolution; - } + return newGroupDeconvolution; } } // namespace builder