Skip to content

Commit

Permalink
[TOPI] Fix mali conv2d performance regression (apache#3131)
Browse files Browse the repository at this point in the history
* [TOPI] fix mali conv

* fix typo

* address comments
  • Loading branch information
merrymercy authored and Wei Chen committed May 13, 2019
1 parent ef78f81 commit 0a570ed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion python/tvm/autotvm/tophub.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
'cuda': "v0.04",
'rocm': "v0.02",
'opencl': "v0.02",
'mali': "v0.04",
'mali': "v0.05",

'vta': "v0.04",
}
Expand Down
8 changes: 5 additions & 3 deletions topi/python/topi/mali/conv2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,11 @@ def _decl_winograd(cfg, data, kernel, strides, padding, dilation, layout, out_dt
# unpack output
output = tvm.compute((N, CO, H, W), lambda n, co, h, w:
Y[co][n * nH * nW + (h//m) * nW + w//m][h % m][w % m]
# thw following term is used to make the padding effective,
# otherwise the padding will be eliminated by bound inference
+ tvm.const(0, out_dtype) * M[alpha-1][alpha-1][CO-1][P_round-1],
# The following hack term is used to make the padding in batch gemm ("M")
# effective, otherwise the padding will be eliminated by bound inference.
# Use `tvm.expr.Mul` instead of `*` to avoid issues in const folding.
+ tvm.expr.Mul(tvm.const(0, out_dtype),
M[alpha-1][alpha-1][CO-1][P_round-1]),
name='output', tag='winograd_conv2d_output')

# we have to manually assign effective GFLOP for winograd
Expand Down

0 comments on commit 0a570ed

Please sign in to comment.