Skip to content

Commit

Permalink
chore: invalid log level check
Browse files Browse the repository at this point in the history
  • Loading branch information
keehyuna committed Sep 26, 2024
1 parent 9ed18a7 commit b8c3abe
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions py/torch_tensorrt/dynamo/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ def set_log_level(parent_logger: Any, level: Any) -> None:
Sets the log level to the user provided level.
This is used to set debug logging at a global level
at entry points of tracing, dynamo and torch_compile compilation.
It also set log level for c++ torch trt logger
"""
if parent_logger:
parent_logger.setLevel(level)
Expand All @@ -218,6 +219,8 @@ def set_log_level(parent_logger: Any, level: Any) -> None:
log_level = trt.ILogger.Severity.ERROR
elif level == logging.CRITICAL:
log_level = trt.ILogger.Severity.INTERNAL_ERROR
else:
raise AssertionError(f"{level} is valid log level")

torch.ops.tensorrt.set_logging_level(int(log_level))

Expand Down

0 comments on commit b8c3abe

Please sign in to comment.