From f43da342350f5ac3f83f7bf31ec6bc1dc92dc04a Mon Sep 17 00:00:00 2001 From: p-wysocki Date: Mon, 10 Jun 2024 14:41:10 +0200 Subject: [PATCH 01/14] Add support and tests --- .../include/openvino/reference/col2im.hpp | 4 +- src/plugins/intel_cpu/src/cpu_types.cpp | 2 + src/plugins/intel_cpu/src/cpu_types.h | 1 + src/plugins/intel_cpu/src/nodes/col2im.cpp | 115 +++++++ src/plugins/intel_cpu/src/nodes/col2im.h | 40 +++ src/plugins/intel_cpu/src/nodes_factory.cpp | 2 + .../custom/single_layer_tests/col2im.cpp | 284 ++++++++++++++++++ 7 files changed, 446 insertions(+), 2 deletions(-) create mode 100644 src/plugins/intel_cpu/src/nodes/col2im.cpp create mode 100644 src/plugins/intel_cpu/src/nodes/col2im.h create mode 100644 src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/col2im.cpp diff --git a/src/core/reference/include/openvino/reference/col2im.hpp b/src/core/reference/include/openvino/reference/col2im.hpp index 498c4265dc59bb..5219d045e37440 100644 --- a/src/core/reference/include/openvino/reference/col2im.hpp +++ b/src/core/reference/include/openvino/reference/col2im.hpp @@ -48,10 +48,10 @@ void col2im(const T* data, const auto channel_idx = column / kernel_product; for (int64_t column_height_idx = 0; column_height_idx < original_height; ++column_height_idx) { - const int64_t image_height_idx = get_image_dimension_index(column_height_idx, height_offset, 0); + const T_idx image_height_idx = get_image_dimension_index(column_height_idx, height_offset, 0); if (image_height_idx >= 0 && image_height_idx < output_size[0]) { for (int64_t column_width_idx = 0; column_width_idx < original_width; ++column_width_idx) { - const int64_t image_width_idx = get_image_dimension_index(column_width_idx, width_offset, 1); + const T_idx image_width_idx = get_image_dimension_index(column_width_idx, width_offset, 1); if (image_width_idx >= 0 && image_width_idx < output_size[1]) { const int64_t img_idx = ((batch * channel_count + channel_idx) * output_size[0] + image_height_idx) * diff --git a/src/plugins/intel_cpu/src/cpu_types.cpp b/src/plugins/intel_cpu/src/cpu_types.cpp index e3a4c21142befa..8e8f5bec2cce23 100644 --- a/src/plugins/intel_cpu/src/cpu_types.cpp +++ b/src/plugins/intel_cpu/src/cpu_types.cpp @@ -142,6 +142,7 @@ static const TypeToNameMap& get_type_to_name_tbl() { {"NV12toBGR", Type::ColorConvert}, {"I420toRGB", Type::ColorConvert}, {"I420toBGR", Type::ColorConvert}, + {"Col2Im", Type::Col2Im}, {"MVN", Type::MVN}, {"NormalizeL2", Type::NormalizeL2}, {"ScatterUpdate", Type::ScatterUpdate}, @@ -303,6 +304,7 @@ std::string NameFromType(const Type type) { CASE(MVN); CASE(TensorIterator); CASE(Convert); + CASE(Col2Im); CASE(ColorConvert); CASE(NormalizeL2); CASE(ScatterUpdate); diff --git a/src/plugins/intel_cpu/src/cpu_types.h b/src/plugins/intel_cpu/src/cpu_types.h index 5593e6728bbffc..055f369dca8681 100644 --- a/src/plugins/intel_cpu/src/cpu_types.h +++ b/src/plugins/intel_cpu/src/cpu_types.h @@ -61,6 +61,7 @@ enum class Type { TensorIterator, Convert, ColorConvert, + Col2Im, MVN, NormalizeL2, ScatterUpdate, diff --git a/src/plugins/intel_cpu/src/nodes/col2im.cpp b/src/plugins/intel_cpu/src/nodes/col2im.cpp new file mode 100644 index 00000000000000..0d6324de35bfe3 --- /dev/null +++ b/src/plugins/intel_cpu/src/nodes/col2im.cpp @@ -0,0 +1,115 @@ +// Copyright (C) 2018-2024 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "col2im.h" +#include "common/cpu_convert.h" +#include "openvino/reference/col2im.hpp" + +#include + +namespace ov { +namespace intel_cpu { +namespace node { +Col2Im::Col2Im(const std::shared_ptr& op, const GraphContext::CPtr context) + : Node(op, context, NgraphShapeInferFactory(op, EMPTY_PORT_MASK)) { + const auto col2Im = ov::as_type_ptr(op); + strides = col2Im->get_strides(); + dilations = col2Im->get_dilations(); + padsBegin = col2Im->get_pads_begin(); + padsEnd = col2Im->get_pads_end(); +} + +void Col2Im::getSupportedDescriptors() { + // Validation is already done in the ov::opset15::Col2Im. +} + +void Col2Im::initSupportedPrimitiveDescriptors() { + if (!supportedPrimitiveDescriptors.empty()) + return; + + ov::element::Type dataPrecision = getOriginalInputPrecisionAtPort(0); + ov::element::Type indexPrecision = getOriginalInputPrecisionAtPort(1); + ov::element::Type outputPrecision = getOriginalOutputPrecisionAtPort(0); + + addSupportedPrimDesc( + {{LayoutType::ncsp, dataPrecision}, {LayoutType::ncsp, indexPrecision}, {LayoutType::ncsp, indexPrecision}}, + {{LayoutType::ncsp, outputPrecision}}, + impl_desc_type::ref); +} + +bool Col2Im::created() const { + return getType() == Type::Col2Im; +} + +bool Col2Im::needPrepareParams() const { + return false; +} + +void Col2Im::executeDynamicImpl(dnnl::stream strm) { + execute(strm); +} + +template +void Col2Im::executeImpl() { + const auto indexPrecision = getSrcMemoryAtPort(1)->getPrecision(); + std::vector outputSizeVector(2); + cpu_convert(getSrcMemoryAtPort(1)->getData(), + outputSizeVector.data(), + indexPrecision, + ov::element::i64, + 2); + + std::vector kernelSizeVector(2); + cpu_convert(getSrcMemoryAtPort(2)->getData(), + kernelSizeVector.data(), + indexPrecision, + ov::element::i64, + 2); + + ov::reference::col2im( + getSrcDataAtPortAs(0), + ov::Shape{getSrcMemoryAtPort(0)->getStaticDims()}, + outputSizeVector.data(), + kernelSizeVector.data(), + getDstDataAtPortAs(0), + strides, + dilations, + padsBegin, + padsEnd); +} + +namespace { +struct Col2ImContext { + Col2Im &node; +}; +} + +template +struct Col2Im::Col2ImExecute { + using TData = typename std::tuple_element<0, T>::type; + using TIndex = typename std::tuple_element<1, T>::type; + + void operator()(Col2ImContext & ctx) { + ctx.node.executeImpl(); + } +}; +void Col2Im::execute(dnnl::stream strm) { + auto dataPrecision = getParentEdgeAt(0)->getMemory().getDesc().getPrecision(); + auto indexPrecision = getParentEdgeAt(1)->getMemory().getDesc().getPrecision(); + + Col2ImContext ctx = { + *this + }; + + OV_SWITCH(intel_cpu, Col2ImExecute, ctx, std::tie(dataPrecision, indexPrecision), + OV_CASE2(ov::element::f32, ov::element::i32, float, uint64_t), + OV_CASE2(ov::element::f32, ov::element::i64, float, uint64_t), + OV_CASE2(ov::element::f16, ov::element::i32, float, uint64_t), + OV_CASE2(ov::element::f16, ov::element::i64, float, uint64_t), + OV_CASE2(ov::element::i32, ov::element::i32, uint32_t, uint64_t), + OV_CASE2(ov::element::i32, ov::element::i64, uint32_t, uint64_t)) +} +} // namespace node +} // namespace intel_cpu +} // namespace ov diff --git a/src/plugins/intel_cpu/src/nodes/col2im.h b/src/plugins/intel_cpu/src/nodes/col2im.h new file mode 100644 index 00000000000000..f1cab2e5ceef3a --- /dev/null +++ b/src/plugins/intel_cpu/src/nodes/col2im.h @@ -0,0 +1,40 @@ +// Copyright (C) 2018-2024 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include "node.h" + +namespace ov { +namespace intel_cpu { +namespace node { + +class Col2Im : public Node { +public: + Col2Im(const std::shared_ptr& op, const GraphContext::CPtr context); + + void getSupportedDescriptors() override; + void initSupportedPrimitiveDescriptors() override; + void execute(dnnl::stream strm) override; + bool created() const override; + bool needPrepareParams() const override; + void executeDynamicImpl(dnnl::stream strm) override; + +private: + //template + template + void executeImpl(); + + template + struct Col2ImExecute; + + ov::Strides strides; + ov::Strides dilations; + ov::Shape padsBegin; + ov::Shape padsEnd; +}; + +} // namespace node +} // namespace intel_cpu +} // namespace ov diff --git a/src/plugins/intel_cpu/src/nodes_factory.cpp b/src/plugins/intel_cpu/src/nodes_factory.cpp index 7833c60d071b4f..38ee3999be279c 100644 --- a/src/plugins/intel_cpu/src/nodes_factory.cpp +++ b/src/plugins/intel_cpu/src/nodes_factory.cpp @@ -7,6 +7,7 @@ #include "nodes/bin_conv.h" #include "nodes/broadcast.h" #include "nodes/bucketize.h" +#include "nodes/col2im.h" #include "nodes/color_convert.h" #include "nodes/concat.h" #include "nodes/conv.h" @@ -158,6 +159,7 @@ Node::NodesFactory::NodesFactory() : Factory("NodesFactory") { INTEL_CPU_NODE(Math, Type::Math); INTEL_CPU_NODE(MultiClassNms, Type::MulticlassNms); INTEL_CPU_NODE(Convert, Type::Convert); + INTEL_CPU_NODE(Col2Im, Type::Col2Im); INTEL_CPU_NODE(ColorConvert, Type::ColorConvert); INTEL_CPU_NODE(EmbeddingBagOffset, Type::EmbeddingBagOffsetsSum); INTEL_CPU_NODE(EmbeddingBagOffset, Type::EmbeddingBagOffsets); diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/col2im.cpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/col2im.cpp new file mode 100644 index 00000000000000..9d682fd4d8d3d8 --- /dev/null +++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/col2im.cpp @@ -0,0 +1,284 @@ +// Copyright (C) 2018-2024 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "utils/cpu_test_utils.hpp" +#include "common_test_utils/ov_tensor_utils.hpp" +#include "shared_test_classes/base/ov_subgraph.hpp" + +using namespace CPUTestUtils; + +namespace ov { +namespace test { +using Col2ImSpecificParams = std::tuple< + InputShape, // data shape + std::vector, // output size values + std::vector, // kernel size values + ov::Strides, // strides + ov::Strides, // dilations + ov::Shape, // pads_begin + ov::Shape // pads_end +>; + +using Col2ImLayerTestParams = std::tuple< + Col2ImSpecificParams, + ElementType, // data precision + ElementType, // index precision + ov::test::TargetDevice // device name +>; + +using Col2ImLayerCPUTestParamsSet = std::tuple< + Col2ImLayerTestParams, + CPUSpecificParams>; + +class Col2ImLayerCPUTest : public testing::WithParamInterface, + public SubgraphBaseTest, public CPUTestsBase { +public: + static std::string getTestCaseName(testing::TestParamInfo obj) { + Col2ImLayerTestParams basicParamsSet; + CPUSpecificParams cpuParams; + std::tie(basicParamsSet, cpuParams) = obj.param; + std::string td; + ElementType netPrecision; + ElementType indexPrecision; + Col2ImSpecificParams col2ImPar; + std::tie(col2ImPar, netPrecision, indexPrecision, td) = basicParamsSet; + + InputShape inputShape; + std::vector outputSize; + std::vector kernelSize; + ov::Strides strides; + ov::Strides dilations; + ov::Shape pads_begin; + ov::Shape pads_end; + std::tie(inputShape, outputSize, kernelSize, strides, dilations, pads_begin, pads_end) = col2ImPar; + std::ostringstream result; + + result << netPrecision << "_IS="; + result << ov::test::utils::partialShape2str({ inputShape.first }) << "_"; + result << "TS="; + result << "("; + for (const auto& targetShape : inputShape.second) { + result << ov::test::utils::vec2str(targetShape) << "_"; + } + result << ")_"; + result << "outputSize=" << ov::test::utils::vec2str(outputSize) << "_"; + result << "kernelSize=" << ov::test::utils::vec2str(kernelSize) << "_"; + result << "strides=" << strides << "_"; + result << "dilations=" << dilations << "_"; + result << "padsBegin=" << pads_begin << "_"; + result << "padsEnd=" << pads_end << "_"; + result << "dataPrecision=" << netPrecision << "_"; + result << "indexPrecision=" << indexPrecision; + result << CPUTestsBase::getTestCaseName(cpuParams); + + return result.str(); + } +protected: + void generate_inputs(const std::vector& targetInputStaticShapes) override { + inputs.clear(); + const auto& funcInputs = function->inputs(); + + ov::Tensor data_tensor; + const auto& dataPrecision = funcInputs[0].get_element_type(); + const auto& dataShape = targetInputStaticShapes.front(); + ov::test::utils::InputGenerateData in_data; + in_data.start_from = 0; + in_data.range = 10; + in_data.resolution = 1000; + data_tensor = ov::test::utils::create_and_fill_tensor(dataPrecision, dataShape, in_data); + inputs.insert({ funcInputs[0].get_node_shared_ptr(), data_tensor }); + } + + void SetUp() override { + Col2ImLayerTestParams basicParamsSet; + CPUSpecificParams cpuParams; + std::tie(basicParamsSet, cpuParams) = this->GetParam(); + std::tie(inFmts, outFmts, priority, selectedType) = cpuParams; + + Col2ImSpecificParams Col2ImParams; + ElementType inputPrecision; + ElementType indexPrecision; + std::tie(Col2ImParams, inputPrecision, indexPrecision, targetDevice) = basicParamsSet; + + InputShape dataInputShape; + std::vector outputSize; + std::vector kernelSize; + ov::Strides strides; + ov::Strides dilations; + ov::Shape pads_begin; + ov::Shape pads_end; + std::tie(dataInputShape, outputSize, kernelSize, strides, dilations, pads_begin, pads_end) = Col2ImParams; + + auto image2DSpatialShape = InputShape{{}, {{2}}}; + init_input_shapes({dataInputShape, image2DSpatialShape, image2DSpatialShape}); + auto dataParameter = std::make_shared(inputPrecision, dataInputShape.second[0]); + auto outputSizeConst = std::make_shared(indexPrecision, ov::Shape{ 2 }, outputSize); + auto kernelSizeConst = std::make_shared(indexPrecision, ov::Shape{ 2 }, kernelSize); + + auto Col2Im = std::make_shared(dataParameter, + outputSizeConst, + kernelSizeConst, + strides, + dilations, + pads_begin, + pads_end); + + ov::ParameterVector params{ dataParameter }; + function = makeNgraphFunction(inputPrecision, params, Col2Im, "Col2Im"); + } +}; + +TEST_P(Col2ImLayerCPUTest, CompareWithRefs) { + run(); + CheckPluginRelatedResults(compiledModel, "Col2Im"); +} + +namespace { +const std::vector indexPrecisions = { + ElementType::i32, + ElementType::i64 +}; + +const std::vector col2ImParamsVector = { + Col2ImSpecificParams { + InputShape{{}, {{1, 12, 9}}}, + std::vector{4, 4}, + std::vector{2, 2}, + ov::Strides{1, 1}, + ov::Strides{1, 1}, + ov::Shape{0, 0}, + ov::Shape{0, 0} + }, + Col2ImSpecificParams { + InputShape{{}, {{3, 12, 81}}}, + std::vector{16, 16}, + std::vector{2, 2}, + ov::Strides{2, 2}, + ov::Strides{2, 2}, + ov::Shape{2, 2}, + ov::Shape{2, 2} + }, + Col2ImSpecificParams { + InputShape{{}, {{12, 81}}}, + std::vector{16, 16}, + std::vector{2, 2}, + ov::Strides{2, 2}, + ov::Strides{2, 2}, + ov::Shape{2, 2}, + ov::Shape{2, 2} + }, + Col2ImSpecificParams { + InputShape{{}, {{3, 12, 225}}}, + std::vector{16, 16}, + std::vector{2, 2}, + ov::Strides{1, 1}, + ov::Strides{1, 1}, + ov::Shape{0, 0}, + ov::Shape{0, 0} + }, + Col2ImSpecificParams { + InputShape{{}, {{1, 27, 49}}}, + std::vector{16, 16}, + std::vector{3, 3}, + ov::Strides{2, 2}, + ov::Strides{2, 2}, + ov::Shape{1, 1}, + ov::Shape{1, 1} + }, + Col2ImSpecificParams { + InputShape{{}, {{1, 18, 104}}}, + std::vector{16, 16}, + std::vector{2, 3}, + ov::Strides{2, 1}, + ov::Strides{2, 2}, + ov::Shape{1, 0}, + ov::Shape{0, 1} + }, + Col2ImSpecificParams { + InputShape{{}, {{12, 12, 324}}}, + std::vector{32, 32}, + std::vector{2, 2}, + ov::Strides{2, 2}, + ov::Strides{2, 2}, + ov::Shape{3, 3}, + ov::Shape{3, 3} + }, + Col2ImSpecificParams { + InputShape{{-1, 12, 324}, {{12, 12, 324}}}, + std::vector{32, 32}, + std::vector{2, 2}, + ov::Strides{2, 2}, + ov::Strides{2, 2}, + ov::Shape{3, 3}, + ov::Shape{3, 3} + }, + Col2ImSpecificParams { + InputShape{{-1, -1, -1}, {{12, 12, 324}}}, + std::vector{32, 32}, + std::vector{2, 2}, + ov::Strides{2, 2}, + ov::Strides{2, 2}, + ov::Shape{3, 3}, + ov::Shape{3, 3} + }, + Col2ImSpecificParams { + InputShape{{12, -1, -1}, {{12, 12, 324}}}, + std::vector{32, 32}, + std::vector{2, 2}, + ov::Strides{2, 2}, + ov::Strides{2, 2}, + ov::Shape{3, 3}, + ov::Shape{3, 3} + }, + Col2ImSpecificParams { + InputShape{{12, 12, -1}, {{12, 12, 324}}}, + std::vector{32, 32}, + std::vector{2, 2}, + ov::Strides{2, 2}, + ov::Strides{2, 2}, + ov::Shape{3, 3}, + ov::Shape{3, 3} + }, + Col2ImSpecificParams { + InputShape{{12, -1, 324}, {{12, 12, 324}}}, + std::vector{32, 32}, + std::vector{2, 2}, + ov::Strides{2, 2}, + ov::Strides{2, 2}, + ov::Shape{3, 3}, + ov::Shape{3, 3} + }, + Col2ImSpecificParams { + InputShape{{-1, -1}, {{12, 324}}}, + std::vector{32, 32}, + std::vector{2, 2}, + ov::Strides{2, 2}, + ov::Strides{2, 2}, + ov::Shape{3, 3}, + ov::Shape{3, 3} + } +}; + +INSTANTIATE_TEST_SUITE_P(smoke_Col2ImLayoutTestF32, Col2ImLayerCPUTest, + ::testing::Combine( + ::testing::Combine( + ::testing::ValuesIn(col2ImParamsVector), + ::testing::ValuesIn(std::vector{ElementType::f32, ElementType::f16}), + ::testing::ValuesIn(indexPrecisions), + ::testing::Values(ov::test::utils::DEVICE_CPU)), + ::testing::Values(CPUSpecificParams{{}, {}, {}, "ref_f32"})), + Col2ImLayerCPUTest::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P(smoke_Col2ImLayoutTestI32, Col2ImLayerCPUTest, + ::testing::Combine( + ::testing::Combine( + ::testing::ValuesIn(col2ImParamsVector), + ::testing::Values(ElementType::i32), + ::testing::ValuesIn(indexPrecisions), + ::testing::Values(ov::test::utils::DEVICE_CPU)), + ::testing::Values(CPUSpecificParams{{}, {}, {}, "ref_i32"})), + Col2ImLayerCPUTest::getTestCaseName); +} // namespace +} // namespace test +} // namespace ov From d8c46a0638c4a3eba18701cec9ce93f68e7da9ea Mon Sep 17 00:00:00 2001 From: p-wysocki Date: Mon, 10 Jun 2024 14:45:36 +0200 Subject: [PATCH 02/14] Remove comment --- src/plugins/intel_cpu/src/nodes/col2im.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/plugins/intel_cpu/src/nodes/col2im.h b/src/plugins/intel_cpu/src/nodes/col2im.h index f1cab2e5ceef3a..9f0534fdfef28f 100644 --- a/src/plugins/intel_cpu/src/nodes/col2im.h +++ b/src/plugins/intel_cpu/src/nodes/col2im.h @@ -22,7 +22,6 @@ class Col2Im : public Node { void executeDynamicImpl(dnnl::stream strm) override; private: - //template template void executeImpl(); From 2b5c1bdab5556146954154c09c5a604826854b78 Mon Sep 17 00:00:00 2001 From: p-wysocki Date: Mon, 17 Jun 2024 15:14:04 +0200 Subject: [PATCH 03/14] Apply CR --- src/plugins/intel_cpu/src/nodes/col2im.cpp | 23 +++++++++++++------ src/plugins/intel_cpu/src/nodes/col2im.h | 1 + .../custom/single_layer_tests/col2im.cpp | 11 ++++++++- 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/src/plugins/intel_cpu/src/nodes/col2im.cpp b/src/plugins/intel_cpu/src/nodes/col2im.cpp index 0d6324de35bfe3..cc73f480395a37 100644 --- a/src/plugins/intel_cpu/src/nodes/col2im.cpp +++ b/src/plugins/intel_cpu/src/nodes/col2im.cpp @@ -5,21 +5,33 @@ #include "col2im.h" #include "common/cpu_convert.h" #include "openvino/reference/col2im.hpp" - -#include +#include "openvino/op/col2im.hpp" namespace ov { namespace intel_cpu { namespace node { Col2Im::Col2Im(const std::shared_ptr& op, const GraphContext::CPtr context) : Node(op, context, NgraphShapeInferFactory(op, EMPTY_PORT_MASK)) { - const auto col2Im = ov::as_type_ptr(op); + const auto col2Im = ov::as_type_ptr(op); strides = col2Im->get_strides(); dilations = col2Im->get_dilations(); padsBegin = col2Im->get_pads_begin(); padsEnd = col2Im->get_pads_end(); } +bool Col2Im::isSupportedOperation(const std::shared_ptr& op, std::string& errorMessage) noexcept { + try { + const auto col2Im = std::dynamic_pointer_cast(op); + if (!col2Im) { + errorMessage = "Only opset15 Col2Im operation is supported"; + return false; + } + } catch (...) { + return false; + } + return true; +} + void Col2Im::getSupportedDescriptors() { // Validation is already done in the ov::opset15::Col2Im. } @@ -104,11 +116,8 @@ void Col2Im::execute(dnnl::stream strm) { OV_SWITCH(intel_cpu, Col2ImExecute, ctx, std::tie(dataPrecision, indexPrecision), OV_CASE2(ov::element::f32, ov::element::i32, float, uint64_t), - OV_CASE2(ov::element::f32, ov::element::i64, float, uint64_t), OV_CASE2(ov::element::f16, ov::element::i32, float, uint64_t), - OV_CASE2(ov::element::f16, ov::element::i64, float, uint64_t), - OV_CASE2(ov::element::i32, ov::element::i32, uint32_t, uint64_t), - OV_CASE2(ov::element::i32, ov::element::i64, uint32_t, uint64_t)) + OV_CASE2(ov::element::i32, ov::element::i32, uint32_t, uint64_t)) } } // namespace node } // namespace intel_cpu diff --git a/src/plugins/intel_cpu/src/nodes/col2im.h b/src/plugins/intel_cpu/src/nodes/col2im.h index 9f0534fdfef28f..9904689e53be0f 100644 --- a/src/plugins/intel_cpu/src/nodes/col2im.h +++ b/src/plugins/intel_cpu/src/nodes/col2im.h @@ -14,6 +14,7 @@ class Col2Im : public Node { public: Col2Im(const std::shared_ptr& op, const GraphContext::CPtr context); + static bool isSupportedOperation(const std::shared_ptr& op, std::string& errorMessage) noexcept; void getSupportedDescriptors() override; void initSupportedPrimitiveDescriptors() override; void execute(dnnl::stream strm) override; diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/col2im.cpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/col2im.cpp index 9d682fd4d8d3d8..fbe7408ffb6394 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/col2im.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/col2im.cpp @@ -112,7 +112,7 @@ class Col2ImLayerCPUTest : public testing::WithParamInterface(inputPrecision, dataInputShape.second[0]); + auto dataParameter = std::make_shared(inputPrecision, inputDynamicShapes[0]); auto outputSizeConst = std::make_shared(indexPrecision, ov::Shape{ 2 }, outputSize); auto kernelSizeConst = std::make_shared(indexPrecision, ov::Shape{ 2 }, kernelSize); @@ -195,6 +195,15 @@ const std::vector col2ImParamsVector = { ov::Shape{1, 0}, ov::Shape{0, 1} }, + Col2ImSpecificParams { + InputShape{{-1, -1, -1}, {{1, 12, 120}, {3, 12, 120}}}, + std::vector{16, 16}, + std::vector{2, 2}, + ov::Strides{2, 1}, + ov::Strides{2, 2}, + ov::Shape{1, 0}, + ov::Shape{0, 1} + }, Col2ImSpecificParams { InputShape{{}, {{12, 12, 324}}}, std::vector{32, 32}, From 4173576f04d81eb0142f443436fa99adb90656d2 Mon Sep 17 00:00:00 2001 From: p-wysocki Date: Wed, 26 Jun 2024 13:57:18 +0200 Subject: [PATCH 04/14] Apply CR --- .../include/openvino/reference/col2im.hpp | 4 +- src/plugins/intel_cpu/src/nodes/col2im.cpp | 43 +++++++------------ .../custom/single_layer_tests/col2im.cpp | 34 +++++++++++++++ 3 files changed, 51 insertions(+), 30 deletions(-) diff --git a/src/core/reference/include/openvino/reference/col2im.hpp b/src/core/reference/include/openvino/reference/col2im.hpp index 5219d045e37440..498c4265dc59bb 100644 --- a/src/core/reference/include/openvino/reference/col2im.hpp +++ b/src/core/reference/include/openvino/reference/col2im.hpp @@ -48,10 +48,10 @@ void col2im(const T* data, const auto channel_idx = column / kernel_product; for (int64_t column_height_idx = 0; column_height_idx < original_height; ++column_height_idx) { - const T_idx image_height_idx = get_image_dimension_index(column_height_idx, height_offset, 0); + const int64_t image_height_idx = get_image_dimension_index(column_height_idx, height_offset, 0); if (image_height_idx >= 0 && image_height_idx < output_size[0]) { for (int64_t column_width_idx = 0; column_width_idx < original_width; ++column_width_idx) { - const T_idx image_width_idx = get_image_dimension_index(column_width_idx, width_offset, 1); + const int64_t image_width_idx = get_image_dimension_index(column_width_idx, width_offset, 1); if (image_width_idx >= 0 && image_width_idx < output_size[1]) { const int64_t img_idx = ((batch * channel_count + channel_idx) * output_size[0] + image_height_idx) * diff --git a/src/plugins/intel_cpu/src/nodes/col2im.cpp b/src/plugins/intel_cpu/src/nodes/col2im.cpp index cc73f480395a37..878c10ca436c58 100644 --- a/src/plugins/intel_cpu/src/nodes/col2im.cpp +++ b/src/plugins/intel_cpu/src/nodes/col2im.cpp @@ -12,6 +12,10 @@ namespace intel_cpu { namespace node { Col2Im::Col2Im(const std::shared_ptr& op, const GraphContext::CPtr context) : Node(op, context, NgraphShapeInferFactory(op, EMPTY_PORT_MASK)) { + std::string errorMessage; + if (!isSupportedOperation(op, errorMessage)) { + OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage); + } const auto col2Im = ov::as_type_ptr(op); strides = col2Im->get_strides(); dilations = col2Im->get_dilations(); @@ -21,8 +25,7 @@ Col2Im::Col2Im(const std::shared_ptr& op, const GraphContext::CPtr con bool Col2Im::isSupportedOperation(const std::shared_ptr& op, std::string& errorMessage) noexcept { try { - const auto col2Im = std::dynamic_pointer_cast(op); - if (!col2Im) { + if (!ov::is_type(op)) { errorMessage = "Only opset15 Col2Im operation is supported"; return false; } @@ -39,14 +42,10 @@ void Col2Im::getSupportedDescriptors() { void Col2Im::initSupportedPrimitiveDescriptors() { if (!supportedPrimitiveDescriptors.empty()) return; - ov::element::Type dataPrecision = getOriginalInputPrecisionAtPort(0); - ov::element::Type indexPrecision = getOriginalInputPrecisionAtPort(1); - ov::element::Type outputPrecision = getOriginalOutputPrecisionAtPort(0); - addSupportedPrimDesc( - {{LayoutType::ncsp, dataPrecision}, {LayoutType::ncsp, indexPrecision}, {LayoutType::ncsp, indexPrecision}}, - {{LayoutType::ncsp, outputPrecision}}, + {{LayoutType::ncsp, dataPrecision}, {LayoutType::ncsp, ov::element::i32}, {LayoutType::ncsp, ov::element::i32}}, + {{LayoutType::ncsp, dataPrecision}}, impl_desc_type::ref); } @@ -64,26 +63,11 @@ void Col2Im::executeDynamicImpl(dnnl::stream strm) { template void Col2Im::executeImpl() { - const auto indexPrecision = getSrcMemoryAtPort(1)->getPrecision(); - std::vector outputSizeVector(2); - cpu_convert(getSrcMemoryAtPort(1)->getData(), - outputSizeVector.data(), - indexPrecision, - ov::element::i64, - 2); - - std::vector kernelSizeVector(2); - cpu_convert(getSrcMemoryAtPort(2)->getData(), - kernelSizeVector.data(), - indexPrecision, - ov::element::i64, - 2); - ov::reference::col2im( getSrcDataAtPortAs(0), ov::Shape{getSrcMemoryAtPort(0)->getStaticDims()}, - outputSizeVector.data(), - kernelSizeVector.data(), + getSrcDataAtPortAs(1), + getSrcDataAtPortAs(2), getDstDataAtPortAs(0), strides, dilations, @@ -115,9 +99,12 @@ void Col2Im::execute(dnnl::stream strm) { }; OV_SWITCH(intel_cpu, Col2ImExecute, ctx, std::tie(dataPrecision, indexPrecision), - OV_CASE2(ov::element::f32, ov::element::i32, float, uint64_t), - OV_CASE2(ov::element::f16, ov::element::i32, float, uint64_t), - OV_CASE2(ov::element::i32, ov::element::i32, uint32_t, uint64_t)) + OV_CASE2(ov::element::f32, ov::element::i32, float, int32_t), + OV_CASE2(ov::element::f16, ov::element::i32, ov::float16, int32_t), + OV_CASE2(ov::element::bf16, ov::element::i32, ov::bfloat16, int32_t), + OV_CASE2(ov::element::i32, ov::element::i32, int32_t, int32_t), + OV_CASE2(ov::element::i8, ov::element::i32, int8_t, int32_t), + OV_CASE2(ov::element::u8, ov::element::i32, uint8_t, int32_t)) } } // namespace node } // namespace intel_cpu diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/col2im.cpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/col2im.cpp index fbe7408ffb6394..5c1bfd9fcde065 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/col2im.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/col2im.cpp @@ -126,6 +126,10 @@ class Col2ImLayerCPUTest : public testing::WithParamInterface Date: Sat, 29 Jun 2024 17:45:26 +0200 Subject: [PATCH 05/14] Check hardware support --- .../tests/functional/custom/single_layer_tests/col2im.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/col2im.cpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/col2im.cpp index 5c1bfd9fcde065..d85d96da8c204f 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/col2im.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/col2im.cpp @@ -5,6 +5,7 @@ #include "utils/cpu_test_utils.hpp" #include "common_test_utils/ov_tensor_utils.hpp" #include "shared_test_classes/base/ov_subgraph.hpp" +#include "utils/precision_support.h" using namespace CPUTestUtils; @@ -127,7 +128,7 @@ class Col2ImLayerCPUTest : public testing::WithParamInterface Date: Mon, 1 Jul 2024 12:05:50 +0200 Subject: [PATCH 06/14] Skip bf16 tests --- src/plugins/intel_cpu/src/nodes/col2im.cpp | 2 +- .../functional/shared_tests_instances/skip_tests_config.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/intel_cpu/src/nodes/col2im.cpp b/src/plugins/intel_cpu/src/nodes/col2im.cpp index 878c10ca436c58..2a071ad01e4d24 100644 --- a/src/plugins/intel_cpu/src/nodes/col2im.cpp +++ b/src/plugins/intel_cpu/src/nodes/col2im.cpp @@ -3,7 +3,6 @@ // #include "col2im.h" -#include "common/cpu_convert.h" #include "openvino/reference/col2im.hpp" #include "openvino/op/col2im.hpp" @@ -43,6 +42,7 @@ void Col2Im::initSupportedPrimitiveDescriptors() { if (!supportedPrimitiveDescriptors.empty()) return; ov::element::Type dataPrecision = getOriginalInputPrecisionAtPort(0); + std::cout << "\n\nCol2Im::initSupportedPrimitiveDescriptors dataPrecision = " << dataPrecision << "\n\n"; addSupportedPrimDesc( {{LayoutType::ncsp, dataPrecision}, {LayoutType::ncsp, ov::element::i32}, {LayoutType::ncsp, ov::element::i32}}, {{LayoutType::ncsp, dataPrecision}}, diff --git a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/skip_tests_config.cpp b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/skip_tests_config.cpp index e64ebb504f93ac..223e9c433c109b 100644 --- a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/skip_tests_config.cpp +++ b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/skip_tests_config.cpp @@ -315,6 +315,8 @@ std::vector disabledTestPatterns() { // Issue: 142997 R"(.*smoke_TestsROIAlign_max/ROIAlignLayerTest.Inference/IS=\(\[\]\)_TS=\{\(2.8.20.20\)\}_coordShape=\(2.4\)_pooledH=2_pooledW=2_spatialScale=0.625_poolingRatio=2_poolingMode=max_modelType=f32_trgDev=CPU*)", R"(.*smoke_TestsROIAlign_average/ROIAlignLayerTest.Inference/IS=\(\[\]\)_TS=\{\(3.8.16.16\)\}_coordShape=\(2.4\)_pooledH=2_pooledW=2_spatialScale=1_poolingRatio=2_poolingMode=avg_modelType=f32_trgDev=CPU*)", + // Issue: 145726 + R"(.*smoke_Col2ImLayoutTestBF16/Col2ImLayerCPUTest.CompareWithRefs.*)", }; // fp32 floor for bf16 models: conversion issue From f6cf664951d40f613839ff09ceca960c43d80c73 Mon Sep 17 00:00:00 2001 From: p-wysocki Date: Mon, 1 Jul 2024 15:12:39 +0200 Subject: [PATCH 07/14] Apply CR --- src/plugins/intel_cpu/src/nodes/col2im.cpp | 1 - .../custom/single_layer_tests/col2im.cpp | 19 +++++-------------- .../skip_tests_config.cpp | 2 -- 3 files changed, 5 insertions(+), 17 deletions(-) diff --git a/src/plugins/intel_cpu/src/nodes/col2im.cpp b/src/plugins/intel_cpu/src/nodes/col2im.cpp index 2a071ad01e4d24..0ec2d8af23e125 100644 --- a/src/plugins/intel_cpu/src/nodes/col2im.cpp +++ b/src/plugins/intel_cpu/src/nodes/col2im.cpp @@ -42,7 +42,6 @@ void Col2Im::initSupportedPrimitiveDescriptors() { if (!supportedPrimitiveDescriptors.empty()) return; ov::element::Type dataPrecision = getOriginalInputPrecisionAtPort(0); - std::cout << "\n\nCol2Im::initSupportedPrimitiveDescriptors dataPrecision = " << dataPrecision << "\n\n"; addSupportedPrimDesc( {{LayoutType::ncsp, dataPrecision}, {LayoutType::ncsp, ov::element::i32}, {LayoutType::ncsp, ov::element::i32}}, {{LayoutType::ncsp, dataPrecision}}, diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/col2im.cpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/col2im.cpp index d85d96da8c204f..0be9eaefcab164 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/col2im.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/col2im.cpp @@ -128,8 +128,8 @@ class Col2ImLayerCPUTest : public testing::WithParamInterface disabledTestPatterns() { R"(.*smoke_LoopForCommon/LoopLayerCPUTest.CompareWithRefs/Input0_IS=\[1..10.1.1..10\]_.*_Input1_IS=\[1..8.1.1..8\]_.*_Input2_IS=\[1..10.\?.1..10\]_TS=.*_types=0_0_1_trip_count_type=.*_trip_count=(1|5)_exec_cond=1_netType=i8.*)", // Issue: 142997 R"(.*smoke_TestsROIAlign.*)", - // Issue: 145726 - R"(.*smoke_Col2ImLayoutTestBF16/Col2ImLayerCPUTest.CompareWithRefs.*)", }; // fp32 floor for bf16 models: conversion issue From 8eeca44ad7cbf170dd66dc1d6a18e1be76395301 Mon Sep 17 00:00:00 2001 From: p-wysocki Date: Tue, 2 Jul 2024 10:52:22 +0200 Subject: [PATCH 08/14] temp --- .../{ => classes}/col2im.cpp | 179 +---------------- .../single_layer_tests/classes/col2im.hpp | 181 ++++++++++++++++++ .../instances/common/col2im.cpp | 45 +++++ .../instances/x64/col2im.cpp | 25 +++ 4 files changed, 253 insertions(+), 177 deletions(-) rename src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/{ => classes}/col2im.cpp (50%) create mode 100644 src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/col2im.hpp create mode 100644 src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/common/col2im.cpp create mode 100644 src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/x64/col2im.cpp diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/col2im.cpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/col2im.cpp similarity index 50% rename from src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/col2im.cpp rename to src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/col2im.cpp index 0be9eaefcab164..fabcf9d0b7bc6a 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/col2im.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/col2im.cpp @@ -11,6 +11,7 @@ using namespace CPUTestUtils; namespace ov { namespace test { +namespace Col2Im { using Col2ImSpecificParams = std::tuple< InputShape, // data shape std::vector, // output size values @@ -138,182 +139,6 @@ TEST_P(Col2ImLayerCPUTest, CompareWithRefs) { run(); CheckPluginRelatedResults(compiledModel, "Col2Im"); } - -namespace { -const std::vector indexPrecisions = { - ElementType::i32, - ElementType::i64 -}; - -const std::vector col2ImParamsVector = { - Col2ImSpecificParams { - InputShape{{}, {{1, 12, 9}}}, - std::vector{4, 4}, - std::vector{2, 2}, - ov::Strides{1, 1}, - ov::Strides{1, 1}, - ov::Shape{0, 0}, - ov::Shape{0, 0} - }, - Col2ImSpecificParams { - InputShape{{}, {{3, 12, 81}}}, - std::vector{16, 16}, - std::vector{2, 2}, - ov::Strides{2, 2}, - ov::Strides{2, 2}, - ov::Shape{2, 2}, - ov::Shape{2, 2} - }, - Col2ImSpecificParams { - InputShape{{}, {{12, 81}}}, - std::vector{16, 16}, - std::vector{2, 2}, - ov::Strides{2, 2}, - ov::Strides{2, 2}, - ov::Shape{2, 2}, - ov::Shape{2, 2} - }, - Col2ImSpecificParams { - InputShape{{}, {{3, 12, 225}}}, - std::vector{16, 16}, - std::vector{2, 2}, - ov::Strides{1, 1}, - ov::Strides{1, 1}, - ov::Shape{0, 0}, - ov::Shape{0, 0} - }, - Col2ImSpecificParams { - InputShape{{}, {{1, 27, 49}}}, - std::vector{16, 16}, - std::vector{3, 3}, - ov::Strides{2, 2}, - ov::Strides{2, 2}, - ov::Shape{1, 1}, - ov::Shape{1, 1} - }, - Col2ImSpecificParams { - InputShape{{}, {{1, 18, 104}}}, - std::vector{16, 16}, - std::vector{2, 3}, - ov::Strides{2, 1}, - ov::Strides{2, 2}, - ov::Shape{1, 0}, - ov::Shape{0, 1} - }, - Col2ImSpecificParams { - InputShape{{-1, -1, -1}, {{1, 12, 120}, {3, 12, 120}}}, - std::vector{16, 16}, - std::vector{2, 2}, - ov::Strides{2, 1}, - ov::Strides{2, 2}, - ov::Shape{1, 0}, - ov::Shape{0, 1} - }, - Col2ImSpecificParams { - InputShape{{}, {{12, 12, 324}}}, - std::vector{32, 32}, - std::vector{2, 2}, - ov::Strides{2, 2}, - ov::Strides{2, 2}, - ov::Shape{3, 3}, - ov::Shape{3, 3} - }, - Col2ImSpecificParams { - InputShape{{-1, 12, 324}, {{12, 12, 324}}}, - std::vector{32, 32}, - std::vector{2, 2}, - ov::Strides{2, 2}, - ov::Strides{2, 2}, - ov::Shape{3, 3}, - ov::Shape{3, 3} - }, - Col2ImSpecificParams { - InputShape{{-1, -1, -1}, {{12, 12, 324}}}, - std::vector{32, 32}, - std::vector{2, 2}, - ov::Strides{2, 2}, - ov::Strides{2, 2}, - ov::Shape{3, 3}, - ov::Shape{3, 3} - }, - Col2ImSpecificParams { - InputShape{{12, -1, -1}, {{12, 12, 324}}}, - std::vector{32, 32}, - std::vector{2, 2}, - ov::Strides{2, 2}, - ov::Strides{2, 2}, - ov::Shape{3, 3}, - ov::Shape{3, 3} - }, - Col2ImSpecificParams { - InputShape{{12, 12, -1}, {{12, 12, 324}}}, - std::vector{32, 32}, - std::vector{2, 2}, - ov::Strides{2, 2}, - ov::Strides{2, 2}, - ov::Shape{3, 3}, - ov::Shape{3, 3} - }, - Col2ImSpecificParams { - InputShape{{12, -1, 324}, {{12, 12, 324}}}, - std::vector{32, 32}, - std::vector{2, 2}, - ov::Strides{2, 2}, - ov::Strides{2, 2}, - ov::Shape{3, 3}, - ov::Shape{3, 3} - }, - Col2ImSpecificParams { - InputShape{{-1, -1}, {{12, 324}}}, - std::vector{32, 32}, - std::vector{2, 2}, - ov::Strides{2, 2}, - ov::Strides{2, 2}, - ov::Shape{3, 3}, - ov::Shape{3, 3} - } -}; - -INSTANTIATE_TEST_SUITE_P(smoke_Col2ImLayoutTestF32, Col2ImLayerCPUTest, - ::testing::Combine( - ::testing::Combine( - ::testing::ValuesIn(col2ImParamsVector), - ::testing::ValuesIn(std::vector{ElementType::f32, ElementType::f16}), - ::testing::ValuesIn(indexPrecisions), - ::testing::Values(ov::test::utils::DEVICE_CPU)), - ::testing::Values(CPUSpecificParams{{}, {}, {}, "ref_f32"})), - Col2ImLayerCPUTest::getTestCaseName); - -INSTANTIATE_TEST_SUITE_P(smoke_Col2ImLayoutTestBF16, Col2ImLayerCPUTest, - ::testing::Combine( - ::testing::Combine( - ::testing::ValuesIn(col2ImParamsVector), - ::testing::Values(ElementType::bf16), - ::testing::ValuesIn(indexPrecisions), - ::testing::Values(ov::test::utils::DEVICE_CPU)), - ::testing::Values(CPUSpecificParams{{}, {}, {}, "ref_bf16"})), - Col2ImLayerCPUTest::getTestCaseName); - -INSTANTIATE_TEST_SUITE_P(smoke_Col2ImLayoutTestI32, Col2ImLayerCPUTest, - ::testing::Combine( - ::testing::Combine( - ::testing::ValuesIn(col2ImParamsVector), - ::testing::Values(ElementType::i32), - ::testing::ValuesIn(indexPrecisions), - ::testing::Values(ov::test::utils::DEVICE_CPU)), - ::testing::Values(CPUSpecificParams{{}, {}, {}, "ref_i32"})), - Col2ImLayerCPUTest::getTestCaseName); - -INSTANTIATE_TEST_SUITE_P(smoke_Col2ImLayoutTestUI8, Col2ImLayerCPUTest, - ::testing::Combine( - ::testing::Combine( - ::testing::ValuesIn(col2ImParamsVector), - ::testing::Values(ElementType::u8, ElementType::i8), - ::testing::ValuesIn(indexPrecisions), - ::testing::Values(ov::test::utils::DEVICE_CPU)), - ::testing::Values(CPUSpecificParams{{}, {}, {}, "ref_i8"})), - Col2ImLayerCPUTest::getTestCaseName); - -} // namespace +} // namespace Col2Im } // namespace test } // namespace ov diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/col2im.hpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/col2im.hpp new file mode 100644 index 00000000000000..a47d8b63b037e0 --- /dev/null +++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/col2im.hpp @@ -0,0 +1,181 @@ +// Copyright (C) 2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include "shared_test_classes/base/ov_subgraph.hpp" +#include "common_test_utils/ov_tensor_utils.hpp" +#include "utils/fusing_test_utils.hpp" +#include "utils/cpu_test_utils.hpp" +#include "gtest/gtest.h" + +using namespace CPUTestUtils; + +namespace ov { +namespace test { +namespace Col2Im { +using Col2ImSpecificParams = std::tuple< + InputShape, // data shape + std::vector, // output size values + std::vector, // kernel size values + ov::Strides, // strides + ov::Strides, // dilations + ov::Shape, // pads_begin + ov::Shape // pads_end +>; + +using Col2ImLayerTestParams = std::tuple< + Col2ImSpecificParams, + ElementType, // data precision + ElementType, // index precision + ov::test::TargetDevice // device name +>; + +using Col2ImLayerCPUTestParamsSet = std::tuple< + Col2ImLayerTestParams, + CPUSpecificParams>; + +class Col2ImLayerCPUTest : public testing::WithParamInterface, + public SubgraphBaseTest, public CPUTestsBase { +protected: + void SetUp() override; + void generate_inputs(); +}; + +const std::vector indexPrecisions = { + ElementType::i32, + ElementType::i64 +}; + +const std::vector col2ImParamsVector = { + Col2ImSpecificParams { + InputShape{{}, {{1, 12, 9}}}, + std::vector{4, 4}, + std::vector{2, 2}, + ov::Strides{1, 1}, + ov::Strides{1, 1}, + ov::Shape{0, 0}, + ov::Shape{0, 0} + }, + Col2ImSpecificParams { + InputShape{{}, {{3, 12, 81}}}, + std::vector{16, 16}, + std::vector{2, 2}, + ov::Strides{2, 2}, + ov::Strides{2, 2}, + ov::Shape{2, 2}, + ov::Shape{2, 2} + }, + Col2ImSpecificParams { + InputShape{{}, {{12, 81}}}, + std::vector{16, 16}, + std::vector{2, 2}, + ov::Strides{2, 2}, + ov::Strides{2, 2}, + ov::Shape{2, 2}, + ov::Shape{2, 2} + }, + Col2ImSpecificParams { + InputShape{{}, {{3, 12, 225}}}, + std::vector{16, 16}, + std::vector{2, 2}, + ov::Strides{1, 1}, + ov::Strides{1, 1}, + ov::Shape{0, 0}, + ov::Shape{0, 0} + }, + Col2ImSpecificParams { + InputShape{{}, {{1, 27, 49}}}, + std::vector{16, 16}, + std::vector{3, 3}, + ov::Strides{2, 2}, + ov::Strides{2, 2}, + ov::Shape{1, 1}, + ov::Shape{1, 1} + }, + Col2ImSpecificParams { + InputShape{{}, {{1, 18, 104}}}, + std::vector{16, 16}, + std::vector{2, 3}, + ov::Strides{2, 1}, + ov::Strides{2, 2}, + ov::Shape{1, 0}, + ov::Shape{0, 1} + }, + Col2ImSpecificParams { + InputShape{{-1, -1, -1}, {{1, 12, 120}, {3, 12, 120}}}, + std::vector{16, 16}, + std::vector{2, 2}, + ov::Strides{2, 1}, + ov::Strides{2, 2}, + ov::Shape{1, 0}, + ov::Shape{0, 1} + }, + Col2ImSpecificParams { + InputShape{{}, {{12, 12, 324}}}, + std::vector{32, 32}, + std::vector{2, 2}, + ov::Strides{2, 2}, + ov::Strides{2, 2}, + ov::Shape{3, 3}, + ov::Shape{3, 3} + }, + Col2ImSpecificParams { + InputShape{{-1, 12, 324}, {{12, 12, 324}}}, + std::vector{32, 32}, + std::vector{2, 2}, + ov::Strides{2, 2}, + ov::Strides{2, 2}, + ov::Shape{3, 3}, + ov::Shape{3, 3} + }, + Col2ImSpecificParams { + InputShape{{-1, -1, -1}, {{12, 12, 324}}}, + std::vector{32, 32}, + std::vector{2, 2}, + ov::Strides{2, 2}, + ov::Strides{2, 2}, + ov::Shape{3, 3}, + ov::Shape{3, 3} + }, + Col2ImSpecificParams { + InputShape{{12, -1, -1}, {{12, 12, 324}}}, + std::vector{32, 32}, + std::vector{2, 2}, + ov::Strides{2, 2}, + ov::Strides{2, 2}, + ov::Shape{3, 3}, + ov::Shape{3, 3} + }, + Col2ImSpecificParams { + InputShape{{12, 12, -1}, {{12, 12, 324}}}, + std::vector{32, 32}, + std::vector{2, 2}, + ov::Strides{2, 2}, + ov::Strides{2, 2}, + ov::Shape{3, 3}, + ov::Shape{3, 3} + }, + Col2ImSpecificParams { + InputShape{{12, -1, 324}, {{12, 12, 324}}}, + std::vector{32, 32}, + std::vector{2, 2}, + ov::Strides{2, 2}, + ov::Strides{2, 2}, + ov::Shape{3, 3}, + ov::Shape{3, 3} + }, + Col2ImSpecificParams { + InputShape{{-1, -1}, {{12, 324}}}, + std::vector{32, 32}, + std::vector{2, 2}, + ov::Strides{2, 2}, + ov::Strides{2, 2}, + ov::Shape{3, 3}, + ov::Shape{3, 3} + } +}; +} // namespace Col2Im +} // namespace test +} // namespace ov \ No newline at end of file diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/common/col2im.cpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/common/col2im.cpp new file mode 100644 index 00000000000000..57a4ea0cb454b2 --- /dev/null +++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/common/col2im.cpp @@ -0,0 +1,45 @@ +// Copyright (C) 2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "custom/single_layer_tests/classes/col2im.hpp" +#include "utils/cpu_test_utils.hpp" +#include "utils/fusing_test_utils.hpp" + +using namespace CPUTestUtils; + +namespace ov { +namespace test { +namespace Col2Im { +INSTANTIATE_TEST_SUITE_P(smoke_Col2ImLayoutTestF32, Col2ImLayerCPUTest, + ::testing::Combine( + ::testing::Combine( + ::testing::ValuesIn(col2ImParamsVector), + ::testing::ValuesIn(std::vector{ElementType::f32, ElementType::f16}), + ::testing::ValuesIn(indexPrecisions), + ::testing::Values(ov::test::utils::DEVICE_CPU)), + ::testing::Values(CPUSpecificParams{{}, {}, {}, "ref_f32"})), + Col2ImLayerCPUTest::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P(smoke_Col2ImLayoutTestI32, Col2ImLayerCPUTest, + ::testing::Combine( + ::testing::Combine( + ::testing::ValuesIn(col2ImParamsVector), + ::testing::Values(ElementType::i32), + ::testing::ValuesIn(indexPrecisions), + ::testing::Values(ov::test::utils::DEVICE_CPU)), + ::testing::Values(CPUSpecificParams{{}, {}, {}, "ref_i32"})), + Col2ImLayerCPUTest::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P(smoke_Col2ImLayoutTestUI8, Col2ImLayerCPUTest, + ::testing::Combine( + ::testing::Combine( + ::testing::ValuesIn(col2ImParamsVector), + ::testing::Values(ElementType::u8, ElementType::i8), + ::testing::ValuesIn(indexPrecisions), + ::testing::Values(ov::test::utils::DEVICE_CPU)), + ::testing::Values(CPUSpecificParams{{}, {}, {}, "ref_i8"})), + Col2ImLayerCPUTest::getTestCaseName); +} // namespace Col2Im +} // namespace test +} // namespace ov \ No newline at end of file diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/x64/col2im.cpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/x64/col2im.cpp new file mode 100644 index 00000000000000..67ed54638e6468 --- /dev/null +++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/x64/col2im.cpp @@ -0,0 +1,25 @@ +// Copyright (C) 2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "custom/single_layer_tests/classes/col2im.hpp" +#include "utils/cpu_test_utils.hpp" +#include "utils/fusing_test_utils.hpp" + +using namespace CPUTestUtils; + +namespace ov { +namespace test { +namespace Col2Im { +INSTANTIATE_TEST_SUITE_P(smoke_Col2ImLayoutTestBF16, Col2ImLayerCPUTest, + ::testing::Combine( + ::testing::Combine( + ::testing::ValuesIn(col2ImParamsVector), + ::testing::Values(ElementType::bf16), + ::testing::ValuesIn(indexPrecisions), + ::testing::Values(ov::test::utils::DEVICE_CPU)), + ::testing::Values(CPUSpecificParams{{}, {}, {}, "ref_bf16"})), + Col2ImLayerCPUTest::getTestCaseName); +} // namespace Col2Im +} // namespace test +} // namespace ov \ No newline at end of file From 567c30ce01976aa0ba11cc1a19c2cb5d02bf2a8d Mon Sep 17 00:00:00 2001 From: p-wysocki Date: Tue, 2 Jul 2024 11:18:54 +0200 Subject: [PATCH 09/14] Move tests --- .../single_layer_tests/classes/col2im.cpp | 145 ++++++++++++++++-- .../single_layer_tests/classes/col2im.hpp | 133 +--------------- 2 files changed, 140 insertions(+), 138 deletions(-) diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/col2im.cpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/col2im.cpp index fabcf9d0b7bc6a..4cb77277ef31e3 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/col2im.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/col2im.cpp @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "col2im.hpp" #include "utils/cpu_test_utils.hpp" #include "common_test_utils/ov_tensor_utils.hpp" #include "shared_test_classes/base/ov_subgraph.hpp" @@ -33,10 +34,7 @@ using Col2ImLayerCPUTestParamsSet = std::tuple< Col2ImLayerTestParams, CPUSpecificParams>; -class Col2ImLayerCPUTest : public testing::WithParamInterface, - public SubgraphBaseTest, public CPUTestsBase { -public: - static std::string getTestCaseName(testing::TestParamInfo obj) { +std::string Col2ImLayerCPUTest::getTestCaseName(testing::TestParamInfo obj) { Col2ImLayerTestParams basicParamsSet; CPUSpecificParams cpuParams; std::tie(basicParamsSet, cpuParams) = obj.param; @@ -76,8 +74,8 @@ class Col2ImLayerCPUTest : public testing::WithParamInterface& targetInputStaticShapes) override { + +void Col2ImLayerCPUTest::generate_inputs(const std::vector& targetInputStaticShapes) { inputs.clear(); const auto& funcInputs = function->inputs(); @@ -92,7 +90,7 @@ class Col2ImLayerCPUTest : public testing::WithParamInterfaceGetParam(); @@ -132,13 +130,142 @@ class Col2ImLayerCPUTest : public testing::WithParamInterface col2ImParamsVector = { + Col2ImSpecificParams { + InputShape{{}, {{1, 12, 9}}}, + std::vector{4, 4}, + std::vector{2, 2}, + ov::Strides{1, 1}, + ov::Strides{1, 1}, + ov::Shape{0, 0}, + ov::Shape{0, 0} + }, + Col2ImSpecificParams { + InputShape{{}, {{3, 12, 81}}}, + std::vector{16, 16}, + std::vector{2, 2}, + ov::Strides{2, 2}, + ov::Strides{2, 2}, + ov::Shape{2, 2}, + ov::Shape{2, 2} + }, + Col2ImSpecificParams { + InputShape{{}, {{12, 81}}}, + std::vector{16, 16}, + std::vector{2, 2}, + ov::Strides{2, 2}, + ov::Strides{2, 2}, + ov::Shape{2, 2}, + ov::Shape{2, 2} + }, + Col2ImSpecificParams { + InputShape{{}, {{3, 12, 225}}}, + std::vector{16, 16}, + std::vector{2, 2}, + ov::Strides{1, 1}, + ov::Strides{1, 1}, + ov::Shape{0, 0}, + ov::Shape{0, 0} + }, + Col2ImSpecificParams { + InputShape{{}, {{1, 27, 49}}}, + std::vector{16, 16}, + std::vector{3, 3}, + ov::Strides{2, 2}, + ov::Strides{2, 2}, + ov::Shape{1, 1}, + ov::Shape{1, 1} + }, + Col2ImSpecificParams { + InputShape{{}, {{1, 18, 104}}}, + std::vector{16, 16}, + std::vector{2, 3}, + ov::Strides{2, 1}, + ov::Strides{2, 2}, + ov::Shape{1, 0}, + ov::Shape{0, 1} + }, + Col2ImSpecificParams { + InputShape{{-1, -1, -1}, {{1, 12, 120}, {3, 12, 120}}}, + std::vector{16, 16}, + std::vector{2, 2}, + ov::Strides{2, 1}, + ov::Strides{2, 2}, + ov::Shape{1, 0}, + ov::Shape{0, 1} + }, + Col2ImSpecificParams { + InputShape{{}, {{12, 12, 324}}}, + std::vector{32, 32}, + std::vector{2, 2}, + ov::Strides{2, 2}, + ov::Strides{2, 2}, + ov::Shape{3, 3}, + ov::Shape{3, 3} + }, + Col2ImSpecificParams { + InputShape{{-1, 12, 324}, {{12, 12, 324}}}, + std::vector{32, 32}, + std::vector{2, 2}, + ov::Strides{2, 2}, + ov::Strides{2, 2}, + ov::Shape{3, 3}, + ov::Shape{3, 3} + }, + Col2ImSpecificParams { + InputShape{{-1, -1, -1}, {{12, 12, 324}}}, + std::vector{32, 32}, + std::vector{2, 2}, + ov::Strides{2, 2}, + ov::Strides{2, 2}, + ov::Shape{3, 3}, + ov::Shape{3, 3} + }, + Col2ImSpecificParams { + InputShape{{12, -1, -1}, {{12, 12, 324}}}, + std::vector{32, 32}, + std::vector{2, 2}, + ov::Strides{2, 2}, + ov::Strides{2, 2}, + ov::Shape{3, 3}, + ov::Shape{3, 3} + }, + Col2ImSpecificParams { + InputShape{{12, 12, -1}, {{12, 12, 324}}}, + std::vector{32, 32}, + std::vector{2, 2}, + ov::Strides{2, 2}, + ov::Strides{2, 2}, + ov::Shape{3, 3}, + ov::Shape{3, 3} + }, + Col2ImSpecificParams { + InputShape{{12, -1, 324}, {{12, 12, 324}}}, + std::vector{32, 32}, + std::vector{2, 2}, + ov::Strides{2, 2}, + ov::Strides{2, 2}, + ov::Shape{3, 3}, + ov::Shape{3, 3} + }, + Col2ImSpecificParams { + InputShape{{-1, -1}, {{12, 324}}}, + std::vector{32, 32}, + std::vector{2, 2}, + ov::Strides{2, 2}, + ov::Strides{2, 2}, + ov::Shape{3, 3}, + ov::Shape{3, 3} + } +}; + } // namespace Col2Im } // namespace test } // namespace ov diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/col2im.hpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/col2im.hpp index a47d8b63b037e0..244c54706ab6a5 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/col2im.hpp +++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/col2im.hpp @@ -38,9 +38,11 @@ using Col2ImLayerCPUTestParamsSet = std::tuple< class Col2ImLayerCPUTest : public testing::WithParamInterface, public SubgraphBaseTest, public CPUTestsBase { +public: + static std::string getTestCaseName(testing::TestParamInfo obj); protected: void SetUp() override; - void generate_inputs(); + void generate_inputs(const std::vector& targetInputStaticShapes); }; const std::vector indexPrecisions = { @@ -48,134 +50,7 @@ const std::vector indexPrecisions = { ElementType::i64 }; -const std::vector col2ImParamsVector = { - Col2ImSpecificParams { - InputShape{{}, {{1, 12, 9}}}, - std::vector{4, 4}, - std::vector{2, 2}, - ov::Strides{1, 1}, - ov::Strides{1, 1}, - ov::Shape{0, 0}, - ov::Shape{0, 0} - }, - Col2ImSpecificParams { - InputShape{{}, {{3, 12, 81}}}, - std::vector{16, 16}, - std::vector{2, 2}, - ov::Strides{2, 2}, - ov::Strides{2, 2}, - ov::Shape{2, 2}, - ov::Shape{2, 2} - }, - Col2ImSpecificParams { - InputShape{{}, {{12, 81}}}, - std::vector{16, 16}, - std::vector{2, 2}, - ov::Strides{2, 2}, - ov::Strides{2, 2}, - ov::Shape{2, 2}, - ov::Shape{2, 2} - }, - Col2ImSpecificParams { - InputShape{{}, {{3, 12, 225}}}, - std::vector{16, 16}, - std::vector{2, 2}, - ov::Strides{1, 1}, - ov::Strides{1, 1}, - ov::Shape{0, 0}, - ov::Shape{0, 0} - }, - Col2ImSpecificParams { - InputShape{{}, {{1, 27, 49}}}, - std::vector{16, 16}, - std::vector{3, 3}, - ov::Strides{2, 2}, - ov::Strides{2, 2}, - ov::Shape{1, 1}, - ov::Shape{1, 1} - }, - Col2ImSpecificParams { - InputShape{{}, {{1, 18, 104}}}, - std::vector{16, 16}, - std::vector{2, 3}, - ov::Strides{2, 1}, - ov::Strides{2, 2}, - ov::Shape{1, 0}, - ov::Shape{0, 1} - }, - Col2ImSpecificParams { - InputShape{{-1, -1, -1}, {{1, 12, 120}, {3, 12, 120}}}, - std::vector{16, 16}, - std::vector{2, 2}, - ov::Strides{2, 1}, - ov::Strides{2, 2}, - ov::Shape{1, 0}, - ov::Shape{0, 1} - }, - Col2ImSpecificParams { - InputShape{{}, {{12, 12, 324}}}, - std::vector{32, 32}, - std::vector{2, 2}, - ov::Strides{2, 2}, - ov::Strides{2, 2}, - ov::Shape{3, 3}, - ov::Shape{3, 3} - }, - Col2ImSpecificParams { - InputShape{{-1, 12, 324}, {{12, 12, 324}}}, - std::vector{32, 32}, - std::vector{2, 2}, - ov::Strides{2, 2}, - ov::Strides{2, 2}, - ov::Shape{3, 3}, - ov::Shape{3, 3} - }, - Col2ImSpecificParams { - InputShape{{-1, -1, -1}, {{12, 12, 324}}}, - std::vector{32, 32}, - std::vector{2, 2}, - ov::Strides{2, 2}, - ov::Strides{2, 2}, - ov::Shape{3, 3}, - ov::Shape{3, 3} - }, - Col2ImSpecificParams { - InputShape{{12, -1, -1}, {{12, 12, 324}}}, - std::vector{32, 32}, - std::vector{2, 2}, - ov::Strides{2, 2}, - ov::Strides{2, 2}, - ov::Shape{3, 3}, - ov::Shape{3, 3} - }, - Col2ImSpecificParams { - InputShape{{12, 12, -1}, {{12, 12, 324}}}, - std::vector{32, 32}, - std::vector{2, 2}, - ov::Strides{2, 2}, - ov::Strides{2, 2}, - ov::Shape{3, 3}, - ov::Shape{3, 3} - }, - Col2ImSpecificParams { - InputShape{{12, -1, 324}, {{12, 12, 324}}}, - std::vector{32, 32}, - std::vector{2, 2}, - ov::Strides{2, 2}, - ov::Strides{2, 2}, - ov::Shape{3, 3}, - ov::Shape{3, 3} - }, - Col2ImSpecificParams { - InputShape{{-1, -1}, {{12, 324}}}, - std::vector{32, 32}, - std::vector{2, 2}, - ov::Strides{2, 2}, - ov::Strides{2, 2}, - ov::Shape{3, 3}, - ov::Shape{3, 3} - } -}; +extern const std::vector col2ImParamsVector; } // namespace Col2Im } // namespace test } // namespace ov \ No newline at end of file From 4dea038b0f68f3db5dd04a26b02e3c0a3a68689b Mon Sep 17 00:00:00 2001 From: p-wysocki Date: Tue, 2 Jul 2024 11:20:25 +0200 Subject: [PATCH 10/14] Minor change --- .../functional/custom/single_layer_tests/classes/col2im.hpp | 2 +- .../custom/single_layer_tests/instances/common/col2im.cpp | 2 +- .../custom/single_layer_tests/instances/x64/col2im.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/col2im.hpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/col2im.hpp index 244c54706ab6a5..28c00c287c88d2 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/col2im.hpp +++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/col2im.hpp @@ -53,4 +53,4 @@ const std::vector indexPrecisions = { extern const std::vector col2ImParamsVector; } // namespace Col2Im } // namespace test -} // namespace ov \ No newline at end of file +} // namespace ov diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/common/col2im.cpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/common/col2im.cpp index 57a4ea0cb454b2..42d9f61018e631 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/common/col2im.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/common/col2im.cpp @@ -42,4 +42,4 @@ INSTANTIATE_TEST_SUITE_P(smoke_Col2ImLayoutTestUI8, Col2ImLayerCPUTest, Col2ImLayerCPUTest::getTestCaseName); } // namespace Col2Im } // namespace test -} // namespace ov \ No newline at end of file +} // namespace ov diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/x64/col2im.cpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/x64/col2im.cpp index 67ed54638e6468..0b2bfa69b4d88c 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/x64/col2im.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/x64/col2im.cpp @@ -22,4 +22,4 @@ INSTANTIATE_TEST_SUITE_P(smoke_Col2ImLayoutTestBF16, Col2ImLayerCPUTest, Col2ImLayerCPUTest::getTestCaseName); } // namespace Col2Im } // namespace test -} // namespace ov \ No newline at end of file +} // namespace ov From 45a89a21db81d3fd2a5c24f01dd1c209317336f1 Mon Sep 17 00:00:00 2001 From: Przemyslaw Wysocki Date: Tue, 2 Jul 2024 11:48:39 +0200 Subject: [PATCH 11/14] Update src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/col2im.hpp Co-authored-by: Maksim Kutakov --- .../functional/custom/single_layer_tests/classes/col2im.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/col2im.hpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/col2im.hpp index 28c00c287c88d2..83d0f7f74334c2 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/col2im.hpp +++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/col2im.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // From 637fc892f6ca77e5c43bc094642d02284807861e Mon Sep 17 00:00:00 2001 From: Przemyslaw Wysocki Date: Tue, 2 Jul 2024 11:48:48 +0200 Subject: [PATCH 12/14] Update src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/x64/col2im.cpp Co-authored-by: Maksim Kutakov --- .../custom/single_layer_tests/instances/x64/col2im.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/x64/col2im.cpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/x64/col2im.cpp index 0b2bfa69b4d88c..2d84fc1164c8a3 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/x64/col2im.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/x64/col2im.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // From 972a2ed106bd0cd79db21386d48879fb1d3d224c Mon Sep 17 00:00:00 2001 From: Przemyslaw Wysocki Date: Tue, 2 Jul 2024 11:48:56 +0200 Subject: [PATCH 13/14] Update src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/common/col2im.cpp Co-authored-by: Maksim Kutakov --- .../custom/single_layer_tests/instances/common/col2im.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/common/col2im.cpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/common/col2im.cpp index 42d9f61018e631..fa07b89fc317c8 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/common/col2im.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/common/col2im.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // From 002eab4903446ad0af893dc5d0305e45ec1eb5c9 Mon Sep 17 00:00:00 2001 From: p-wysocki Date: Tue, 2 Jul 2024 11:57:02 +0200 Subject: [PATCH 14/14] Apply CR --- .../single_layer_tests/classes/col2im.cpp | 21 ------------------- .../single_layer_tests/classes/col2im.hpp | 2 +- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/col2im.cpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/col2im.cpp index 4cb77277ef31e3..3bb0ff903a9ba8 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/col2im.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/col2im.cpp @@ -13,27 +13,6 @@ using namespace CPUTestUtils; namespace ov { namespace test { namespace Col2Im { -using Col2ImSpecificParams = std::tuple< - InputShape, // data shape - std::vector, // output size values - std::vector, // kernel size values - ov::Strides, // strides - ov::Strides, // dilations - ov::Shape, // pads_begin - ov::Shape // pads_end ->; - -using Col2ImLayerTestParams = std::tuple< - Col2ImSpecificParams, - ElementType, // data precision - ElementType, // index precision - ov::test::TargetDevice // device name ->; - -using Col2ImLayerCPUTestParamsSet = std::tuple< - Col2ImLayerTestParams, - CPUSpecificParams>; - std::string Col2ImLayerCPUTest::getTestCaseName(testing::TestParamInfo obj) { Col2ImLayerTestParams basicParamsSet; CPUSpecificParams cpuParams; diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/col2im.hpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/col2im.hpp index 28c00c287c88d2..26ee530363575b 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/col2im.hpp +++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/col2im.hpp @@ -42,7 +42,7 @@ class Col2ImLayerCPUTest : public testing::WithParamInterface obj); protected: void SetUp() override; - void generate_inputs(const std::vector& targetInputStaticShapes); + void generate_inputs(const std::vector& targetInputStaticShapes) override; }; const std::vector indexPrecisions = {