diff options
author | Gian Marco Iodice <gianmarco.iodice@arm.com> | 2022-08-16 13:04:18 +0100 |
---|---|---|
committer | Ramy Elgammal <ramy.elgammal@arm.com> | 2022-08-16 14:47:49 +0000 |
commit | e54d8c07e75d70baeb80fecbb43088027ea45658 (patch) | |
tree | e2a7c576a24fa6a3d903497a317a92766d4c970b /src/gpu/cl/operators | |
parent | fa8ff8e44f33b73375e4cec6361b58beaffc0d73 (diff) | |
download | ComputeLibrary-e54d8c07e75d70baeb80fecbb43088027ea45658.tar.gz |
Fix performance regression in ClConv2D
- Call gemm-based convolution when the kernel is large and the stride is
unit
Resolves: COMPMID-5504
Change-Id: I8dd83bd012000ed76824b96a8e37c98c861c59e4
Signed-off-by: Gian Marco Iodice <gianmarco.iodice@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/8081
Benchmark: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Adnan AlSinan <adnan.alsinan@arm.com>
Reviewed-by: Gunes Bayir <gunes.bayir@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/gpu/cl/operators')
-rw-r--r-- | src/gpu/cl/operators/ClConv2d.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gpu/cl/operators/ClConv2d.cpp b/src/gpu/cl/operators/ClConv2d.cpp index 8119fc8e3d..cd64c8d6b0 100644 --- a/src/gpu/cl/operators/ClConv2d.cpp +++ b/src/gpu/cl/operators/ClConv2d.cpp @@ -273,6 +273,11 @@ ConvolutionMethod ClConv2d::get_convolution_method(const ITensorInfo *src, const { return ConvolutionMethod::WINOGRAD; } + + if(weights->dimension(idx_w) > 3 && weights->dimension(idx_h) > 3) + { + return ConvolutionMethod::WINOGRAD; + } } else { @@ -301,7 +306,11 @@ ConvolutionMethod ClConv2d::get_convolution_method(const ITensorInfo *src, const { if( ((is_large_kernel_sz || is_m_one) && workload_gte_8192) || is_ofm_lte_8 ) { - return ConvolutionMethod::DIRECT; + // Do not use direct convolution when the kernel is large and the stride is unit + if(!(is_large_kernel_sz && conv_info.stride().first == 1 && conv_info.stride().second == 1)) + { + return ConvolutionMethod::DIRECT; + } } } } |