diff --git a/src/plugins/intel_cpu/src/nodes/deconv.cpp b/src/plugins/intel_cpu/src/nodes/deconv.cpp index a3d141ff28be98..2d9362afcc7faf 100644 --- a/src/plugins/intel_cpu/src/nodes/deconv.cpp +++ b/src/plugins/intel_cpu/src/nodes/deconv.cpp @@ -468,8 +468,8 @@ void Deconvolution::getSupportedDescriptors() { } VectorDims inDims, outDims; std::tie(inDims, outDims) = makeDummyInOutShape(); - inShape = Shape(inDims); - Shape outShape(outDims); + inShape = Shape(inDims); + outShape = Shape(outDims); initPaddingR(inShape, outShape); #if defined(OV_CPU_WITH_ACL) @@ -486,10 +486,10 @@ void Deconvolution::getSupportedDescriptors() { for (size_t i = 0; i < getParentEdges().size(); ++i) { config.inConfs[i].setMemDesc( - creatorsMap.at(format)->createSharedDesc(getOriginalInputPrecisionAtPort(i), getInputShapeAtPort(i))); + creatorsMap.at(format)->createSharedDesc(getOriginalInputPrecisionAtPort(0), getInputShapeAtPort(i))); } config.outConfs[0].setMemDesc( - creatorsMap.at(format)->createSharedDesc(getOriginalOutputPrecisionAtPort(0), getOutputShapeAtPort(0))); + creatorsMap.at(format)->createSharedDesc(getOriginalOutputPrecisionAtPort(0), outShape)); std::vector srcMemoryDescs; for (size_t i = 0; i < config.inConfs.size(); i++) { @@ -502,7 +502,7 @@ void Deconvolution::getSupportedDescriptors() { return AclDeconvExecutorBuilder::customIsSupported(deconvAttrs, srcMemoryDescs, dstMemoryDescs); }; - useACL = checkDesc(LayoutType::nspc) || checkDesc(LayoutType::ncsp); + useACL = checkDesc(LayoutType::ncsp); } if (useACL) return; #endif @@ -1221,14 +1221,17 @@ void Deconvolution::initSupportedPrimitiveDescriptors() { config.inConfs.resize(getParentEdges().size()); config.outConfs.resize(getOriginalOutputsNumber()); - for (size_t i = 0; i < getParentEdges().size(); ++i) { + config.inConfs[0].setMemDesc( + // ACL expected equal precision + creatorsMap.at(format)->createSharedDesc(getOriginalInputPrecisionAtPort(0), inShape)); + for (size_t i = 1; i < getParentEdges().size(); ++i) { config.inConfs[i].setMemDesc( // ACL expected equal precision creatorsMap.at(format)->createSharedDesc(getOriginalInputPrecisionAtPort(0), getInputShapeAtPort(i))); } config.outConfs[0].setMemDesc( // ACL expected equal precision - creatorsMap.at(format)->createSharedDesc(getOriginalInputPrecisionAtPort(0), getOutputShapeAtPort(0))); + creatorsMap.at(format)->createSharedDesc(getOriginalInputPrecisionAtPort(0), outShape)); std::vector srcMemoryDescs; for (size_t i = 0; i < config.inConfs.size(); i++) { diff --git a/src/plugins/intel_cpu/src/nodes/deconv.h b/src/plugins/intel_cpu/src/nodes/deconv.h index 5477feadc4ffc6..30022220b61804 100644 --- a/src/plugins/intel_cpu/src/nodes/deconv.h +++ b/src/plugins/intel_cpu/src/nodes/deconv.h @@ -100,7 +100,7 @@ class Deconvolution : public Node { bool useACL = false; DeconvAttrs deconvAttrs; - Shape inShape; + Shape inShape, outShape;; AttrPtr pAttr; diff --git a/src/plugins/intel_cpu/src/nodes/executors/acl/acl_deconv.cpp b/src/plugins/intel_cpu/src/nodes/executors/acl/acl_deconv.cpp index 692d9d8f370d49..146f9dfd0dc37b 100644 --- a/src/plugins/intel_cpu/src/nodes/executors/acl/acl_deconv.cpp +++ b/src/plugins/intel_cpu/src/nodes/executors/acl/acl_deconv.cpp @@ -204,6 +204,8 @@ bool AclDeconvExecutorBuilder::customIsSupported(const DeconvAttrs &deconvAttrs, if (!one_of(dilation_x, static_cast(0), static_cast(1)) || !one_of(dilation_y, static_cast(0), static_cast(1))) return false; + auto abc = srcDescs[0]->getShape().getDims(); + size_t in_h = srcDescs[0]->hasLayoutType(LayoutType::ncsp) ? srcDescs[0]->getShape().getDims()[2] : srcDescs[0]->getShape().getDims()[1]; size_t in_w = srcDescs[0]->hasLayoutType(LayoutType::ncsp) ? srcDescs[0]->getShape().getDims()[3] : srcDescs[0]->getShape().getDims()[2]; diff --git a/src/plugins/intel_cpu/src/plugin.cpp b/src/plugins/intel_cpu/src/plugin.cpp index 72de4a5dcd2390..195628cb71e14f 100644 --- a/src/plugins/intel_cpu/src/plugin.cpp +++ b/src/plugins/intel_cpu/src/plugin.cpp @@ -160,10 +160,10 @@ std::shared_ptr Engine::SchedulerGuard::instance() { } Engine::SchedulerGuard::~SchedulerGuard() { - // To save the state of scheduler after ACLScheduler has been executed - // TODO: find out the cause of the state - std::lock_guard lock{this->dest_mutex}; - arm_compute::Scheduler::set(arm_compute::Scheduler::Type::ST); +// // To save the state of scheduler after ACLScheduler has been executed +// // TODO: find out the cause of the state +// std::lock_guard lock{this->dest_mutex}; +// arm_compute::Scheduler::set(arm_compute::Scheduler::Type::ST); } #endif diff --git a/src/plugins/intel_cpu/tests/functional/single_layer_tests/classes/convolution_backprop_data.hpp b/src/plugins/intel_cpu/tests/functional/single_layer_tests/classes/convolution_backprop_data.hpp index 634584f927562a..45221af3309c45 100755 --- a/src/plugins/intel_cpu/tests/functional/single_layer_tests/classes/convolution_backprop_data.hpp +++ b/src/plugins/intel_cpu/tests/functional/single_layer_tests/classes/convolution_backprop_data.hpp @@ -55,4 +55,29 @@ class DeconvolutionLayerCPUTest : public testing::WithParamInterface fusingParamsSet{ + emptyFusingSpec, +#if !defined(OPENVINO_ARCH_ARM64) && !defined(OPENVINO_ARCH_ARM) + fusingScaleShift +#endif +}; + +const std::vector> emptyOutputPadding = { {} }; + +/* ============= Deconvolution params (planar layout) ============= */ +const InferenceEngine::SizeVector numOutChannels_Planar = { 6 }; + +const std::map cpuEmptyPluginConfig; + +/* ============= Deconvolution params (blocked layout) ============= */ +const InferenceEngine::SizeVector numOutChannels_Blocked = { 64 }; + +/* ============= Deconvolution params (2D) ============= */ +const std::vector kernels2d = { {3, 3}, {1, 1} }; +const std::vector strides2d = { {1, 1}, {2, 2} }; +const std::vector> padBegins2d = { {0, 0} }; +const std::vector> padEnds2d = { {0, 0} }; +const std::vector dilations2d = { {1, 1} }; + } // namespace CPULayerTestsDefinitions diff --git a/src/plugins/intel_cpu/tests/functional/single_layer_tests/instances/arm/convolution_backprop_data.cpp b/src/plugins/intel_cpu/tests/functional/single_layer_tests/instances/arm/convolution_backprop_data.cpp new file mode 100755 index 00000000000000..b48011da1a370b --- /dev/null +++ b/src/plugins/intel_cpu/tests/functional/single_layer_tests/instances/arm/convolution_backprop_data.cpp @@ -0,0 +1,118 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "single_layer_tests/classes/convolution_backprop_data.hpp" +#include "shared_test_classes/single_layer/convolution_backprop_data.hpp" +#include "test_utils/cpu_test_utils.hpp" +#include "test_utils/filter_cpu_info.hpp" +#include "test_utils/fusing_test_utils.hpp" + +using namespace CPUTestUtils; +using namespace ov::test; + +namespace CPULayerTestsDefinitions { + +namespace { + +/* INSTANCES */ +/* ============= Deconvolution (Planar 2D) ============= */ +const auto convParams_ExplicitPadding_Planar_2D = ::testing::Combine( + ::testing::ValuesIn(kernels2d), + ::testing::ValuesIn(strides2d), + ::testing::ValuesIn(padBegins2d), + ::testing::ValuesIn(padEnds2d), + ::testing::ValuesIn(dilations2d), + ::testing::ValuesIn(numOutChannels_Planar), + ::testing::Values(ngraph::op::PadType::EXPLICIT), + ::testing::ValuesIn(emptyOutputPadding) +); + +const std::vector Planar_2D_inputs_smoke = { + DeconvInputData{ + InputShape{{}, {{ 2, 12, 7, 7 }}}, + ngraph::helpers::InputLayerType::CONSTANT, + {} + }, +}; + +const std::vector Planar_2D_inputs_nightly = { + DeconvInputData{ + InputShape{{{1, 10}, 12, 7, 7}, {{ 1, 12, 7, 7}, { 2, 12, 7, 7}, { 3, 12, 7, 7}}}, + ngraph::helpers::InputLayerType::CONSTANT, + {{15, 15}} + }, +}; + +INSTANTIATE_TEST_SUITE_P(smoke_Deconv_2D_Planar_FP32, DeconvolutionLayerCPUTest, + ::testing::Combine( + convParams_ExplicitPadding_Planar_2D, + ::testing::ValuesIn(Planar_2D_inputs_smoke), + ::testing::Values(ElementType::f32), + ::testing::ValuesIn(fusingParamsSet), + ::testing::ValuesIn(filterCPUInfo({conv_gemm_2D_acl})), + ::testing::Values(cpuEmptyPluginConfig)), + DeconvolutionLayerCPUTest::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P(nightly_Deconv_2D_Planar_FP32, DeconvolutionLayerCPUTest, + ::testing::Combine( + convParams_ExplicitPadding_Planar_2D, + ::testing::ValuesIn(Planar_2D_inputs_nightly), + ::testing::Values(ElementType::f32), + ::testing::ValuesIn(fusingParamsSet), + ::testing::ValuesIn(filterCPUInfo({conv_gemm_2D_acl})), + ::testing::Values(cpuEmptyPluginConfig)), + DeconvolutionLayerCPUTest::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P(nightly_Deconv_2D_Planar_BF16, DeconvolutionLayerCPUTest, + ::testing::Combine( + convParams_ExplicitPadding_Planar_2D, + ::testing::ValuesIn(Planar_2D_inputs_nightly), + ::testing::Values(ElementType::f32), + ::testing::ValuesIn(fusingParamsSet), + ::testing::ValuesIn(filterCPUInfo({conv_gemm_2D_acl})), + ::testing::Values(cpuBF16PluginConfig)), + DeconvolutionLayerCPUTest::getTestCaseName); + +/* ============= Deconvolution (Blocked 2D) ============= */ +const std::vector Blocked_2D_inputs_smoke = { + DeconvInputData{ + InputShape{{}, {{ 2, 67, 7, 7 }}}, + ngraph::helpers::InputLayerType::CONSTANT, + {} + }, +}; + +/* ============= Deconvolution auto padding tests ============= */ +const std::vector inputs_2D_AutoPadding = { + DeconvInputData{ + InputShape{{}, {{ 2, 67, 7, 7 }}}, + ngraph::helpers::InputLayerType::CONSTANT, + {} + }, +}; + +const auto deconvParams_AutoPadding_2D = ::testing::Combine( + ::testing::ValuesIn(kernels2d), + ::testing::ValuesIn(strides2d), + ::testing::ValuesIn(padBegins2d), + ::testing::ValuesIn(padEnds2d), + ::testing::ValuesIn(dilations2d), + ::testing::ValuesIn(numOutChannels_Blocked), + ::testing::Values(ngraph::op::PadType::SAME_UPPER, ngraph::op::PadType::SAME_LOWER), + ::testing::ValuesIn(emptyOutputPadding) +); + +INSTANTIATE_TEST_SUITE_P(smoke_Deconv_2D_AutoPadding_FP32, DeconvolutionLayerCPUTest, + ::testing::Combine( + deconvParams_AutoPadding_2D, + ::testing::ValuesIn(inputs_2D_AutoPadding), + ::testing::Values(ElementType::f32), + ::testing::Values(emptyFusingSpec), + ::testing::ValuesIn(filterCPUInfo({conv_gemm_2D_acl})), + ::testing::Values(cpuEmptyPluginConfig)), + DeconvolutionLayerCPUTest::getTestCaseName); + +} // namespace + +} // namespace CPULayerTestsDefinitions diff --git a/src/plugins/intel_cpu/tests/functional/single_layer_tests/instances/common/convolution_backprop_data.cpp b/src/plugins/intel_cpu/tests/functional/single_layer_tests/instances/common/convolution_backprop_data.cpp index da77f03862fd84..e3743f1f5a63ae 100755 --- a/src/plugins/intel_cpu/tests/functional/single_layer_tests/instances/common/convolution_backprop_data.cpp +++ b/src/plugins/intel_cpu/tests/functional/single_layer_tests/instances/common/convolution_backprop_data.cpp @@ -31,46 +31,6 @@ TEST_P(DeconvolutionLayerCPUTest, CompareWithRefs) { namespace { -/* COMMON PARAMS */ -const std::vector fusingParamsSet{ - emptyFusingSpec, - fusingScaleShift -}; - -const std::map cpuEmptyPluginConfig; -const std::mapcpuBF16PluginConfig = { { InferenceEngine::PluginConfigParams::KEY_ENFORCE_BF16, - InferenceEngine::PluginConfigParams::YES } }; -const std::vector> emptyOutputPadding = { {} }; - -/* ============= Deconvolution params (planar layout) ============= */ -const InferenceEngine::SizeVector numOutChannels_Planar = { 6 }; - -/* ============= Deconvolution params (blocked layout) ============= */ -const InferenceEngine::SizeVector numOutChannels_Blocked = { 64 }; - -/* ============= Deconvolution params (2D) ============= */ -const std::vector kernels2d = { {3, 3}, {1, 1} }; -const std::vector strides2d = { {1, 1}, {2, 2} }; -const std::vector> padBegins2d = { {0, 0} }; -const std::vector> padEnds2d = { {0, 0} }; -const std::vector dilations2d = { {1, 1} }; - - -const std::vector deconvAmxKernels2d = { {3, 3}, {2, 2}}; -const std::vector deconvAmxStrides2d = { {2, 2}}; - -/* ============= Deconvolution params (3D) ============= */ -const std::vector kernels3d = { {3, 3, 3}, {1, 1, 1} }; -const std::vector strides3d = { {1, 1, 1}, {2, 2, 2} }; -const std::vector> padBegins3d = { {0, 0, 0} }; -const std::vector> padEnds3d = { {0, 0, 0} }; -const std::vector dilations3d = { {1, 1, 1} }; - -const std::vector deconvAmxKernels3d = { {3, 3, 3}, {2, 2, 2} }; -const std::vector deconvAmxStrides3d = { {2, 2, 2} }; - -/* ============= */ - /* INSTANCES */ /* ============= Deconvolution (Planar 2D) ============= */ const auto convParams_ExplicitPadding_Planar_2D = ::testing::Combine( @@ -121,27 +81,17 @@ INSTANTIATE_TEST_SUITE_P(smoke_Deconv_2D_Planar_FP32, DeconvolutionLayerCPUTest, ::testing::ValuesIn(Planar_2D_inputs_smoke), ::testing::Values(ElementType::f32), ::testing::ValuesIn(fusingParamsSet), - ::testing::ValuesIn(filterCPUInfo({conv_gemm_2D, conv_gemm_2D_acl})), + ::testing::ValuesIn(filterCPUInfo({conv_gemm_2D})), ::testing::Values(cpuEmptyPluginConfig)), DeconvolutionLayerCPUTest::getTestCaseName); -INSTANTIATE_TEST_SUITE_P(smoke_Deconv_2D_Planar_BF16, DeconvolutionLayerCPUTest, - ::testing::Combine( - convParams_ExplicitPadding_Planar_2D, - ::testing::ValuesIn(Planar_2D_inputs_smoke), - ::testing::Values(ElementType::f32), - ::testing::ValuesIn(fusingParamsSet), - ::testing::ValuesIn(filterCPUInfo({conv_gemm_2D, conv_gemm_2D_acl})), - ::testing::Values(cpuBF16PluginConfig)), - DeconvolutionLayerCPUTest::getTestCaseName); - INSTANTIATE_TEST_SUITE_P(nightly_Deconv_2D_Planar_FP32, DeconvolutionLayerCPUTest, ::testing::Combine( convParams_ExplicitPadding_Planar_2D, ::testing::ValuesIn(Planar_2D_inputs_nightly), ::testing::Values(ElementType::f32), ::testing::ValuesIn(fusingParamsSet), - ::testing::ValuesIn(filterCPUInfo({conv_gemm_2D, conv_gemm_2D_acl})), + ::testing::ValuesIn(filterCPUInfo({conv_gemm_2D})), ::testing::Values(cpuEmptyPluginConfig)), DeconvolutionLayerCPUTest::getTestCaseName); @@ -151,92 +101,7 @@ INSTANTIATE_TEST_SUITE_P(nightly_Deconv_2D_Planar_BF16, DeconvolutionLayerCPUTes ::testing::ValuesIn(Planar_2D_inputs_nightly), ::testing::Values(ElementType::f32), ::testing::ValuesIn(fusingParamsSet), - ::testing::ValuesIn(filterCPUInfo({conv_gemm_2D, conv_gemm_2D_acl})), - ::testing::Values(cpuBF16PluginConfig)), - DeconvolutionLayerCPUTest::getTestCaseName); - -/* ============= Deconvolution (Planar 3D) ============= */ -const std::vector Planar_3D_inputs_smoke = { - DeconvInputData{ - InputShape{{}, {{ 2, 12, 7, 7, 7 }}}, - ngraph::helpers::InputLayerType::CONSTANT, - {} - }, - DeconvInputData{ - InputShape{{-1, 12, -1, -1, -1}, {{ 2, 12, 7, 7, 7}, { 2, 12, 5, 7, 7}, { 1, 12, 9, 4, 9}}}, - ngraph::helpers::InputLayerType::PARAMETER, - {{15, 15, 15}, {9, 10, 10}, {9, 9, 9}} - } -}; - -const std::vector Planar_3D_inputs_nightly = { - DeconvInputData{ - // -1 will result deconv use 64 to infer output shape, for 3d output shape is too big for gemm bwd kernel - // to buffer the intermedia results - InputShape{{-1, 12, {5, 9}, {4, 7}, {7, 9}}, {{ 2, 12, 7, 7, 7}, { 2, 12, 5, 7, 7}, { 1, 12, 9, 4, 9}}}, - ngraph::helpers::InputLayerType::CONSTANT, - {} - }, - DeconvInputData{ - InputShape{{-1, 12, -1, -1, -1}, {{ 2, 12, 7, 7, 7}, { 2, 12, 5, 7, 7}, { 1, 12, 9, 4, 9}, { 2, 12, 7, 7, 7}}}, - ngraph::helpers::InputLayerType::CONSTANT, - {{10, 16, 16}} - }, - DeconvInputData{ - InputShape{{{1, 10}, 12, 7, 7, 7}, {{ 2, 12, 7, 7, 7}, { 1, 12, 7, 7, 7}, { 3, 12, 7, 7, 7}}}, - ngraph::helpers::InputLayerType::CONSTANT, - {{15, 15, 15}} - } -}; - -const auto convParams_ExplicitPadding_Planar_3D = ::testing::Combine( - ::testing::ValuesIn(kernels3d), - ::testing::ValuesIn(strides3d), - ::testing::ValuesIn(padBegins3d), - ::testing::ValuesIn(padEnds3d), - ::testing::ValuesIn(dilations3d), - ::testing::ValuesIn(numOutChannels_Planar), - ::testing::Values(ngraph::op::PadType::EXPLICIT), - ::testing::ValuesIn(emptyOutputPadding) -); - -INSTANTIATE_TEST_SUITE_P(smoke_Deconv_3D_Planar_FP32, DeconvolutionLayerCPUTest, - ::testing::Combine( - convParams_ExplicitPadding_Planar_3D, - ::testing::ValuesIn(Planar_3D_inputs_smoke), - ::testing::Values(ElementType::f32), - ::testing::ValuesIn(fusingParamsSet), - ::testing::ValuesIn(filterCPUInfo({conv_gemm_3D})), - ::testing::Values(cpuEmptyPluginConfig)), - DeconvolutionLayerCPUTest::getTestCaseName); - -INSTANTIATE_TEST_SUITE_P(smoke_Deconv_3D_Planar_BF16, DeconvolutionLayerCPUTest, - ::testing::Combine( - convParams_ExplicitPadding_Planar_3D, - ::testing::ValuesIn(Planar_3D_inputs_smoke), - ::testing::Values(ElementType::f32), - ::testing::ValuesIn(fusingParamsSet), - ::testing::ValuesIn(filterCPUInfo({conv_gemm_3D})), - ::testing::Values(cpuBF16PluginConfig)), - DeconvolutionLayerCPUTest::getTestCaseName); - -INSTANTIATE_TEST_SUITE_P(nightly_Deconv_3D_Planar_FP32, DeconvolutionLayerCPUTest, - ::testing::Combine( - convParams_ExplicitPadding_Planar_3D, - ::testing::ValuesIn(Planar_3D_inputs_nightly), - ::testing::Values(ElementType::f32), - ::testing::ValuesIn(fusingParamsSet), - ::testing::ValuesIn(filterCPUInfo({conv_gemm_3D})), - ::testing::Values(cpuEmptyPluginConfig)), - DeconvolutionLayerCPUTest::getTestCaseName); - -INSTANTIATE_TEST_SUITE_P(nightly_Deconv_3D_Planar_BF16, DeconvolutionLayerCPUTest, - ::testing::Combine( - convParams_ExplicitPadding_Planar_3D, - ::testing::ValuesIn(Planar_3D_inputs_nightly), - ::testing::Values(ElementType::f32), - ::testing::ValuesIn(fusingParamsSet), - ::testing::ValuesIn(filterCPUInfo({conv_gemm_3D})), + ::testing::ValuesIn(filterCPUInfo({conv_gemm_2D})), ::testing::Values(cpuBF16PluginConfig)), DeconvolutionLayerCPUTest::getTestCaseName); @@ -254,298 +119,6 @@ const std::vector Blocked_2D_inputs_smoke = { } }; - -const auto convParams_ExplicitPadding_Blocked_2D_nightly = ::testing::Combine( - ::testing::ValuesIn(kernels2d), - // Use 7x7 with stride 1 is too small to generate 15x15 output. It needs a big negative pad which will result - // avx512 kernel not to be selected. - ::testing::ValuesIn({strides2d[1]}), - ::testing::ValuesIn(padBegins2d), - ::testing::ValuesIn(padEnds2d), - ::testing::ValuesIn(dilations2d), - ::testing::ValuesIn(numOutChannels_Blocked), - ::testing::Values(ngraph::op::PadType::EXPLICIT), - ::testing::ValuesIn(emptyOutputPadding) -); - -const std::vector Blocked_2D_inputs_nightly = { - DeconvInputData{ - InputShape{{-1, 67, -1, -1}, {{ 2, 67, 7, 7}, { 2, 67, 5, 7}, { 1, 67, 9, 4}, { 2, 67, 7, 7}}}, - ngraph::helpers::InputLayerType::CONSTANT, - {} - }, - DeconvInputData{ - InputShape{{-1, 67, -1, -1}, {{ 2, 67, 7, 7}, { 2, 67, 5, 7}, { 1, 67, 9, 4}}}, - ngraph::helpers::InputLayerType::CONSTANT, - {{15, 15}} - }, - DeconvInputData{ - InputShape{{ {1, 10}, 67, 7, 7}, {{ 2, 67, 7, 7}, { 3, 67, 7, 7}, { 1, 67, 7, 7}}}, - ngraph::helpers::InputLayerType::CONSTANT, - {{15, 15}} - } -}; - -const auto convParams_ExplicitPadding_Blocked_2D = ::testing::Combine( - ::testing::ValuesIn(kernels2d), - ::testing::ValuesIn(strides2d), - ::testing::ValuesIn(padBegins2d), - ::testing::ValuesIn(padEnds2d), - ::testing::ValuesIn(dilations2d), - ::testing::ValuesIn(numOutChannels_Blocked), - ::testing::Values(ngraph::op::PadType::EXPLICIT), - ::testing::ValuesIn(emptyOutputPadding) -); - -const auto convParams_ExplicitPadding_AMX_2D = ::testing::Combine( - ::testing::ValuesIn(deconvAmxKernels2d), - ::testing::ValuesIn(deconvAmxStrides2d), - ::testing::ValuesIn(padBegins2d), - ::testing::ValuesIn(padEnds2d), - ::testing::ValuesIn(dilations2d), - ::testing::ValuesIn(numOutChannels_Blocked), - ::testing::Values(ngraph::op::PadType::EXPLICIT), - ::testing::ValuesIn(emptyOutputPadding) -); - -INSTANTIATE_TEST_SUITE_P(smoke_Deconv_2D_Blocked_FP32, DeconvolutionLayerCPUTest, - ::testing::Combine( - convParams_ExplicitPadding_Blocked_2D, - ::testing::ValuesIn(Blocked_2D_inputs_smoke), - ::testing::Values(ElementType::f32), - ::testing::ValuesIn(fusingParamsSet), - ::testing::ValuesIn(filterCPUInfo({conv_avx512_2D, conv_avx2_2D})), - ::testing::Values(cpuEmptyPluginConfig)), - DeconvolutionLayerCPUTest::getTestCaseName); - -INSTANTIATE_TEST_SUITE_P(smoke_Deconv_2D_Blocked_BF16, DeconvolutionLayerCPUTest, - ::testing::Combine( - convParams_ExplicitPadding_Blocked_2D, - ::testing::ValuesIn(Blocked_2D_inputs_smoke), - ::testing::Values(ElementType::f32), - ::testing::ValuesIn(fusingParamsSet), - ::testing::ValuesIn(filterCPUInfo({conv_avx512_2D})), - ::testing::Values(cpuBF16PluginConfig)), - DeconvolutionLayerCPUTest::getTestCaseName); - -INSTANTIATE_TEST_SUITE_P(smoke_Deconv_2D_NSPC_BF16_AMX_NO_FUSING, DeconvolutionLayerCPUTest, - ::testing::Combine( - convParams_ExplicitPadding_AMX_2D, - ::testing::ValuesIn(Blocked_2D_inputs_smoke), - ::testing::Values(ElementType::f32), - ::testing::ValuesIn({emptyFusingSpec}), - ::testing::ValuesIn(filterCPUInfo({conv_avx512_2D_nspc_amx})), - ::testing::Values(cpuBF16PluginConfig)), - DeconvolutionLayerCPUTest::getTestCaseName); - -INSTANTIATE_TEST_SUITE_P(smoke_Deconv_2D_NSPC_INT8_AMX, DeconvolutionLayerCPUTest, - ::testing::Combine( - convParams_ExplicitPadding_AMX_2D, - ::testing::ValuesIn(Blocked_2D_inputs_smoke), - ::testing::Values(ElementType::i8), - ::testing::ValuesIn({emptyFusingSpec, fusingClampRoundAddRelu}), - ::testing::ValuesIn(filterCPUInfo({conv_avx512_2D_nspc_amx})), - ::testing::Values(cpuEmptyPluginConfig)), - DeconvolutionLayerCPUTest::getTestCaseName); - -INSTANTIATE_TEST_SUITE_P(nightly_Deconv_2D_Blocked_FP32, DeconvolutionLayerCPUTest, - ::testing::Combine( - convParams_ExplicitPadding_Blocked_2D_nightly, - ::testing::ValuesIn(Blocked_2D_inputs_nightly), - ::testing::Values(ElementType::f32), - ::testing::ValuesIn(fusingParamsSet), - ::testing::ValuesIn(filterCPUInfo({conv_avx512_2D, conv_avx2_2D})), - ::testing::Values(cpuEmptyPluginConfig)), - DeconvolutionLayerCPUTest::getTestCaseName); - -INSTANTIATE_TEST_SUITE_P(nightly_Deconv_2D_Blocked_BF16, DeconvolutionLayerCPUTest, - ::testing::Combine( - convParams_ExplicitPadding_Blocked_2D_nightly, - ::testing::ValuesIn(Blocked_2D_inputs_nightly), - ::testing::Values(ElementType::f32), - ::testing::ValuesIn(fusingParamsSet), - ::testing::ValuesIn(filterCPUInfo({conv_avx512_2D})), - ::testing::Values(cpuBF16PluginConfig)), - DeconvolutionLayerCPUTest::getTestCaseName); - -/* ============= Deconvolution (Blocked 3D) ============= */ -const std::vector Blocked_3D_inputs_smoke = { - DeconvInputData{ - InputShape{{}, {{ 2, 35, 7, 7, 7 }}}, - ngraph::helpers::InputLayerType::CONSTANT, - {} - }, - DeconvInputData{ - InputShape{{-1, 35, -1, -1, -1}, {{ 1, 35, 5, 5, 5}, { 2, 35, 5, 7, 5}}}, - ngraph::helpers::InputLayerType::PARAMETER, - {{7, 7, 7}, {7, 9, 7}} - } -}; - -const auto convParams_ExplicitPadding_Blocked_3D_nightly = ::testing::Combine( - ::testing::ValuesIn(kernels3d), - ::testing::ValuesIn({strides3d[0]}), - ::testing::ValuesIn(padBegins3d), - ::testing::ValuesIn(padEnds3d), - ::testing::ValuesIn(dilations3d), - ::testing::Values(32), - ::testing::Values(ngraph::op::PadType::EXPLICIT), - ::testing::ValuesIn(emptyOutputPadding) -); - -const std::vector Blocked_3D_inputs_nightly = { - DeconvInputData{ - InputShape{{-1, 35, -1, -1, -1}, {{ 1, 35, 5, 5, 5}, { 2, 35, 5, 7, 5}, { 1, 35, 5, 5, 5}}}, - ngraph::helpers::InputLayerType::CONSTANT, - {} - }, - DeconvInputData{ - InputShape{{-1, 35, -1, -1, -1}, {{ 1, 35, 5, 5, 5}, { 2, 35, 5, 7, 5}}}, - ngraph::helpers::InputLayerType::CONSTANT, - {{7, 7, 7}} - }, - DeconvInputData{ - InputShape{{{1, 10}, 35, 5, 5, 5}, {{ 1, 35, 5, 5, 5}, { 2, 35, 5, 5, 5}}}, - ngraph::helpers::InputLayerType::CONSTANT, - {{7, 7, 7}} - } -}; - -const auto convParams_ExplicitPadding_Blocked_3D = ::testing::Combine( - ::testing::ValuesIn(kernels3d), - ::testing::ValuesIn(strides3d), - ::testing::ValuesIn(padBegins3d), - ::testing::ValuesIn(padEnds3d), - ::testing::ValuesIn(dilations3d), - ::testing::Values(32), - ::testing::Values(ngraph::op::PadType::EXPLICIT), - ::testing::ValuesIn(emptyOutputPadding) -); - -const auto convParams_ExplicitPadding_AMX_3D = ::testing::Combine( - ::testing::ValuesIn(deconvAmxKernels3d), - ::testing::ValuesIn(deconvAmxStrides3d), - ::testing::ValuesIn(padBegins3d), - ::testing::ValuesIn(padEnds3d), - ::testing::ValuesIn(dilations3d), - ::testing::Values(32), - ::testing::Values(ngraph::op::PadType::EXPLICIT), - ::testing::ValuesIn(emptyOutputPadding) -); - -INSTANTIATE_TEST_SUITE_P(smoke_Deconv_3D_Blocked_FP32, DeconvolutionLayerCPUTest, - ::testing::Combine( - convParams_ExplicitPadding_Blocked_3D, - ::testing::ValuesIn(Blocked_3D_inputs_smoke), - ::testing::Values(ElementType::f32), - ::testing::ValuesIn(fusingParamsSet), - ::testing::ValuesIn(filterCPUInfo({conv_avx512_3D})), - ::testing::Values(cpuEmptyPluginConfig)), - DeconvolutionLayerCPUTest::getTestCaseName); - -INSTANTIATE_TEST_SUITE_P(smoke_Deconv_3D_Blocked_BF16, DeconvolutionLayerCPUTest, - ::testing::Combine( - convParams_ExplicitPadding_Blocked_3D, - ::testing::ValuesIn(Blocked_3D_inputs_smoke), - ::testing::Values(ElementType::f32), - ::testing::ValuesIn(fusingParamsSet), - ::testing::ValuesIn(filterCPUInfo({conv_avx512_3D})), - ::testing::Values(cpuBF16PluginConfig)), - DeconvolutionLayerCPUTest::getTestCaseName); - - -INSTANTIATE_TEST_SUITE_P(smoke_Deconv_3D_NSPC_BF16_AMX_NO_FUSING, DeconvolutionLayerCPUTest, - ::testing::Combine( - convParams_ExplicitPadding_AMX_3D, - ::testing::ValuesIn(Blocked_3D_inputs_smoke), - ::testing::Values(ElementType::f32), - ::testing::ValuesIn({emptyFusingSpec}), - ::testing::ValuesIn(filterCPUInfo({conv_avx512_3D_nspc_amx})), - ::testing::Values(cpuBF16PluginConfig)), - DeconvolutionLayerCPUTest::getTestCaseName); - -INSTANTIATE_TEST_SUITE_P(smoke_Deconv_3D_NSPC_INT8_AMX, DeconvolutionLayerCPUTest, - ::testing::Combine( - convParams_ExplicitPadding_AMX_3D, - ::testing::ValuesIn(Blocked_3D_inputs_smoke), - ::testing::Values(ElementType::i8), - ::testing::ValuesIn({emptyFusingSpec, fusingClampRoundAddRelu}), - ::testing::ValuesIn(filterCPUInfo({conv_avx512_3D_nspc_amx})), - ::testing::Values(cpuEmptyPluginConfig)), - DeconvolutionLayerCPUTest::getTestCaseName); - -INSTANTIATE_TEST_SUITE_P(nightly_Deconv_3D_Blocked_FP32, DeconvolutionLayerCPUTest, - ::testing::Combine( - convParams_ExplicitPadding_Blocked_3D_nightly, - ::testing::ValuesIn(Blocked_3D_inputs_nightly), - ::testing::Values(ElementType::f32), - ::testing::ValuesIn(fusingParamsSet), - ::testing::ValuesIn(filterCPUInfo({conv_avx512_3D})), - ::testing::Values(cpuEmptyPluginConfig)), - DeconvolutionLayerCPUTest::getTestCaseName); - -INSTANTIATE_TEST_SUITE_P(nightly_Deconv_3D_Blocked_BF16, DeconvolutionLayerCPUTest, - ::testing::Combine( - convParams_ExplicitPadding_Blocked_3D_nightly, - ::testing::ValuesIn(Blocked_3D_inputs_nightly), - ::testing::Values(ElementType::f32), - ::testing::ValuesIn(fusingParamsSet), - ::testing::ValuesIn(filterCPUInfo({conv_avx512_3D})), - ::testing::Values(cpuBF16PluginConfig)), - DeconvolutionLayerCPUTest::getTestCaseName); - -/* ============= Kernel_1x1 (2D) ============= */ -const auto convParams_ExplicitPadding_1x1_2D = ::testing::Combine( - ::testing::Values(InferenceEngine::SizeVector({1, 1})), - ::testing::Values(InferenceEngine::SizeVector({1, 1})), - ::testing::Values(std::vector({0, 0})), - ::testing::Values(std::vector({0, 0})), - ::testing::Values(InferenceEngine::SizeVector({1, 1})), - ::testing::ValuesIn(numOutChannels_Blocked), - ::testing::Values(ngraph::op::PadType::EXPLICIT), - ::testing::ValuesIn(emptyOutputPadding) -); - -INSTANTIATE_TEST_SUITE_P(smoke_Deconv_2D_1x1_FP32, DeconvolutionLayerCPUTest, - ::testing::Combine( - convParams_ExplicitPadding_1x1_2D, - ::testing::ValuesIn(Blocked_2D_inputs_smoke), - ::testing::Values(ElementType::f32), - ::testing::ValuesIn(fusingParamsSet), - ::testing::ValuesIn(filterCPUInfo({conv_avx512_2D_1x1, conv_avx2_2D_1x1})), - ::testing::Values(cpuEmptyPluginConfig)), - DeconvolutionLayerCPUTest::getTestCaseName); - -INSTANTIATE_TEST_SUITE_P(smoke_Deconv_2D_1x1_BF16, DeconvolutionLayerCPUTest, - ::testing::Combine( - convParams_ExplicitPadding_1x1_2D, - ::testing::ValuesIn(Blocked_2D_inputs_smoke), - ::testing::Values(ElementType::f32), - ::testing::ValuesIn(fusingParamsSet), - ::testing::ValuesIn(filterCPUInfo({conv_avx512_2D_1x1, conv_avx2_2D_1x1})), - ::testing::Values(cpuBF16PluginConfig)), - DeconvolutionLayerCPUTest::getTestCaseName); - -/* ============= Reorder + Deconvolution ============= */ -INSTANTIATE_TEST_SUITE_P(smoke_reorder_Deconv_2D, DeconvolutionLayerCPUTest, - ::testing::Combine( - ::testing::Combine(::testing::ValuesIn(kernels2d), - ::testing::Values(InferenceEngine::SizeVector{1, 1}), - ::testing::ValuesIn(padBegins2d), - ::testing::ValuesIn(padEnds2d), - ::testing::ValuesIn(dilations2d), - ::testing::ValuesIn(numOutChannels_Blocked), - ::testing::Values(ngraph::op::PadType::EXPLICIT), - ::testing::ValuesIn(emptyOutputPadding)), - ::testing::Values(DeconvInputData{InputShape{{-1, 67, -1, -1}, {{ 1, 67, 7, 7}, { 1, 67, 9, 4}, { 1, 67, 5, 7}, { 1, 67, 7, 7}, { 1, 67, 9, 4}}}, - ngraph::helpers::InputLayerType::PARAMETER, - {{15, 15}, {9, 9}, {9, 10}, {15, 15}, {9, 9}}}), - ::testing::Values(ElementType::f32), - ::testing::Values(emptyFusingSpec), - ::testing::ValuesIn(filterCPUInfo({conv_avx512_2D})), - ::testing::Values(cpuEmptyPluginConfig)), - DeconvolutionLayerCPUTest::getTestCaseName); - /* ============= Deconvolution auto padding tests ============= */ const std::vector inputs_2D_AutoPadding = { DeconvInputData{ @@ -587,74 +160,10 @@ INSTANTIATE_TEST_SUITE_P(smoke_Deconv_2D_AutoPadding_FP32, DeconvolutionLayerCPU ::testing::ValuesIn(inputs_2D_AutoPadding), ::testing::Values(ElementType::f32), ::testing::Values(emptyFusingSpec), - ::testing::ValuesIn(filterCPUInfo({conv_gemm_2D, conv_gemm_2D_acl, conv_avx512_2D})), + ::testing::ValuesIn(filterCPUInfo({conv_gemm_2D})), ::testing::Values(cpuEmptyPluginConfig)), DeconvolutionLayerCPUTest::getTestCaseName); -const std::vector inputs_3D_AutoPadding = { - DeconvInputData{ - InputShape{{-1, 2, 4, {32, 64}, {32, 64}}, {{1, 2, 4, 32, 32}, {1, 2, 4, 40, 40}}}, - ngraph::helpers::InputLayerType::PARAMETER, - {{8, 64, 64}, {8, 80, 80}} - }, - DeconvInputData{ - InputShape{ - {1, 64, 5, {1, std::numeric_limits::max()}, {1, std::numeric_limits::max()}}, - {{1, 64, 5, 8, 8}} - }, - ngraph::helpers::InputLayerType::CONSTANT, - {{10, 16, 16}} - }, -}; - -const auto deconvParams_AutoPadding_3D = ::testing::Combine( - ::testing::Values(kernels3d[0]), - ::testing::Values(strides3d[1]), - ::testing::ValuesIn(padBegins3d), - ::testing::ValuesIn(padEnds3d), - ::testing::ValuesIn(dilations3d), - ::testing::Values(1), - ::testing::Values(ngraph::op::PadType::SAME_UPPER, ngraph::op::PadType::SAME_LOWER), - ::testing::ValuesIn(emptyOutputPadding) -); - -INSTANTIATE_TEST_SUITE_P(smoke_Deconv_3D_AutoPadding_FP32, DeconvolutionLayerCPUTest, - ::testing::Combine( - deconvParams_AutoPadding_3D, - ::testing::ValuesIn(inputs_3D_AutoPadding), - ::testing::Values(ElementType::f32), - ::testing::Values(emptyFusingSpec), - ::testing::ValuesIn(filterCPUInfo({conv_gemm_3D, conv_avx512_3D})), - ::testing::Values(cpuEmptyPluginConfig)), - DeconvolutionLayerCPUTest::getTestCaseName); - -const auto deconvParams_AutoPadding_2D_AMX = ::testing::Combine( - ::testing::ValuesIn(deconvAmxKernels2d), - ::testing::ValuesIn(deconvAmxStrides2d), - ::testing::ValuesIn(padBegins2d), - ::testing::ValuesIn(padEnds2d), - ::testing::ValuesIn(dilations2d), - ::testing::Values(256), - ::testing::Values(ngraph::op::PadType::SAME_UPPER, ngraph::op::PadType::SAME_LOWER), - ::testing::ValuesIn(emptyOutputPadding) -); - -const DeconvInputData inputs_2D_AutoPadding_AMX = { - InputShape{{-1, 512, -1, -1}, {{ 1, 512, 32, 51}, { 1, 512, 68, 101}}}, - ngraph::helpers::InputLayerType::PARAMETER, - {{64, 101}, {135, 202}} -}; - -INSTANTIATE_TEST_SUITE_P(smoke_Deconv_2D_AutoPadding_AMX_BF16, DeconvolutionLayerCPUTest, - ::testing::Combine( - deconvParams_AutoPadding_2D_AMX, - ::testing::Values(inputs_2D_AutoPadding_AMX), - ::testing::Values(ElementType::f32), - ::testing::Values(emptyFusingSpec), - ::testing::ValuesIn(filterCPUInfo({conv_avx512_2D_nspc_brgconv_amx})), - ::testing::Values(cpuBF16PluginConfig)), - DeconvolutionLayerCPUTest::getTestCaseName); - } // namespace } // namespace CPULayerTestsDefinitions diff --git a/src/plugins/intel_cpu/tests/functional/single_layer_tests/instances/x64/convolution_backprop_data.cpp b/src/plugins/intel_cpu/tests/functional/single_layer_tests/instances/x64/convolution_backprop_data.cpp new file mode 100755 index 00000000000000..4060258250ebf4 --- /dev/null +++ b/src/plugins/intel_cpu/tests/functional/single_layer_tests/instances/x64/convolution_backprop_data.cpp @@ -0,0 +1,533 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "single_layer_tests/classes/convolution_backprop_data.hpp" +#include "shared_test_classes/single_layer/convolution_backprop_data.hpp" +#include "test_utils/cpu_test_utils.hpp" +#include "test_utils/filter_cpu_info.hpp" +#include "test_utils/fusing_test_utils.hpp" + +using namespace CPUTestUtils; +using namespace ov::test; + +namespace CPULayerTestsDefinitions { + +namespace { + +/* ============= Deconvolution params (3D) ============= */ +const std::vector kernels3d = { {3, 3, 3}, {1, 1, 1} }; +const std::vector strides3d = { {1, 1, 1}, {2, 2, 2} }; +const std::vector> padBegins3d = { {0, 0, 0} }; +const std::vector> padEnds3d = { {0, 0, 0} }; +const std::vector dilations3d = { {1, 1, 1} }; + +const std::vector deconvAmxKernels3d = { {3, 3, 3}, {2, 2, 2} }; +const std::vector deconvAmxStrides3d = { {2, 2, 2} }; + +/* ============= */ +/* ============= Deconvolution (Planar 3D) ============= */ +const std::vector Planar_3D_inputs_smoke = { + DeconvInputData{ + InputShape{{}, {{ 2, 12, 7, 7, 7 }}}, + ngraph::helpers::InputLayerType::CONSTANT, + {} + }, + DeconvInputData{ + InputShape{{-1, 12, -1, -1, -1}, {{ 2, 12, 7, 7, 7}, { 2, 12, 5, 7, 7}, { 1, 12, 9, 4, 9}}}, + ngraph::helpers::InputLayerType::PARAMETER, + {{15, 15, 15}, {9, 10, 10}, {9, 9, 9}} + } +}; + +const std::vector Planar_3D_inputs_nightly = { + DeconvInputData{ + // -1 will result deconv use 64 to infer output shape, for 3d output shape is too big for gemm bwd kernel + // to buffer the intermedia results + InputShape{{-1, 12, {5, 9}, {4, 7}, {7, 9}}, {{ 2, 12, 7, 7, 7}, { 2, 12, 5, 7, 7}, { 1, 12, 9, 4, 9}}}, + ngraph::helpers::InputLayerType::CONSTANT, + {} + }, + DeconvInputData{ + InputShape{{-1, 12, -1, -1, -1}, {{ 2, 12, 7, 7, 7}, { 2, 12, 5, 7, 7}, { 1, 12, 9, 4, 9}, { 2, 12, 7, 7, 7}}}, + ngraph::helpers::InputLayerType::CONSTANT, + {{10, 16, 16}} + }, + DeconvInputData{ + InputShape{{{1, 10}, 12, 7, 7, 7}, {{ 2, 12, 7, 7, 7}, { 1, 12, 7, 7, 7}, { 3, 12, 7, 7, 7}}}, + ngraph::helpers::InputLayerType::CONSTANT, + {{15, 15, 15}} + } +}; + +const auto convParams_ExplicitPadding_Planar_3D = ::testing::Combine( + ::testing::ValuesIn(kernels3d), + ::testing::ValuesIn(strides3d), + ::testing::ValuesIn(padBegins3d), + ::testing::ValuesIn(padEnds3d), + ::testing::ValuesIn(dilations3d), + ::testing::ValuesIn(numOutChannels_Planar), + ::testing::Values(ngraph::op::PadType::EXPLICIT), + ::testing::ValuesIn(emptyOutputPadding) +); + +INSTANTIATE_TEST_SUITE_P(smoke_Deconv_3D_Planar_FP32, DeconvolutionLayerCPUTest, + ::testing::Combine( + convParams_ExplicitPadding_Planar_3D, + ::testing::ValuesIn(Planar_3D_inputs_smoke), + ::testing::Values(ElementType::f32), + ::testing::ValuesIn(fusingParamsSet), + ::testing::ValuesIn(filterCPUInfo({conv_gemm_3D})), + ::testing::Values(cpuEmptyPluginConfig)), + DeconvolutionLayerCPUTest::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P(smoke_Deconv_3D_Planar_BF16, DeconvolutionLayerCPUTest, + ::testing::Combine( + convParams_ExplicitPadding_Planar_3D, + ::testing::ValuesIn(Planar_3D_inputs_smoke), + ::testing::Values(ElementType::f32), + ::testing::ValuesIn(fusingParamsSet), + ::testing::ValuesIn(filterCPUInfo({conv_gemm_3D})), + ::testing::Values(cpuBF16PluginConfig)), + DeconvolutionLayerCPUTest::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P(nightly_Deconv_3D_Planar_FP32, DeconvolutionLayerCPUTest, + ::testing::Combine( + convParams_ExplicitPadding_Planar_3D, + ::testing::ValuesIn(Planar_3D_inputs_nightly), + ::testing::Values(ElementType::f32), + ::testing::ValuesIn(fusingParamsSet), + ::testing::ValuesIn(filterCPUInfo({conv_gemm_3D})), + ::testing::Values(cpuEmptyPluginConfig)), + DeconvolutionLayerCPUTest::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P(nightly_Deconv_3D_Planar_BF16, DeconvolutionLayerCPUTest, + ::testing::Combine( + convParams_ExplicitPadding_Planar_3D, + ::testing::ValuesIn(Planar_3D_inputs_nightly), + ::testing::Values(ElementType::f32), + ::testing::ValuesIn(fusingParamsSet), + ::testing::ValuesIn(filterCPUInfo({conv_gemm_3D})), + ::testing::Values(cpuBF16PluginConfig)), + DeconvolutionLayerCPUTest::getTestCaseName); +} + +/* ============= Deconvolution (Blocked 3D) ============= */ +const std::vector Blocked_3D_inputs_smoke = { + DeconvInputData{ + InputShape{{}, {{ 2, 35, 7, 7, 7 }}}, + ngraph::helpers::InputLayerType::CONSTANT, + {} + }, + DeconvInputData{ + InputShape{{-1, 35, -1, -1, -1}, {{ 1, 35, 5, 5, 5}, { 2, 35, 5, 7, 5}}}, + ngraph::helpers::InputLayerType::PARAMETER, + {{7, 7, 7}, {7, 9, 7}} + } +}; + +const auto convParams_ExplicitPadding_Blocked_3D_nightly = ::testing::Combine( + ::testing::ValuesIn(kernels3d), + ::testing::ValuesIn({strides3d[0]}), + ::testing::ValuesIn(padBegins3d), + ::testing::ValuesIn(padEnds3d), + ::testing::ValuesIn(dilations3d), + ::testing::Values(32), + ::testing::Values(ngraph::op::PadType::EXPLICIT), + ::testing::ValuesIn(emptyOutputPadding) +); + +const std::vector Blocked_3D_inputs_nightly = { + DeconvInputData{ + InputShape{{-1, 35, -1, -1, -1}, {{ 1, 35, 5, 5, 5}, { 2, 35, 5, 7, 5}, { 1, 35, 5, 5, 5}}}, + ngraph::helpers::InputLayerType::CONSTANT, + {} + }, + DeconvInputData{ + InputShape{{-1, 35, -1, -1, -1}, {{ 1, 35, 5, 5, 5}, { 2, 35, 5, 7, 5}}}, + ngraph::helpers::InputLayerType::CONSTANT, + {{7, 7, 7}} + }, + DeconvInputData{ + InputShape{{{1, 10}, 35, 5, 5, 5}, {{ 1, 35, 5, 5, 5}, { 2, 35, 5, 5, 5}}}, + ngraph::helpers::InputLayerType::CONSTANT, + {{7, 7, 7}} + } +}; + +const auto convParams_ExplicitPadding_Blocked_3D = ::testing::Combine( + ::testing::ValuesIn(kernels3d), + ::testing::ValuesIn(strides3d), + ::testing::ValuesIn(padBegins3d), + ::testing::ValuesIn(padEnds3d), + ::testing::ValuesIn(dilations3d), + ::testing::Values(32), + ::testing::Values(ngraph::op::PadType::EXPLICIT), + ::testing::ValuesIn(emptyOutputPadding) +); + +const auto convParams_ExplicitPadding_AMX_3D = ::testing::Combine( + ::testing::ValuesIn(deconvAmxKernels3d), + ::testing::ValuesIn(deconvAmxStrides3d), + ::testing::ValuesIn(padBegins3d), + ::testing::ValuesIn(padEnds3d), + ::testing::ValuesIn(dilations3d), + ::testing::Values(32), + ::testing::Values(ngraph::op::PadType::EXPLICIT), + ::testing::ValuesIn(emptyOutputPadding) +); + +INSTANTIATE_TEST_SUITE_P(smoke_Deconv_3D_Blocked_FP32, DeconvolutionLayerCPUTest, + ::testing::Combine( + convParams_ExplicitPadding_Blocked_3D, + ::testing::ValuesIn(Blocked_3D_inputs_smoke), + ::testing::Values(ElementType::f32), + ::testing::ValuesIn(fusingParamsSet), + ::testing::ValuesIn(filterCPUInfo({conv_avx512_3D})), + ::testing::Values(cpuEmptyPluginConfig)), + DeconvolutionLayerCPUTest::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P(smoke_Deconv_3D_Blocked_BF16, DeconvolutionLayerCPUTest, + ::testing::Combine( + convParams_ExplicitPadding_Blocked_3D, + ::testing::ValuesIn(Blocked_3D_inputs_smoke), + ::testing::Values(ElementType::f32), + ::testing::ValuesIn(fusingParamsSet), + ::testing::ValuesIn(filterCPUInfo({conv_avx512_3D})), + ::testing::Values(cpuBF16PluginConfig)), + DeconvolutionLayerCPUTest::getTestCaseName); + + +INSTANTIATE_TEST_SUITE_P(smoke_Deconv_3D_NSPC_BF16_AMX_NO_FUSING, DeconvolutionLayerCPUTest, + ::testing::Combine( + convParams_ExplicitPadding_AMX_3D, + ::testing::ValuesIn(Blocked_3D_inputs_smoke), + ::testing::Values(ElementType::f32), + ::testing::ValuesIn({emptyFusingSpec}), + ::testing::ValuesIn(filterCPUInfo({conv_avx512_3D_nspc_amx})), + ::testing::Values(cpuBF16PluginConfig)), + DeconvolutionLayerCPUTest::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P(smoke_Deconv_3D_NSPC_INT8_AMX, DeconvolutionLayerCPUTest, + ::testing::Combine( + convParams_ExplicitPadding_AMX_3D, + ::testing::ValuesIn(Blocked_3D_inputs_smoke), + ::testing::Values(ElementType::i8), + ::testing::ValuesIn({emptyFusingSpec, fusingClampRoundAddRelu}), + ::testing::ValuesIn(filterCPUInfo({conv_avx512_3D_nspc_amx})), + ::testing::Values(cpuEmptyPluginConfig)), + DeconvolutionLayerCPUTest::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P(nightly_Deconv_3D_Blocked_FP32, DeconvolutionLayerCPUTest, + ::testing::Combine( + convParams_ExplicitPadding_Blocked_3D_nightly, + ::testing::ValuesIn(Blocked_3D_inputs_nightly), + ::testing::Values(ElementType::f32), + ::testing::ValuesIn(fusingParamsSet), + ::testing::ValuesIn(filterCPUInfo({conv_avx512_3D})), + ::testing::Values(cpuEmptyPluginConfig)), + DeconvolutionLayerCPUTest::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P(nightly_Deconv_3D_Blocked_BF16, DeconvolutionLayerCPUTest, + ::testing::Combine( + convParams_ExplicitPadding_Blocked_3D_nightly, + ::testing::ValuesIn(Blocked_3D_inputs_nightly), + ::testing::Values(ElementType::f32), + ::testing::ValuesIn(fusingParamsSet), + ::testing::ValuesIn(filterCPUInfo({conv_avx512_3D})), + ::testing::Values(cpuBF16PluginConfig)), + DeconvolutionLayerCPUTest::getTestCaseName); + +const std::vector inputs_3D_AutoPadding = { + DeconvInputData{ + InputShape{{-1, 2, 4, {32, 64}, {32, 64}}, {{1, 2, 4, 32, 32}, {1, 2, 4, 40, 40}}}, + ngraph::helpers::InputLayerType::PARAMETER, + {{8, 64, 64}, {8, 80, 80}} + }, + DeconvInputData{ + InputShape{ + {1, 64, 5, {1, std::numeric_limits::max()}, {1, std::numeric_limits::max()}}, + {{1, 64, 5, 8, 8}} + }, + ngraph::helpers::InputLayerType::CONSTANT, + {{10, 16, 16}} + }, +}; + +const auto deconvParams_AutoPadding_3D = ::testing::Combine( + ::testing::Values(kernels3d[0]), + ::testing::Values(strides3d[1]), + ::testing::ValuesIn(padBegins3d), + ::testing::ValuesIn(padEnds3d), + ::testing::ValuesIn(dilations3d), + ::testing::Values(1), + ::testing::Values(ngraph::op::PadType::SAME_UPPER, ngraph::op::PadType::SAME_LOWER), + ::testing::ValuesIn(emptyOutputPadding) +); + +INSTANTIATE_TEST_SUITE_P(smoke_Deconv_3D_AutoPadding_FP32, DeconvolutionLayerCPUTest, + ::testing::Combine( + deconvParams_AutoPadding_3D, + ::testing::ValuesIn(inputs_3D_AutoPadding), + ::testing::Values(ElementType::f32), + ::testing::Values(emptyFusingSpec), + ::testing::ValuesIn(filterCPUInfo({conv_gemm_3D, conv_avx512_3D})), + ::testing::Values(cpuEmptyPluginConfig)), + DeconvolutionLayerCPUTest::getTestCaseName); + +const std::vector deconvAmxKernels2d = { {3, 3}, {2, 2}}; +const std::vector deconvAmxStrides2d = { {2, 2}}; + +const auto convParams_ExplicitPadding_AMX_2D = ::testing::Combine( + ::testing::ValuesIn(deconvAmxKernels2d), + ::testing::ValuesIn(deconvAmxStrides2d), + ::testing::ValuesIn(padBegins2d), + ::testing::ValuesIn(padEnds2d), + ::testing::ValuesIn(dilations2d), + ::testing::ValuesIn(numOutChannels_Blocked), + ::testing::Values(ngraph::op::PadType::EXPLICIT), + ::testing::ValuesIn(emptyOutputPadding) +); + +/* ============= Deconvolution (Blocked 2D) ============= */ +const std::vector Blocked_2D_inputs_smoke = { + DeconvInputData{ + InputShape{{}, {{ 2, 67, 7, 7 }}}, + ngraph::helpers::InputLayerType::CONSTANT, + {} + }, + DeconvInputData{ + InputShape{{-1, 67, -1, -1}, {{ 2, 67, 7, 7}, { 2, 67, 5, 7}, { 1, 67, 9, 4}}}, + ngraph::helpers::InputLayerType::PARAMETER, + {{15, 15}, {9, 10}, {9, 9}} + } +}; + +INSTANTIATE_TEST_SUITE_P(smoke_Deconv_2D_NSPC_BF16_AMX_NO_FUSING, DeconvolutionLayerCPUTest, + ::testing::Combine( + convParams_ExplicitPadding_AMX_2D, + ::testing::ValuesIn(Blocked_2D_inputs_smoke), + ::testing::Values(ElementType::f32), + ::testing::ValuesIn({emptyFusingSpec}), + ::testing::ValuesIn(filterCPUInfo({conv_avx512_2D_nspc_amx})), + ::testing::Values(cpuBF16PluginConfig)), + DeconvolutionLayerCPUTest::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P(smoke_Deconv_2D_NSPC_INT8_AMX, DeconvolutionLayerCPUTest, + ::testing::Combine( + convParams_ExplicitPadding_AMX_2D, + ::testing::ValuesIn(Blocked_2D_inputs_smoke), + ::testing::Values(ElementType::i8), + ::testing::ValuesIn({emptyFusingSpec, fusingClampRoundAddRelu}), + ::testing::ValuesIn(filterCPUInfo({conv_avx512_2D_nspc_amx})), + ::testing::Values(cpuEmptyPluginConfig)), + DeconvolutionLayerCPUTest::getTestCaseName); + +const auto deconvParams_AutoPadding_2D_AMX = ::testing::Combine( + ::testing::ValuesIn(deconvAmxKernels2d), + ::testing::ValuesIn(deconvAmxStrides2d), + ::testing::ValuesIn(padBegins2d), + ::testing::ValuesIn(padEnds2d), + ::testing::ValuesIn(dilations2d), + ::testing::Values(256), + ::testing::Values(ngraph::op::PadType::SAME_UPPER, ngraph::op::PadType::SAME_LOWER), + ::testing::ValuesIn(emptyOutputPadding) +); + +const DeconvInputData inputs_2D_AutoPadding_AMX = { + InputShape{{-1, 512, -1, -1}, {{ 1, 512, 32, 51}, { 1, 512, 68, 101}}}, + ngraph::helpers::InputLayerType::PARAMETER, + {{64, 101}, {135, 202}} +}; + +INSTANTIATE_TEST_SUITE_P(smoke_Deconv_2D_AutoPadding_AMX_BF16, DeconvolutionLayerCPUTest, + ::testing::Combine( + deconvParams_AutoPadding_2D_AMX, + ::testing::Values(inputs_2D_AutoPadding_AMX), + ::testing::Values(ElementType::f32), + ::testing::Values(emptyFusingSpec), + ::testing::ValuesIn(filterCPUInfo({conv_avx512_2D_nspc_brgconv_amx})), + ::testing::Values(cpuBF16PluginConfig)), + DeconvolutionLayerCPUTest::getTestCaseName); + +/* ============= Reorder + Deconvolution ============= */ +INSTANTIATE_TEST_SUITE_P(smoke_reorder_Deconv_2D, DeconvolutionLayerCPUTest, + ::testing::Combine( + ::testing::Combine(::testing::ValuesIn(kernels2d), + ::testing::Values(InferenceEngine::SizeVector{1, 1}), + ::testing::ValuesIn(padBegins2d), + ::testing::ValuesIn(padEnds2d), + ::testing::ValuesIn(dilations2d), + ::testing::ValuesIn(numOutChannels_Blocked), + ::testing::Values(ngraph::op::PadType::EXPLICIT), + ::testing::ValuesIn(emptyOutputPadding)), + ::testing::Values(DeconvInputData{InputShape{{-1, 67, -1, -1}, {{ 1, 67, 7, 7}, { 1, 67, 9, 4}, { 1, 67, 5, 7}, { 1, 67, 7, 7}, { 1, 67, 9, 4}}}, + ngraph::helpers::InputLayerType::PARAMETER, + {{15, 15}, {9, 9}, {9, 10}, {15, 15}, {9, 9}}}), + ::testing::Values(ElementType::f32), + ::testing::Values(emptyFusingSpec), + ::testing::ValuesIn(filterCPUInfo({conv_avx512_2D})), + ::testing::Values(cpuEmptyPluginConfig)), + DeconvolutionLayerCPUTest::getTestCaseName); + +const auto convParams_ExplicitPadding_Blocked_2D = ::testing::Combine( + ::testing::ValuesIn(kernels2d), + ::testing::ValuesIn(strides2d), + ::testing::ValuesIn(padBegins2d), + ::testing::ValuesIn(padEnds2d), + ::testing::ValuesIn(dilations2d), + ::testing::ValuesIn(numOutChannels_Blocked), + ::testing::Values(ngraph::op::PadType::EXPLICIT), + ::testing::ValuesIn(emptyOutputPadding) +); + +INSTANTIATE_TEST_SUITE_P(smoke_Deconv_2D_Blocked_FP32, DeconvolutionLayerCPUTest, + ::testing::Combine( + convParams_ExplicitPadding_Blocked_2D, + ::testing::ValuesIn(Blocked_2D_inputs_smoke), + ::testing::Values(ElementType::f32), + ::testing::ValuesIn(fusingParamsSet), + ::testing::ValuesIn(filterCPUInfo({conv_avx512_2D, conv_avx2_2D})), + ::testing::Values(cpuEmptyPluginConfig)), + DeconvolutionLayerCPUTest::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P(smoke_Deconv_2D_Blocked_BF16, DeconvolutionLayerCPUTest, + ::testing::Combine( + convParams_ExplicitPadding_Blocked_2D, + ::testing::ValuesIn(Blocked_2D_inputs_smoke), + ::testing::Values(ElementType::f32), + ::testing::ValuesIn(fusingParamsSet), + ::testing::ValuesIn(filterCPUInfo({conv_avx512_2D})), + ::testing::Values(cpuBF16PluginConfig)), + DeconvolutionLayerCPUTest::getTestCaseName); + + +const auto convParams_ExplicitPadding_Blocked_2D_nightly = ::testing::Combine( + ::testing::ValuesIn(kernels2d), + // Use 7x7 with stride 1 is too small to generate 15x15 output. It needs a big negative pad which will result + // avx512 kernel not to be selected. + ::testing::ValuesIn({strides2d[1]}), + ::testing::ValuesIn(padBegins2d), + ::testing::ValuesIn(padEnds2d), + ::testing::ValuesIn(dilations2d), + ::testing::ValuesIn(numOutChannels_Blocked), + ::testing::Values(ngraph::op::PadType::EXPLICIT), + ::testing::ValuesIn(emptyOutputPadding) +); + +const std::vector Blocked_2D_inputs_nightly = { + DeconvInputData{ + InputShape{{-1, 67, -1, -1}, {{ 2, 67, 7, 7}, { 2, 67, 5, 7}, { 1, 67, 9, 4}, { 2, 67, 7, 7}}}, + ngraph::helpers::InputLayerType::CONSTANT, + {} + }, + DeconvInputData{ + InputShape{{-1, 67, -1, -1}, {{ 2, 67, 7, 7}, { 2, 67, 5, 7}, { 1, 67, 9, 4}}}, + ngraph::helpers::InputLayerType::CONSTANT, + {{15, 15}} + }, + DeconvInputData{ + InputShape{{ {1, 10}, 67, 7, 7}, {{ 2, 67, 7, 7}, { 3, 67, 7, 7}, { 1, 67, 7, 7}}}, + ngraph::helpers::InputLayerType::CONSTANT, + {{15, 15}} + } +}; + +INSTANTIATE_TEST_SUITE_P(nightly_Deconv_2D_Blocked_FP32, DeconvolutionLayerCPUTest, + ::testing::Combine( + convParams_ExplicitPadding_Blocked_2D_nightly, + ::testing::ValuesIn(Blocked_2D_inputs_nightly), + ::testing::Values(ElementType::f32), + ::testing::ValuesIn(fusingParamsSet), + ::testing::ValuesIn(filterCPUInfo({conv_avx512_2D, conv_avx2_2D})), + ::testing::Values(cpuEmptyPluginConfig)), + DeconvolutionLayerCPUTest::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P(nightly_Deconv_2D_Blocked_BF16, DeconvolutionLayerCPUTest, + ::testing::Combine( + convParams_ExplicitPadding_Blocked_2D_nightly, + ::testing::ValuesIn(Blocked_2D_inputs_nightly), + ::testing::Values(ElementType::f32), + ::testing::ValuesIn(fusingParamsSet), + ::testing::ValuesIn(filterCPUInfo({conv_avx512_2D})), + ::testing::Values(cpuBF16PluginConfig)), + DeconvolutionLayerCPUTest::getTestCaseName); + + +/* ============= Kernel_1x1 (2D) ============= */ +const auto convParams_ExplicitPadding_1x1_2D = ::testing::Combine( + ::testing::Values(InferenceEngine::SizeVector({1, 1})), + ::testing::Values(InferenceEngine::SizeVector({1, 1})), + ::testing::Values(std::vector({0, 0})), + ::testing::Values(std::vector({0, 0})), + ::testing::Values(InferenceEngine::SizeVector({1, 1})), + ::testing::ValuesIn(numOutChannels_Blocked), + ::testing::Values(ngraph::op::PadType::EXPLICIT), + ::testing::ValuesIn(emptyOutputPadding) +); + +INSTANTIATE_TEST_SUITE_P(smoke_Deconv_2D_1x1_FP32, DeconvolutionLayerCPUTest, + ::testing::Combine( + convParams_ExplicitPadding_1x1_2D, + ::testing::ValuesIn(Blocked_2D_inputs_smoke), + ::testing::Values(ElementType::f32), + ::testing::ValuesIn(fusingParamsSet), + ::testing::ValuesIn(filterCPUInfo({conv_avx512_2D_1x1, conv_avx2_2D_1x1})), + ::testing::Values(cpuEmptyPluginConfig)), + DeconvolutionLayerCPUTest::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P(smoke_Deconv_2D_1x1_BF16, DeconvolutionLayerCPUTest, + ::testing::Combine( + convParams_ExplicitPadding_1x1_2D, + ::testing::ValuesIn(Blocked_2D_inputs_smoke), + ::testing::Values(ElementType::f32), + ::testing::ValuesIn(fusingParamsSet), + ::testing::ValuesIn(filterCPUInfo({conv_avx512_2D_1x1, conv_avx2_2D_1x1})), + ::testing::Values(cpuBF16PluginConfig)), + DeconvolutionLayerCPUTest::getTestCaseName); + +/* ============= Deconvolution auto padding tests ============= */ +const std::vector inputs_2D_AutoPadding = { + DeconvInputData{ + InputShape{{}, {{ 2, 67, 7, 7 }}}, + ngraph::helpers::InputLayerType::CONSTANT, + {} + }, + DeconvInputData{ + InputShape{{-1, 67, -1, -1}, {{ 1, 67, 9, 4}, { 2, 67, 5, 7}, { 1, 67, 9, 4}}}, + ngraph::helpers::InputLayerType::CONSTANT, + {} + }, + DeconvInputData{ + InputShape{{-1, 67, -1, -1}, {{ 2, 67, 7, 7}, { 2, 67, 5, 7}, { 1, 67, 9, 4}}}, + ngraph::helpers::InputLayerType::CONSTANT, + {{15, 15}} + }, + DeconvInputData{ + InputShape{{-1, 67, -1, -1}, {{ 1, 67, 9, 4}, { 2, 67, 5, 7}, { 1, 67, 9, 4}}}, + ngraph::helpers::InputLayerType::PARAMETER, + {{9, 9}, {9, 10}, {9, 9}} + } +}; + +const auto deconvParams_AutoPadding_2D = ::testing::Combine( + ::testing::ValuesIn(kernels2d), + ::testing::ValuesIn(strides2d), + ::testing::ValuesIn(padBegins2d), + ::testing::ValuesIn(padEnds2d), + ::testing::ValuesIn(dilations2d), + ::testing::ValuesIn(numOutChannels_Blocked), + ::testing::Values(ngraph::op::PadType::SAME_UPPER, ngraph::op::PadType::SAME_LOWER), + ::testing::ValuesIn(emptyOutputPadding) +); + +INSTANTIATE_TEST_SUITE_P(smoke_Deconv_2D_AutoPadding_FP32, DeconvolutionLayerCPUTest, + ::testing::Combine( + deconvParams_AutoPadding_2D, + ::testing::ValuesIn(inputs_2D_AutoPadding), + ::testing::Values(ElementType::f32), + ::testing::Values(emptyFusingSpec), + ::testing::ValuesIn(filterCPUInfo({conv_avx512_2D})), + ::testing::Values(cpuEmptyPluginConfig)), + DeconvolutionLayerCPUTest::getTestCaseName); +} // namespace CPULayerTestsDefinitions