Skip to content

Commit

Permalink
Remove ngraph::helper (#22704)
Browse files Browse the repository at this point in the history
### Details:
 - Port required functions to `common_test_utils/test_helpers.*pp`
 - Delete `ov_models` target

### Tickets:
 - [CVS-123998](https://jira.devtools.intel.com/browse/CVS-123998)
  • Loading branch information
vurusovs authored Feb 23, 2024
1 parent bdf6fce commit d58efea
Show file tree
Hide file tree
Showing 60 changed files with 658 additions and 1,250 deletions.
1 change: 1 addition & 0 deletions src/common/transformations/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ ov_add_test_target(
gmock
func_test_utils
openvino::offline_transformations
openvino::reference
sharedTestClasses
ov_lpt_models
ADD_CLANG_FORMAT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

#include "auto_func_test.hpp"
#include "common_test_utils/include/common_test_utils/ov_tensor_utils.hpp"
#include "common_test_utils/ov_test_utils.hpp"
#include "common_test_utils/test_common.hpp"
#include "ov_models/utils/ov_helpers.hpp"

namespace ov {
namespace auto_plugin {
Expand Down Expand Up @@ -76,7 +76,7 @@ class Consistency_Test : public AutoFuncTests, public testing::WithParamInterfac
inf_req.set_tensor(iter, tensor);
}
}
auto refOutData = ngraph::helpers::interpretFunction(model_cannot_batch, input_data);
auto refOutData = ov::test::utils::infer_on_template(model_cannot_batch, input_data);
ref.push_back(refOutData);
}
for (size_t i = 0; i < 50; i++) {
Expand Down
2 changes: 0 additions & 2 deletions src/plugins/auto/tests/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@ ov_add_test_target(
${CMAKE_CURRENT_SOURCE_DIR}
${OpenVINO_SOURCE_DIR}/src/plugins/auto/src
LINK_LIBRARIES
ov_models
unit_test_utils
ADD_CPPLINT
DEPENDENCIES
openvino_template_extension
mock_engine
ov_models
LABELS
OV UNIT MULTI AUTO
)
Expand Down
2 changes: 0 additions & 2 deletions src/plugins/auto_batch/tests/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ ov_add_test_target(
${SHARED_HEADERS_DIR}
LINK_LIBRARIES
unit_test_utils
ov_models
DEPENDENCIES
mock_engine
ov_models
ADD_CPPLINT
LABELS
OV UNIT AUTO_BATCH
Expand Down
1 change: 0 additions & 1 deletion src/plugins/hetero/tests/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ ov_add_test_target(
${OBJ_LIB}
LINK_LIBRARIES
unit_test_utils
ov_models
DEPENDENCIES
mock_engine
ADD_CLANG_FORMAT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "common_test_utils/test_enums.hpp"
#include "utils/cpu_test_utils.hpp"
#include "gtest/gtest.h"
#include "common_test_utils/test_enums.hpp"

namespace ov {
namespace test {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "common_test_utils/test_enums.hpp"
#include "shared_test_classes/base/ov_subgraph.hpp"
#include "utils/cpu_test_utils.hpp"
#include "common_test_utils/test_enums.hpp"

using namespace CPUTestUtils;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "custom/single_layer_tests/classes/activation.hpp"
#include "utils/cpu_test_utils.hpp"
#include "common_test_utils/test_enums.hpp"

using namespace CPUTestUtils;
using namespace ov::test::utils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "shared_test_classes/base/ov_subgraph.hpp"
#include "shared_test_classes/base/utils/ranges.hpp"
#include "utils/cpu_test_utils.hpp"
#include "common_test_utils/test_enums.hpp"

using namespace CPUTestUtils;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "openvino/op/pad.hpp"
#include "shared_test_classes/base/ov_subgraph.hpp"
#include "utils/cpu_test_utils.hpp"
#include "common_test_utils/test_enums.hpp"

using namespace CPUTestUtils;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "common_test_utils/test_enums.hpp"
#include "shared_test_classes/base/ov_subgraph.hpp"
#include "utils/cpu_test_utils.hpp"
#include "common_test_utils/test_enums.hpp"

using namespace CPUTestUtils;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "common_test_utils/test_enums.hpp"
#include "shared_test_classes/base/ov_subgraph.hpp"
#include "utils/cpu_test_utils.hpp"
#include "common_test_utils/test_enums.hpp"

using namespace CPUTestUtils;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include "shared_test_classes/base/ov_subgraph.hpp"
#include "utils/cpu_test_utils.hpp"
#include "common_test_utils/test_enums.hpp"

using namespace CPUTestUtils;
using namespace ov::test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "common_test_utils/test_enums.hpp"
#include "shared_test_classes/base/ov_subgraph.hpp"
#include "utils/cpu_test_utils.hpp"
#include "common_test_utils/test_enums.hpp"

using namespace CPUTestUtils;
using namespace ov;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "common_test_utils/test_enums.hpp"
#include "shared_test_classes/base/ov_subgraph.hpp"
#include "utils/cpu_test_utils.hpp"
#include "common_test_utils/test_enums.hpp"

using namespace ov::test;
using namespace CPUTestUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//

#include "shared_test_classes/base/ov_subgraph.hpp"
#include "ov_models/utils/data_utils.hpp"
#include "common_test_utils/data_utils.hpp"
#include "openvino/runtime/aligned_buffer.hpp"

namespace ov {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "custom/subgraph_tests/include/fuse_transpose_reorder.hpp"
#include "common_test_utils/node_builders/constant.hpp"
#include "common_test_utils/node_builders/convolution.hpp"
#include "ov_models/preprocess/preprocess_builders.hpp"
#include "common_test_utils/subgraph_builders/preprocess_builders.hpp"
#include "openvino/openvino.hpp"
#include "functional_test_utils/skip_tests_config.hpp"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "common_test_utils/node_builders/fake_quantize.hpp"
#include "cpu_test_utils.hpp"
#include "openvino/runtime/system_conf.hpp"
#include "ov_models/utils/data_utils.hpp"
#include "common_test_utils/data_utils.hpp"
#include "openvino/op/multiply.hpp"
#include "openvino/op/add.hpp"
#include "openvino/op/matmul.hpp"
Expand Down
1 change: 0 additions & 1 deletion src/plugins/intel_cpu/tests/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ ov_add_test_target(
openvino::shape_inference
openvino_runtime_s
unit_test_utils
ov_models
ov_snippets_models
snippets_test_utils
${MLAS_LIBRARY}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include "shared_test_classes/base/ov_subgraph.hpp"
#include "common_test_utils/ov_tensor_utils.hpp"
#include "common_test_utils/test_enums.hpp"
#include "ov_models/utils/ov_helpers.hpp"

#include "openvino/op/parameter.hpp"
#include "openvino/op/constant.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include "common_test_utils/file_utils.hpp"
#include "subgraphs_builders.hpp"
#include "shared_test_classes/base/utils/compare_results.hpp"
#include "ov_models/utils/ov_helpers.hpp"

#include "openvino/op/parameter.hpp"
#include "openvino/op/result.hpp"
Expand Down Expand Up @@ -100,18 +99,6 @@ const std::vector<std::vector<InputShape>> input_shapes_basic = {
},
};

void resize_function(std::shared_ptr<ov::Model> function, const std::vector<ov::Shape>& targetInputStaticShapes) {
auto inputs = function->inputs();
std::map<ov::Output<ov::Node>, ov::PartialShape> shapes;
OPENVINO_ASSERT(inputs.size() <= targetInputStaticShapes.size(),
"targetInputStaticShapes.size() = ", targetInputStaticShapes.size(), " != inputs.size() = ", inputs.size());

for (size_t i = 0; i < inputs.size(); i++) {
shapes.insert({inputs[i], targetInputStaticShapes[i]});
}
function->reshape(shapes);
}

INSTANTIATE_TEST_SUITE_P(smoke_GPU_Dynamic,
KVCacheTest,
::testing::Combine(::testing::ValuesIn(input_shapes_basic),
Expand Down Expand Up @@ -166,7 +153,12 @@ class KVCacheTests: public ::testing::Test {
auto ref_model = model->clone();
ov::Tensor kv_cache_copy(kv_cache.get_element_type(), kv_cache.get_shape());
kv_cache.copy_to(kv_cache_copy);
resize_function(ref_model, {kv_cache_copy.get_shape(), new_token_data.get_shape(), matmul_data.get_shape()});
std::map<ov::Output<ov::Node>, ov::PartialShape> shapes = {
{ref_model->input(0), kv_cache_copy.get_shape()},
{ref_model->input(1), new_token_data.get_shape()},
{ref_model->input(2), matmul_data.get_shape()}
};
ref_model->reshape(shapes);

auto compiled_model_ref = core->compile_model(ref_model, ov::test::utils::DEVICE_TEMPLATE);
auto inf_req_ref = compiled_model_ref.create_infer_request();
Expand Down Expand Up @@ -349,18 +341,21 @@ class KVCacheTests: public ::testing::Test {
auto input1 = ref_model->get_parameters().at(1);
auto input2 = ref_model->get_parameters().at(2);
auto input3 = fuse_cache_reorder ? ref_model->get_parameters().at(3) : nullptr;
std::vector<ov::Shape> input_shapes = {kv_cache.get_shape(), new_token_data.get_shape(), matmul_data.get_shape()};
std::map<ov::Output<ov::Node>, ov::PartialShape> input_shapes = {
{input0, kv_cache.get_shape()},
{input1, new_token_data.get_shape()},
{input2, matmul_data.get_shape()}
};
std::map<std::shared_ptr<ov::Node>, ov::Tensor> inputs = {
{input0, kv_cache},
{input1, new_token_data},
{input2, matmul_data}
};
if (fuse_cache_reorder) {
input_shapes.push_back(beam_idx_shape);
input_shapes[input3] = beam_idx_shape;
inputs.emplace(input3, beam_idx_data);
}

resize_function(ref_model, input_shapes);
ref_model->reshape(input_shapes);
return ov::test::utils::infer_on_template(ref_model, inputs);
};

Expand Down
2 changes: 1 addition & 1 deletion src/tests/functional/plugin/shared/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ ov_add_target(
openvino::pugixml
common_test_utils
func_test_utils
ov_models
ov_models # TODO (vurusovs): delete after migration of NVidia and NPU
ov_lpt_models
sharedTestClasses
PRIVATE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@


#include "common_test_utils/common_utils.hpp"
#include "ov_models/pass/convert_prc.hpp"
#include "ov_lpt_models/fake_quantize_and_convolution.hpp"

namespace LayerTestsDefinitions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@


#include "common_test_utils/common_utils.hpp"
#include "ov_models/pass/convert_prc.hpp"
#include "ov_lpt_models/fake_quantize_and_convolution.hpp"

namespace LayerTestsDefinitions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@


#include "common_test_utils/common_utils.hpp"
#include "ov_models/pass/convert_prc.hpp"
#include "ov_lpt_models/convolution.hpp"

namespace LayerTestsDefinitions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "openvino/op/depth_to_space.hpp"
#include "openvino/pass/constant_folding.hpp"
#include "ov_lpt_models/depth_to_space.hpp"
#include "ov_models/pass/convert_prc.hpp"
#include "transformations/common_optimizations/depth_to_space_fusion.hpp"
#include "transformations/init_node_info.hpp"
#include "transformations/utils/utils.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@


#include "common_test_utils/common_utils.hpp"
#include "ov_models/pass/convert_prc.hpp"

namespace LayerTestsDefinitions {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@


#include "common_test_utils/common_utils.hpp"
#include "ov_models/pass/convert_prc.hpp"
#include "ov_lpt_models/mat_mul.hpp"

namespace LayerTestsDefinitions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

#include "common_test_utils/common_utils.hpp"

#include "ov_models/pass/convert_prc.hpp"
#include "ov_lpt_models/fuse_convert.hpp"

namespace LayerTestsDefinitions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@


#include "common_test_utils/common_utils.hpp"
#include "ov_models/pass/convert_prc.hpp"
#include "ov_lpt_models/group_convolution.hpp"

namespace LayerTestsDefinitions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@


#include "common_test_utils/common_utils.hpp"
#include "ov_models/pass/convert_prc.hpp"
#include "ov_lpt_models/fake_quantize_and_convolution.hpp"

namespace LayerTestsDefinitions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@


#include "common_test_utils/common_utils.hpp"
#include "ov_models/pass/convert_prc.hpp"
#include "ov_lpt_models/mat_mul_with_optimized_constant_fake_quantize.hpp"

namespace LayerTestsDefinitions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

#include "common_test_utils/common_utils.hpp"

#include "ov_models/pass/convert_prc.hpp"
#include "ov_lpt_models/multiply_to_group_convolution.hpp"

namespace LayerTestsDefinitions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

#include "common_test_utils/common_utils.hpp"

#include "ov_models/pass/convert_prc.hpp"
#include "ov_lpt_models/mvn.hpp"

namespace LayerTestsDefinitions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

#include "common_test_utils/common_utils.hpp"

#include "ov_models/pass/convert_prc.hpp"
#include "ov_lpt_models/normalize_l2.hpp"

namespace LayerTestsDefinitions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "common_test_utils/common_utils.hpp"
#include "common_test_utils/node_builders/fake_quantize.hpp"

#include "ov_models/pass/convert_prc.hpp"

namespace LayerTestsDefinitions {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "common_test_utils/common_utils.hpp"
#include "common_test_utils/node_builders/fake_quantize.hpp"

#include "ov_models/pass/convert_prc.hpp"

namespace LayerTestsDefinitions {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "common_test_utils/common_utils.hpp"
#include "common_test_utils/node_builders/fake_quantize.hpp"

#include "ov_models/pass/convert_prc.hpp"

namespace LayerTestsDefinitions {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@


#include "common_test_utils/common_utils.hpp"
#include "ov_models/pass/convert_prc.hpp"
#include "ov_lpt_models/fake_quantize_and_convolution.hpp"

namespace LayerTestsDefinitions {
Expand Down
Loading

0 comments on commit d58efea

Please sign in to comment.