aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFreddie Liardet <frederick.liardet@arm.com>2021-04-22 14:55:17 +0100
committerfrederick.liardet <frederick.liardet@arm.com>2021-04-28 14:17:10 +0000
commite92b0458a0432254f8e49bc306aebfe172bb4d0e (patch)
treec22bfced606c2b00990b74032c1bcd70529b74ca /src
parenta47dcc229d912d4e4bb5afa37220d20451f243a7 (diff)
downloadComputeLibrary-e92b0458a0432254f8e49bc306aebfe172bb4d0e.tar.gz
Add per-channel quantization support for CLDeconvolutionLayer
Add QSYMM8_PER_CHANNEL support on weight input for CLDeconvolutionLayer. When weights are per-channel quantized type "Direct" method is always used. Also reduce number of QSYMM8_PER_CHANNEL tests for NEDeconvolutionLayer. Resolves: COMPMID-3438 Signed-off-by: Freddie Liardet <frederick.liardet@arm.com> Change-Id: I1330cac5142e19d21e322574fb8d912558745b02 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5484 Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com> Reviewed-by: Giorgio Arena <giorgio.arena@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src')
-rw-r--r--src/runtime/CL/functions/CLDeconvolutionLayer.cpp7
-rw-r--r--src/runtime/CL/functions/CLDirectDeconvolutionLayer.cpp8
2 files changed, 12 insertions, 3 deletions
diff --git a/src/runtime/CL/functions/CLDeconvolutionLayer.cpp b/src/runtime/CL/functions/CLDeconvolutionLayer.cpp
index 75f34cc5ee..918848745e 100644
--- a/src/runtime/CL/functions/CLDeconvolutionLayer.cpp
+++ b/src/runtime/CL/functions/CLDeconvolutionLayer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2020 Arm Limited.
+ * Copyright (c) 2017-2021 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -105,6 +105,11 @@ DeconvolutionMethod CLDeconvolutionLayer::get_deconvolution_method(const ITensor
{
ARM_COMPUTE_UNUSED(output, bias, weights_info);
+ if(is_data_type_quantized_per_channel(weights->data_type()))
+ {
+ return DeconvolutionMethod::DIRECT;
+ }
+
const DataLayout data_layout = input->data_layout();
const size_t idx_w = get_data_layout_dimension_index(data_layout, DataLayoutDimension::WIDTH);
diff --git a/src/runtime/CL/functions/CLDirectDeconvolutionLayer.cpp b/src/runtime/CL/functions/CLDirectDeconvolutionLayer.cpp
index d802ef2dc9..00d9a9ec89 100644
--- a/src/runtime/CL/functions/CLDirectDeconvolutionLayer.cpp
+++ b/src/runtime/CL/functions/CLDirectDeconvolutionLayer.cpp
@@ -74,7 +74,12 @@ Status CLDirectDeconvolutionLayer::validate(const ITensorInfo *input, const ITen
const TensorShape output_shape = compute_deconvolution_output_shape(out_dims, *input, *weights);
- ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(input, output, weights);
+ ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(input, output);
+
+ if(input->data_type() != weights->data_type())
+ {
+ ARM_COMPUTE_RETURN_ERROR_ON(weights->data_type() != DataType::QSYMM8_PER_CHANNEL || !is_data_type_quantized_asymmetric(input->data_type()));
+ }
if(bias != nullptr)
{
@@ -227,7 +232,6 @@ void CLDirectDeconvolutionLayer::prepare()
{
_weights_flipped.allocator()->free();
}
-
_is_prepared = true;
}
}