aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGian Marco Iodice <gianmarco.iodice@arm.com>2022-08-25 12:25:44 +0100
committerGian Marco Iodice <gianmarco.iodice@arm.com>2022-09-02 08:33:21 +0000
commit1257131193fdb9b6940055a41691320e37a208b5 (patch)
treeea48d445c6be8e258d742a67fe41a65472d51963
parent16789a14afc27c1a77c8ca1e3d04b79cda6c833b (diff)
downloadComputeLibrary-1257131193fdb9b6940055a41691320e37a208b5.tar.gz
Enable Winograd-based conv2d when IFM>=8 on Gpu
From an internal performance evaluation, it seems that Winograd-based Conv2D offers better performance than alternative methods such as direct convolution and gemm-based conv already from IFM=8. Before the condition was for IFM>=16 Resolves COMPMID-5532 Change-Id: I9ff04835d6fd07f5f0abeec9645c9d9cc913b6b7 Signed-off-by: Gian Marco Iodice <gianmarco.iodice@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/8147 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Gunes Bayir <gunes.bayir@arm.com> Benchmark: Arm Jenkins <bsgcomp@arm.com>
-rw-r--r--src/core/CL/kernels/CLDepthwiseConvolutionLayerNativeKernel.cpp2
-rw-r--r--src/gpu/cl/operators/ClConv2d.cpp5
2 files changed, 4 insertions, 3 deletions
diff --git a/src/core/CL/kernels/CLDepthwiseConvolutionLayerNativeKernel.cpp b/src/core/CL/kernels/CLDepthwiseConvolutionLayerNativeKernel.cpp
index d1f0338739..732d768308 100644
--- a/src/core/CL/kernels/CLDepthwiseConvolutionLayerNativeKernel.cpp
+++ b/src/core/CL/kernels/CLDepthwiseConvolutionLayerNativeKernel.cpp
@@ -211,7 +211,7 @@ void CLDepthwiseConvolutionLayerNativeKernel::configure(const CLCompileContext &
arm_compute::opencl::kernels::gemm::update_padding_for_cl_image(weights->info());
}
- // Conditions of -cl-fast-relaxed-math causing accuracy issues can be traced from COMPMID-5324
+ // Conditions of -cl-fast-relaxed-math causing accuracy issues can be traced from COMPMID-5324
const GPUTarget gpu_target = get_target();
const auto act_function = conv_info.act_info.activation();
const auto dst_data_type = _output->info()->data_type();
diff --git a/src/gpu/cl/operators/ClConv2d.cpp b/src/gpu/cl/operators/ClConv2d.cpp
index 8119fc8e3d..16fc0e90d3 100644
--- a/src/gpu/cl/operators/ClConv2d.cpp
+++ b/src/gpu/cl/operators/ClConv2d.cpp
@@ -258,14 +258,15 @@ ConvolutionMethod ClConv2d::get_convolution_method(const ITensorInfo *src, const
// Get dst shape
TensorShape output_shape = misc::shape_calculator::compute_deep_convolution_shape(*src, *weights, conv_info);
const bool is_large_kernel_sz = (weights->dimension(idx_w) >= kernel_sz_direct_conv_thr) && (weights->dimension(idx_h) >= kernel_sz_direct_conv_thr);
+ const bool is_ifm_ge_8 = src->dimension(idx_c) >= 8;
const bool is_ifm_ge_16 = src->dimension(idx_c) >= 16;
const bool is_ofm_lte_8 = weights->dimension(3U) <= 8;
const bool workload_gte_8192 = (output_shape[0] * output_shape[1] * output_shape[2]) / 16 >= 8192;
const bool is_ifm_gt_ofm = src->dimension(idx_c) > weights->dimension(3U);
const bool is_m_one = output_shape[1] * output_shape[2] == 1;
- // Run Winograd if valid and IFM >= 16
- if(is_wino_valid && is_ifm_ge_16)
+ // Run Winograd if valid and IFM >= 8
+ if(is_wino_valid && is_ifm_ge_8)
{
if(is_ofm_lte_8)
{