Skip to content
Snippets Groups Projects
Commit 390acc52 authored by Lianmin Zheng's avatar Lianmin Zheng Committed by Tianqi Chen
Browse files

[AUTOTVM] Fix measurement for CPU (#1956)

parent e61659a9
No related branches found
No related tags found
No related merge requests found
......@@ -460,7 +460,11 @@ def run_through_rpc(measure_input, build_result,
if ref_input:
args = [nd.array(x, ctx=ctx) for x in ref_input]
else:
# create empty arrays on the remote device and copy them once.
# This can avoid some memory issues that make the measurment results unreliable.
args = [nd.empty(x[0], dtype=x[1], ctx=ctx) for x in build_result.arg_info]
args = [nd.array(x, ctx=ctx) for x in args]
ctx.sync()
costs = time_f(*args).results
if len(costs) > 2: # remove largest and smallest value to reduce variance
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment