From 84712f8e7a9c599f0a1b0b75cefa1c06d80283c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Alfv=C3=A9n?= Date: Tue, 4 Feb 2025 15:20:08 +0100 Subject: [PATCH] MLBEDSW-10367: Fix assert in AreaFit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - AreaFit failed to find a shape for a small aspect ratio. The adjustment ratio step was too small and the retry counter caused the iteration to break before finding a solution - The fix is to increase the allowed number of iterations and as a last resort change the scaling ratio Change-Id: Ic07e1cc60beae592dc832c9e71706d87621b1219 Signed-off-by: Johan Alfvén --- ethosu/regor/architecture/ethosu85/ethos_u85.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ethosu/regor/architecture/ethosu85/ethos_u85.cpp b/ethosu/regor/architecture/ethosu85/ethos_u85.cpp index ec616dba..dff971ff 100644 --- a/ethosu/regor/architecture/ethosu85/ethos_u85.cpp +++ b/ethosu/regor/architecture/ethosu85/ethos_u85.cpp @@ -706,7 +706,7 @@ Shape ArchEthosU85::AreaFit(const FindConfigCommon &common, const Shape &ofmShap int ifmVolume = Shape::RoundAway(ifmShape, ifmAllocUnit).Elements(); bool fitted = false; int prevAccReq = -1; - int retry = 8; + int retry = 25; while ( true ) { FitAreaByAspect(aspect, width, height, fitAcc / depth, granule); @@ -754,11 +754,14 @@ Shape ArchEthosU85::AreaFit(const FindConfigCommon &common, const Shape &ofmShap break; } - // Stop searching if no subdivision progress was made for this depth - // after a few iterations. + // If no subdivision progress was made for this depth + // after a few iterations, force the scaling ratio to change if ( accRequired == prevAccReq ) { - if ( --retry == 0 ) break; + if ( --retry <= 0 ) + { + ibRatio = 0.9; + } } prevAccReq = accRequired; -- GitLab