It is often useful to collect information about how much of an application runtime is spent executing oneDNN primitives and which of those take the most time. oneDNN verbose mode enables tracing execution of oneDNN primitives and collection of basic statistics like execution time and primitive parameters.
When verbose mode is enabled oneDNN will print out information to stdout
. The first lines of verbose information contain the build version and git hash, if available, as well as CPU and GPU runtimes, and the supported instruction set architecture.
Each subsequent line of verbose information is formatted as a comma-separated list containing:
dnnl_verbose
marker stringcreate:<cache_hit|cache_miss>
or exec
cpu
or gpu
convolution
, reorder
, sum
, etcforward_training
, forward_inference
, or backward
At build-time, support for this feature is controlled via cmake option DNNL_VERBOSE
.
CMake Option | Supported values (defaults in bold) | Description |
---|---|---|
DNNL_VERBOSE | ON, OFF | Enables verbose mode |
When the feature is enabled at build-time, the DNNL_VERBOSE
environment variable can be used to turn verbose mode on and control the level of verbosity.
Environment variable | Value | Description |
---|---|---|
DNNL_VERBOSE | 0 | no verbose output (default) |
1 | primitive information at execution | |
2 | primitive information at creation and execution |
This feature can also be managed at run-time with the following functions:
The function setting takes precedence over the environment variable.
This produces the following output (the line breaks were added to fit the page width):
Please see the profiling example here, as it uses DNNL_VERBOSE output to tune oneDNN code to align with best practices.