Skip to content

Commit

Permalink
Add fallback for ApplyGraphBest (apache#2485)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinthesun authored and Wei Chen committed Feb 20, 2019
1 parent 3115119 commit 0c35035
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion python/tvm/autotvm/task/dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,16 @@ def _query_inside(self, target, workload):
self.update(target, workload, cfg)
return cfg
key = (str(target), workload)
return self._global_cfg_dict[key]
if key not in self._global_cfg_dict:
msg = "Config for target=%s, workload=%s is missing in ApplyGraphBest context. " \
"A fallback configuration is used, which may bring great performance " \
"regression." % (target, workload)
logger.warning(msg)
cfg = FallbackConfigEntity()
self._global_cfg_dict[key] = cfg
else:
cfg = self._global_cfg_dict[key]
return cfg

def update(self, target, workload, cfg):
key = (str(target), workload)
Expand Down

0 comments on commit 0c35035

Please sign in to comment.