From 67daf2a3036608e60d7741f5bdf02196234ef85c Mon Sep 17 00:00:00 2001 From: Johan Alfven Date: Mon, 30 Oct 2023 20:39:01 +0100 Subject: MLBEDSW-8219: Activation can not be fused with dma operation - A reshape followed by an activation function was converted to a Memcpy with fused activation. The problem is that Memcpy does not support activation so no activation was executed. - Added logic to prevent activation functions to be fused with the Memcpy. Change-Id: Ibc7d985e5037146dd1f6cb2601407d0f8b865ac6 Signed-off-by: Johan Alfven --- ethosu/vela/tflite_graph_optimiser.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ethosu/vela/tflite_graph_optimiser.py b/ethosu/vela/tflite_graph_optimiser.py index ae11bec..85fb8ba 100644 --- a/ethosu/vela/tflite_graph_optimiser.py +++ b/ethosu/vela/tflite_graph_optimiser.py @@ -1743,6 +1743,7 @@ def fuse_activation_function_with_prev(op, arch, nng): # Note: the below checks on prev_op require that a first optimize pass on the full graph has been performed fuse = ( prev_op.run_on_npu + and prev_op.type != Op.Memcpy and prev_op.type.npu_block_type != NpuBlockType.Default and len(ifm.ops) == 1 and len(prev_op.outputs[0].consumers()) == 1 -- cgit v1.2.1