From 174555a5a3080726646a96b9cf27b5568941e6d6 Mon Sep 17 00:00:00 2001 From: Max Bergfelt Date: Thu, 15 May 2025 11:35:35 +0200 Subject: [PATCH] MLBEDSW-10801: Removed Ethos-U55/65 Argmax overflow constraint Removed supported operator check for argmax width and height overflow as it has been solved by max pool decomposition. Change-Id: I12c45a333ea48a8cdb69ef27023ba71a428401b6 Signed-off-by: Max Bergfelt --- .../tflite/tflite_supported_operators_u55.cpp | 23 ------------------- .../tflite/tflite_supported_operators_u55.hpp | 1 - 2 files changed, 24 deletions(-) diff --git a/ethosu/regor/tflite/tflite_supported_operators_u55.cpp b/ethosu/regor/tflite/tflite_supported_operators_u55.cpp index b8d3b77b..156f46ee 100644 --- a/ethosu/regor/tflite/tflite_supported_operators_u55.cpp +++ b/ethosu/regor/tflite/tflite_supported_operators_u55.cpp @@ -101,7 +101,6 @@ TfLiteSupportedOperatorsU55::TfLiteSupportedOperatorsU55(IArchitectureConstraint &TfLiteSupportedOperatorsU55::Constraint32bitOps, &TfLiteSupportedOperatorsU55::ConstraintArgMaxDepth, &TfLiteSupportedOperatorsU55::ConstraintArgMaxAxis, - &TfLiteSupportedOperatorsU55::ConstraintArgMaxOverflow, // TODO: Remove after MLBEDSW-9758: TOSA MaxPool decomp &TfLiteSupportedOperatorsU55::ConstraintKernelStride, &TfLiteSupportedOperatorsU55::ConstraintUnrolledKernelStride, &TfLiteSupportedOperatorsU55::ConstraintMatmul, @@ -429,28 +428,6 @@ bool TfLiteSupportedOperatorsU55::ConstraintArgMaxAxis(const Operation *op) return true; } -// TODO: Remove this constraint when MLBEDSW-9758: decomposition for max pooling has been implemented. -bool TfLiteSupportedOperatorsU55::ConstraintArgMaxOverflow(const Operation *op) -{ - if ( op->Type() != OpType::ArgMax ) - { - return true; - } - auto ifmConn = op->Input(TensorUsage::IFM); - assert(ifmConn); - static constexpr int maxProd = 1 << 16; - const auto &ifmShape = ifmConn->shape; - int w = ifmShape.Size() > 1 ? ifmShape.Width() : 1; - int h = ifmShape.Size() > 2 ? ifmShape.Height() : 1; - if ( w * h > maxProd ) - { - Failure(op, fmt::format("ifmShape: ({}), W * H = {}", ifmShape.ToString(), ifmShape.ElementsWH()), - "The product of IFM width and height must be less than 65536"); - return false; - } - return true; -} - bool TfLiteSupportedOperatorsU55::ConstraintKernelStride(const Operation *op) { const auto kernel = op->Kernel(); diff --git a/ethosu/regor/tflite/tflite_supported_operators_u55.hpp b/ethosu/regor/tflite/tflite_supported_operators_u55.hpp index fe855925..7e20d316 100644 --- a/ethosu/regor/tflite/tflite_supported_operators_u55.hpp +++ b/ethosu/regor/tflite/tflite_supported_operators_u55.hpp @@ -48,7 +48,6 @@ private: bool ConstraintMatmul(const Operation *op); bool ConstraintArgMaxDepth(const Operation *op); bool ConstraintArgMaxAxis(const Operation *op); - bool ConstraintArgMaxOverflow(const Operation *op); // TODO: Remove after MLBEDSW-9758: TOSA MaxPool decomp bool ConstraintTranspose(const Operation *op); bool ConstraintResize(const Operation *op); }; -- GitLab