diff options
author | TeresaARM <teresa.charlinreyes@arm.com> | 2023-05-11 15:16:39 +0000 |
---|---|---|
committer | Teresa Charlin <teresa.charlinreyes@arm.com> | 2023-05-11 17:19:27 +0100 |
commit | acedd859c64fff029ef89ac47dd1083434c3cec4 (patch) | |
tree | 463e95ba946840c7b1b869b93538bf5b846795bd /src/backends/cl | |
parent | fecd9ed396705a17805ffc49839bd82ae24c892b (diff) | |
download | armnn-acedd859c64fff029ef89ac47dd1083434c3cec4.tar.gz |
Revert "IVGCVSW-7454 Enable dynamic bias in CpuAcc and GpuAcc in Conv2d DWConv and FC"
This reverts commit fecd9ed396705a17805ffc49839bd82ae24c892b.
Reason for revert: IVGCVSW-7727 Dynamic bias CTS failing
Change-Id: I53f67d60fca0e60a81298f90450ceef26b97c321
Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com>
Diffstat (limited to 'src/backends/cl')
3 files changed, 25 insertions, 0 deletions
diff --git a/src/backends/cl/workloads/ClConvolution2dWorkload.cpp b/src/backends/cl/workloads/ClConvolution2dWorkload.cpp index 68dfdaaf54..d6a72e6488 100644 --- a/src/backends/cl/workloads/ClConvolution2dWorkload.cpp +++ b/src/backends/cl/workloads/ClConvolution2dWorkload.cpp @@ -42,6 +42,12 @@ arm_compute::Status ClConvolution2dWorkloadValidate(const TensorInfo& input, if (descriptor.m_BiasEnabled) { ARMNN_ASSERT(biases.has_value()); + // Same for bias as weights. We don't currently support non const. + if (!biases.value().IsConstant()) + { + return arm_compute::Status{arm_compute::ErrorCode::RUNTIME_ERROR, + "ArmNN ClConvolution2dWorkload does not support non constant bias."}; + } aclBiasesInfo = BuildArmComputeTensorInfo(biases.value(), descriptor.m_DataLayout); aclBiasesInfo.set_are_values_constant(biases.value().IsConstant()); optionalAclBiasesInfo = &aclBiasesInfo; @@ -88,6 +94,8 @@ ClConvolution2dWorkload::ClConvolution2dWorkload(const Convolution2dQueueDescrip { arm_compute::ICLTensor& bias = static_cast<IClTensorHandle*>(m_Data.m_Inputs[2])->GetTensor(); bias.info()->set_are_values_constant(info.m_InputTensorInfos[2].IsConstant()); + // We do not support dynamic bias + ARMNN_ASSERT(info.m_InputTensorInfos[2].IsConstant() == true); m_BiasProxy = std::make_unique<ICLTensorProxy>(&bias); } diff --git a/src/backends/cl/workloads/ClDepthwiseConvolutionWorkload.cpp b/src/backends/cl/workloads/ClDepthwiseConvolutionWorkload.cpp index 05f95ff71d..e6c9cb5c20 100644 --- a/src/backends/cl/workloads/ClDepthwiseConvolutionWorkload.cpp +++ b/src/backends/cl/workloads/ClDepthwiseConvolutionWorkload.cpp @@ -55,6 +55,12 @@ arm_compute::Status ClDepthwiseConvolutionWorkloadValidate(const TensorInfo& inp if (descriptor.m_BiasEnabled) { ARMNN_ASSERT(biases.has_value()); + // Same for bias as weights. We don't currently support non const. + if (!biases.value().IsConstant()) + { + return arm_compute::Status{arm_compute::ErrorCode::RUNTIME_ERROR, + "ArmNN ClDepthwiseConv2dWorkload does not support non constant bias."}; + } aclBiasesInfo = BuildArmComputeTensorInfo(biases.value(), descriptor.m_DataLayout); aclBiasesInfo.set_are_values_constant(biases.value().IsConstant()); optionalAclBiasesInfo = &aclBiasesInfo; @@ -106,6 +112,8 @@ ClDepthwiseConvolutionWorkload::ClDepthwiseConvolutionWorkload( { bias = &PolymorphicDowncast<IClTensorHandle*>(m_Data.m_Inputs[2])->GetTensor(); bias->info()->set_are_values_constant(info.m_InputTensorInfos[2].IsConstant()); + // We do not support dynamic bias + ARMNN_ASSERT(info.m_InputTensorInfos[2].IsConstant() == true); } const arm_compute::Size2D aclDilationInfo = BuildArmComputeSize2D( diff --git a/src/backends/cl/workloads/ClFullyConnectedWorkload.cpp b/src/backends/cl/workloads/ClFullyConnectedWorkload.cpp index 727ae5634a..1f26b09964 100644 --- a/src/backends/cl/workloads/ClFullyConnectedWorkload.cpp +++ b/src/backends/cl/workloads/ClFullyConnectedWorkload.cpp @@ -33,6 +33,12 @@ arm_compute::Status ClFullyConnectedWorkloadValidate(const TensorInfo& input, if (descriptor.m_BiasEnabled) { ARMNN_ASSERT(biases.has_value()); + // Same for bias as weights. We don't currently support non const. + if (!biases.value().IsConstant()) + { + return arm_compute::Status{arm_compute::ErrorCode::RUNTIME_ERROR, + "Arm NN ClFullyConnectedWorkload does not support non constant bias."}; + } aclBiases = BuildArmComputeTensorInfo(biases.value()); aclBiases.set_are_values_constant(biases.value().IsConstant()); optionalAclBiases = &aclBiases; @@ -68,6 +74,9 @@ ClFullyConnectedWorkload::ClFullyConnectedWorkload( { bias = &PolymorphicDowncast<IClTensorHandle*>(m_Data.m_Inputs[2])->GetTensor(); bias->info()->set_are_values_constant(info.m_InputTensorInfos[2].IsConstant()); + + // We do not support dynamic bias + ARMNN_ASSERT(info.m_InputTensorInfos[2].IsConstant() == true); } const arm_compute::ActivationLayerInfo activationInfo = ConvertAdditionalInfoToAclActivationLayerInfo(descriptor); |