Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Giuseppe Rossini committed Dec 10, 2020
1 parent 5b3c3b6 commit 6ade51f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
13 changes: 6 additions & 7 deletions python/tvm/driver/tvmc/autotuner.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def add_tune_parser(subparsers):
"--tuner",
choices=["ga", "gridsearch", "random", "xgb", "xgb_knob", "xgb-rank"],
default="xgb",
help="type of tuner to use when autotuning. If --enable-autoscheduler is set, this option won't have any effect",
help="type of tuner to use when autotuning.",
)
# TODO (@leandron) This is a path to a physical file, but
# can be improved in future to add integration with a modelzoo
Expand Down Expand Up @@ -207,12 +207,17 @@ def drive_tune(args):
logger.debug("Default --min-repeat-ms for this target is %s", 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, 0, 0, 0, 0, 0
)
tasks, weights = autoscheduler_get_tuning_tasks(
mod=mod,
params=params,
target=target,
target_host=args.target_host,
alter_layout=args.desired_layout,
hardware_params=hardware_params,
)
else:
tasks = autotuner_get_tuning_tasks(
Expand Down Expand Up @@ -256,12 +261,6 @@ def drive_tune(args):
early_stopping=args.early_stopping,
)

# Specify hardware parameters
print(type(args.vector_unit_bytes))
hardware_params = auto_scheduler.HardwareParams(
args.num_cores, args.vector_unit_bytes, args.cache_line_bytes, 0, 0, 0, 0, 0
)

# Schedule the tasks (i.e., produce a schedule for each task)
schedule_tasks(
tasks,
Expand Down
2 changes: 1 addition & 1 deletion python/tvm/driver/tvmc/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def compile_model(

try:
auto_scheduler.load_records(tuning_records)
except Exception:
except tvm._ffi.base.TVMError:
use_autoscheduler = False

if use_autoscheduler:
Expand Down

0 comments on commit 6ade51f

Please sign in to comment.