From 186b1b6bfc0e2469670e89be35f520a28cba8d2a Mon Sep 17 00:00:00 2001 From: Marcin Kusmierski Date: Wed, 19 Jul 2023 14:48:01 +0200 Subject: [PATCH] Gna 3 5 as default target with transpose fixes (#18373) * [GNA] Set GNA 3.5 as default target and add 3.5 to properties * [GNA] fix release version to 2023.1. Co-authored-by: Szymon Irzabek * [GNA] Fix E2E Tests for Kaldi Framework * added fix for InsertConvolutionTransposeHW --------- Co-authored-by: Szymon Irzabek Co-authored-by: Mikhail Ryzhov --- src/inference/include/ie/gna/gna_config.hpp | 9 ++++++--- .../include/openvino/runtime/intel_gna/properties.hpp | 2 +- src/plugins/intel_gna/src/common/gna_target.hpp | 2 +- .../intel_gna/src/transformations/rotate_inputs.cpp | 11 ++++++++++- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/inference/include/ie/gna/gna_config.hpp b/src/inference/include/ie/gna/gna_config.hpp index b4a5f81551b..1e7a7db7571 100644 --- a/src/inference/include/ie/gna/gna_config.hpp +++ b/src/inference/include/ie/gna/gna_config.hpp @@ -165,20 +165,23 @@ INFERENCE_ENGINE_1_0_DEPRECATED DECLARE_GNA_CONFIG_VALUE(AVX2); INFERENCE_ENGINE_1_0_DEPRECATED DECLARE_GNA_CONFIG_VALUE(AVX2_EXACT); /** - * @brief The option to override the GNA HW execution target. May be one of GNA_TARGET_2_0, GNA_TARGET_3_0. + * @brief The option to override the GNA HW execution target. May be one of GNA_TARGET_2_0, GNA_TARGET_3_0, + * GNA_TARGET_3_5. * By default (in case of no value set) the behavior depends on GNA HW availability: * If GNA HW is present, use the option corresponding to this HW. * If HW is not present, use the option corresponding to the latest fully supported GNA HW generation. * A fully supported GNA HW generation means it must be supported by both the OV GNA Plugin and the core GNA Library. - * For the OV GNA Plugin 2022.1, the latest supported GNA HW generation corresponds to GNA_TARGET_3_0. + * For the OV GNA Plugin 2023.1, the latest supported GNA HW generation corresponds to GNA_TARGET_3_5. */ INFERENCE_ENGINE_1_0_DEPRECATED DECLARE_GNA_CONFIG_KEY(EXEC_TARGET); INFERENCE_ENGINE_1_0_DEPRECATED DECLARE_GNA_CONFIG_VALUE(TARGET_2_0); INFERENCE_ENGINE_1_0_DEPRECATED DECLARE_GNA_CONFIG_VALUE(TARGET_3_0); +INFERENCE_ENGINE_1_0_DEPRECATED DECLARE_GNA_CONFIG_VALUE(TARGET_3_5); /** - * @brief The option to override the GNA HW compile target. May be one of GNA_TARGET_2_0, GNA_TARGET_3_0. + * @brief The option to override the GNA HW compile target. May be one of GNA_TARGET_2_0, GNA_TARGET_3_0, + * GNA_TARGET_3_5. * By default the same as GNA_EXEC_TARGET. */ INFERENCE_ENGINE_1_0_DEPRECATED DECLARE_GNA_CONFIG_KEY(COMPILE_TARGET); diff --git a/src/inference/include/openvino/runtime/intel_gna/properties.hpp b/src/inference/include/openvino/runtime/intel_gna/properties.hpp index 4e53c05187c..ee437665a5c 100644 --- a/src/inference/include/openvino/runtime/intel_gna/properties.hpp +++ b/src/inference/include/openvino/runtime/intel_gna/properties.hpp @@ -194,7 +194,7 @@ static constexpr Property execution_mode{"GNA_DEVICE_MODE"}; * If GNA HW is present, use the option corresponding to this HW. * If HW is not present, use the option corresponding to the latest fully supported GNA HW generation. * A fully supported GNA HW generation means it must be supported by both the OV GNA Plugin and the core GNA Library. - * Currently, the latest supported GNA HW generation corresponds to GNA_3_0. + * Currently, the latest supported GNA HW generation corresponds to GNA_3_5. * @ingroup ov_runtime_gna_prop_cpp_api */ static constexpr Property execution_target{"GNA_HW_EXECUTION_TARGET"}; diff --git a/src/plugins/intel_gna/src/common/gna_target.hpp b/src/plugins/intel_gna/src/common/gna_target.hpp index 81c59e68016..45aac53a02c 100644 --- a/src/plugins/intel_gna/src/common/gna_target.hpp +++ b/src/plugins/intel_gna/src/common/gna_target.hpp @@ -24,7 +24,7 @@ enum class DeviceVersion { GNAEmbedded3_5 = 0x35e, GNA3_6 = 0x36e, GNA4_0 = 0x40e, - Default = GNA3_0 + Default = GNA3_5 }; class Target { diff --git a/src/plugins/intel_gna/src/transformations/rotate_inputs.cpp b/src/plugins/intel_gna/src/transformations/rotate_inputs.cpp index 7a3c661fff8..fafaf442582 100644 --- a/src/plugins/intel_gna/src/transformations/rotate_inputs.cpp +++ b/src/plugins/intel_gna/src/transformations/rotate_inputs.cpp @@ -36,7 +36,16 @@ InsertConvolutionTransposeHW::InsertConvolutionTransposeHW() { std::dynamic_pointer_cast(node.get_node_shared_ptr()); helper::ConvData conv_data; helper::GetConvData(conv, conv_data); - return gna_convolution_layer::should_transpose_h_w(static_cast(conv_data.input_height), + auto validator = limitations::Limitations::get_instance()->get_cnn_validator(); + return (validator && !validator->ShouldUseOnlyConv2DGnaIface()) && + gna_convolution_layer::isMappableFrom2DTo1D(static_cast(conv_data.input_height), + static_cast(conv_data.input_width), + static_cast(conv_data.input_channel_count), + static_cast(conv_data.filter_height), + static_cast(conv_data.filter_width), + static_cast(conv_data.filter_stride_height), + static_cast(conv_data.filter_stride_width)) && + gna_convolution_layer::should_transpose_h_w(static_cast(conv_data.input_height), static_cast(conv_data.filter_height), static_cast(conv_data.input_channel_count), static_cast(conv_data.filter_stride_height));