1
0
forked from pool/onednn
oneapi-onednn/1428.patch
2022-09-21 12:12:47 +00:00

35 lines
1.7 KiB
Diff

From 24d4c1379d3c4cbf423f979fa25283b1914159c7 Mon Sep 17 00:00:00 2001
From: Diana Bite <diana.bite@arm.com>
Date: Thu, 21 Jul 2022 12:27:17 +0100
Subject: [PATCH] cpu: aarch64: acl: disallow large padding in ACL wino to be
consist with oneDNN
---
src/cpu/aarch64/acl_convolution_utils.cpp | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/cpu/aarch64/acl_convolution_utils.cpp b/src/cpu/aarch64/acl_convolution_utils.cpp
index db3bde6a48..542033df0e 100644
--- a/src/cpu/aarch64/acl_convolution_utils.cpp
+++ b/src/cpu/aarch64/acl_convolution_utils.cpp
@@ -307,10 +307,17 @@ status_t init_conf_wino(acl_conv_conf_t &acp, memory_desc_t &src_md,
// General Compute Library checks, memory tags are also set there
CHECK(acl_init_conf(acp, src_md, weights_md, dst_md, bias_md, cd, attr));
- const bool wino_shape_ok // unit strides only, no dilations
+ const bool shape_ok
+ // only unit strides allowed
= (acp.padstride_info.stride() == std::pair<uint, uint> {1, 1})
+ // Note: Compute Library supports arbitrary padding for wino kernels
+ // but we only allow small padding to be consistent with oneDNN
+ && (acp.padstride_info.pad().first <= 1) // padding left/right
+ && (acp.padstride_info.pad().second <= 1) // padding top/bottom
+ // only non-dilated convolutions allowed
&& (acp.dilation_info == arm_compute::Size2D(1, 1));
- if (!wino_shape_ok) return status::unimplemented;
+
+ ACL_CHECK_SUPPORT(!shape_ok, "shape not supported by winograd kernels");
// clang-format off
// Validate convolution manually to check for return status