From 3c3d79a535b66236e85c8d558badf0cacebd7986 Mon Sep 17 00:00:00 2001 From: sbalandi Date: Tue, 30 Apr 2024 22:47:52 +0100 Subject: [PATCH] test --- .../single_layer_tests/classes/reduce.cpp | 9 +- .../src/index_add_scatter_elements_update.cpp | 7 +- .../skip_tests_config.cpp | 51 +++- .../skip_tests_config.cpp | 15 +- .../shared_test_classes/base/ov_subgraph.hpp | 3 + .../base/utils/generate_inputs.hpp | 2 +- .../shared_test_classes/base/utils/ranges.hpp | 217 ++++-------------- .../src/base/ov_subgraph.cpp | 8 +- .../src/base/utils/generate_inputs.cpp | 14 ++ .../src/base/utils/ranges.cpp | 3 +- .../src/single_op/eltwise.cpp | 4 + .../src/single_op/gru_sequence.cpp | 29 ++- .../include/common_test_utils/data_utils.hpp | 14 +- .../common_test_utils/ov_tensor_utils.hpp | 16 +- .../common_test_utils/tests/CMakeLists.txt | 3 +- .../common_test_utils/tests/core_config.cpp | 15 ++ .../tests/generate_intepus.cpp | 2 + 17 files changed, 203 insertions(+), 209 deletions(-) create mode 100644 src/tests/test_utils/common_test_utils/tests/core_config.cpp diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/reduce.cpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/reduce.cpp index 06dd6a56e50f93..4e77b208375aeb 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/reduce.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/reduce.cpp @@ -139,10 +139,13 @@ void ReduceCPULayerTest::SetUp() { function = makeNgraphFunction(netPrecision, params, reduce, "Reduce"); - if (ov::with_cpu_x86_avx512_core_amx()) { - if (netPrecision == ov::element::f32 && configuration.count(ov::hint::inference_precision.name()) && - configuration.at(ov::hint::inference_precision.name()) == ov::element::f16) { + if (netPrecision == ov::element::f32 && configuration.count(ov::hint::inference_precision.name()) && + (configuration.at(ov::hint::inference_precision.name()) == ov::element::f16 || + configuration.at(ov::hint::inference_precision.name()) == ov::element::bf16)) { + if (ov::with_cpu_x86_avx512_core_amx()) { abs_threshold = 5e-3; + } else { + abs_threshold = 5e-2; } } } diff --git a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/index_add_scatter_elements_update.cpp b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/index_add_scatter_elements_update.cpp index 4aa422fa263b18..3b2a0262b81aa7 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/index_add_scatter_elements_update.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/index_add_scatter_elements_update.cpp @@ -98,7 +98,8 @@ class IndexAddTest : public testing::WithParamInterface, if (ov::element::bf16 == data_type || ov::element::f16 == data_type) { configuration.insert({ov::hint::inference_precision.name(), data_type}); - inType = outType = data_type; + outType = data_type; + inTypes = {data_type, ov::element::Type_t::undefined, data_type}; abs_threshold = 0.01f; rel_threshold = 0.01f; } @@ -209,12 +210,14 @@ class IndexAddTest : public testing::WithParamInterface, // All index values are expected to be within bounds [-d, d - 1] along dimension d pointed by axis. auto d = dataShape[normalized_axis]; in_data.start_from = -1.0 * static_cast(d); - in_data.range = d-1; + // in_data.range = static_cast(d-1 - in_data.start_from); + in_data.range = d - 1; in_data.resolution = 1; tensor = shape_size(indicesShape) == 0 ? ov::Tensor(funcInput.get_element_type(), indicesShape) : ov::test::utils::create_and_fill_tensor(funcInput.get_element_type(), indicesShape, in_data); } else if (i == 2) { // "updates" in_data.start_from = -50; + // in_data.range = 100; in_data.range = 50; in_data.resolution = 1; tensor = shape_size(updateShape) == 0 ? ov::Tensor(funcInput.get_element_type(), updateShape) : 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 8c171def6f1427..68e39f41ed5393 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 @@ -243,6 +243,7 @@ std::vector disabledTestPatterns() { R"(.*smoke_static/ConvertFqRnnToQuantizedRnn.*2.1.5.*2.1.1.*2.1.1.*)", R"(.*smoke_InterpolateBicubicPillow_Layout_Test/InterpolateLayerCPUTest.CompareWithRefs/ShapeCalcMode=sizes_IS=\[?.2..20.?.?\]_TS.*1.17.4.4.*2.3.10.12.*1.17.4.4.*Sizes.*4.4.*10.20.*10.4.*PARAMETER.*0.0.0.0.*0.0.1.1.*2.3.*)", R"(.*smoke_LoopForCommon/LoopLayerCPUTest.CompareWithRefs/.*_netType=bf16.*)", + R"(.*smoke_LoopForCommon/LoopLayerCPUTest.CompareWithRefs/.*trip_count=5_exec_cond=1_netType=i8.*)", R"(.*smoke_FuseScaleShiftAndFakeQuantize/FuseScaleShiftAndFakeQuantizeTest.CompareWithRefs/.*Scale=\[ 30 \]_Shift=\[ 17 \]_Intervals=\[ -1 \],\[ 5 \],\[ -5 \],\[ 1 \].*)", R"(.*smoke_QuantizedConvolutionBatchNorm.*/QuantizedConvolutionBatchNorm.CompareWithRefs/conv_type=convolution_quantize.*)", R"(.*smoke_Param/RandomUniformLayerTestCPU.CompareWithRefs/IS=\{3\}_OS=\[4,3,210\]_Min=-50_Max=0_ShapePrc=.*_OutPrc=f32_GlobalSeed=8_OperationalSeed=(0|3).*)", @@ -301,6 +302,28 @@ std::vector disabledTestPatterns() { R"(.*FQLayerDQBias.smoke_CompareWithRefs.*)", R"(.*smoke_matmulBrgemmInt8/MatmulBrgemmInt8Test.CompareWithRefs.*MatMul.*InputType=i8_OutputType=i8.*)", R"(.*smoke_Snippets_MHAWOTransposeOnInputs_4D/MHAWOTransposeOnInputs.CompareWithRefImpl.*)", + // ranges + R"(.*smoke_Reduce_MultiAxis_4D_fusing_CPU/ReduceCPULayerTest.CompareWithRefs/.*=VECTOR_type=(Max|ReduceL2|Mean)_.*_INFERENCE_PRECISION_HINT=bf16_.*_Fused=Multiply\(PerChannel\).Add\(PerChannel\).*)", + R"(.*smoke_Reduce_MultiAxis_4D_fusing_CPU/ReduceCPULayerTest.CompareWithRefs/IS=.*_axes=\((0.2|0.3)\)_opType=VECTOR_type=Mean_.*_INFERENCE_PRECISION_HINT=bf16_.*_Fused=Multiply\(PerChannel\).Add\(PerChannel\).*)", + R"(.*smoke_Reduce_OneAxis_fusing_CPU/ReduceCPULayerTest.CompareWithRefs/.*_INFERENCE_PRECISION_HINT=bf16_Fused=Multiply\(PerChannel\).Add\(PerChannel\).*)", + R"(.*smoke_Reduce_OneAxis_CPU/ReduceCPULayerTest.CompareWithRefs/IS=.*_axes=\((1|3)\)_opType=.*_type=(ReduceL1|Sum)_.*_INFERENCE_PRECISION_HINT=bf16.*)", + R"(.*smoke_Reduce_MultiAxis_4D_CPU/ReduceCPULayerTest.CompareWithRefs/IS=.*_axes=\((0.1|0.3|1.2|1.3|2.3|0.1.2|0.1.3|0.2.3|1.2.3)\)_opType=.*_type=(ReduceL1|Sum)_.*_INFERENCE_PRECISION_HINT=bf16.*)", + R"(.*smoke_Reduce_MultiAxis_5D_fusing_CPU/ReduceCPULayerTest.CompareWithRefs/IS=.*_axes=\((2.4|0.2.4|0.1.2.3.4)\)_opType=.*_type=(ReduceL1|Mean|ReduceL2|Max)_KeepDims=true_netPRC=f32_.*_INFERENCE_PRECISION_HINT=bf16_.*_Fused=Multiply\(PerChannel\).Add\(PerChannel\).*)", + R"(.*smoke_Reduce_MultiAxis_5D_fusing_CPU/ReduceCPULayerTest.CompareWithRefs/IS=.*_axes=\(1.2.4\)_opType=.*_type=(ReduceL2|Max)_KeepDims=true_netPRC=f32_.*_INFERENCE_PRECISION_HINT=bf16_.*_Fused=Multiply\(PerChannel\).Add\(PerChannel\).*)", + R"(.*smoke_Reduce_SingleBatch_CPU/ReduceCPULayerTest.CompareWithRefs/.*_axes=\((1|3)\)_opType=.*_type=(ReduceL1|Sum)_KeepDims=true_netPRC=f32_.*_INFERENCE_PRECISION_HINT=bf16_.*)", + R"(.*smoke_Reduce_MultiAxis_5D_CPU/ReduceCPULayerTest.CompareWithRefs/IS=.*_axes=\((2.4|0.2.4)\)_opType=.*_type=(ReduceL1|Sum)_KeepDims=true_netPRC=f32_.*_INFERENCE_PRECISION_HINT=bf16.*)", + R"(.*smoke_Reduce_MultiAxis_4D_dynamic_CPU/ReduceCPULayerTest.CompareWithRefs/IS=.*_axes=\(0.1\)_opType=.*_type=(ReduceL1|Sum)_KeepDims=true_netPRC=f32_.*_INFERENCE_PRECISION_HINT=bf16.*)", + R"(.*smoke_Reduce_NHWC_SmallChannel_CPU/ReduceCPULayerTest.CompareWithRefs/IS=.*_axes=\(2.3\)_opType=.*_type=(ReduceL1|Sum)_KeepDims=true_netPRC=f32_.*_INFERENCE_PRECISION_HINT=bf16.*)", + R"(.*smoke_Interpolate_Basic/InterpolateLayerTest.Inference/.*_InterpolateMode=cubic_ShapeCalcMode=scales_CoordinateTransformMode=tf_half_pixel_.*PB=\(0.0.0.0\)_PE=\(0.0.0.0\)_.*_netType=f32.*)", + R"(.*smoke_Interpolate_Basic/InterpolateLayerTest.Inference/.*_InterpolateMode=cubic_ShapeCalcMode=scales_CoordinateTransformMode=asymmetric_.*_netType=f32.*)", + R"(.*smoke_Interpolate_Basic_Down_Sample_Tail/InterpolateLayerTest.Inference/.*_InterpolateMode=cubic_ShapeCalcMode=scales_CoordinateTransformMode=tf_half_pixel_.*_PB=\(0.0.1.1\)_.*_netType=f32_.*)", + R"(.*smoke_GatherTree/GatherTreeLayerTest.Inference/IS=\(20.(1|20).10\)_secondary_input_type=CONSTANT_netPRC=f32.*)", + R"(.*smoke_LoopForCommon/LoopLayerCPUTest.CompareWithRefs/Input0_IS=\[\?.1.\?\]_TS=\(10.1.10\)_\(1.1.1\)_\(1.1.1\)_\(5.1.3\)_Input1_IS=\[\?.\?.\?\]_TS=.*_Input2_IS=\[\?.1.\?\]_.*_types=0_0_1_trip_count_type=PARAMETER_trip_count=1_exec_cond=1_netType=i8.*)", + 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=PARAMETER_trip_count=1_exec_cond=1_netType=i8.*)", + R"(.*smoke_FakeQuantizeLayerCPUTest_5D_jit/FakeQuantizeLayerCPUTest.CompareWithRefs/IS=\[\?.\?.\?.\?.\?\]_TS=\(\(4.16.6.7.8\)\)_\(\(1.16.1.1.1\)\)_.*_inPrec=f32_LOW_BOUNDS=-10_HIGH_BOUNDS=10_IL=\(-10\)_IH=\(-5\)_OL=\(5\)_OH=\(25\)_LEVELS=256_.*)", + R"(.*smoke_basic/PermConvPermConcat.CompareWithRefs/IS=\(1.1.8.16\)_KS=\(1.3\)_OC=(32|64)_ET=f32_targetDevice=CPU.*)", + R"(.*smoke_GatherTreeCPUStatic/GatherTreeLayerCPUTest.CompareWithRefs/IS=.*_TS=\(20.(1|20).10\)_secondaryInputType=CONSTANT_netPRC=f32_inPRC=undefined_outPRC=undefined_trgDev=CPU.*)", + R"(.*smoke_GatherTreeCPUDynamicConstant/GatherTreeLayerCPUTest.CompareWithRefs/IS=.*_TS=\((7.1.10|2.1.7|20.1.10|20.20.15)\)_secondaryInputType=CONSTANT_netPRC=f32_inPRC=undefined_outPRC=undefined_trgDev=CPU.*)", }; #if defined(OPENVINO_ARCH_X86) @@ -352,7 +375,26 @@ std::vector disabledTestPatterns() { // Issue: 124395 retVector.emplace_back(R"(smoke_VariableStateBasic/InferRequestVariableStateTest.*)"); retVector.emplace_back(R"(smoke_VariableState/OVInferRequestVariableStateTest.*)"); - + // fill_data_random fix + retVector.emplace_back(R"(.*smoke_MVNMultiplyAdd_3D/MVNMultiplyAdd.CompareWithRefs/IS=\(2.17.9\)_CS=\(1.1.9\)_DataET=f32_AxET=i64_Ax=\(2\)_NormVariance=TRUE_Eps=1e-09_EM=(inside|outside)_sqrt.*)"); + retVector.emplace_back(R"(.*smoke_Activation5D_dynamicMath_CPU/ActivationLayerCPUTest.CompareWithRefs/Log_IS=\(\[\?.\?\]\)_TS=\(1.50\)_\(5.128\)_\(3.64\)_AS=\(\)_ConstantsValue=\(\)_netPRC=f32_inPRC=f32_outPRC=f32.*)"); + retVector.emplace_back(R"(.*smoke_Activation5D_dynamicMath_CPU/ActivationLayerCPUTest.CompareWithRefs/Log_IS=\(\[1..5.128\]\)_TS=\(1.128\)_\(3.128\)_\(5.128\)_AS=\(\)_ConstantsValue=\(\)_netPRC=f32_inPRC=f32_outPRC=f32.*)"); + retVector.emplace_back(R"(.*smoke_CompareWithRefs_dynamic/EltwiseLayerTest.Inference/IS=.*1..10.200.*1..10.200.*_TS=.*2.200.*1.200.*2.200.*5.200.*_eltwise_op_type=Sum_secondary_input_type=PARAMETER_opType=VECTOR_model_type=i32_.*)"); + retVector.emplace_back(R"(.*smoke_CompareWithRefs_static_check_collapsing/EltwiseLayerTest.Inference/IS=.*_TS=\(\(16.16.16.16\)_\(16.16.(16.1|1.16)\)_\)_eltwise_op_type=Sum_secondary_input_type=PARAMETER_opType=VECTOR_model_type=i32_.*)"); + retVector.emplace_back(R"(.*smoke_CompareWithRefs_static_check_collapsing/EltwiseLayerTest.Inference/IS=.*_TS=\(\(16.16.16.(16|1)\)_\(16.16.16.1\)_\)_eltwise_op_type=SqDiff_secondary_input_type=.*_opType=VECTOR_model_type=i32.*)"); + retVector.emplace_back(R"(.*smoke_CompareWithRefs_static_check_collapsing/EltwiseLayerTest.Inference/IS=.*_TS=\(\(16.16.(16|1).16\)_\(16.16.1.16\)_\)_eltwise_op_type=SqDiff_secondary_input_type=.*_opType=VECTOR_model_type=i32.*)"); + retVector.emplace_back(R"(.*smoke_CompareWithRefs_static/EltwiseLayerTest.Inference/IS=.*_TS=\(\(16.16.16.(16|1).(16|1)\)_\)_eltwise_op_type=Sum_secondary_input_type=PARAMETER_opType=SCALAR_model_type=i32.*)"); + retVector.emplace_back(R"(.*smoke_LSTMCellCommon/LSTMCellTest.Inference/decomposition0_batch=5_hidden_size=10_input_size=1_IS=\(5.1\)\(5.10\)\(5.10\)\(40.1\)\(40.10\)\(40\)_activations=\(relu.(sigmoid.tanh|relu.relu)\)_clip=0_WType=.*_RType=CONSTANT_BType=PARAMETER_modelType=f16.*)"); + retVector.emplace_back(R"(.*smoke_LSTMCellCommon/LSTMCellTest.Inference/decomposition0_batch=5_hidden_size=10_input_size=30_IS=\(5.30\)\(5.10\)\(5.10\)\(40.30\)\(40.10\)\(40\)_activations=\(relu.(sigmoid.tanh|relu.relu)\)_clip=0_WType=.*_RType=CONSTANT_BType=PARAMETER_modelType=f16.*)"); + retVector.emplace_back(R"(.*smoke_GRUCellCommon/GRUCellTest.Inference/decomposition1_batch=5_hidden_size=1_input_size=1_IS=\(5.1\)\(5.1\)\(3.1\)\(3.1\)\(4\)_activations=\(tanh.relu\)_clip=0_linear_before_reset=1_WType=.*_RType=.*_BType=CONSTANT_netPRC=f32_.*)"); + retVector.emplace_back(R"(.*smoke_GRUCellCommon/GRUCellTest.Inference/decomposition1_batch=5_hidden_size=1_input_size=30_IS=\(5.30\)\(5.1\)\(3.30\)\(3.1\)\(4\)_activations=\(tanh.relu\)_clip=0_linear_before_reset=1_WType=.*_RType=.*_BType=CONSTANT_netPRC=f32_.*)"); + retVector.emplace_back(R"(.*smoke_GRUCellCommon/GRUCellTest.Inference/decomposition1_batch=5_hidden_size=10_input_size=1_IS=\(5.1\)\(5.10\)\(30.1\)\(30.10\)\((40|30)\)_activations=\(tanh.relu\)_clip=0_linear_before_reset=(0|1)_WType=.*_RType=.*_BType=CONSTANT_netPRC=f32_.*)"); + retVector.emplace_back(R"(.*smoke_GRUCellCommon/GRUCellTest.Inference/decomposition1_batch=5_hidden_size=10_input_size=30_IS=\(5.30\)\(5.10\)\(30.30\)\(30.10\)\(30\)_activations=\(tanh.relu\)_clip=0_linear_before_reset=0_WType=.*_RType=.*_BType=CONSTANT_netPRC=f32.*)"); + retVector.emplace_back(R"(.*moke_Activation5D_dynamicMath_CPU/ActivationLayerCPUTest.CompareWithRefs/Log_IS=\(\[?.?\]\)_TS=\(1.50\)_\(5.128\)_\(3.64\)_AS=\(\)_ConstantsValue=\(\)_netPRC=f32_inPRC=f32_outPRC=f32_.*)"); + retVector.emplace_back(R"(.*moke_Activation5D_dynamicMath_CPU/ActivationLayerCPUTest.CompareWithRefs/Log_IS=\(\[1..5.128\]\)_TS=\(1.128\)_\(3.128\)_\(5.128\)_AS=\(\)_ConstantsValue=\(\)_netPRC=f32_inPRC=f32_outPRC=f32_.*)"); + retVector.emplace_back(R"(.*smoke_EltwiseChain_MergeConvert_int8/EltwiseChainTest.CompareWithRefs/IS=.*_TS=\(\(1.1.2.3\)_\(1.1.2.3\)_\(1.1.2.3\)_InPRC0=f16_InPRC1=f32_InPRC2=f32_Op0=Div_secondaryInputType=CONSTANT_WithQuant=0_Conversion=(i8|u8).*)"); + retVector.emplace_back(R"(.*smoke_EltwiseChain_MergeConvert_int8/EltwiseChainTest.CompareWithRefs/IS=.*_TS=\(\(1.1.2.3\)_\(1.1.2.3\)_\(1.1.2.3\)_InPRC0=f32_InPRC1=f32_InPRC2=f32_Op0=Prod_secondaryInputType=CONSTANT_WithQuant=0_Conversion=(i8|u8).*)"); + retVector.emplace_back(R"(.*smoke_Interpolate_Basic/InterpolateLayerTest.Inference/.*_InterpolateMode=(linear|linear_onnx)_ShapeCalcMode=scales_CoordinateTransformMode=asymmetric_NearestMode=round_prefer_floor_cube_.*_PB=\(0.0.0.0\)_PE=\(0.0.0.0\)_Axes=\(0.1.2.3\)_.*_netType=f32.*)"); #endif #if defined(OPENVINO_ARCH_ARM) @@ -488,6 +530,13 @@ std::vector disabledTestPatterns() { retVector.emplace_back(R"(.*smoke_Snippets_EnforcePrecision_bf16/EnforcePrecisionTest.*)"); retVector.emplace_back(R"(.*smoke_Snippets_MHABF16_4D/MHA.CompareWithRefImpl/.*\[1.58.16.34\]_IS\[1\]=\[1.58.16.34\]_IS\[2\]=\[1.1.1.58\]_IS\[3\]=\[1.58.16.34\].*)"); retVector.emplace_back(R"(.*smoke_Snippets_MHAWOTransposeBF16_(3|4)D/MHAWOTranspose.*)"); + // range + retVector.emplace_back(R"(.*smoke_Deconv_(2|3)D_NSPC_INT8_AMX/DeconvolutionLayerCPUTest.*)"); + retVector.emplace_back(R"(.*smoke_Deconv_(2|3)D_NSPC_INT8_AMX/DeconvolutionLayerCPUTest.*)"); + retVector.emplace_back(R"(.*smoke_LoopForDiffShapesConcat/LoopForDiffShapesLayerCPUTest.CompareWithRefs/Input0_IS=.*_TS=\(10.1.10\)_\(1.10.1\)_\(1.10.1\)_\(2.2.2\)_types=trip_count_type=PARAMETER_trip_count=(1|5)_exec_cond=1_netType=bf16.*)"); + retVector.emplace_back(R"(.*smoke_LoopForDiffShapesConcat/LoopForDiffShapesLayerCPUTest.CompareWithRefs/Input0_IS=.*_TS=\(10.5.10\)_\(1.10.1\)_\(1.10.1\)_\(2.1.2\)_types=trip_count_type=PARAMETER_trip_count=(1|5)_exec_cond=1_netType=bf16.*)"); + retVector.emplace_back(R"(.*smoke_LoopForConcat/LoopForConcatLayerCPUTest.CompareWithRefs/Input0_IS=.*_TS=\(10.5.10\)_\(1.10.1\)_\(1.10.1\)_\(2.1.2\)_types=trip_count_type=PARAMETER_trip_count=(1|5)_exec_cond=1_netType=bf16.*)"); + retVector.emplace_back(R"(.*smoke_LoopForConcat/LoopForConcatLayerCPUTest.CompareWithRefs/Input0_IS=\[\?.10.10\]_TS=\(10.10.10\)_\(5.10.10\)_\(5.10.10\)_\(8.10.10\)_Input1_IS=\[\?.10.10\]_.*_types=trip_count_type=PARAMETER_trip_count=1_exec_cond=1_netType=bf16.*)"); } if (ov::with_cpu_x86_avx512_core_fp16()) { diff --git a/src/plugins/intel_gpu/tests/functional/shared_tests_instances/skip_tests_config.cpp b/src/plugins/intel_gpu/tests/functional/shared_tests_instances/skip_tests_config.cpp index 11360f1fe80faa..9e94a2a9684ade 100644 --- a/src/plugins/intel_gpu/tests/functional/shared_tests_instances/skip_tests_config.cpp +++ b/src/plugins/intel_gpu/tests/functional/shared_tests_instances/skip_tests_config.cpp @@ -156,12 +156,8 @@ std::vector disabledTestPatterns() { R"(.*smoke_MVN_4D/Mvn6LayerTest.Inference/.*TS=\{\(1.3.8.9\)\}.*_ModelType=f16.*Ax=\((2.3|1.2.3)\).*)", R"(.*smoke_MVN_3D/Mvn6LayerTest.Inference/IS=\(\[\]\)_TS=\{\(1.32.17\)\}_ModelType=f16_AxType=(i64|i32)_Ax=\((1.2|2)\).*)", R"(.*smoke_MVN_2D/Mvn6LayerTest.Inference.*TS=\{\(2.55\)\}_ModelType=f32_.*)", - - R"(.*smoke_Decomposition_6D/Mvn6LayerTest.Inference.*ModelType=(f16|f32).*Ax=\(0.1.2\).*)", R"(.*smoke_Decomposition_6D/Mvn6LayerTest.Inference.*ModelType=(f16|f32).*Ax=\(0.1.5\).*)", - - R"(.*smoke_Decomposition_4D/Mvn6LayerTest.Inference.*ModelType=f16.*Ax=\(1\).*)", R"(.*smoke_CTCLoss_Set2/CTCLossLayerTest.Inference/.*_LL=\(6.5.6\)_A=\(2.1.5.3.2.6\)\(3.3.3.3.3.3\)\(6.5.6.5.6.5\)_.*_BI=7_.*_CMR=1_U=1_PF=f16.*)", R"(.*smoke_RMSNormDecomposition_basic/RMSNormDecomposition.Inference/.*precision=f32.*)", @@ -205,6 +201,17 @@ std::vector disabledTestPatterns() { R"(.*smoke_RDFT_5d_last_axis/RDFTLayerTest.Inference/IS=\(10.4.8.2.5\)_modelType=f32_Axes=\(0.1.2.3.4\)_SignalSize=\(\).*)", // Issue: 136862 R"(.*smoke_ConditionGPUTest_static/StaticConditionLayerGPUTest.CompareWithRefs/IS=\(3.6\)_netPRC=i8_ifCond=PARAM_targetDevice=GPU_.*)", + // fill_data_randoom fix + R"(.*smoke_CTCLoss_Set2/CTCLossLayerTest.Inference/IS=.*_TS=.*3.6.8.*_LL=.*6.5.6.*_A=.*2.1.5.3.2.6.*3.3.3.3.3.3.*6.5.6.5.6.5.*_AL=\(4.3.5\)_BI=0_PCR=(1|0)_CMR=(1|0)_U=0_PF=f16_PI=(i64|i32)_.*)", + R"(.*smoke_CTCLoss_Set2/CTCLossLayerTest.Inference/IS=.*_TS=.*3.6.8.*_LL=.*6.5.6.*_A=.*2.1.5.3.2.6.*3.3.3.3.3.3.*6.5.6.5.6.5.*_AL=\(4.3.5\)_BI=0_PCR=(1|0)_CMR=1_U=1_PF=f16_PI=(i64|i32)_.*)", + R"(.*smoke_DeformablePSROIPooling/DeformablePSROIPoolingLayerTest.Inference/IS=.*_TS=\{\((1.8.67.32|3.8.16.16)\)_\(10.5\)\}_out_dim=2_group_size=2_scale=0.5_bins_x=3_bins_y=3_trans_std=(0|0.01|0.5)_part_size=2_prec=f16_dev=GPU.*)", + R"(.*smoke_DeformablePSROIPooling/DeformablePSROIPoolingLayerTest.Inference/IS=.*_TS=\{\((1.8.67.32|3.8.16.16)\)_\(10.5\)_\(10.2.2.2\)\}_out_dim=2_group_size=2_scale=0.5_bins_x=3_bins_y=3_trans_std=0_part_size=2_prec=f16_dev=GPU.*)", + R"(.*smoke_DetectionOutput3In/DetectionOutputLayerTest.Inference/.*LOC=\((1|2).660\)_CONF=\((1|2).165\)_PRIOR=.*_decrId=1.*)", + R"(.*smoke_GenerateProposalsLayerTest_(f32|f16)/GenerateProposalsLayerTest.GenerateProposalsLayerTests/im_info=\[\]_\(\[2,3\]\)_anchors=\[\]_\(\[2,6,3,4\]\)_deltas=\[\]_\(\[2,12,2,6\]\)_scores=\[\]_\(\[2,3,2,6\]\).*)", + R"(.*smoke_MVN_4D/Mvn6LayerTest.Inference/IS=.*_TS=.*1.10.5.17.*_ModelType=f16_AxType=(i32|i64)_Ax=\(1.2.3\).*_EM=(inside|outside)_sqrt.*)", + R"(.*smoke_GPUDetectionOutputDynamic3In2/DetectionOutputLayerGPUTest.Inference/.*_\(\[1,660\].\[1,1320\]\)_.*=\(50\)_codeType=caffe.PriorBoxParameter.CORNER_.*_clipAfterNms=1_clipBeforeNms=1_decrId=1_norm=(1|0)_inH=(1|10)_inW=(1|10)_OS=0.4.*)", + R"(.*smoke_ROIPoolingGPU_bilinear/ROIPoolingLayerGPUTest.Inference/netPRC=f32_\[1..8.3..5.7..60.5..50\]_\[1..5.5\]_TS=.*3.4.50.50.*1.3.7.8.*8.5.59.5.*1.3.7.8.*1.5.*2.5.*1.5.*2.5.*PS=\(6.6\)_Scale=1_Bilinear__RandomProposal.*)", + R"(.*smoke_RMSNormDecomposition_basic/RMSNormDecomposition.Inference.*IS=\(\[\?.\?.\?\]_\)_TS=\(\(1.2.16\)\)_input_precision=f16.*)", #if defined(_WIN32) R"(.*smoke_RemoteTensor/OVRemoteTensorBatched_Test.NV12toBGR_buffer/(num_batch_4|num_batch_2).*)", R"(.*smoke_Check/ConstantResultSubgraphTest.Inference/SubgraphType=SINGLE_COMPONENT_IS=\[1,3,10,10\]_IT=i16_Device=GPU.*)", diff --git a/src/tests/functional/shared_test_classes/include/shared_test_classes/base/ov_subgraph.hpp b/src/tests/functional/shared_test_classes/include/shared_test_classes/base/ov_subgraph.hpp index d9dcf8ca69813c..5a88a381eb53fe 100644 --- a/src/tests/functional/shared_test_classes/include/shared_test_classes/base/ov_subgraph.hpp +++ b/src/tests/functional/shared_test_classes/include/shared_test_classes/base/ov_subgraph.hpp @@ -69,6 +69,9 @@ class SubgraphBaseTest : public ov::test::TestsCommon { outType = ov::element::undefined, inference_precision = ov::element::undefined; + std::vector inTypes = {}, + outTypes = {}; + ov::CompiledModel compiledModel; ov::InferRequest inferRequest; diff --git a/src/tests/functional/shared_test_classes/include/shared_test_classes/base/utils/generate_inputs.hpp b/src/tests/functional/shared_test_classes/include/shared_test_classes/base/utils/generate_inputs.hpp index d2930be59d5eac..4a17fdf3d2ff7d 100644 --- a/src/tests/functional/shared_test_classes/include/shared_test_classes/base/utils/generate_inputs.hpp +++ b/src/tests/functional/shared_test_classes/include/shared_test_classes/base/utils/generate_inputs.hpp @@ -7,7 +7,7 @@ #include "openvino/core/preprocess/color_format.hpp" #include "functional_test_utils/common_utils.hpp" -#include "shared_test_classes/base/utils/ranges.hpp" +#include "ranges.hpp" namespace ov { namespace test { diff --git a/src/tests/functional/shared_test_classes/include/shared_test_classes/base/utils/ranges.hpp b/src/tests/functional/shared_test_classes/include/shared_test_classes/base/utils/ranges.hpp index 342e5863d19d3f..b3a2e6e6430a62 100644 --- a/src/tests/functional/shared_test_classes/include/shared_test_classes/base/utils/ranges.hpp +++ b/src/tests/functional/shared_test_classes/include/shared_test_classes/base/utils/ranges.hpp @@ -10,6 +10,7 @@ #include #include "common_test_utils/ov_tensor_utils.hpp" +#include "common_test_utils/type_ranges.hpp" #include "openvino/core/node.hpp" #include "openvino/op/abs.hpp" #include "openvino/op/acos.hpp" @@ -112,177 +113,35 @@ #include "openvino/op/topk.hpp" #include "openvino/op/unsqueeze.hpp" #include "openvino/op/variadic_split.hpp" +#include "openvino/op/cum_sum.hpp" +#include "openvino/op/mvn.hpp" +#include "openvino/op/gru_cell.hpp" +#include "openvino/op/gru_sequence.hpp" +#include "openvino/op/if.hpp" +#include "openvino/op/tensor_iterator.hpp" +#include "openvino/op/group_normalization.hpp" +#include "openvino/op/reverse_sequence.hpp" +#include "openvino/op/gather_tree.hpp" +#include "openvino/op/deformable_psroi_pooling.hpp" +#include "openvino/op/softmax.hpp" +#include "openvino/op/psroi_pooling.hpp" +#include "ov_ops/augru_sequence.hpp" +#include "ov_ops/augru_cell.hpp" +#include "openvino/op/roll.hpp" +#include "openvino/op/lstm_cell.hpp" +#include "openvino/op/lstm_sequence.hpp" +#include "openvino/op/squared_difference.hpp" +#include "openvino/op/scaled_dot_product_attention.hpp" +#include "openvino/op/transpose.hpp" +#include "openvino/op/loop.hpp" +#include "openvino/op/squared_difference.hpp" +#include "openvino/op/avg_pool.hpp" + namespace ov { namespace test { namespace utils { -static ov::test::utils::InputGenerateData get_range_by_type(ov::element::Type temp_type) { - double min_start = 0 - (int32_t)round(testing::internal::Random::kMaxRange / 2); - uint32_t max_range = testing::internal::Random::kMaxRange - 1; - - ov::test::utils::InputGenerateData inData(min_start, max_range); -#define CASE_T(X) \ - case X: { \ - auto lowest = std::numeric_limits::value_type>::lowest(); \ - auto max = std::numeric_limits::value_type>::max(); \ - double tmp_range = static_cast(max) - static_cast(lowest); \ - if (tmp_range < testing::internal::Random::kMaxRange) { \ - inData.start_from = lowest; \ - inData.range = (uint32_t)round(tmp_range); \ - } else { \ - inData.range = testing::internal::Random::kMaxRange - 1; \ - inData.start_from = lowest > min_start ? static_cast(lowest) : min_start; \ - } \ - break; \ - } - - switch (temp_type) { - case (ov::element::Type_t::undefined): { - inData.start_from = min_start; - inData.range = max_range; - break; - } - case (ov::element::Type_t::dynamic): { - inData.start_from = min_start; - inData.range = max_range; - break; - } - case (ov::element::Type_t::boolean): { - inData.start_from = 0; - inData.range = 2; - break; - } - case (ov::element::Type_t::bf16): { - ov::bfloat16 lowest_tmp = std::numeric_limits::lowest(); - ov::bfloat16 max_tmp = std::numeric_limits::max(); - - double lowest = 0 - static_cast(lowest_tmp.to_bits()); - double max = max_tmp.to_bits(); - - double tmp_range = max - lowest; - if (tmp_range < testing::internal::Random::kMaxRange) { - inData.start_from = lowest; - inData.range = (uint32_t)round(tmp_range); - } else { - inData.start_from = lowest > min_start ? lowest : min_start; - inData.range = testing::internal::Random::kMaxRange - 1; - } - - break; - } - case ov::element::Type_t::f16: { - ov::float16 lowest_tmp = std::numeric_limits::lowest(); - ov::float16 max_tmp = std::numeric_limits::max(); - - double lowest = 0 - static_cast(lowest_tmp.to_bits()); - double max = max_tmp.to_bits(); - - double tmp_range = max - lowest; - if (tmp_range < testing::internal::Random::kMaxRange) { - inData.start_from = lowest; - inData.range = (uint32_t)round(tmp_range); - } else { - inData.start_from = lowest > min_start ? lowest : min_start; - inData.range = testing::internal::Random::kMaxRange - 1; - } - - break; - } - case ov::element::Type_t::f8e4m3: { - ov::float8_e4m3 lowest_tmp = std::numeric_limits::lowest(); - ov::float8_e4m3 max_tmp = std::numeric_limits::max(); - - double lowest = 0 - static_cast(lowest_tmp.to_bits()); - double max = max_tmp.to_bits(); - - double tmp_range = max - lowest; - if (tmp_range < testing::internal::Random::kMaxRange) { - inData.start_from = lowest; - inData.range = (uint32_t)round(tmp_range); - } else { - inData.start_from = lowest > min_start ? lowest : min_start; - inData.range = testing::internal::Random::kMaxRange - 1; - } - - break; - } - case ov::element::Type_t::f8e5m2: { - ov::float8_e5m2 lowest_tmp = std::numeric_limits::lowest(); - ov::float8_e5m2 max_tmp = std::numeric_limits::max(); - - double lowest = 0 - static_cast(lowest_tmp.to_bits()); - double max = max_tmp.to_bits(); - - double tmp_range = max - lowest; - if (tmp_range < testing::internal::Random::kMaxRange) { - inData.start_from = lowest; - inData.range = (uint32_t)round(tmp_range); - } else { - inData.start_from = lowest > min_start ? lowest : min_start; - inData.range = testing::internal::Random::kMaxRange - 1; - } - - break; - } - case ov::element::Type_t::string: { - auto lowest = std::numeric_limits::lowest(); - auto max = std::numeric_limits::max(); - - double tmp_range = static_cast(max) - static_cast(lowest); - if (tmp_range < testing::internal::Random::kMaxRange) { - inData.start_from = lowest; - inData.range = (uint32_t)round(tmp_range); - } else { - inData.start_from = lowest > min_start ? lowest : min_start; - inData.range = testing::internal::Random::kMaxRange - 1; - } - - break; - } - CASE_T(ov::element::Type_t::f32) - CASE_T(ov::element::Type_t::f64) - CASE_T(ov::element::Type_t::i4) - CASE_T(ov::element::Type_t::i8) - CASE_T(ov::element::Type_t::i16) - CASE_T(ov::element::Type_t::i32) - CASE_T(ov::element::Type_t::i64) - CASE_T(ov::element::Type_t::u1) - CASE_T(ov::element::Type_t::u2) - CASE_T(ov::element::Type_t::u3) - CASE_T(ov::element::Type_t::u4) - CASE_T(ov::element::Type_t::u6) - CASE_T(ov::element::Type_t::u8) - CASE_T(ov::element::Type_t::nf4) - CASE_T(ov::element::Type_t::u16) - CASE_T(ov::element::Type_t::u32) - CASE_T(ov::element::Type_t::u64) - break; - } - - return inData; -} - -struct RangeByType { - std::map data; - - RangeByType() { - for (auto& type : ov::element::Type::get_known_types()) { - data[*type] = get_range_by_type(*type); - } - } - - ov::test::utils::InputGenerateData get_range(ov::element::Type type) { - if (data.count(type) > 0) { - return data.at(type); - } else { - throw std::runtime_error("Couln't find Type in typeMap: " + type.to_string()); - } - } -}; - -static RangeByType rangeByType; - struct Range { std::vector int_port_ranges; std::vector real_port_ranges; @@ -390,6 +249,8 @@ static std::map inputRanges = { {ov::op::v5::Round::get_type_info_static(), Range({{0, 15}}, {{-10, 20, 4}})}, {ov::op::v7::Gelu::get_type_info_static(), Range({{0, 15}}, {{-1, 2, 32768}})}, {ov::op::v8::MaxPool::get_type_info_static(), Range({{0, 10, 1, 1}}, {{0, 10, 1, 1}})}, + {ov::op::v1::MaxPool::get_type_info_static(), Range({{0, 10, 1, 1}}, {{0, 10, 1, 1}})}, + {ov::op::v1::AvgPool::get_type_info_static(), Range({{0, 10, 1, 1}}, {{0, 10, 1, 1}})}, {ov::op::v9::SoftSign::get_type_info_static(), Range({{0, 15}}, {{-100, 200, 32768}})}, // new temp {ov::op::v1::Convolution::get_type_info_static(), Range({{0, 15}}, {{0, 8, 32}})}, @@ -402,6 +263,7 @@ static std::map inputRanges = { {ov::op::v0::RegionYolo::get_type_info_static(), Range({{0, 15}}, {{0, 8, 32}})}, {ov::op::v0::MatMul::get_type_info_static(), Range({{0, 15}}, {{0, 8, 32}})}, {ov::op::v11::Interpolate::get_type_info_static(), Range({{0, 15}}, {{0, 8, 32}})}, + {ov::op::v4::Interpolate::get_type_info_static(), Range({{0, 15}}, {{0, 8, 32}})}, {ov::op::v0::LRN::get_type_info_static(), Range({{0, 15}}, {{0, 8, 32}})}, {ov::op::v1::Pad::get_type_info_static(), Range({{0, 15}}, {{0, 8, 32}})}, {ov::op::v3::Broadcast::get_type_info_static(), Range({{0, 2000}}, {{0, 2000, 32768}})}, @@ -427,12 +289,10 @@ static std::map inputRanges = { {ov::op::v1::ReduceLogicalAnd::get_type_info_static(), Range({{0, 2}}, {{0, 2}})}, {ov::op::v1::ReduceLogicalOr::get_type_info_static(), Range({{0, 2}}, {{0, 2}})}, {ov::op::v1::Reshape::get_type_info_static(), Range({{-1000, 2000}, {0, 256, 1, 1, true}}, {{-100, 200, 32768}})}, - {ov::op::v4::Interpolate::get_type_info_static(), Range({{0, 15}}, {{0, 8, 32}})}, {ov::op::v3::TopK::get_type_info_static(), Range({{-1000, 2000}, {0, 1000, 1, 1, true}}, {{-1000, 2000, 32768}})}, {ov::op::v11::TopK::get_type_info_static(), Range({{-1000, 2000}, {0, 1000, 1, 1, true}}, {{-1000, 2000, 32768}})}, {ov::op::v4::Range::get_type_info_static(), Range({{0, 15}, {1, 1000, 1, 1, true}}, {{-1000, 2000, 32768}, {1, 1000, 1, 1, true}})}, - {ov::op::v11::Interpolate::get_type_info_static(), Range({{0, 15}}, {{-1000, 2000, 32768}})}, {ov::op::v9::ROIAlign::get_type_info_static(), Range({{0, 15}, {0, 1000, 1, 1, true}, {0, 1000, 1, 1, true}}, {{-1000, 2000, 32768}, {0, 1000, 1, 1, true}, {0, 1000, 1, 1, true}})}, {ov::op::v0::Convert::get_type_info_static(), Range({{0, 1000}}, {{-100, 200, 32768}})}, @@ -451,6 +311,27 @@ static std::map inputRanges = { {ov::op::v7::Einsum::get_type_info_static(), Range({{0, 15}}, {{0, 8, 32}})}, {ov::op::v8::RandomUniform::get_type_info_static(), Range({{0, 15}}, {{0, 8, 32}})}, {ov::op::v9::Eye::get_type_info_static(), Range({{0, 15}}, {{0, 8, 32}})}, + {ov::op::v0::CumSum::get_type_info_static(), Range({{0, 15}}, {{0, 8, 32}})}, + {ov::op::v0::MVN::get_type_info_static(), Range({{0, 15}}, {{0, 8, 32}})}, + {ov::op::v6::MVN::get_type_info_static(), Range({{0, 15}}, {{0, 8, 32}})}, + {ov::op::v3::GRUCell::get_type_info_static(), Range({{0, 15}}, {{0, 8, 32}})}, + {ov::op::v5::GRUSequence::get_type_info_static(), Range({{0, 15}}, {{0, 8, 32}})}, + {ov::op::v8::If::get_type_info_static(), Range({{0, 15}}, {{0, 8, 32}})}, + {ov::op::v0::TensorIterator::get_type_info_static(), Range({{0, 15}}, {{0, 8, 32}})}, + {ov::op::v12::GroupNormalization::get_type_info_static(), Range({{0, 15}}, {{0, 8, 32}})}, + {ov::op::v0::ReverseSequence::get_type_info_static(), Range({{0, 15}}, {{0, 8, 32}})}, + {ov::op::v1::GatherTree::get_type_info_static(), Range({{0, 15}}, {{0, 8, 32}})}, + {ov::op::v1::DeformablePSROIPooling::get_type_info_static(), Range({{0, 15}}, {{0, 8, 32}})}, + {ov::op::v1::Softmax::get_type_info_static(), Range({{0, 15}}, {{0, 8, 32}})}, + {ov::op::v0::PSROIPooling::get_type_info_static(), Range({{0, 15}}, {{0, 8, 32}})}, + {ov::op::internal::AUGRUSequence::get_type_info_static(), Range({{0, 15}}, {{0, 8, 32}})}, + {ov::op::internal::AUGRUCell::get_type_info_static(), Range({{0, 15}}, {{0, 8, 32}})}, + {ov::op::v7::Roll::get_type_info_static(), Range({{0, 15}}, {{0, 8, 32}})}, + {ov::op::v4::LSTMCell::get_type_info_static(), Range({{0, 15}}, {{0, 8, 32}})}, + {ov::op::v13::ScaledDotProductAttention::get_type_info_static(), Range({{0, 15}}, {{0, 8, 32}})}, + {ov::op::v1::Transpose::get_type_info_static(), Range({{0, 15}}, {{0, 8, 32}})}, + {ov::op::v5::Loop::get_type_info_static(), Range({{0, 15}}, {{0, 8, 32}})}, + {ov::op::v0::SquaredDifference::get_type_info_static(), Range({{0, 15}}, {{0, 8, 32}})}, }; class ModelRange { diff --git a/src/tests/functional/shared_test_classes/src/base/ov_subgraph.cpp b/src/tests/functional/shared_test_classes/src/base/ov_subgraph.cpp index 2df908bbba2273..aaa196cd5af13f 100644 --- a/src/tests/functional/shared_test_classes/src/base/ov_subgraph.cpp +++ b/src/tests/functional/shared_test_classes/src/base/ov_subgraph.cpp @@ -271,7 +271,9 @@ void SubgraphBaseTest::configure_model() { { auto& params = function->get_parameters(); for (size_t i = 0; i < params.size(); i++) { - if (inType != ov::element::Type_t::undefined) { + if (!inTypes.empty() && i < inTypes.size() && inTypes[i] != ov::element::Type_t::undefined) { + p.input(i).tensor().set_element_type(inTypes[i]); + } else if (inType != ov::element::Type_t::undefined) { p.input(i).tensor().set_element_type(inType); } } @@ -281,7 +283,9 @@ void SubgraphBaseTest::configure_model() { { auto results = function->get_results(); for (size_t i = 0; i < results.size(); i++) { - if (outType != ov::element::Type_t::undefined) { + if (!outTypes.empty() && i < outTypes.size() && outTypes[i] != ov::element::Type_t::undefined) { + p.output(i).tensor().set_element_type(outTypes[i]); + } else if (outType != ov::element::Type_t::undefined) { p.output(i).tensor().set_element_type(outType); } } diff --git a/src/tests/functional/shared_test_classes/src/base/utils/generate_inputs.cpp b/src/tests/functional/shared_test_classes/src/base/utils/generate_inputs.cpp index 756a8482993220..a74960d0a98575 100644 --- a/src/tests/functional/shared_test_classes/src/base/utils/generate_inputs.cpp +++ b/src/tests/functional/shared_test_classes/src/base/utils/generate_inputs.cpp @@ -971,6 +971,20 @@ ov::Tensor generate(const std::shared_ptr& node, + size_t port, + const ov::element::Type& elemType, + const ov::Shape& targetShape, + std::shared_ptr inGenRangeData = nullptr) { + if (port == 1) { + auto seq_axis = node->get_sequence_axis(); + // range - [start_data, start_data + range) + InputGenerateData inGenData(1, seq_axis + 1); + return ov::test::utils::create_and_fill_tensor(elemType, targetShape, inGenData); + } + return generate(std::dynamic_pointer_cast(node), port, elemType, targetShape, inGenRangeData); +} + template ov::Tensor generateInput(const std::shared_ptr& node, size_t port, diff --git a/src/tests/functional/shared_test_classes/src/base/utils/ranges.cpp b/src/tests/functional/shared_test_classes/src/base/utils/ranges.cpp index 85a04402a2f142..48c6f70db877cd 100644 --- a/src/tests/functional/shared_test_classes/src/base/utils/ranges.cpp +++ b/src/tests/functional/shared_test_classes/src/base/utils/ranges.cpp @@ -44,7 +44,7 @@ ov::Tensor ModelRange::generate_input(std::shared_ptr node, size_t por void ModelRange::find_mode_ranges(const std::shared_ptr& model) { for (auto param : model->get_parameters()) { std::shared_ptr data = - std::make_shared(rangeByType.get_range(param->get_element_type())); + std::make_shared(ov::test::utils::rangeByType.get_range(param->get_element_type())); bool range_corrected = true; std::queue> queue; @@ -80,6 +80,7 @@ void ModelRange::find_mode_ranges(const std::shared_ptr& model) { } } } catch (const std::exception& ex) { + (void)ex; #ifndef NDEBUG std::cout << ex.what() << std::endl; #endif diff --git a/src/tests/functional/shared_test_classes/src/single_op/eltwise.cpp b/src/tests/functional/shared_test_classes/src/single_op/eltwise.cpp index 359782bf3173be..dac9dd348a48c9 100644 --- a/src/tests/functional/shared_test_classes/src/single_op/eltwise.cpp +++ b/src/tests/functional/shared_test_classes/src/single_op/eltwise.cpp @@ -79,6 +79,10 @@ void EltwiseLayerTest::SetUp() { std::tie(shapes, eltwise_type, secondary_input_type, op_type, model_type, inType, outType, targetDevice, configuration) = this->GetParam(); init_input_shapes(shapes); + if (inType == ov::element::undefined) { + inType = model_type; + } + ov::ParameterVector parameters{std::make_shared(model_type, inputDynamicShapes.front())}; ov::PartialShape shape_input_secondary; diff --git a/src/tests/functional/shared_test_classes/src/single_op/gru_sequence.cpp b/src/tests/functional/shared_test_classes/src/single_op/gru_sequence.cpp index fe4f387aadb575..4ce920a007cc58 100644 --- a/src/tests/functional/shared_test_classes/src/single_op/gru_sequence.cpp +++ b/src/tests/functional/shared_test_classes/src/single_op/gru_sequence.cpp @@ -62,11 +62,12 @@ void GRUSequenceTest::SetUp() { ov::op::RecurrentSequenceDirection direction; InputLayerType wbr_type; ov::test::utils::SequenceTestsMode mode; + ov::element::Type_t in_type = ov::element::undefined; std::tie(mode, shapes, activations, clip, linear_before_reset, direction, wbr_type, - inType, targetDevice) = this->GetParam(); - outType = inType; + in_type, targetDevice) = this->GetParam(); + outType = in_type; init_input_shapes(shapes); - if (inType == ElementType::bf16 || inType == ElementType::f16) { + if (in_type == ElementType::bf16 || in_type == ElementType::f16) { rel_threshold = 1e-2; } @@ -80,9 +81,9 @@ void GRUSequenceTest::SetUp() { 1lu; max_seq_lengths = seq_lengths; - ov::ParameterVector params{std::make_shared(inType, inputDynamicShapes[0]), - std::make_shared(inType, inputDynamicShapes[1])}; - + ov::ParameterVector params{std::make_shared(in_type, inputDynamicShapes[0]), + std::make_shared(in_type, inputDynamicShapes[1])}; + inTypes = {in_type, in_type}; const auto& w_shape = ov::Shape{num_directions, 3 * hidden_size, input_size}; const auto& r_shape = ov::Shape{num_directions, 3 * hidden_size, hidden_size}; const auto& b_shape = ov::Shape{num_directions, (linear_before_reset ? 4 : 3) * hidden_size}; @@ -94,6 +95,7 @@ void GRUSequenceTest::SetUp() { auto param = std::make_shared(ov::element::i64, inputDynamicShapes[2]); param->set_friendly_name("seq_lengths"); params.push_back(param); + inTypes.push_back(ov::element::i64); seq_lengths_node = param; } else if (mode == SequenceTestsMode::CONVERT_TO_TI_RAND_SEQ_LEN_CONST || mode == SequenceTestsMode::PURE_SEQ_RAND_SEQ_LEN_CONST) { @@ -109,23 +111,26 @@ void GRUSequenceTest::SetUp() { std::shared_ptr w, r, b; if (wbr_type == InputLayerType::PARAMETER) { - const auto w_param = std::make_shared(inType, w_shape); - const auto r_param = std::make_shared(inType, r_shape); - const auto b_param = std::make_shared(inType, b_shape); + const auto w_param = std::make_shared(in_type, w_shape); + const auto r_param = std::make_shared(in_type, r_shape); + const auto b_param = std::make_shared(in_type, b_shape); w = w_param; r = r_param; b = b_param; params.push_back(w_param); params.push_back(r_param); params.push_back(b_param); + inTypes.push_back(in_type); + inTypes.push_back(in_type); + inTypes.push_back(in_type); } else { - auto tensor_w = ov::test::utils::create_and_fill_tensor(inType, w_shape); + auto tensor_w = ov::test::utils::create_and_fill_tensor(in_type, w_shape); w = std::make_shared(tensor_w); - auto tensor_R = ov::test::utils::create_and_fill_tensor(inType, r_shape); + auto tensor_R = ov::test::utils::create_and_fill_tensor(in_type, r_shape); r = std::make_shared(tensor_R); - auto tensor_B = ov::test::utils::create_and_fill_tensor(inType, b_shape); + auto tensor_B = ov::test::utils::create_and_fill_tensor(in_type, b_shape); b = std::make_shared(tensor_B); } diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/data_utils.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/data_utils.hpp index d5df2ba080aa5f..e42e0f61b70d96 100644 --- a/src/tests/test_utils/common_test_utils/include/common_test_utils/data_utils.hpp +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/data_utils.hpp @@ -243,23 +243,25 @@ void inline fill_data_random(T* pointer, } else { if (std::numeric_limits::is_integer) { std::mt19937 gen(seed); - std::uniform_int_distribution dist(static_cast(start_from), - static_cast(start_from + static_cast(range))); + std::uniform_int_distribution dist( + static_cast(start_from), + static_cast(start_from + static_cast(range - 1))); for (std::size_t i = 0; i < size; i++) { pointer[i] = static_cast(dist(gen)); } } else { std::mt19937 gen(seed); - std::uniform_real_distribution dist(static_cast(start_from), - static_cast(start_from + static_cast(range))); + std::uniform_real_distribution dist( + static_cast(start_from), + static_cast(start_from + static_cast(range - 1))); for (std::size_t i = 0; i < size; i++) { double value = dist(gen); if (std::is_same::value) { - pointer[i] = static_cast(ov::float16(value)); + pointer[i] = static_cast(ov::float16(value).to_bits()); } else if (std::is_same::value) { - pointer[i] = static_cast(ov::bfloat16(value)); + pointer[i] = static_cast(ov::bfloat16(value).to_bits()); } else { pointer[i] = static_cast(value); } diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/ov_tensor_utils.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/ov_tensor_utils.hpp index fb26f18b25888f..8bc454f035cf44 100644 --- a/src/tests/test_utils/common_test_utils/include/common_test_utils/ov_tensor_utils.hpp +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/ov_tensor_utils.hpp @@ -78,12 +78,12 @@ struct InputGenerateData { // could not find range - -----start_new---range*res new-----start_curr-----range*res curr--- if (start_from > new_max) { success = false; -// #ifndef NDEBUG +#ifndef NDEBUG std::cout << " FAIL TO FIND RANGE: current->start_from > new_range->start_from + new_range->range " << " current->start_from: " << std::to_string(start_from) << " new_range->start_from: " << std::to_string(new_range->start_from) << " new_range max: " << std::to_string(new_max) << std::endl; -// #endif +#endif } else if (current_max > new_max) { range = (uint32_t)round(new_max - start_from); resolution = new_range->resolution > resolution ? new_range->resolution : resolution; @@ -95,12 +95,12 @@ struct InputGenerateData { // could not find range - -----start_curr---range*res curr-----start_new-----range*res new--- if (current_max < new_range->start_from) { success = false; -// #ifndef NDEBUG +#ifndef NDEBUG std::cout << " FAIL TO FIND RANGE: current->start_from + current->range < new_range->start_from " << " new_range start_from: " << std::to_string(new_range->start_from) << " current->start_from: " << std::to_string(start_from) << " current max: " << std::to_string(current_max) << std::endl; -// #endif +#endif } else if (current_max >= new_max) { start_from = new_range->start_from; range = new_range->range; @@ -136,12 +136,12 @@ struct InputGenerateData { // could not find range - -----start_new---range*res new-----start_curr-----range*res curr--- if (start_from > new_max) { success = false; -// #ifndef NDEBUG +#ifndef NDEBUG std::cout << " FAIL TO FIND RANGE: current->start_from > new_range->start_from + new_range->range " << " current->start_from: " << std::to_string(start_from) << " new_range->start_from: " << std::to_string(new_range.start_from) << " new_range max: " << std::to_string(new_max) << std::endl; -// #endif +#endif } else if (current_max > new_max) { range = (uint32_t)round(new_max - start_from); resolution = new_range.resolution > resolution ? new_range.resolution : resolution; @@ -153,12 +153,12 @@ struct InputGenerateData { // could not find range - -----start_curr---range*res curr-----start_new-----range*res new--- if (current_max < new_range.start_from) { success = false; -// #ifndef NDEBUG +#ifndef NDEBUG std::cout << " FAIL TO FIND RANGE: current->start_from + current->range < new_range->start_from " << " new_range start_from: " << std::to_string(new_range.start_from) << " current->start_from: " << std::to_string(start_from) << " current max: " << std::to_string(current_max) << std::endl; -// #endif +#endif } else if (current_max >= new_max) { start_from = new_range.start_from; range = new_range.range; diff --git a/src/tests/test_utils/common_test_utils/tests/CMakeLists.txt b/src/tests/test_utils/common_test_utils/tests/CMakeLists.txt index c994ed5f75cc3e..69f9d716b35ce5 100644 --- a/src/tests/test_utils/common_test_utils/tests/CMakeLists.txt +++ b/src/tests/test_utils/common_test_utils/tests/CMakeLists.txt @@ -10,8 +10,9 @@ ov_add_test_target( DEPENDENCIES LINK_LIBRARIES common_test_utils + func_test_utils sharedTestClasses ADD_CPPLINT LABELS OV UNIT -) +) \ No newline at end of file diff --git a/src/tests/test_utils/common_test_utils/tests/core_config.cpp b/src/tests/test_utils/common_test_utils/tests/core_config.cpp new file mode 100644 index 00000000000000..71fb033de4bcd1 --- /dev/null +++ b/src/tests/test_utils/common_test_utils/tests/core_config.cpp @@ -0,0 +1,15 @@ +// Copyright (C) 2018-2024 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "common_test_utils/file_utils.hpp" +#include "shared_test_classes/base/ov_subgraph.hpp" +#include "openvino/util/file_util.hpp" + +namespace ov { +namespace test { + +void core_configuration(ov::test::SubgraphBaseTest* test) {} + +} // namespace test +} // namespace ov \ No newline at end of file diff --git a/src/tests/test_utils/common_test_utils/tests/generate_intepus.cpp b/src/tests/test_utils/common_test_utils/tests/generate_intepus.cpp index 9368404acd22b9..0e368d2bbdfb43 100644 --- a/src/tests/test_utils/common_test_utils/tests/generate_intepus.cpp +++ b/src/tests/test_utils/common_test_utils/tests/generate_intepus.cpp @@ -5,6 +5,7 @@ #include #include "openvino/op/util/op_types.hpp" +#include "common_test_utils/type_ranges.hpp" #include "shared_test_classes/base/utils/ranges.hpp" #include "shared_test_classes/base/utils/generate_inputs.hpp" @@ -14,6 +15,7 @@ #include "openvino/op/result.hpp" #include "openvino/op/reduce_mean.hpp" #include "openvino/op/floor_mod.hpp" +#include "openvino/op/reshape.hpp" using namespace testing; using namespace ov::util;