Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[NPU] Update and add new func tests (#29891)

Bogdan Pereanuff3972d50bf2
diff --git a/src/plugins/intel_npu/tests/functional/internal/overload/ov_plugin/core_integration.hpp b/src/plugins/intel_npu/tests/functional/internal/overload/ov_plugin/core_integration.hpp
index d195df2930b..afd587e4c03 100644
--- a/src/plugins/intel_npu/tests/functional/internal/overload/ov_plugin/core_integration.hpp
+++ b/src/plugins/intel_npu/tests/functional/internal/overload/ov_plugin/core_integration.hpp
@@ -221,7 +221,7 @@ TEST_P(OVClassGetMetricAndPrintNoThrow, DeviceAllocMemSizeLesserAfterModelIsLoad
ASSERT_LE(a1, a2);
}
-TEST_P(OVClassGetMetricAndPrintNoThrow, VpuDeviceAllocMemSizeLesserAfterModelIsLoaded) {
+TEST_P(OVClassGetMetricAndPrintNoThrow, NpuDeviceAllocMemSizeLesserAfterModelIsLoaded) {
SKIP_IF_CURRENT_TEST_IS_DISABLED()
ov::Core ie;
ov::Any p;
@@ -244,7 +244,7 @@ TEST_P(OVClassGetMetricAndPrintNoThrow, VpuDeviceAllocMemSizeLesserAfterModelIsL
ASSERT_LE(a1, a2);
}
-TEST_P(OVClassGetMetricAndPrintNoThrow, VpuDeviceAllocMemSizeSameAfterDestroyCompiledModel) {
+TEST_P(OVClassGetMetricAndPrintNoThrow, NpuDeviceAllocMemSizeSameAfterDestroyCompiledModel) {
SKIP_IF_CURRENT_TEST_IS_DISABLED()
ov::Core core;
ov::Any deviceAllocMemSizeAny;
@@ -256,7 +256,7 @@ TEST_P(OVClassGetMetricAndPrintNoThrow, VpuDeviceAllocMemSizeSameAfterDestroyCom
uint64_t deviceAllocMemSize = deviceAllocMemSizeAny.as<uint64_t>();
uint64_t deviceAllocMemSizeFinal;
- for (size_t i = 0; i < 1000; ++i) {
+ for (size_t i = 0; i < 10; ++i) {
ov::CompiledModel compiledModel;
OV_ASSERT_NO_THROW(compiledModel = core.compile_model(model, target_device));
@@ -269,7 +269,7 @@ TEST_P(OVClassGetMetricAndPrintNoThrow, VpuDeviceAllocMemSizeSameAfterDestroyCom
}
}
-TEST_P(OVClassGetMetricAndPrintNoThrow, VpuDeviceAllocMemSizeSameAfterDestroyInferRequest) {
+TEST_P(OVClassGetMetricAndPrintNoThrow, NpuDeviceAllocMemSizeSameAfterDestroyInferRequest) {
SKIP_IF_CURRENT_TEST_IS_DISABLED()
ov::Core core;
ov::Any deviceAllocMemSizeAny;
@@ -289,7 +289,7 @@ TEST_P(OVClassGetMetricAndPrintNoThrow, VpuDeviceAllocMemSizeSameAfterDestroyInf
uint64_t deviceAllocMemSize = deviceAllocMemSizeAny.as<uint64_t>();
uint64_t deviceAllocMemSizeFinal;
- for (size_t i = 0; i < 1000; ++i) {
+ for (size_t i = 0; i < 10; ++i) {
inferRequest = compiledModel.create_infer_request();
inferRequest.infer();
@@ -302,7 +302,7 @@ TEST_P(OVClassGetMetricAndPrintNoThrow, VpuDeviceAllocMemSizeSameAfterDestroyInf
}
}
-TEST_P(OVClassGetMetricAndPrintNoThrow, VpuDeviceAllocMemSizeSameAfterDestroyInferRequestSetTensor) {
+TEST_P(OVClassGetMetricAndPrintNoThrow, NpuDeviceAllocMemSizeSameAfterDestroyInferRequestSetTensor) {
SKIP_IF_CURRENT_TEST_IS_DISABLED()
ov::Core core;
ov::Any deviceAllocMemSizeAny;
@@ -322,10 +322,11 @@ TEST_P(OVClassGetMetricAndPrintNoThrow, VpuDeviceAllocMemSizeSameAfterDestroyInf
uint64_t deviceAllocMemSize = deviceAllocMemSizeAny.as<uint64_t>();
uint64_t deviceAllocMemSizeFinal;
- for (size_t i = 0; i < 1000; ++i) {
+ auto tensor = ov::Tensor(model->input(0).get_element_type(), model->input(0).get_shape());
+ ov::test::utils::fill_data_random(static_cast<ov::float16*>(tensor.data()), tensor.get_size());
+
+ for (size_t i = 0; i < 10; ++i) {
auto inferRequest = compiledModel.create_infer_request();
- auto tensor = ov::Tensor(model->input(0).get_element_type(), model->input(0).get_shape());
- ov::test::utils::fill_data_random(static_cast<ov::float16*>(tensor.data()), tensor.get_size());
inferRequest.set_input_tensor(tensor);
inferRequest.infer();
@@ -338,7 +339,7 @@ TEST_P(OVClassGetMetricAndPrintNoThrow, VpuDeviceAllocMemSizeSameAfterDestroyInf
}
}
-TEST_P(OVClassGetMetricAndPrintNoThrow, VpuDeviceAllocMemSizeSameAfterDestroyInferRequestGetTensor) {
+TEST_P(OVClassGetMetricAndPrintNoThrow, NpuDeviceAllocMemSizeSameAfterDestroyInferRequestGetTensor) {
SKIP_IF_CURRENT_TEST_IS_DISABLED()
ov::Core core;
ov::Any deviceAllocMemSizeAny;
@@ -351,7 +352,7 @@ TEST_P(OVClassGetMetricAndPrintNoThrow, VpuDeviceAllocMemSizeSameAfterDestroyInf
uint64_t deviceAllocMemSize = deviceAllocMemSizeAny.as<uint64_t>();
uint64_t deviceAllocMemSizeFinal;
- for (size_t i = 0; i < 1000; ++i) {
+ for (size_t i = 0; i < 10; ++i) {
OV_ASSERT_NO_THROW(compiledModel = core.compile_model(model, target_device));
auto inferRequest = compiledModel.create_infer_request();
diff --git a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_plugin/core_threading_tests.cpp b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_plugin/core_threading_tests.cpp
index 8e7e22b50f9..327cd582981 100644
--- a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_plugin/core_threading_tests.cpp
+++ b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_plugin/core_threading_tests.cpp
@@ -17,6 +17,10 @@ const Params params[] = {
std::tuple<Device, Config>{ov::test::utils::DEVICE_NPU,
{{ov::hint::performance_mode(ov::hint::PerformanceMode::THROUGHPUT)}}}};
+const Params params_disable_umd_cache[] = {std::tuple<Device, Config>{
+ ov::test::utils::DEVICE_NPU,
+ {{ov::hint::performance_mode(ov::hint::PerformanceMode::THROUGHPUT), ov::intel_npu::bypass_umd_caching(true)}}}};
+
const Params params_cached[] = {std::tuple<Device, Config>{ov::test::utils::DEVICE_NPU, {}}};
} // namespace
@@ -33,5 +37,12 @@ INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests_CoreThreadingTest_NPU,
INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests_CoreThreadingTest_NPU,
CoreThreadingTestsWithCacheEnabled,
- testing::Combine(testing::ValuesIn(params), testing::Values(10), testing::Values(30)),
+ testing::Combine(testing::ValuesIn(params_cached), testing::Values(10), testing::Values(30)),
(ov::test::utils::appendPlatformTypeTestName<CoreThreadingTestsWithCacheEnabled>));
+
+INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests_CoreThreadingTest_UmdCacheDisabled_NPU,
+ CoreThreadingTestsWithIter,
+ testing::Combine(testing::ValuesIn(params_disable_umd_cache),
+ testing::Values(8),
+ testing::Values(20)),
+ (ov::test::utils::appendPlatformTypeTestName<CoreThreadingTestsWithIter>));