Based on feedback in a recent PR, it is of interest to reconsider how we print diagnostics in TensileCreateLibrary. Currently, there are three print related options in Tensile:
globalParameters["LibraryPrintDebug"] solutions will print enqueue info when enqueueing a kernel
globalParameters["PrintLevel"] how much info to print in generator. 0=none, 1=standard, 2=verbose
globalParameters["PrintCodeCommands"] print the commands used to generate the code objects (asm,link,hip-clang, etc)
Until recently, LibraryPrintDebug was the only print control that had a command line option in TensileCreateLibrary and its' usage does not appear to do anything. That is, it is used to conditionally set the same print option on a generated call to TensileCreateLibrary in the clientWriter code. However, TensileCreateLibrary doesn't actually use the option in practice.
More recently the --verbose option was added to set PrintLevel which is used in several places to control printing.
Lastly, there is PrintCodeCommands which set to false by default and doesn't have a command line option. So to use it in TensileCreateLibrary one would need to manually set it to True in Common.py. The way that it is currently used is if true we make calls to print(...) which doesn't flush to stdout.
This PR removes LibraryPrintDebug and PrintCodeCommands, and uses PrintLevel to control what is printed when executing Tensile. The new levels are:
no output
standard output
1 + print code commands
2 + verbose
In addition, a tPrint function was added that takes a verbosity level to avoid repeating code like print1, print2, and print3. Further, tPrint takes a variadic pack of arguments to align the syntax with python print.
Based on feedback in a recent PR, it is of interest to reconsider how we print diagnostics in TensileCreateLibrary. Currently, there are three print related options in Tensile:
Until recently,
LibraryPrintDebug
was the only print control that had a command line option in TensileCreateLibrary and its' usage does not appear to do anything. That is, it is used to conditionally set the same print option on a generated call to TensileCreateLibrary in the clientWriter code. However, TensileCreateLibrary doesn't actually use the option in practice.More recently the
--verbose
option was added to set PrintLevel which is used in several places to control printing.Lastly, there is
PrintCodeCommands
which set to false by default and doesn't have a command line option. So to use it in TensileCreateLibrary one would need to manually set it to True in Common.py. The way that it is currently used is if true we make calls to print(...) which doesn't flush to stdout.This PR removes
LibraryPrintDebug
andPrintCodeCommands
, and usesPrintLevel
to control what is printed when executing Tensile. The new levels are:In addition, a
tPrint
function was added that takes a verbosity level to avoid repeating code like print1, print2, and print3. Further,tPrint
takes a variadic pack of arguments to align the syntax with pythonprint
.