From 0efdf5acdfdf8d7d270234dc4ddad73e6708219e Mon Sep 17 00:00:00 2001 From: Johan Gunnarsson Date: Wed, 18 Jun 2025 13:40:58 +0200 Subject: [PATCH] MLBEDSW-10868: Refine Ethos-U55/U65 transpose constraints We can actually support all transpose types in a 3D shape on Ethos-U55/U65 through decomposition. The 64k axis constraint remains. Signed-off-by: Johan Gunnarsson Change-Id: Idd6769a9f001f1cab05e764a3c052137b5ba6c2a --- ethosu/regor/tflite/tflite_supported_operators_u55.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ethosu/regor/tflite/tflite_supported_operators_u55.cpp b/ethosu/regor/tflite/tflite_supported_operators_u55.cpp index fe9f4e3b..a82f1dd7 100644 --- a/ethosu/regor/tflite/tflite_supported_operators_u55.cpp +++ b/ethosu/regor/tflite/tflite_supported_operators_u55.cpp @@ -354,10 +354,13 @@ bool TfLiteSupportedOperatorsU55::ConstraintTranspose(const Operation *op) return true; } if ( (ifmShape.Size() <= 4) && - (transposeMask == TransposeType::NWHC || transposeMask == TransposeType::NHCW || transposeMask == TransposeType::NCWH) ) + (transposeMask == TransposeType::NWHC || transposeMask == TransposeType::NHCW || transposeMask == TransposeType::NCWH || + transposeMask == TransposeType::NWCH || transposeMask == TransposeType::NCHW) ) { // Directly HW-supported transpose-masks - // NWHC/NHCW/NCWH: (N*H: 65536, 65536, 65536) + // NWHC/NHCW/NCWH: (N*H: 65536, W: 65536, C: 65536) + // Indirectly HW-supported transpose-masks through decomposition + // NWCH/NCHW: (N*H: 65536, W: 65536, C: 65536) const static Shape maxShape = Shape((1 << 16), (1 << 16), (1 << 16)); Shape ifmSquashed = ifmShape.WithHeight(ifmShape.Height() * ifmShape.Batch()).WithBatch(1); if ( ifmSquashed.GreaterMask(maxShape) > 0 ) -- GitLab