diff --git a/src/common/transformations/src/transformations/op_conversions/convert_interpolate11_downgrade.cpp b/src/common/transformations/src/transformations/op_conversions/convert_interpolate11_downgrade.cpp index 179b81f7bd9e32..44b189d72cdae6 100644 --- a/src/common/transformations/src/transformations/op_conversions/convert_interpolate11_downgrade.cpp +++ b/src/common/transformations/src/transformations/op_conversions/convert_interpolate11_downgrade.cpp @@ -42,9 +42,11 @@ ov::pass::ConvertInterpolate11ToInterpolate4::ConvertInterpolate11ToInterpolate4 ov::op::util::InterpolateBase::ShapeCalcMode::SCALES) { v4_input_scales = interpolate_v11->input_value(1); v4_input_output_shape = opset4::Constant::create(element::i32, Shape{}, {1}); + copy_runtime_info(interpolate_v11, v4_input_output_shape.get_node_shared_ptr()); } else { v4_input_output_shape = interpolate_v11->input_value(1); v4_input_scales = opset4::Constant::create(element::f32, Shape{}, {1.0f}); + copy_runtime_info(interpolate_v11, v4_input_scales.get_node_shared_ptr()); } if (interpolate_v11->get_input_size() == 3) { // with axes input diff --git a/src/common/transformations/tests/op_conversions/convert_interpolate11_downgrade_test.cpp b/src/common/transformations/tests/op_conversions/convert_interpolate11_downgrade_test.cpp index d568ed7abfad7b..fde7f5579868c0 100644 --- a/src/common/transformations/tests/op_conversions/convert_interpolate11_downgrade_test.cpp +++ b/src/common/transformations/tests/op_conversions/convert_interpolate11_downgrade_test.cpp @@ -15,20 +15,47 @@ using namespace testing; -TEST_F(TransformationTestsF, ConvertInterpolate11ToInterpolate4_scales) { - { - auto attributes = ov::opset11::Interpolate::InterpolateAttrs{}; - attributes.shape_calculation_mode = ov::opset11::Interpolate::ShapeCalcMode::SCALES; - attributes.pads_begin = {0, 0}; - attributes.pads_end = {0, 0}; +namespace { +constexpr bool WITH_AXES = true; +constexpr bool WITHOUT_AXES = false; - const auto input = std::make_shared(ov::element::i32, ov::Shape{1, 2, 10, 10}); - const auto scales = std::make_shared(ov::element::f32, ov::Shape{2}); +std::shared_ptr create_v11_model(const bool with_axes, + const ov::opset11::Interpolate::ShapeCalcMode shape_calc_mode) { + auto attributes = ov::opset11::Interpolate::InterpolateAttrs{}; + attributes.shape_calculation_mode = shape_calc_mode; + attributes.pads_begin = {0, 0}; + attributes.pads_end = {0, 0}; + + const auto input = std::make_shared(ov::element::i32, ov::Shape{1, 2, 10, 10}); + std::shared_ptr scales_or_sizes; + std::shared_ptr interpolate; + + const size_t num_scales_or_sizes = with_axes ? 2 : 4; + if (shape_calc_mode == ov::opset11::Interpolate::ShapeCalcMode::SCALES) { + scales_or_sizes = std::make_shared(ov::element::f32, ov::Shape{num_scales_or_sizes}); + } else { + scales_or_sizes = std::make_shared(ov::element::i32, ov::Shape{num_scales_or_sizes}); + } + + ov::ParameterVector model_params; + model_params.push_back(input); + model_params.push_back(scales_or_sizes); + if (with_axes) { const auto axes = std::make_shared(ov::element::i32, ov::Shape{2}); - const auto interpolate = std::make_shared(input, scales, axes, attributes); - interpolate->set_friendly_name("interpolate11"); + model_params.push_back(axes); + interpolate = std::make_shared(input, scales_or_sizes, axes, attributes); + } else { + interpolate = std::make_shared(input, scales_or_sizes, attributes); + } + interpolate->set_friendly_name("interpolate11"); + + return std::make_shared(interpolate->outputs(), model_params); +} +} // namespace - function = std::make_shared(interpolate->outputs(), ov::ParameterVector{input, scales, axes}); +TEST_F(TransformationTestsF, ConvertInterpolate11ToInterpolate4_scales) { + { + function = create_v11_model(WITH_AXES, ov::opset11::Interpolate::ShapeCalcMode::SCALES); manager.register_pass(); } @@ -53,18 +80,7 @@ TEST_F(TransformationTestsF, ConvertInterpolate11ToInterpolate4_scales) { TEST_F(TransformationTestsF, ConvertInterpolate11ToInterpolate4_sizes) { { - auto attributes = ov::opset11::Interpolate::InterpolateAttrs{}; - attributes.shape_calculation_mode = ov::opset11::Interpolate::ShapeCalcMode::SIZES; - attributes.pads_begin = {0, 0}; - attributes.pads_end = {0, 0}; - - const auto input = std::make_shared(ov::element::i32, ov::Shape{1, 2, 10, 10}); - const auto sizes = std::make_shared(ov::element::i32, ov::Shape{2}); - const auto axes = std::make_shared(ov::element::i32, ov::Shape{2}); - const auto interpolate = std::make_shared(input, sizes, axes, attributes); - interpolate->set_friendly_name("interpolate11"); - - function = std::make_shared(interpolate->outputs(), ov::ParameterVector{input, sizes, axes}); + function = create_v11_model(WITH_AXES, ov::opset11::Interpolate::ShapeCalcMode::SIZES); manager.register_pass(); } @@ -90,17 +106,7 @@ TEST_F(TransformationTestsF, ConvertInterpolate11ToInterpolate4_sizes) { TEST_F(TransformationTestsF, ConvertInterpolate11ToInterpolate4_no_axes) { { - auto attributes = ov::opset11::Interpolate::InterpolateAttrs{}; - attributes.shape_calculation_mode = ov::opset11::Interpolate::ShapeCalcMode::SCALES; - attributes.pads_begin = {0, 0}; - attributes.pads_end = {0, 0}; - - const auto input = std::make_shared(ov::element::i32, ov::Shape{1, 2, 10, 10}); - const auto scales = std::make_shared(ov::element::f32, ov::Shape{4}); - const auto interpolate = std::make_shared(input, scales, attributes); - interpolate->set_friendly_name("interpolate11"); - - function = std::make_shared(interpolate->outputs(), ov::ParameterVector{input, scales}); + function = create_v11_model(WITHOUT_AXES, ov::opset11::Interpolate::ShapeCalcMode::SCALES); manager.register_pass(); } @@ -123,17 +129,7 @@ TEST_F(TransformationTestsF, ConvertInterpolate11ToInterpolate4_no_axes) { TEST_F(TransformationTestsF, ConvertInterpolate11ToInterpolate4_sizes_no_axes) { { - auto attributes = ov::opset11::Interpolate::InterpolateAttrs{}; - attributes.shape_calculation_mode = ov::opset11::Interpolate::ShapeCalcMode::SIZES; - attributes.pads_begin = {0, 0}; - attributes.pads_end = {0, 0}; - - const auto input = std::make_shared(ov::element::i32, ov::Shape{1, 2, 10, 10}); - const auto sizes = std::make_shared(ov::element::i32, ov::Shape{4}); - const auto interpolate = std::make_shared(input, sizes, attributes); - interpolate->set_friendly_name("interpolate11"); - - function = std::make_shared(interpolate->outputs(), ov::ParameterVector{input, sizes}); + function = create_v11_model(WITHOUT_AXES, ov::opset11::Interpolate::ShapeCalcMode::SIZES); manager.register_pass(); } @@ -154,9 +150,10 @@ TEST_F(TransformationTestsF, ConvertInterpolate11ToInterpolate4_sizes_no_axes) { } } -TEST_F(TransformationTestsF, ConvertInterpolate11ToInterpolate4_bicubic_pillow) { +namespace { +std::shared_ptr create_non_downgradeable_model(const ov::opset11::Interpolate::InterpolateMode mode) { auto attributes = ov::opset11::Interpolate::InterpolateAttrs{}; - attributes.mode = ov::opset11::Interpolate::InterpolateMode::BICUBIC_PILLOW; + attributes.mode = mode; attributes.shape_calculation_mode = ov::opset11::Interpolate::ShapeCalcMode::SCALES; attributes.pads_begin = {0, 0}; attributes.pads_end = {0, 0}; @@ -168,24 +165,16 @@ TEST_F(TransformationTestsF, ConvertInterpolate11ToInterpolate4_bicubic_pillow) const auto interpolate = std::make_shared(input, scales, axes, attributes); interpolate->set_friendly_name("interpolate11"); - function = std::make_shared(interpolate->outputs(), ov::ParameterVector{input, scales, axes}); + return std::make_shared(interpolate->outputs(), ov::ParameterVector{input, scales, axes}); +} +} // namespace + +TEST_F(TransformationTestsF, ConvertInterpolate11ToInterpolate4_bicubic_pillow) { + function = create_non_downgradeable_model(ov::opset11::Interpolate::InterpolateMode::BICUBIC_PILLOW); manager.register_pass(); } TEST_F(TransformationTestsF, ConvertInterpolate11ToInterpolate4_bilinear_pillow) { - auto attributes = ov::opset11::Interpolate::InterpolateAttrs{}; - attributes.mode = ov::opset11::Interpolate::InterpolateMode::BILINEAR_PILLOW; - attributes.shape_calculation_mode = ov::opset11::Interpolate::ShapeCalcMode::SCALES; - attributes.pads_begin = {0, 0}; - attributes.pads_end = {0, 0}; - - const auto input = std::make_shared(ov::element::i32, ov::Shape{1, 2, 10, 10}); - const auto scales = std::make_shared(ov::element::f32, ov::Shape{2}); - const auto axes = std::make_shared(ov::element::i32, ov::Shape{2}); - - const auto interpolate = std::make_shared(input, scales, axes, attributes); - interpolate->set_friendly_name("interpolate11"); - - function = std::make_shared(interpolate->outputs(), ov::ParameterVector{input, scales, axes}); + function = create_non_downgradeable_model(ov::opset11::Interpolate::InterpolateMode::BILINEAR_PILLOW); manager.register_pass(); } diff --git a/src/plugins/intel_gpu/thirdparty/onednn_gpu b/src/plugins/intel_gpu/thirdparty/onednn_gpu index ad34c124895690..b52e9cd54df5af 160000 --- a/src/plugins/intel_gpu/thirdparty/onednn_gpu +++ b/src/plugins/intel_gpu/thirdparty/onednn_gpu @@ -1 +1 @@ -Subproject commit ad34c124895690bafd2b110577639824899ecbca +Subproject commit b52e9cd54df5af92d1d586d435cdd514dd7617fe