Skip to content

Commit 3a32729

Browse files
anijain2305yzhliu
authored andcommitted
[TOPI][X86] Pool operator parallel support. (#4090)
1 parent 1c56c72 commit 3a32729

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

topi/python/topi/x86/pooling.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,13 @@ def traverse(OP):
9898
traverse(tensor.op)
9999
# schedule pool
100100
elif OP.tag.startswith('pool'):
101+
# Average pool accumulation and division happens in different for loops (#3607).
102+
# To ensure good parallel support, apply multi-threading on the second loop.
103+
if OP != outs[0].op:
104+
output = outs[0]
105+
output_fused = s[output].fuse(output.op.axis[0], output.op.axis[1])
106+
s[output].parallel(output_fused)
107+
101108
PaddedInput = OP.input_tensors[0]
102109
Pool = OP.output(0)
103110
_schedule(PaddedInput, Pool)

0 commit comments

Comments
 (0)