Skip to content

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

[NPU] Update func behavior test `TestCompiledModelNPU` (#30746)

Stefania Herganea86732ef2dcf
diff --git a/src/plugins/intel_npu/tests/functional/behavior/work_with_devices.cpp b/src/plugins/intel_npu/tests/functional/behavior/work_with_devices.cpp
index fde9be94f5b..3e48a6b1811 100644
--- a/src/plugins/intel_npu/tests/functional/behavior/work_with_devices.cpp
+++ b/src/plugins/intel_npu/tests/functional/behavior/work_with_devices.cpp
@@ -10,7 +10,7 @@
namespace {
const std::vector<ov::AnyMap> configs = {
- {{ov::log::level(ov::log::Level::ERR)}},
+ {{ov::intel_npu::bypass_umd_caching(true)}},
};
INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTest,
diff --git a/src/plugins/intel_npu/tests/functional/behavior/work_with_devices.hpp b/src/plugins/intel_npu/tests/functional/behavior/work_with_devices.hpp
index f76bbae4fc3..7b423f28b40 100644
--- a/src/plugins/intel_npu/tests/functional/behavior/work_with_devices.hpp
+++ b/src/plugins/intel_npu/tests/functional/behavior/work_with_devices.hpp
@@ -51,18 +51,14 @@ protected:
TEST_P(TestCompiledModelNPU, samePlatformProduceTheSameBlob) {
SKIP_IF_CURRENT_TEST_IS_DISABLED() {
- std::string platform = ov::test::utils::getTestsPlatformFromEnvironmentOr("3720");
-
configuration[ov::intel_npu::defer_weights_load.name()] = true;
auto configuration1 = configuration;
- configuration1[ov::intel_npu::platform.name()] = platform;
const auto& ov_model1 = buildSingleLayerSoftMaxNetwork();
auto compiled_model1 = core->compile_model(ov_model1, target_device, configuration1);
std::stringstream blobStream1;
compiled_model1.export_model(blobStream1);
auto configuration2 = configuration;
- configuration2[ov::intel_npu::platform.name()] = platform;
const auto& ov_model2 = buildSingleLayerSoftMaxNetwork();
auto compiled_model2 = core->compile_model(ov_model2, target_device, configuration2);
std::stringstream blobStream2;
@@ -73,6 +69,31 @@ TEST_P(TestCompiledModelNPU, samePlatformProduceTheSameBlob) {
}
}
+TEST_P(TestCompiledModelNPU, samePlatformProduceTheSameBlobCacheEnabled) {
+ SKIP_IF_CURRENT_TEST_IS_DISABLED() {
+ // compiled model (uncached)
+ configuration[ov::intel_npu::defer_weights_load.name()] = true;
+ auto configuration1 = configuration;
+ const auto& ov_model1 = buildSingleLayerSoftMaxNetwork();
+ auto compiled_model1 = core->compile_model(ov_model1, target_device, configuration1);
+ std::stringstream blobStream1;
+ compiled_model1.export_model(blobStream1);
+
+ // cached blobs
+ auto configuration2 = configuration;
+ configuration2[ov::intel_npu::bypass_umd_caching.name()] = false;
+ const auto& ov_model2 = buildSingleLayerSoftMaxNetwork();
+ // call compile_model() twice to make sure compiled model is cached
+ auto compiled_model2 = core->compile_model(ov_model2, target_device, configuration2);
+ auto compiled_model3 = core->compile_model(ov_model2, target_device, configuration2);
+ std::stringstream blobStream3;
+ compiled_model3.export_model(blobStream3);
+
+ ASSERT_NE(0, blobStream1.str().size());
+ ASSERT_EQ(0, std::memcmp(blobStream1.str().c_str(), blobStream3.str().c_str(), blobStream1.str().size()));
+ }
+}
+
class TestCompileModelWithoutDeviceNPU : public TestCompiledModelNPU {
protected:
void SetUp() override {
diff --git a/src/plugins/intel_npu/tests/functional/shared_tests_instances/skip_tests.xml b/src/plugins/intel_npu/tests/functional/shared_tests_instances/skip_tests.xml
index a800b88aefc..6449d24dd73 100644
--- a/src/plugins/intel_npu/tests/functional/shared_tests_instances/skip_tests.xml
+++ b/src/plugins/intel_npu/tests/functional/shared_tests_instances/skip_tests.xml
@@ -879,4 +879,15 @@ Example:
<filter>.*OVCompiledModelBaseTest.*use_blob_hint_.*</filter>
</filters>
</skip_config>
+
+ <!-- EISW 167305 -->
+ <skip_config>
+ <message>Failing test on Ubuntu after NPU driver update</message>
+ <enable_rules>
+ <operating_system>linux</operating_system>
+ </enable_rules>
+ <filters>
+ <filter>.*TestCompiledModelNPU.samePlatformProduceTheSameBlobCacheEnabled.*</filter>
+ </filters>
+ </skip_config>
</skip_configs>