From 8df91f5b0ef5f270cbe848d8cebb5bf31ac4a088 Mon Sep 17 00:00:00 2001 From: Johan Alfven Date: Mon, 10 Jul 2023 12:20:22 +0200 Subject: MLBEDSW-7833: MLCE: Fixed output diff for reshape op - In order to reduce memory usage, the live range mechanism have logic to check if the ifm tensor can be reused for the ofm tensor for certain operators - In this failing test case, the input to the reshape/memcpy operator has more than one consumer and this results in a faulty memory overwrite since there are missing logic that should check the ifm consumers for the memcpy operator - The fix is to add the missing logic that ifm can only have one consumer Change-Id: I2184c0f905b554f648c9732734098509e23b537c Signed-off-by: Johan Alfven --- ethosu/vela/live_range.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ethosu/vela/live_range.py b/ethosu/vela/live_range.py index 9f94dd63..0ccfc17a 100644 --- a/ethosu/vela/live_range.py +++ b/ethosu/vela/live_range.py @@ -208,8 +208,11 @@ def _get_ifm_to_fuse(sched_op, target_mem_area=None, target_mem_type_set=None): if not ( tensor_should_be_ignored(ifm, target_mem_area, target_mem_type_set) or tensor_should_be_ignored(ofm, target_mem_area, target_mem_type_set) + # input tensor only allowed to have one consumer + or len(ifm.consumer_list) > 1 ): # Currently DMA only used when bypassing memory only ops so ok to reuse ifm + # if ifm has only one consumer ifm_tens = ifm return ifm_tens -- cgit v1.2.1