aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Alfven <johan.alfven@arm.com>2023-10-30 20:39:01 +0100
committerJohan Alfven <johan.alfven@arm.com>2023-10-31 10:18:33 +0100
commit67daf2a3036608e60d7741f5bdf02196234ef85c (patch)
treebd0823c61025a2bd55efcc7d4f15fe07922922d4
parentafb56ae11294bdf50e190cfafd76e507d5e2787d (diff)
downloadethos-u-vela-67daf2a3036608e60d7741f5bdf02196234ef85c.tar.gz
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 <johan.alfven@arm.com>
-rw-r--r--ethosu/vela/tflite_graph_optimiser.py1
1 files changed, 1 insertions, 0 deletions
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