Skip to content

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

[NPU] Create a copy to the model for the compilation path (#29755)

Bogdan Pereanu94bc742e4c50
diff --git a/src/plugins/intel_npu/src/plugin/src/plugin.cpp b/src/plugins/intel_npu/src/plugin/src/plugin.cpp
index 340209c9061..dbd7f9d2a19 100644
--- a/src/plugins/intel_npu/src/plugin/src/plugin.cpp
+++ b/src/plugins/intel_npu/src/plugin/src/plugin.cpp
@@ -766,7 +766,6 @@ std::shared_ptr<ov::ICompiledModel> Plugin::compile_model(const std::shared_ptr<
}
}
- auto originalModel = model->clone();
CompilerAdapterFactory compilerAdapterFactory;
auto compiler = compilerAdapterFactory.getCompiler(_backend, localConfig);
@@ -774,7 +773,7 @@ std::shared_ptr<ov::ICompiledModel> Plugin::compile_model(const std::shared_ptr<
std::shared_ptr<intel_npu::IGraph> graph;
try {
_logger.debug("performing compile");
- graph = compiler->compile(model, localConfig);
+ graph = compiler->compile(model->clone(), localConfig);
} catch (const std::exception& ex) {
OPENVINO_THROW(ex.what());
} catch (...) {
@@ -784,7 +783,7 @@ std::shared_ptr<ov::ICompiledModel> Plugin::compile_model(const std::shared_ptr<
std::shared_ptr<ov::ICompiledModel> compiledModel;
try {
- compiledModel = std::make_shared<CompiledModel>(originalModel, shared_from_this(), device, graph, localConfig);
+ compiledModel = std::make_shared<CompiledModel>(model, shared_from_this(), device, graph, localConfig);
} catch (const std::exception& ex) {
OPENVINO_THROW(ex.what());
} catch (...) {
diff --git a/src/plugins/intel_npu/tests/functional/main.cpp b/src/plugins/intel_npu/tests/functional/main.cpp
index 99dfd6ad1fe..2f714f4a863 100644
--- a/src/plugins/intel_npu/tests/functional/main.cpp
+++ b/src/plugins/intel_npu/tests/functional/main.cpp
@@ -35,6 +35,9 @@ int main(int argc, char** argv, char** envp) {
// register crashHandler for SIGSEGV signal
signal(SIGSEGV, sigsegv_handler);
+ //set timeout to 30 min
+ ov::test::utils::CrashHandler::SetUpTimeout(1800);
+
std::ostringstream oss;
oss << "Command line args (" << argc << "): ";
for (int c = 0; c < argc; ++c) {