h2o4gpu icon indicating copy to clipboard operation
h2o4gpu copied to clipboard

Logging framework

Open mdymczyk opened this issue 8 years ago • 13 comments

Add a proper logging framework for C++ and Python enabling debug prints and (maybe) performance timings.

mdymczyk avatar Aug 24 '17 17:08 mdymczyk

This is already in, no?

navdeep-G avatar Feb 08 '18 02:02 navdeep-G

@navdeep-G for C/C++ yes but we still need something in Python (and possibly R?).

mdymczyk avatar Feb 08 '18 04:02 mdymczyk

Yep. We should have it for those APIs.

navdeep-G avatar Feb 08 '18 04:02 navdeep-G

I'm not sure what's the best practice for R but in Python we probably can just use the standard import logging. We just need to map the verbosity number to a String level representation (INFO, DEBUG etc.). Ideally we'd add a Python/R call to our C/C++ backend which would map int -> String according to what is hardcoded in the C code (there are definitions for those in the logger files) so we don't have to hardcode that for example 500 is DEBUG several times in C, Python and R code.

mdymczyk avatar Feb 08 '18 04:02 mdymczyk

We just need to expose the verbosity in Python API and then we can modify it as an option in R. We can also use futile.logger package if needed.

terrytangyuan avatar Feb 08 '18 04:02 terrytangyuan

Yes, only needs to be in python and we can use reticulate to invoke it in R

navdeep-G avatar Feb 08 '18 04:02 navdeep-G

python already has logging, used in DAI alot: https://docs.python.org/3/library/logging.html

pseudotensor avatar Feb 08 '18 04:02 pseudotensor

@pseudotensor yes, we just need to replace the print statements in our code for those logger calls and set the log level appropriately based on the verbosity level.

mdymczyk avatar Feb 08 '18 06:02 mdymczyk

I can start working on this soon if that’s okay with you guys.

navdeep-G avatar Feb 08 '18 06:02 navdeep-G

Copy/paste the logger setup arno did for DAI. It's non-trivial to set it up and now it's very nice for DAI.

pseudotensor avatar Feb 08 '18 06:02 pseudotensor

This isn't really very high priority, we can do this after we have tSVD in DAI and are done with preparations for GTC I think.

mdymczyk avatar Feb 08 '18 06:02 mdymczyk

Sounds good. Not sure what the process of tsvd in DAI is but can check.

navdeep-G avatar Feb 08 '18 06:02 navdeep-G

Agreed on priority, just laying out what would be done to someone doesn't do crazy amounts of independent work.

We should try cusolver in DAI, easy to try, just busy getting release out.

pseudotensor avatar Feb 08 '18 06:02 pseudotensor