Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoTVM][Ansor] Enable random fill and CPU cache flush for AutoTVM and Ansor #6391

Merged
merged 6 commits into from Sep 8, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 3 additions & 4 deletions python/tvm/auto_scheduler/measure.py
Expand Up @@ -594,9 +594,8 @@ def timed_func(inp, build_res):
try:
args = [ndarray.empty(get_const_tuple(x.shape), x.dtype, ctx) for x in
build_res.args]
assert tvm.get_global_func("tvm.contrib.random.random_fill", True), \
"Do you enable USE_RANDOM in the config.cmake?"
random_fill = tvm.get_global_func("tvm.contrib.random.random_fill")
random_fill = tvm.get_global_func("tvm.contrib.random.random_fill", True)
assert random_fill, "Please make sure USE_RANDOM is ON in the config.cmake"
for arg in args:
random_fill(arg)
ctx.sync()
Expand Down Expand Up @@ -697,7 +696,7 @@ def timed_func():
args = [ndarray.empty(get_const_tuple(x.shape), x.dtype, ctx) for x in
build_res.args]
assert tvm.get_global_func("tvm.contrib.random.random_fill", True), \
"Do you enable USE_RANDOM in the config.cmake?"
"Please make sure USE_RANDOM is ON in the config.cmake"
random_fill = remote.get_function("tvm.contrib.random.random_fill")
FrozenGene marked this conversation as resolved.
Show resolved Hide resolved
FrozenGene marked this conversation as resolved.
Show resolved Hide resolved
for arg in args:
random_fill(arg)
Expand Down
2 changes: 1 addition & 1 deletion python/tvm/autotvm/measure/measure_methods.py
Expand Up @@ -512,7 +512,7 @@ def run_through_rpc(measure_input, build_result,
args = [nd.array(x, ctx=ctx) for x in ref_input]
else:
assert tvm.get_global_func("tvm.contrib.random.random_fill", True), \
"Do you enable USE_RANDOM in the config.cmake?"
"Please make sure USE_RANDOM is ON in the config.cmake"
random_fill = remote.get_function("tvm.contrib.random.random_fill")
merrymercy marked this conversation as resolved.
Show resolved Hide resolved
args = [nd.empty(x[0], dtype=x[1], ctx=ctx) for x in build_result.arg_info]
for arg in args:
Expand Down