From 5170350cf5004ebe109fe07c582e55401105d81c Mon Sep 17 00:00:00 2001 From: Wilson Seok Date: Fri, 13 Oct 2023 12:39:35 +0900 Subject: [PATCH] [GPU] fix issue of optimized out reorder during event sync (#20223) * fix confliction * remove debug code * fix unit test failure * update condition of reorder check * apply the condition for only opt out reorder user --- src/plugins/intel_gpu/src/graph/primitive_inst.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/intel_gpu/src/graph/primitive_inst.cpp b/src/plugins/intel_gpu/src/graph/primitive_inst.cpp index eea18ca1fe6b79..44b1fec8bb0963 100644 --- a/src/plugins/intel_gpu/src/graph/primitive_inst.cpp +++ b/src/plugins/intel_gpu/src/graph/primitive_inst.cpp @@ -685,6 +685,7 @@ void primitive_inst::do_runtime_skip_reorder() { GPU_DEBUG_TRACE_DETAIL << "[do runtime skip reorder] update shape for user " << u->id() << std::endl; u->update_shape(); u->update_shape_done_by_other = true; + if (u->_impl_params->get_input_layout() == u->_impl_params->get_output_layout()) { std::function>)> update_memory_dependencies; update_memory_dependencies = [&](std::vector> users) { @@ -699,6 +700,10 @@ void primitive_inst::do_runtime_skip_reorder() { update_memory_dependencies(u->get_user_insts()); u->set_can_be_optimized(true); + // Opt out reorder which has _needs_completion_event = true causes syncronization failed in dGPU. + if (_needs_completion_event == false && u->_needs_completion_event == true) { + _needs_completion_event = true; + } GPU_DEBUG_TRACE_DETAIL << "[do runtime skip reorder] set user " << u->id() << " as can_be_optimized" << std::endl; } else { GPU_DEBUG_TRACE_DETAIL << "[do runtime skip reorder] user " << u->id() << " cannot be optimized" << std::endl;