-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changing logging levels #222
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add error logging as an option for pure performance mode.
For the final per metric we should use a different logging, which outputs PRINT messages to STDOUT and redirects to the dlio.log file.
The other logging is optional from the benchmark.
@zhenghh04 Can we not print the file name and line number for info logging. We should only do that for debug logging. This will significantly reduce log size. |
@hariharan-devarajan , made the changes as you suggested. Please review it again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are almost there. I see we have some code which got reverted from the mock logging.
@hariharan-devarajan , I am hesitating between using workflow.log_level to control the log level, vs using DLIO_LOG_LEVEL environment variable to control it. I slightly lean towards to the latter one, which is more common in other apps. What is your preference? |
I see a value in both. But I prefer the environment variable, too. By default, we should have WARN level, not info. Then we can make DLIO_LOG_LEVEL to higher logging levels like INFO and DEBUG. We should switch the per epoch time to print and include the sample rate per epoch there. Then, per step becomes info. And variable logging becomes debug. |
@hariharan-devarajan After reading the documentation more: https://docs.python.org/3/library/logging.html#levels, I feel that we should have default logging level to be info, and everything should go through logging, not through print. What do you think? |
So printing is different than logging in my opinion. The things that tell us about benchmark high-level like initialize, progress, and metrics. Logging here is for internal parts. I wrote a logger in the past on c++ in which I added print as the highest log above error. For benchmarks I feel it makes sense to have this. |
Now if u want to use logging for printing, I would create two loggers. One for printing and one for logging internal stuff. The printing could always be info, internal, and cannot change by benchmark parameters. |
In this PR, we changed the per step output from info to debug to reduce the logging overhead.
We also add support for changing logging level