Skip to content

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

[GPU] Use impls cache in case when shape changed (#27226)

Vladimir Paramuzov70987649c16b
diff --git a/src/plugins/intel_gpu/src/graph/primitive_inst.cpp b/src/plugins/intel_gpu/src/graph/primitive_inst.cpp
index f90d4e34b08..da56141cee4 100644
--- a/src/plugins/intel_gpu/src/graph/primitive_inst.cpp
+++ b/src/plugins/intel_gpu/src/graph/primitive_inst.cpp
@@ -2505,7 +2505,7 @@ std::shared_ptr<primitive_impl> ImplementationsFactory::get_primitive_impl_for_p
}
// 1. If we have static impl in the cache - use it
- if (use_async_compilation && inst.get_impl() && inst.get_impl()->is_dynamic()) {
+ if (use_async_compilation && ((inst.get_impl() && inst.get_impl()->is_dynamic()) || inst.shape_changed())) {
auto cached_impl = m_static_impls_cache.get(updated_params);
if (cached_impl) {
return cached_impl->clone();