From ad84823fab4bd93d9347a362727264c8563af96e Mon Sep 17 00:00:00 2001 From: Elen Kalda Date: Tue, 31 Jan 2023 11:14:46 +0000 Subject: [PATCH] [TVMC] Stop printing a wall of warnings with tvmc tune A simple tvmc tune command currently results in a huge wall of warnings about target_host parameter being deprecated, even when the user hasn't provided a target-host cmd line argument. We can prevent that happening from just not providing the default target-host to tvmc. Also, ensure that when the user does provide target-host, we print the warning once, not 500 times. --- python/tvm/autotvm/measure/measure_methods.py | 2 +- python/tvm/driver/tvmc/autotuner.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/python/tvm/autotvm/measure/measure_methods.py b/python/tvm/autotvm/measure/measure_methods.py index f1c14c3cd914..5537d28c2dac 100644 --- a/python/tvm/autotvm/measure/measure_methods.py +++ b/python/tvm/autotvm/measure/measure_methods.py @@ -541,7 +541,7 @@ def _build_func_common(measure_input, runtime=None, checks=None, build_option=No instruments=current_pass_context.instruments, config=current_config, ): - func = build(s, args, target_host=task.target_host, runtime=runtime) + func = build(s, args, target=target, runtime=runtime) return func, tuple((get_const_tuple(x.shape), x.dtype) for x in args) diff --git a/python/tvm/driver/tvmc/autotuner.py b/python/tvm/driver/tvmc/autotuner.py index 98293e596b5d..b7766efb4796 100644 --- a/python/tvm/driver/tvmc/autotuner.py +++ b/python/tvm/driver/tvmc/autotuner.py @@ -112,8 +112,7 @@ def add_tune_parser(subparsers, _, json_params): generate_target_args(parser) parser.add_argument( "--target-host", - help="the host compilation target, defaults to 'llvm'", - default="llvm", + help="the host compilation target.", ) parser.add_argument("--timeout", type=int, default=10, help="compilation timeout, in seconds")