Skip to content

Commit

Permalink
removing sim stats from log for now due to tophub issues
Browse files Browse the repository at this point in the history
  • Loading branch information
tmoreau89 committed May 28, 2019
1 parent ce46cc3 commit 7ec3e64
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 19 deletions.
4 changes: 1 addition & 3 deletions python/tvm/autotvm/measure/measure.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class MeasureInput(namedtuple("MeasureInput", ["target", "task", "config"])):
"""


class MeasureResult(namedtuple("MeasureResult", ["costs", "error_no", "all_cost", "timestamp", "sim_stats"])):
class MeasureResult(namedtuple("MeasureResult", ["costs", "error_no", "all_cost", "timestamp"])):
"""
Stores all the results of a measurement
Expand All @@ -49,8 +49,6 @@ class MeasureResult(namedtuple("MeasureResult", ["costs", "error_no", "all_cost"
All cost of this measure, including rpc, compilation, test runs
timestamp: float
The absolute time stamp when we finish measurement.
sim_stats: Dictionary
Dictionary of VTA simulator statistics (only used when target is VTA)
"""


Expand Down
20 changes: 9 additions & 11 deletions python/tvm/autotvm/measure/measure_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

logger = logging.getLogger('autotvm')

class BuildResult(namedtuple("BuildResult", ('filename', 'arg_info', 'error', 'time_cost', 'sim_stats'))):
class BuildResult(namedtuple("BuildResult", ('filename', 'arg_info', 'error', 'time_cost'))):
"""
Stores all the necessary inputs for a measurement.
Expand All @@ -60,8 +60,6 @@ class BuildResult(namedtuple("BuildResult", ('filename', 'arg_info', 'error', 't
The error happens during compilation.
time_cost : float
The time cost of building
sim_stats : Dictionary
Dictionary of VTA simulator statistics (only used when target is VTA)
"""

class LocalBuilder(Builder):
Expand Down Expand Up @@ -116,13 +114,13 @@ def build(self, measure_inputs):
if isinstance(res, Exception):
# timeout or fleet error, return MeasureResult directly
results.append(MeasureResult((res,), MeasureErrorNo.BUILD_TIMEOUT,
self.timeout, time.time(), {}))
self.timeout, time.time()))
elif res.error is not None:
# instantiation error
if isinstance(res.error, InstantiationError):
results.append(MeasureResult((res.error,),
MeasureErrorNo.INSTANTIATION_ERROR,
res.time_cost, time.time(), {}))
res.time_cost, time.time()))
else:
if "InstantiationError" in str(res.error):
msg = str(res.error)
Expand All @@ -132,11 +130,11 @@ def build(self, measure_inputs):
pass
results.append(MeasureResult((InstantiationError(msg),),
MeasureErrorNo.INSTANTIATION_ERROR,
res.time_cost, time.time(), {}))
res.time_cost, time.time()))
else: # tvm error
results.append(MeasureResult((res.error,),
MeasureErrorNo.COMPILE_HOST,
res.time_cost, time.time(), {}))
res.time_cost, time.time()))
else:
# return BuildResult
results.append(res)
Expand Down Expand Up @@ -284,7 +282,7 @@ def run(self, measure_inputs, build_results):
res = future.get()
if isinstance(res, Exception): # executor error or timeout
results.append(MeasureResult((str(res),), MeasureErrorNo.RUN_TIMEOUT,
self.timeout, time.time(), {}))
self.timeout, time.time()))
else:
results.append(res)

Expand Down Expand Up @@ -418,8 +416,8 @@ def _wrapped(measure_input, tmp_dir, **kwargs):
func, arg_info = _build_func_common(measure_input, **kwargs)
func.export_library(filename, build_func)
except Exception as e: # pylint: disable=broad-except
return BuildResult(None, None, e, time.time() - tic, {})
return BuildResult(filename, arg_info, None, time.time() - tic, {})
return BuildResult(None, None, e, time.time() - tic)
return BuildResult(filename, arg_info, None, time.time() - tic)
return _wrapped


Expand Down Expand Up @@ -516,7 +514,7 @@ def run_through_rpc(measure_input, build_result,
errno = MeasureErrorNo.RUNTIME_DEVICE
tstamp = time.time()
time.sleep(cooldown_interval)
return MeasureResult(costs, errno, tstamp - tic + build_result.time_cost, tstamp, build_result.sim_stats)
return MeasureResult(costs, errno, tstamp - tic + build_result.time_cost, tstamp)


def request_remote(device_key, host=None, port=None, priority=1, timeout=60):
Expand Down
4 changes: 1 addition & 3 deletions python/tvm/autotvm/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,7 @@ def encode(inp, result, protocol='json'):
result.all_cost,
result.timestamp),

"v": AUTOTVM_LOG_VERSION,

"s": result.sim_stats
"v": AUTOTVM_LOG_VERSION
}
return json.dumps(json_dict)
if protocol == 'pickle':
Expand Down
4 changes: 2 additions & 2 deletions vta/python/vta/build_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,5 +175,5 @@ def vta_autotvm_build_func(measure_input, tmp_dir, **kwargs):
sim(*args)

except Exception as e: # pylint: disable=broad-except
return BuildResult(None, None, e, time.time() - tic, stats)
return BuildResult(filename, arg_info, None, time.time() - tic, stats)
return BuildResult(None, None, e, time.time() - tic)
return BuildResult(filename, arg_info, None, time.time() - tic)

0 comments on commit 7ec3e64

Please sign in to comment.