mbs-octoml opened a new pull request #9012:
URL: https://github.com/apache/tvm/pull/9012


   I've been making very heavy use of DLOG and PrettyPrint to trace, understand 
and
   debug Relay transforms. I've found myself deleting log statements to reduce 
the
   output verbosity, only to have to re-add them a few days later. Better would 
be to
   support leaving all those statements in place but have finer control over 
when they
   are enabled.
   
   This PR introduces a 'VLOG(level)' macro to that end. The log is ignored
   unless TVM_LOG_DEBUG is enabled (both as #define and an environment var), 
and the
   the current verbosity level is >= level. The current verbosity level can be 
set
   globally and/or overridden per source file (see 'VerboseLoggingEnabled').
   
   (Those familiar with the origin of the LOG and DLOG family will also 
recognize VLOG.)
   
   I also introduce a 'VLOG_CONTEXT' macro which pushes a string onto an 
internal
   per-thread stack. Each VLOG message includes that stack as its prefix, which 
is a
   very handy way to keep track of the (often recursive) program context in 
which each
   VLOG is executed.
   
   I've rejigged some existing DLOGs to VLOGs to illustrate, but left most of 
them
   alone for now.  See the draft https://github.com/apache/tvm/pull/8788 for 
use in the
   wild.
   
   I noticed the DCHECK macros *disabled* instead enabled with TVM_LOG_DEBUG 
defined, so
   fixed that.
   
   I've also made changes to the Relay text printer to dump attributes in a 
human
   readable format rather than the indirect but machine readable 'meta' 
representation.
   This is gated by the show_meta_data_ flag, and I think this use is 
consistent with it's
   original purpose.
   
   Thanks for contributing to TVM!   Please refer to guideline 
https://tvm.apache.org/docs/contribute/ for useful information and tips. After 
the pull request is submitted, please request code reviews from 
[Reviewers](https://github.com/apache/incubator-tvm/blob/master/CONTRIBUTORS.md#reviewers)
 by @ them in the pull request thread.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to