Skip to content

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

[NPUW] Fixed null dereference in three-model-pipeline (#31771)

Anastasiya(Asya) Pronina64bb9ffec741
diff --git a/src/plugins/intel_npu/src/plugin/npuw/llm_compiled_model.cpp b/src/plugins/intel_npu/src/plugin/npuw/llm_compiled_model.cpp
index 2bf59de09af..33d72e5d57c 100644
--- a/src/plugins/intel_npu/src/plugin/npuw/llm_compiled_model.cpp
+++ b/src/plugins/intel_npu/src/plugin/npuw/llm_compiled_model.cpp
@@ -737,7 +737,9 @@ std::shared_ptr<ov::Model> cut_lm_head(std::shared_ptr<ov::Model>& model) {
std::shared_ptr<ov::Model> lm_head_model = nullptr;
rewr.add_matcher<CutLMHead>(lm_head_model);
rewr.run_on_model(model);
- lm_head_model->set_friendly_name(model->get_friendly_name() + "_lm_head");
+ if (lm_head_model) {
+ lm_head_model->set_friendly_name(model->get_friendly_name() + "_lm_head");
+ }
model->validate_nodes_and_infer_types();
return lm_head_model;