Adjust cpp torch trt logging level with compiler option by keehyuna · Pull Request #3181 · pytorch/TensorRT (original) (raw)
Description
Log level of python and native TRT logger is set differently. Same level from compiler option should be helpful to work with development version of torch-TRT module.
- python trt logger: when compiler option provide debug=True
- c++ trt logger: compiled at build time
TorchTRTLogger.cpp
#ifndef NDEBUG
static TorchTRTLogger global_logger("[Torch-TensorRT - Debug Build] - ", LogLevel::kDEBUG, true);
#else
static TorchTRTLogger global_logger("[Torch-TensorRT] - ", LogLevel::kWARNING, false);
#endif
And profile option for c++ trt runtime module is enabled by debug level logging. This is helpful to measure/evaluate
performance with development version of torch-TRT module
Fixes # (issue)
Type of change
Please delete options that are not relevant and/or add your own.
- New feature (non-breaking change which adds functionality)
Checklist:
- My code follows the style guidelines of this project (You can use the linters)
- I have performed a self-review of my own code
- I have commented my code, particularly in hard-to-understand areas and hacks
- I have made corresponding changes to the documentation
- I have added tests to verify my fix or my feature
- New and existing unit tests pass locally with my changes
- I have added the relevant labels to my PR in so that relevant reviewers are notified