From f33996223eae1e3daa662325e8ac4d9a2ee08cac Mon Sep 17 00:00:00 2001 From: Giorgio Arena Date: Mon, 13 Dec 2021 17:42:52 +0000 Subject: Redirect Pool2d unsupported cases to unoptimized path Unsupported case: Any of the convolution padding > pool size Resolve COMPMID-4999 Signed-off-by: Giorgio Arena Change-Id: I4279f3f14d865e0faf53e04847b52ef328970cf2 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/6817 Comments-Addressed: Arm Jenkins Tested-by: Arm Jenkins Reviewed-by: Michele Di Giorgio --- src/cpu/kernels/internal/CpuPool2dAssemblyWrapperKernel.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/cpu/kernels/internal/CpuPool2dAssemblyWrapperKernel.cpp b/src/cpu/kernels/internal/CpuPool2dAssemblyWrapperKernel.cpp index 78ac134604..8610bc7f43 100644 --- a/src/cpu/kernels/internal/CpuPool2dAssemblyWrapperKernel.cpp +++ b/src/cpu/kernels/internal/CpuPool2dAssemblyWrapperKernel.cpp @@ -104,6 +104,11 @@ Status CpuPool2dAssemblyWrapperKernel::validate(const ITensorInfo *src, const IT ARM_COMPUTE_RETURN_ERROR_ON_MSG((info.pool_type != PoolingType::AVG) && (info.pool_type != PoolingType::MAX), "Only AVG and MAX pooling are supported by assembly kernels"); + const auto ps = info.pad_stride_info; + const auto max_padding = std::max({ ps.pad_left(), ps.pad_right(), ps.pad_top(), ps.pad_bottom() }); + const auto min_pool_sz = std::min(info.pool_size.x(), info.pool_size.y()); + ARM_COMPUTE_RETURN_ERROR_ON_MSG(max_padding > min_pool_sz, "Convolution padding greater than pool size is unsupported by assembly kernels"); + if(dst->total_size() > 0) { ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(src, dst); @@ -278,12 +283,12 @@ void CpuPool2dAssemblyWrapperKernel::create_arm_pooling_requant(const ITensorInf size_t CpuPool2dAssemblyWrapperKernel::get_mws(const CPUInfo &platform, size_t thread_count) const { ARM_COMPUTE_UNUSED(thread_count); - // Tuning results that gave optimized results in performance investigation - if (platform.get_cpu_model() == CPUModel::A73 ) + // Tuning results that gave optimized results in performance investigation + if(platform.get_cpu_model() == CPUModel::A73) { return 10240; } - else + else { return 9216; } -- cgit v1.2.1