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
79735eb2
Commit
79735eb2
authored
Nov 18, 2018
by
Lianmin Zheng
Committed by
Tianqi Chen
Nov 18, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[TOPHUB] fix x86 backend after introducing dilation (#2129)
parent
a376eb30
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
python/tvm/autotvm/tophub.py
+1
-1
topi/python/topi/x86/conv2d.py
+5
-4
No files found.
python/tvm/autotvm/tophub.py
View file @
79735eb2
...
@@ -21,7 +21,7 @@ AUTOTVM_TOPHUB_ROOT_PATH = os.path.join(os.path.expanduser('~'), ".tvm", "tophub
...
@@ -21,7 +21,7 @@ AUTOTVM_TOPHUB_ROOT_PATH = os.path.join(os.path.expanduser('~'), ".tvm", "tophub
# the version of each package
# the version of each package
PACKAGE_VERSION
=
{
PACKAGE_VERSION
=
{
'arm_cpu'
:
"v0.04"
,
'arm_cpu'
:
"v0.04"
,
'llvm'
:
"v0.0
2
"
,
'llvm'
:
"v0.0
3
"
,
'cuda'
:
"v0.04"
,
'cuda'
:
"v0.04"
,
'rocm'
:
"v0.02"
,
'rocm'
:
"v0.02"
,
...
...
topi/python/topi/x86/conv2d.py
View file @
79735eb2
...
@@ -292,6 +292,7 @@ def _alter_conv2d_layout(attrs, inputs, tinfo):
...
@@ -292,6 +292,7 @@ def _alter_conv2d_layout(attrs, inputs, tinfo):
out_channel
=
attrs
.
get_int
(
"channels"
)
out_channel
=
attrs
.
get_int
(
"channels"
)
padding
=
attrs
.
get_int_tuple
(
"padding"
)
padding
=
attrs
.
get_int_tuple
(
"padding"
)
strides
=
attrs
.
get_int_tuple
(
"strides"
)
strides
=
attrs
.
get_int_tuple
(
"strides"
)
dilation
=
attrs
.
get_int_tuple
(
"dilation"
)
layout
=
attrs
[
'layout'
]
layout
=
attrs
[
'layout'
]
kh
,
kw
=
attrs
.
get_int_tuple
(
"kernel_size"
)
kh
,
kw
=
attrs
.
get_int_tuple
(
"kernel_size"
)
...
@@ -309,10 +310,10 @@ def _alter_conv2d_layout(attrs, inputs, tinfo):
...
@@ -309,10 +310,10 @@ def _alter_conv2d_layout(attrs, inputs, tinfo):
target
=
tvm
.
target
.
current_target
()
target
=
tvm
.
target
.
current_target
()
# query schedule and fallback if necessary
# query schedule and fallback if necessary
workload
=
autotvm
.
task
.
args_to_workload
(
workload
=
autotvm
.
task
.
args_to_workload
(
[
data
,
kernel
,
strides
,
padding
,
out_dtype
],
depthwise_conv2d_nchw
)
\
[
data
,
kernel
,
strides
,
padding
,
dilation
,
out_dtype
],
depthwise_conv2d_nchw
)
\
if
is_depthwise
else
\
if
is_depthwise
else
\
autotvm
.
task
.
args_to_workload
(
autotvm
.
task
.
args_to_workload
(
[
data
,
kernel
,
strides
,
padding
,
layout
,
out_dtype
],
conv2d
)
[
data
,
kernel
,
strides
,
padding
,
dilation
,
layout
,
out_dtype
],
conv2d
)
cfg
=
dispatch_ctx
.
query
(
target
,
workload
)
cfg
=
dispatch_ctx
.
query
(
target
,
workload
)
if
cfg
.
is_fallback
:
if
cfg
.
is_fallback
:
_get_default_config
(
cfg
,
data
,
kernel
,
strides
,
padding
,
out_dtype
,
is_depthwise
)
_get_default_config
(
cfg
,
data
,
kernel
,
strides
,
padding
,
out_dtype
,
is_depthwise
)
...
@@ -334,7 +335,7 @@ def _alter_conv2d_layout(attrs, inputs, tinfo):
...
@@ -334,7 +335,7 @@ def _alter_conv2d_layout(attrs, inputs, tinfo):
# Store altered operator's config
# Store altered operator's config
new_kernel
=
tvm
.
placeholder
((
out_channel
//
oc_bn
,
kh
,
kw
,
oc_bn
),
dtype
=
kernel
.
dtype
)
new_kernel
=
tvm
.
placeholder
((
out_channel
//
oc_bn
,
kh
,
kw
,
oc_bn
),
dtype
=
kernel
.
dtype
)
new_workload
=
autotvm
.
task
.
args_to_workload
(
new_workload
=
autotvm
.
task
.
args_to_workload
(
[
new_data
,
new_kernel
,
strides
,
padding
,
new_attrs
[
'layout'
],
[
new_data
,
new_kernel
,
strides
,
padding
,
dilation
,
new_attrs
[
'layout'
],
new_attrs
[
'out_layout'
],
out_dtype
],
depthwise_conv2d_NCHWc
)
new_attrs
[
'out_layout'
],
out_dtype
],
depthwise_conv2d_NCHWc
)
else
:
else
:
out_channel
,
_
,
kh
,
kw
=
get_const_tuple
(
kernel
.
shape
)
out_channel
,
_
,
kh
,
kw
=
get_const_tuple
(
kernel
.
shape
)
...
@@ -345,7 +346,7 @@ def _alter_conv2d_layout(attrs, inputs, tinfo):
...
@@ -345,7 +346,7 @@ def _alter_conv2d_layout(attrs, inputs, tinfo):
new_kernel
=
tvm
.
placeholder
((
out_channel
//
oc_bn
,
in_channel
//
ic_bn
,
kh
,
kw
,
ic_bn
,
oc_bn
),
new_kernel
=
tvm
.
placeholder
((
out_channel
//
oc_bn
,
in_channel
//
ic_bn
,
kh
,
kw
,
ic_bn
,
oc_bn
),
dtype
=
kernel
.
dtype
)
dtype
=
kernel
.
dtype
)
new_workload
=
autotvm
.
task
.
args_to_workload
(
new_workload
=
autotvm
.
task
.
args_to_workload
(
[
new_data
,
new_kernel
,
strides
,
padding
,
new_attrs
[
'layout'
],
[
new_data
,
new_kernel
,
strides
,
padding
,
dilation
,
new_attrs
[
'layout'
],
new_attrs
[
'out_layout'
],
out_dtype
],
conv2d_NCHWc
)
new_attrs
[
'out_layout'
],
out_dtype
],
conv2d_NCHWc
)
dispatch_ctx
.
update
(
target
,
new_workload
,
cfg
)
dispatch_ctx
.
update
(
target
,
new_workload
,
cfg
)
...
...
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