h2oai / h2o4gpu

H2Oai GPU Edition
Apache License 2.0
460 stars 95 forks source link

Logging framework #48

Open mdymczyk opened 7 years ago

mdymczyk commented 7 years ago

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

navdeep-G commented 6 years ago

This is already in, no?

mdymczyk commented 6 years ago

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

navdeep-G commented 6 years ago

Yep. We should have it for those APIs.

mdymczyk commented 6 years ago

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.

terrytangyuan commented 6 years ago

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.

navdeep-G commented 6 years ago

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

pseudotensor commented 6 years ago

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

mdymczyk commented 6 years ago

@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.

navdeep-G commented 6 years ago

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

pseudotensor commented 6 years ago

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.

mdymczyk commented 6 years ago

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.

navdeep-G commented 6 years ago

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

pseudotensor commented 6 years ago

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.