Commit e920c099 by Lianmin Zheng Committed by Tianqi Chen

[AUTOTVM] Support multiple targets load in tophub (#1803)

parent ad4c142b
......@@ -51,32 +51,35 @@ def context(target, extra_files=None):
Parameters
----------
target: Target
target: Target or List of Target
The compilation target
extra_files: list of str, optional
Extra log files to load
"""
best_context = ApplyHistoryBest([])
if isinstance(target, str):
target = _target.create(target)
possible_names = []
for opt in target.options:
if opt.startswith("-device"):
device = _alias(opt[8:])
possible_names.append(device)
possible_names.append(target.target_name)
all_packages = list(PACKAGE_VERSION.keys())
for name in possible_names:
name = _alias(name)
if name in all_packages:
check_backend(name)
filename = "%s_%s.log" % (name, PACKAGE_VERSION[name])
best_context.load(os.path.join(AUTOTVM_TOPHUB_ROOT_PATH, filename))
break # only load one file to avoid some fallback template mismatch problem
targets = target if isinstance(target, (list, tuple)) else [target]
for tgt in targets:
if isinstance(tgt, str):
tgt = _target.create(tgt)
possible_names = []
for opt in tgt.options:
if opt.startswith("-device"):
device = _alias(opt[8:])
possible_names.append(device)
possible_names.append(tgt.target_name)
all_packages = list(PACKAGE_VERSION.keys())
for name in possible_names:
name = _alias(name)
if name in all_packages:
check_backend(name)
filename = "%s_%s.log" % (name, PACKAGE_VERSION[name])
best_context.load(os.path.join(AUTOTVM_TOPHUB_ROOT_PATH, filename))
break # only load one file to avoid some fallback template mismatch problem
if extra_files:
for filename in extra_files:
......
......@@ -22,12 +22,20 @@ from mxnet.model import load_checkpoint
######################################################################
# Set the parameters here
# -----------------------
# Preliminary and Set parameters
# ------------------------------
# We should build TVM with sort support, in TVM root directory
#
# .. code-block:: bash
#
# echo "set(USE_SORT ON)" > config.mk
# make -j8
#
# .. note::
#
# Currently we support compiling SSD on CPU only.
# GPU support is in progress.
#
model_name = "ssd_resnet50_512"
model_file = "%s.zip" % model_name
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment