Skip to content

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

[NPUW] WA for second token generation when weight bank for generate is on CPU (#31703)

Anastasiya(Asya) Pronina7ad84da08ea3
diff --git a/src/plugins/intel_npu/src/plugin/npuw/llm_infer_request.cpp b/src/plugins/intel_npu/src/plugin/npuw/llm_infer_request.cpp
index b629a175290..63c542fce33 100644
--- a/src/plugins/intel_npu/src/plugin/npuw/llm_infer_request.cpp
+++ b/src/plugins/intel_npu/src/plugin/npuw/llm_infer_request.cpp
@@ -344,6 +344,12 @@ ov::npuw::LLMInferRequest::LLMInferRequest(const std::shared_ptr<ov::npuw::LLMCo
}
}
+ ov::Any kvcache_weight_bank_alloc =
+ compiled_model->m_kvcache_compiled->get_property(ov::intel_npu::npuw::weights_bank_alloc.name());
+ if (kvcache_weight_bank_alloc.as<std::string>() == "CPU") {
+ enable_cpu_wa = true;
+ }
+
if (enable_cpu_wa) {
const auto& kvcache_compiled = m_kvcache_request->get_compiled_model();
// FIXME: Find only matching by names outputs and copy them, having previously checked that such inputs exist