6. Environment Variables

There are several environment variables which you can use to control the behaviour of the Poplar SDK.

6.1. Logging

The behaviour of a Poplar program can be traced by enabling logging using the environment variable POPLAR_LOG_LEVEL. If you want to enable logging for the PopLibs libraries, then the POPLIBS_LOG_LEVEL variable can be used.

The supported logging levels are shown in the table below.

OFF

No logging information.

ERR

Only error conditions will be reported.

WARN

Warnings when, for example, the software cannot achieve what was requested (for example, if the convolution planner can’t keep to the memory budget, or Poplar has determined that the model won’t fit in memory but the debug.allowOutOfMemory option is enabled).

INFO

Very high level information, such as PopLibs function calls.

DEBUG

Useful per-graph information.

TRACE

The most verbose level. All useful per-tile information.

All Poplar log messages are prefixed with PO. Messages from PopLibs are prefixed with PL.

The logging information is sent to standard error by default. This can be changed by setting the POPLAR_LOG_DEST or POPLIBS_LOG_DEST environment variables. The value can be “stdout”, “stderr” or a file name.

6.2. Graph report

Deprecated in favour of debug.graphReportDestination engine option.

You can set the variable POPLAR_GRAPH_REPORT_DEST in order to write out a graph report when the graph has been compiled. This is equivalent to calling engine.printProfileSummary() without the execution summary.

The value of POPLAR_GRAPH_REPORT_DEST can be “stdout”, “stderr” or a file name.

6.3. Setting options

The following environment variables can be used to override the option values specified in the program:

  • POPLAR_ENGINE_OPTIONS

  • POPLAR_SIMULATOR_OPTIONS

For more information, see the Poplar and PopLibs API Reference.