From 72b7471955f32d2fccb170ab1ab40c7eecfa7f44 Mon Sep 17 00:00:00 2001 From: Mohammed Suhail Munshi Date: Thu, 12 Oct 2023 17:17:42 +0100 Subject: Add check to disable dynamic bias with quantized datatypes in Conv2D layer Resolves: COMPMID-6397 Signed-off-by: Mohammed Suhail Munshi Change-Id: Id4404f75dae03fd529db1adac5ab9ca48d08ec46 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/10498 Tested-by: Arm Jenkins Reviewed-by: Gian Marco Iodice Comments-Addressed: Arm Jenkins Benchmark: Arm Jenkins --- src/runtime/NEON/functions/NEConvolutionLayer.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/runtime') diff --git a/src/runtime/NEON/functions/NEConvolutionLayer.cpp b/src/runtime/NEON/functions/NEConvolutionLayer.cpp index 37958fc2e9..8efebbbb1a 100644 --- a/src/runtime/NEON/functions/NEConvolutionLayer.cpp +++ b/src/runtime/NEON/functions/NEConvolutionLayer.cpp @@ -25,6 +25,7 @@ #include "arm_compute/core/PixelValue.h" #include "arm_compute/core/Utils.h" +#include "arm_compute/core/utils/DataTypeUtils.h" #include "arm_compute/core/Validate.h" #include "arm_compute/runtime/NEON/functions/NEFFTConvolutionLayer.h" @@ -132,6 +133,13 @@ Status NEConvolutionLayer::validate(const ITensorInfo *input, ARM_COMPUTE_RETURN_ERROR_ON_MSG(!weights->are_values_constant(), "Dynamic weights are not supported"); + // Biases with dynamic values are not supported with quantized inputs. + if (biases) + { + ARM_COMPUTE_RETURN_ERROR_ON_MSG((!biases->are_values_constant() && is_data_type_quantized(input->data_type())), + "Dynamic Biases are not supported with quantized input data."); + } + switch (cpu::CpuConv2d::get_convolution_method(input, weights, output, conv_info, weights_info, dilation, act_info, enable_fast_math)) { -- cgit v1.2.1