From f73eb63e9f109806cfb6db4369fde3b93a5c9ef0 Mon Sep 17 00:00:00 2001 From: Alexander Bengtsson Date: Thu, 13 Feb 2025 14:27:15 +0100 Subject: [PATCH] MLBEDSW-10426: Disable MoveSplitSliceToConsumer for some OpTypes - MLBEDSW-9591: OpType::Passthrough Slices should not be moved to CPU-operations - MLBEDSW-10426: OpType::Tile The RCS-TILE lowering assumes unsliced IFM. Change-Id: I923a650fc3ab127b1ff7e2b4c18d0a692a666372 Signed-off-by: Alexander Bengtsson --- ethosu/regor/compiler/graphir_optimiser.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ethosu/regor/compiler/graphir_optimiser.cpp b/ethosu/regor/compiler/graphir_optimiser.cpp index 0f00be0b..436c20d6 100644 --- a/ethosu/regor/compiler/graphir_optimiser.cpp +++ b/ethosu/regor/compiler/graphir_optimiser.cpp @@ -2079,7 +2079,6 @@ Operation *GraphIrOptimiser::MoveSplitSliceToConsumer(Graph *const, Operation *c { auto *ofm = ofmConn->tensor.get(); - // TODO: MLBEDSW-9072: Add check that moving split to consumer is valid if ( ofm->Readers().size() == 1 ) { auto cons = ofm->Readers().front(); @@ -2087,6 +2086,14 @@ Operation *GraphIrOptimiser::MoveSplitSliceToConsumer(Graph *const, Operation *c auto *consIfm1 = cons->IFM(1); bool ifmShapeEqual = false; + + // Don't move to CPU, Reshape or Tile operations + // low-level implementation of TILE requires unsliced inputs + if ( cons->Type() == OpType::Passthrough || IsReshape(cons->Type()) || cons->Type() == OpType::Tile ) + { + return operation; + } + if ( consIfm0 == ofm ) { // Check if ifm0 consumer has correct shape @@ -2109,7 +2116,7 @@ Operation *GraphIrOptimiser::MoveSplitSliceToConsumer(Graph *const, Operation *c // We can only move to consumer if there is no transpose on the op that we move to, // otherwise the IFM shape may change and transposition will be wrong. - if ( !IsReshape(cons->Type()) && Shape::IsReducedEqual(ofmConn->shape, ofm->StorageShape()) && IsNone(consumerTranspose) && ifmShapeEqual ) + if ( Shape::IsReducedEqual(ofmConn->shape, ofm->StorageShape()) && IsNone(consumerTranspose) && ifmShapeEqual ) { // Split/Slice can be performed by tensor consumer MoveToConsumer(operation, cons.get()); -- GitLab