Commit b63182ea by Yao Wang Committed by Lianmin Zheng

Add fallback for ApplyGraphBest (#2485)

parent b6ae3e15
......@@ -460,7 +460,16 @@ class ApplyGraphBest(DispatchContext):
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)
......
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