Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tvm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cld
ml
tvm
Commits
56c50d2d
Commit
56c50d2d
authored
6 years ago
by
Lianmin Zheng
Committed by
Tianqi Chen
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
trigger ci (#1620)
parent
c98ba601
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
topi/python/topi/x86/nn.py
+19
-24
19 additions, 24 deletions
topi/python/topi/x86/nn.py
with
19 additions
and
24 deletions
topi/python/topi/x86/nn.py
+
19
−
24
View file @
56c50d2d
...
...
@@ -2,8 +2,9 @@
"""
x86 nn operators
"""
from
__future__
import
absolute_import
as
_abs
import
tvm
from
..
import
generic
from
..
import
t
ag
from
..
util
import
t
raverse_inline
@generic.schedule_softmax.register
([
"
cpu
"
])
def
schedule_softmax
(
outs
):
...
...
@@ -53,44 +54,38 @@ def schedule_dense(outs):
outs
=
[
outs
]
if
isinstance
(
outs
,
tvm
.
tensor
.
Tensor
)
else
outs
s
=
tvm
.
create_schedule
([
x
.
op
for
x
in
outs
])
scheduled_ops
=
[]
def
traverse
(
op
):
"""
Traverse operators from computation graph
"""
# inline all one-to-one-mapping operators except the last stage (output)
if
tag
.
is_broadcast
(
op
.
tag
):
if
op
not
in
s
.
outputs
:
s
[
op
].
compute_inline
()
for
tensor
in
op
.
input_tensors
:
if
tensor
.
op
.
input_tensors
and
tensor
.
op
not
in
scheduled_ops
:
traverse
(
tensor
.
op
)
def
_callback
(
op
):
if
'
dense
'
in
op
.
tag
:
C
=
op
.
output
(
0
)
x
,
y
=
C
.
op
.
axis
output
=
outs
[
0
]
dense
=
op
.
output
(
0
)
# Write cache for blocks
CC
=
s
.
cache_write
(
C
,
'
global
'
)
if
dense
.
op
in
s
.
outputs
:
CC
=
s
.
cache_write
(
dense
,
'
local
'
)
else
:
CC
=
dense
# Tile
bnx
=
1
bny
=
4
_
,
yo
,
_
,
yi
=
s
[
C
].
tile
(
x
,
y
,
bnx
,
bny
)
s
[
CC
].
compute_at
(
s
[
C
],
yo
)
x
,
y
=
output
.
op
.
axis
xo
,
yo
,
xi
,
yi
=
s
[
output
].
tile
(
x
,
y
,
bnx
,
bny
)
xc
,
yc
=
s
[
CC
].
op
.
axis
k
,
=
s
[
CC
].
op
.
reduce_axis
ko
,
ki
=
s
[
CC
].
split
(
k
,
factor
=
4
)
s
[
CC
].
reorder
(
ko
,
xc
,
ki
,
yc
)
s
[
CC
].
unroll
(
ki
)
s
[
CC
].
vectorize
(
yc
)
# Vectorization
s
[
C
].
vectorize
(
yi
)
# Parallelization
s
[
C
].
parallel
(
yo
)
s
[
output
].
unroll
(
xi
)
s
[
output
].
vectorize
(
yi
)
scheduled_ops
.
append
(
op
)
fused
=
s
[
output
].
fuse
(
xo
,
yo
)
s
[
output
].
parallel
(
fused
)
s
[
CC
].
compute_at
(
s
[
output
],
fused
)
traverse
(
outs
[
0
].
op
)
traverse
_inline
(
s
,
outs
[
0
].
op
,
_callback
)
return
s
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment