jwfromm commented on a change in pull request #7823:
URL: https://github.com/apache/tvm/pull/7823#discussion_r615327404
##########
File path: python/tvm/driver/tvmc/autotuner.py
##########
@@ -255,97 +380,100 @@ def drive_tune(args):
# min_repeat_ms should be:
# a. the value provided by the user, if any, or
# b. 0ms in case target is "cpu"; otherwise 1000ms
- if args.min_repeat_ms is not None:
- min_repeat_ms = args.min_repeat_ms
- else:
+ if min_repeat_ms is None:
min_repeat_ms = 0 if target.keys[0] == "cpu" else 1000
logger.debug("Default --min-repeat-ms for this target is %s",
min_repeat_ms)
- if args.rpc_tracker:
- runner_ctor = auto_scheduler.RPCRunner if args.enable_autoscheduler
else autotvm.RPCRunner
+ if rpc_tracker:
+ runner_ctor = auto_scheduler.RPCRunner if enable_autoscheduler else
autotvm.RPCRunner
runner = runner_ctor(
- key=args.rpc_key,
+ key=rpc_key,
host=rpc_hostname,
port=rpc_port,
- number=args.number,
- repeat=args.repeat,
- n_parallel=args.parallel,
- timeout=args.timeout,
+ number=number,
+ repeat=repeat,
+ n_parallel=parallel,
+ timeout=timeout,
min_repeat_ms=min_repeat_ms,
)
else:
logger.info("starting localhost tuning")
runner_ctor = (
- auto_scheduler.LocalRunner if args.enable_autoscheduler else
autotvm.LocalRunner
+ auto_scheduler.LocalRPCMeasureContext if enable_autoscheduler else
autotvm.LocalRunner
)
runner = runner_ctor(
- number=args.number,
- repeat=args.repeat,
- timeout=args.timeout,
+ number=number,
+ repeat=repeat,
+ timeout=timeout,
min_repeat_ms=min_repeat_ms,
)
- if args.enable_autoscheduler:
- # Specify hardware parameters
- hardware_params = auto_scheduler.HardwareParams(
- args.num_cores,
- args.vector_unit_bytes,
- args.cache_line_bytes,
- args.max_shared_memory_per_block,
- args.max_local_memory_per_block,
- args.max_threads_per_block,
- args.max_vthread_extent,
- args.warp_size,
- )
+ if enable_autoscheduler:
+
tasks, weights = autoscheduler_get_tuning_tasks(
mod=mod,
params=params,
target=target,
- alter_layout=args.desired_layout,
+ alter_layout=desired_layout,
hardware_params=hardware_params,
- include_simple_tasks=args.include_simple_tasks,
+ include_simple_tasks=include_simple_tasks,
)
+ # If not specified, choose a number of trials likely to produce good
results.
+ if trials is None:
+ trials = 10000
Review comment:
where should the constant live?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]