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
8e3b5d39
Commit
8e3b5d39
authored
Dec 15, 2019
by
Cody Yu
Committed by
Tianqi Chen
Dec 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix empty config caused KeyError (#4520)
parent
8541e255
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletions
+14
-1
python/tvm/autotvm/record.py
+7
-1
tests/python/unittest/test_autotvm_record.py
+7
-0
No files found.
python/tvm/autotvm/record.py
View file @
8e3b5d39
...
...
@@ -183,7 +183,13 @@ def load_from_file(filename):
"""
for
row
in
open
(
filename
):
if
row
and
not
row
.
startswith
(
'#'
):
yield
decode
(
row
)
inp
,
res
=
decode
(
row
)
# Avoid loading the record with an empty config. The TOPI schedule with no entities
# will result in an empty entity map (e.g., depthwise_conv2d_nchw on x86).
# Using an empty config will cause problems when applying alter op like NCHW to NCHWc.
if
not
inp
.
config
.
_entity_map
:
continue
yield
(
inp
,
res
)
def
split_workload
(
in_file
,
clean
=
True
):
...
...
tests/python/unittest/test_autotvm_record.py
View file @
8e3b5d39
...
...
@@ -52,9 +52,16 @@ def test_file_io():
inputs
=
[
MeasureInput
(
target
,
tsk
,
tsk
.
config_space
.
get
(
i
))
for
i
in
range
(
0
,
10
)]
results
=
[
MeasureResult
((
i
,
),
0
,
0
,
0
)
for
i
in
range
(
0
,
10
)]
invalid_inp
=
MeasureInput
(
target
,
tsk
,
tsk
.
config_space
.
get
(
10
))
invalid_res
=
MeasureResult
((
10
,
),
0
,
0
,
0
)
# Erase the entity map to test if it will be ignored when loading back.
invalid_inp
.
config
.
_entity_map
=
{}
with
open
(
file_path
,
"w"
)
as
fo
:
cb
=
autotvm
.
callback
.
log_to_file
(
fo
)
cb
(
None
,
inputs
,
results
)
cb
(
None
,
[
invalid_inp
],
[
invalid_res
])
ref
=
zip
(
inputs
,
results
)
for
x
,
y
in
zip
(
ref
,
autotvm
.
record
.
load_from_file
(
file_path
)):
...
...
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