From 02acf86444d0648a15d82c9be3f7f52e0ecfbd1b Mon Sep 17 00:00:00 2001 From: William Isaksson Date: Wed, 2 Jul 2025 22:48:18 +0200 Subject: [PATCH] MLBEDSW-10927: Fix identity scaling for pooling mode SUM Right now, for avg_pool with global scaling when pooling mode sum is required, an implicit scale is set to implement averaging. When we don't want this implicit scaling, we clear the scales to signal this (e.g. in decomposition) and this patch makes sure we check explicitly for that in the rcs gen. Change-Id: I8662de9315542906508dd8f97246f6b80c19eb46 Signed-off-by: William Isaksson --- .../architecture/ethosu85/ethos_u85_register_cs_generator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethosu/regor/architecture/ethosu85/ethos_u85_register_cs_generator.cpp b/ethosu/regor/architecture/ethosu85/ethos_u85_register_cs_generator.cpp index 0ab17246..607eac86 100644 --- a/ethosu/regor/architecture/ethosu85/ethos_u85_register_cs_generator.cpp +++ b/ethosu/regor/architecture/ethosu85/ethos_u85_register_cs_generator.cpp @@ -692,7 +692,7 @@ void EthosU85RCSGenerator::GenerateOFMScalingForPooling(HLCOperation *poolOp, bo QuantizedScale ofmScale(1, 0); pooling_mode mode = (poolOp->type == OpType::AvgPool && (poolOp->kernel.Size().x > 8 || poolOp->kernel.Size().y > 8)) ? pooling_mode::SUM : pooling_mode::NONE; - if ( mode == pooling_mode::SUM && useGlobalScale && poolOp->kernel.Padding().IsZero() ) + if ( mode == pooling_mode::SUM && useGlobalScale && !poolOp->ofm.quantization.scales.empty() ) { uint32_t scale = 1; int shift = 0; -- GitLab