Skip to content

Commit

Permalink
[GPU] fix issue of optimized out reorder during event sync (openvinot…
Browse files Browse the repository at this point in the history
…oolkit#20223)

* fix confliction

* remove debug code

* fix unit test failure

* update condition of reorder check

* apply the condition for only opt out reorder user
  • Loading branch information
wilson-seok authored and allnes committed Nov 23, 2023
1 parent f617c2c commit 2f06733
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/plugins/intel_gpu/src/graph/primitive_inst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<void(std::vector<std::shared_ptr<primitive_inst>>)> update_memory_dependencies;
update_memory_dependencies = [&](std::vector<std::shared_ptr<primitive_inst>> users) {
Expand All @@ -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;
Expand Down

0 comments on commit 2f06733

Please sign in to comment.