Skip to content

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

[Snippets] Skip kernel update for unchanged config (#37040)

Arseniy Obolenskiy548846cc42a8
diff --git a/src/common/snippets/include/snippets/kernel_executor_table.hpp b/src/common/snippets/include/snippets/kernel_executor_table.hpp
index 312418d9599..5a60d989157 100644
--- a/src/common/snippets/include/snippets/kernel_executor_table.hpp
+++ b/src/common/snippets/include/snippets/kernel_executor_table.hpp
@@ -89,8 +89,12 @@ public:
// Note: override when final is redundant, but needed to avoid warnings on some compilers
void update_by_expression(const lowered::ExpressionPtr& expr,
const lowered::LinearIRCPtr& linear_ir) override final {
+ const auto old_hash = m_config.hash();
update_config(expr, linear_ir, m_config);
OPENVINO_ASSERT(m_config.is_completed(), "Failed to update kernel config in update_by_expression");
+ if (m_kernel && old_hash == m_config.hash()) {
+ return;
+ }
update_kernel(m_config, m_kernel);
OPENVINO_ASSERT(m_kernel, "Failed to compile kernel executor");
}