From 5fabfcaa2b636b02899b4d6e0ccf95d853986475 Mon Sep 17 00:00:00 2001 From: Henrik G Olsson Date: Thu, 15 Apr 2021 17:57:26 +0200 Subject: MLBEDSW-4350 Use padding instead of skirt for merged SplitSlice When the operations are merged some later passes are confused by start and end coordinates for the convolution not being along the edges of the IFM, and omitting padding. But we need the zero padding to keep the output the same as before the transformation. Also fixes bug where Vela could crash if convolution had explicit start coordinate. Signed-off-by: Henrik G Olsson Change-Id: I8449d237350d528f83738b2f09124f1ed79c07ca --- ethosu/vela/graph_optimiser.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ethosu/vela/graph_optimiser.py') diff --git a/ethosu/vela/graph_optimiser.py b/ethosu/vela/graph_optimiser.py index 7c60368d..573b7ebb 100644 --- a/ethosu/vela/graph_optimiser.py +++ b/ethosu/vela/graph_optimiser.py @@ -196,6 +196,10 @@ def remove_SplitSliceRead(op, arch): cons_op.set_input_tensor(op.ifm, cons_op.type.info.indices.ifms[1]) cons_op.ifm_shapes[1] = op.ifm_shapes[0] + if "skirt" in cons_op.attrs: + assert cons_op.attrs["explicit_padding"] == cons_op.attrs["skirt"] + cons_op.attrs["skirt"] = None + cons_op.attrs["force_padding"] = True op.ofm.consumer_list.remove(cons_op) op.ofm.ops = [] op.ifm.consumer_list.remove(op) -- cgit v1.2.1