comaniac commented on a change in pull request #7975:
URL: https://github.com/apache/tvm/pull/7975#discussion_r626970274
##########
File path: python/tvm/relay/backend/compile_engine.py
##########
@@ -253,7 +255,16 @@ def select_implementation(op, attrs, inputs, out_type,
target, use_autotvm=True)
and msg not in autotvm.task.DispatchContext.warning_messages
):
autotvm.task.DispatchContext.warning_messages.add(msg)
- autotvm_logger.warning(msg)
+ if autotvm_logger.level == logging.DEBUG: # only print if in
debug mode
+ autotvm_logger.warning(msg)
Review comment:
Can this just be `autotvm_logger.debug(msg)` so that we can simplify
this logic to
```
if _first_warning:
# print the first time warning.
autotvm_logger.debug(msg)
```
I believe it's fine to have the first time warning in both cases. Advance
developers won't be mad to see one more warning.
##########
File path: python/tvm/relay/backend/compile_engine.py
##########
@@ -253,7 +255,16 @@ def select_implementation(op, attrs, inputs, out_type,
target, use_autotvm=True)
and msg not in autotvm.task.DispatchContext.warning_messages
):
autotvm.task.DispatchContext.warning_messages.add(msg)
- autotvm_logger.warning(msg)
+ if autotvm_logger.level == logging.DEBUG: # only print if in
debug mode
+ autotvm_logger.warning(msg)
+ else:
+ global _first_warning
+ if _first_warning == True:
Review comment:
```suggestion
if _first_warning:
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]