Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tic
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenyuanbo
tic
Commits
5a8ab8fe
Commit
5a8ab8fe
authored
Mar 18, 2019
by
hlu1
Committed by
Lianmin Zheng
Mar 19, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[TOPI][ARM] Improve injective schedule (#2801)
parent
fa709832
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
2 deletions
+44
-2
topi/python/topi/arm_cpu/__init__.py
+1
-0
topi/python/topi/arm_cpu/injective.py
+37
-0
topi/tests/python/test_topi_resize.py
+3
-1
topi/tests/python/test_topi_upsampling.py
+3
-1
No files found.
topi/python/topi/arm_cpu/__init__.py
View file @
5a8ab8fe
...
...
@@ -4,3 +4,4 @@ from . import conv2d
from
.
import
depthwise_conv2d
from
.
import
conv2d_transpose
from
.
import
bitserial_conv2d
from
.
import
injective
topi/python/topi/arm_cpu/injective.py
0 → 100755
View file @
5a8ab8fe
# pylint: disable=invalid-name, unused-variable
"""Schedule for pooling operators"""
import
tvm
from
..
import
generic
@generic.schedule_injective.register
([
"arm_cpu"
])
def
schedule_injective
(
outs
):
"""ARM CPU schedule for injective op.
Parameters
----------
outs: Array of Tensor
The computation graph description of injective in the format
of an array of tensors.
Returns
-------
sch: Schedule
The computation schedule for the op.
"""
outs
=
[
outs
]
if
isinstance
(
outs
,
tvm
.
tensor
.
Tensor
)
else
outs
s
=
tvm
.
create_schedule
([
x
.
op
for
x
in
outs
])
x
=
outs
[
0
]
if
list
(
s
[
x
]
.
op
.
axis
):
# do not vectorize for broadcast
(
io
,
ii
)
=
s
[
x
]
.
split
(
list
(
s
[
x
]
.
op
.
axis
)[
-
1
],
8
)
s
[
x
]
.
vectorize
(
ii
)
tvm
.
schedule
.
AutoInlineInjective
(
s
)
if
len
(
s
[
x
]
.
op
.
axis
)
>=
4
:
fused
=
s
[
x
]
.
fuse
(
s
[
x
]
.
op
.
axis
[
0
],
s
[
x
]
.
op
.
axis
[
1
],
s
[
x
]
.
op
.
axis
[
2
])
s
[
x
]
.
parallel
(
fused
)
elif
len
(
s
[
x
]
.
op
.
axis
)
>=
3
:
fused
=
s
[
x
]
.
fuse
(
s
[
x
]
.
op
.
axis
[
0
],
s
[
x
]
.
op
.
axis
[
1
])
s
[
x
]
.
parallel
(
fused
)
elif
len
(
s
[
x
]
.
op
.
axis
)
>=
2
:
s
[
x
]
.
parallel
(
s
[
x
]
.
op
.
axis
[
0
])
return
s
topi/tests/python/test_topi_resize.py
View file @
5a8ab8fe
...
...
@@ -5,6 +5,8 @@ import topi
import
topi.testing
import
math
from
common
import
get_all_backend
def
verify_bilinear_scale
(
batch
,
in_channel
,
in_height
,
in_width
,
out_height
,
out_width
,
layout
=
'NCHW'
,
align_corners
=
False
):
if
layout
==
'NCHW'
:
...
...
@@ -40,7 +42,7 @@ def verify_bilinear_scale(batch, in_channel, in_height, in_width, out_height, ou
tvm
.
testing
.
assert_allclose
(
b
.
asnumpy
(),
b_np
,
rtol
=
1e-3
,
atol
=
1e-3
)
for
device
in
[
'llvm'
,
'cuda'
,
'vulkan'
,
'nvptx'
]
:
for
device
in
get_all_backend
()
:
check_device
(
device
)
def
test_resize
():
...
...
topi/tests/python/test_topi_upsampling.py
View file @
5a8ab8fe
...
...
@@ -5,6 +5,8 @@ import topi
import
topi.testing
import
math
from
common
import
get_all_backend
def
verify_upsampling
(
batch
,
in_channel
,
in_height
,
in_width
,
scale
,
layout
=
'NCHW'
,
method
=
"NEAREST_NEIGHBOR"
):
...
...
@@ -45,7 +47,7 @@ def verify_upsampling(batch, in_channel, in_height, in_width, scale, layout='NCH
tvm
.
testing
.
assert_allclose
(
b
.
asnumpy
(),
b_np
,
rtol
=
1e-5
,
atol
=
1e-5
)
for
device
in
[
'llvm'
,
'cuda'
,
'vulkan'
,
'nvptx'
]
:
for
device
in
get_all_backend
()
:
check_device
(
device
)
def
test_upsampling
():
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment