diff options
author | Gunes Bayir <gunes.bayir@arm.com> | 2022-11-09 09:26:27 +0000 |
---|---|---|
committer | Gunes Bayir <gunes.bayir@arm.com> | 2022-11-14 15:01:27 +0000 |
commit | ec0113dd7749991959ae351934eea0c0d8077dcb (patch) | |
tree | 792f38b3a05fa85436339d54abddab096e20cc77 /arm_compute | |
parent | 46ede332c7064b85dc538891cad165b3bb427320 (diff) | |
download | ComputeLibrary-ec0113dd7749991959ae351934eea0c0d8077dcb.tar.gz |
Optimize Transposed Convolution for CL backend (FP32/16)
This patch optimizes transposed convolution for CL backend by rewriting it in a single kernel instead of three (flip_kernel + upsample + conv). The new kernel skips the upsampling step which reduces the input space of convolution by stride_x * stride_y, resulting in significant performance improvement. It also skips the kernel flipping by traversing the weights accordingly, thus reduces the memory footprint.
Resolves: COMPMID-5676
Signed-off-by: Gunes Bayir <gunes.bayir@arm.com>
Change-Id: I8a333212dc7c5f7f0597aa58b0d56d44814baa14
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/8588
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Gian Marco Iodice <gianmarco.iodice@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Benchmark: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'arm_compute')
-rw-r--r-- | arm_compute/core/Types.h | 5 | ||||
-rw-r--r-- | arm_compute/runtime/CL/functions/CLDeconvolutionLayer.h | 7 |
2 files changed, 9 insertions, 3 deletions
diff --git a/arm_compute/core/Types.h b/arm_compute/core/Types.h index b0a6475527..d5a4125c88 100644 --- a/arm_compute/core/Types.h +++ b/arm_compute/core/Types.h @@ -150,8 +150,9 @@ enum class DepthwiseConvolutionFunction /** Available DeconvolutionMethod*/ enum class DeconvolutionMethod { - GEMM, /**< Deconvolution using GEMM */ - DIRECT, /**< Direct deconvolution */ + GEMM, /**< Deconvolution using GEMM */ + DIRECT, /**< Direct deconvolution */ + UPSCALE_CONV2D /**< Deconvolution with Upscaling */ }; /** Available FuseBatchNormalizationType*/ diff --git a/arm_compute/runtime/CL/functions/CLDeconvolutionLayer.h b/arm_compute/runtime/CL/functions/CLDeconvolutionLayer.h index 8ad805492d..0c59e2c86d 100644 --- a/arm_compute/runtime/CL/functions/CLDeconvolutionLayer.h +++ b/arm_compute/runtime/CL/functions/CLDeconvolutionLayer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2021 Arm Limited. + * Copyright (c) 2017-2022 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -44,6 +44,8 @@ public: /** Default constructor */ CLDeconvolutionLayer(std::shared_ptr<IMemoryManager> memory_manager = nullptr); + ~CLDeconvolutionLayer(); + /** Set the input, weights, biases and output tensors. * * Valid data layouts: @@ -105,6 +107,9 @@ public: private: std::shared_ptr<IMemoryManager> _memory_manager; std::unique_ptr<IFunction> _function; + + struct Impl; + std::unique_ptr<Impl> _impl; }; } // namespace arm_compute #endif /* ARM_COMPUTE_CLDECONVOLUTIONLAYER_H */ |