This is an automated email from the ASF dual-hosted git repository.
masahi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git
The following commit(s) were added to refs/heads/main by this push:
new 8dafaf3a4d [Adreno] Fix winograd schedule to support prime shapes > 4
(#12157)
8dafaf3a4d is described below
commit 8dafaf3a4d37ffc17725af70e626f6223f5b2a12
Author: Andrey Malyshev <[email protected]>
AuthorDate: Fri Jul 22 11:40:52 2022 +0300
[Adreno] Fix winograd schedule to support prime shapes > 4 (#12157)
---
python/tvm/topi/adreno/conv2d_winograd_common.py | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/python/tvm/topi/adreno/conv2d_winograd_common.py
b/python/tvm/topi/adreno/conv2d_winograd_common.py
index be3c808eec..6d11c1fe73 100644
--- a/python/tvm/topi/adreno/conv2d_winograd_common.py
+++ b/python/tvm/topi/adreno/conv2d_winograd_common.py
@@ -427,11 +427,20 @@ def schedule_conv2d_winograd(cfg, s, output,
pre_computed):
cfg.define_split(
"tile_y", y, num_outputs=3, filter=lambda entry: entry.size[2] <= 64
and entry.size[1] <= 16
)
+
+ min_x_div = 1
+ for bn in range(4, 0, -1):
+ if bgemm.shape[3] % bn == 0:
+ min_x_div = bn
+ break
+
cfg.define_split(
"tile_x",
x,
num_outputs=3,
- filter=lambda entry: entry.size[2] <= 64 and entry.size[1] >= 4 and
entry.size[1] <= 16,
+ filter=lambda entry: entry.size[2] <= 64
+ and entry.size[1] >= min_x_div
+ and entry.size[1] <= 16,
)
cfg.define_split("tile_rc", rcc, num_outputs=2)
# TODO: Uncomment the following lines when multi_filter will be introduced