Skip to content

Commit

Permalink
Remove warning which is adding too much noise (#7975)
Browse files Browse the repository at this point in the history
  • Loading branch information
rkimball authored May 13, 2021
1 parent 39fa759 commit b81f3f7
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions python/tvm/relay/backend/compile_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
logger = logging.getLogger("compile_engine")
autotvm_logger = logging.getLogger("autotvm")

_first_warning = True


@tvm._ffi.register_object("relay.LoweredOutput")
class LoweredOutput(Object):
Expand Down Expand Up @@ -244,16 +246,25 @@ def select_implementation(op, attrs, inputs, out_type, target, use_autotvm=True)
# Use the implementation with highest plevel
if workloads[best_plevel_impl] is not None:
msg = (
"Cannot find config for target=%s, workload=%s. A fallback configuration "
"is used, which may bring great performance regression."
"Cannot find tuning records for:\n target=%s\n key=%s\n"
"TVM will apply a default schedule which may negatively impact performance."
% (target, workloads[best_plevel_impl])
)
if (
not autotvm.env.GLOBAL_SCOPE.silent
and msg not in autotvm.task.DispatchContext.warning_messages
):
autotvm.task.DispatchContext.warning_messages.add(msg)
autotvm_logger.warning(msg)
global _first_warning
if _first_warning:
_first_warning = False
info_msg = (
"One or more operators have not been tuned. Please tune your model "
"for better performance. Use DEBUG logging level to see more details."
)
autotvm_logger.warning(info_msg)
autotvm_logger.debug(msg)

logger.info(
"Using %s for %s based on highest priority (%s)",
best_plevel_impl.name,
Expand Down

0 comments on commit b81f3f7

Please sign in to comment.