Skip to content

Commit

Permalink
[GPU] fix memory conflict for multi iteration in loop. (openvinotoolk…
Browse files Browse the repository at this point in the history
…it#28487)

Cause is shown in graph below.

The black, green, and dotted line donates the primitive dependency,
memory buffer reuse, and memory conflict (at the second iteration)
respectively.
The body of the loop is compiled as a separate model and is not aware
the data reuse in backedge in multiple iteration.

Tickets:
[CVS-158017](https://jira.devtools.intel.com/browse/CVS-158017)
  • Loading branch information
timxu826 authored Jan 17, 2025
1 parent 08d8755 commit 7da364d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/plugins/intel_gpu/src/graph/primitive_inst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2391,6 +2391,9 @@ memory::ptr primitive_inst::allocate_output(engine& _engine,
if (_node.is_in_shape_of_subgraph())
reusable_across_network = false;

if (reusable_across_network && _node.get_program().is_body_program() && is_output_buffer && runtime_alloc)
reusable_across_network = false;

// For outputs, cpu prim we want to have lockable alloc type
// Also if the successor of a node is an cpu, then memory needs to be lockable.
bool is_cpu = _node.get_selected_impl() ? _node.get_selected_impl()->is_cpu() :
Expand Down

0 comments on commit 7da364d

Please sign in to comment.