diff options
author | Gian Marco Iodice <gianmarco.iodice@arm.com> | 2018-04-11 15:59:10 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:49:37 +0000 |
commit | e52a3000d2c13bc1b66ca66b3d12b6b836982394 (patch) | |
tree | 70e8ef5ba216762604f84228805aac9bd65747b6 /arm_compute | |
parent | dd03870b63784abe499761da2b26b209b33f2db2 (diff) | |
download | ComputeLibrary-e52a3000d2c13bc1b66ca66b3d12b6b836982394.tar.gz |
COMPMID-1026 - Add support for 4x4 output tile in CLWinogradConvolutionLayer
The performance achieved can be found at the following confluence page:
https://confluence.arm.com/display/MLENG/GEMM-based+convolution+vs+Winograd-based+convolution+on+OpenCL
Change-Id: I4b690cfdd4eb4ff0cd17b14fdd49ccaa1d1dc85c
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/127729
Tested-by: Jenkins <bsgcomp@arm.com>
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Diffstat (limited to 'arm_compute')
5 files changed, 12 insertions, 20 deletions
diff --git a/arm_compute/core/CL/kernels/CLWinogradFilterTransformKernel.h b/arm_compute/core/CL/kernels/CLWinogradFilterTransformKernel.h index 7115710d59..828e2e521a 100644 --- a/arm_compute/core/CL/kernels/CLWinogradFilterTransformKernel.h +++ b/arm_compute/core/CL/kernels/CLWinogradFilterTransformKernel.h @@ -49,8 +49,7 @@ public: /** Set the input and output tensor. * * @note Winograd filter transform supports the following configurations: - * Output tile size: 2x2, 4x4 - * Kernel size: 3x3 + * F(output tile, kernel size):F(2x2, 3x3), F(4x4, 3x3), F(4x4, 5x5) * Strides: only unit strides * * @param[in] input Source tensor. The input is a 4D tensor with dimensions [kernel_x, kernel_y, IFM, OFM] (NCHW data layout). Data types supported: F32. @@ -61,8 +60,7 @@ public: /** Static function to check if given info will lead to a valid configuration of @ref CLWinogradFilterTransformKernel * * @note Winograd filter transform supports the following configurations: - * Output tile size: 2x2, 4x4 - * Kernel size: 3x3 + * F(output tile, kernel size):F(2x2, 3x3), F(4x4, 3x3), F(4x4, 5x5) * Strides: only unit strides * * @param[in] input Source tensor. The input is a 4D tensor with dimensions [kernel_x, kernel_y, IFM, OFM] (NCHW data layout). Data types supported: F32. diff --git a/arm_compute/core/CL/kernels/CLWinogradInputTransformKernel.h b/arm_compute/core/CL/kernels/CLWinogradInputTransformKernel.h index 2d1eadf3cf..b92ff2f60c 100644 --- a/arm_compute/core/CL/kernels/CLWinogradInputTransformKernel.h +++ b/arm_compute/core/CL/kernels/CLWinogradInputTransformKernel.h @@ -47,8 +47,7 @@ public: /** Set the input and output of the kernel. * * @note Winograd input transform supports the following configurations: - * Output tile size: 2x2 - * Kernel size: 3x3 + * F(output tile, kernel size):F(2x2, 3x3), F(4x4, 3x3), F(4x4, 5x5) * Strides: only unit strides * * @param[in] input The input tensor to transform. Data types supported: F32 @@ -59,8 +58,7 @@ public: /** Static function to check if given info will lead to a valid configuration of @ref CLWinogradInputTransformKernel * * @note Winograd input transform supports the following configurations: - * Output tile size: 2x2 - * Kernel size: 3x3 + * F(output tile, kernel size):F(2x2, 3x3), F(4x4, 3x3), F(4x4, 5x5) * Strides: only unit strides * * @param[in] input The input tensor to transform. Data types supported: F32 diff --git a/arm_compute/core/CL/kernels/CLWinogradOutputTransformKernel.h b/arm_compute/core/CL/kernels/CLWinogradOutputTransformKernel.h index b0d0bbeeaa..5e64a82e48 100644 --- a/arm_compute/core/CL/kernels/CLWinogradOutputTransformKernel.h +++ b/arm_compute/core/CL/kernels/CLWinogradOutputTransformKernel.h @@ -49,11 +49,10 @@ public: /** Set the input and output tensor. * * @note Winograd output transform supports the following configurations: - * Output tile size: 2x2 - * Kernel size: 3x3 + * F(output tile, kernel size):F(2x2, 3x3), F(4x4, 3x3), F(4x4, 5x5) * Strides: only unit strides * - * @param[in] input Source tensor with shape [C, N, 16, batches]. Data types supported: F32. + * @param[in] input Source tensor with shape [C, N, K, batches]. Data types supported: F32. * @param[in] bias Biases tensor. Shared biases supported. Biases are 1D tensor with dimensions [OFM]. It can be a nullptr. Data type supported: as @p input * @param[out] output The output tensor. The shape for this tensor can be calculated using the utility function @p compute_winograd_output_transform_shape. Data types supported: Same as @p input * @param[in] winograd_info Contains Winograd's information described in @ref WinogradInfo @@ -62,11 +61,10 @@ public: /** Static function to check if given info will lead to a valid configuration of @ref CLWinogradOutputTransformKernel * * @note Winograd output transform supports the following configurations: - * Output tile size: 2x2 - * Kernel size: 3x3 + * F(output tile, kernel size):F(2x2, 3x3), F(4x4, 3x3), F(4x4, 5x5) * Strides: only unit strides * - * @param[in] input Source tensor with shape [C, N, 16, batches]. Data types supported: F32. + * @param[in] input Source tensor with shape [C, N, K, batches]. Data types supported: F32. * @param[in] bias Biases tensor. Shared biases supported. Biases are 1D tensor with dimensions [OFM]. It can be a nullptr. Data type supported: as @p input * @param[out] output The output tensor. The shape for this tensor can be calculated using the utility function @p compute_winograd_output_transform_shape. Data types supported: Same as @p input * @param[in] winograd_info Contains Winograd's information described in @ref WinogradInfo diff --git a/arm_compute/runtime/CL/functions/CLConvolutionLayer.h b/arm_compute/runtime/CL/functions/CLConvolutionLayer.h index 7df765988f..a1cd15515f 100644 --- a/arm_compute/runtime/CL/functions/CLConvolutionLayer.h +++ b/arm_compute/runtime/CL/functions/CLConvolutionLayer.h @@ -26,6 +26,7 @@ #include "arm_compute/runtime/CL/functions/CLDirectConvolutionLayer.h" #include "arm_compute/runtime/CL/functions/CLGEMMConvolutionLayer.h" +#include "arm_compute/runtime/CL/functions/CLWinogradConvolutionLayer.h" #include "arm_compute/runtime/IFunction.h" #include "arm_compute/runtime/IMemoryManager.h" @@ -84,7 +85,6 @@ public: * while every optional dimension from 4 and above represent a batch of inputs. * Data types supported: QS8/QASYMM8/QS16/F16/F32. * @param[in] weights Weights tensor. Weights are 4D tensor with dimensions [kernel_x, kernel_y, IFM, OFM]. Data type supported:Same as @p input. - * @param[in] biases Biases tensor. Shared biases supported. Biases are 1D tensor with dimensions [OFM]. Data type supported:Same as @p input. * @param[in] output Destination tensor. 3 lower dimensions represent a single output [width, height, OFM], while the rest represent batch of outputs. * Data types supported: Same as @p input. * @param[in] conv_info Contains padding and stride information described in @ref PadStrideInfo. @@ -95,7 +95,7 @@ public: * * @return a status */ - static ConvolutionMethod get_convolution_method(const ITensorInfo *input, const ITensorInfo *weights, const ITensorInfo *biases, const ITensorInfo *output, const PadStrideInfo &conv_info, + static ConvolutionMethod get_convolution_method(const ITensorInfo *input, const ITensorInfo *weights, const ITensorInfo *output, const PadStrideInfo &conv_info, const WeightsInfo &weights_info, const ActivationLayerInfo &act_info, const GPUTarget gpu_target, const Size2D &dilation = Size2D(1U, 1U)); // Inherited methods overridden: void run() override; diff --git a/arm_compute/runtime/CL/functions/CLWinogradInputTransform.h b/arm_compute/runtime/CL/functions/CLWinogradInputTransform.h index 0e0d6bf284..64d3e80bc9 100644 --- a/arm_compute/runtime/CL/functions/CLWinogradInputTransform.h +++ b/arm_compute/runtime/CL/functions/CLWinogradInputTransform.h @@ -40,8 +40,7 @@ public: /** Set the input and output tensors. * * @note Winograd input transform supports the following configurations: - * Output tile size: 2x2 - * Kernel size: 3x3 + * F(output tile, kernel size):F(2x2, 3x3), F(4x4, 3x3), F(4x4, 5x5) * Strides: only unit strides * * @param[in] input The input tensor to transform. Data types supported: F32 @@ -52,8 +51,7 @@ public: /** Static function to check if given info will lead to a valid configuration of @ref CLWinogradInputTransform. * * @note Winograd input transform supports the following configurations: - * Output tile size: 2x2 - * Kernel size: 3x3 + * F(output tile, kernel size):F(2x2, 3x3), F(4x4, 3x3), F(4x4, 5x5) * Strides: only unit strides * * @param[in] input The input tensor to transform. Data types supported: F32 |