4. Running a program on the IPU

You can now run one of the example programs from the SDK. The Poplar examples are in the directory /opt/gc/poplar_sdk-ubuntu_18_04-[ver]/poplar-ubuntu_18_04-[ver]/examples.

The program adder_ipu.cpp builds a simple graph to add two vectors together and return the result.

  1. Make a copy of the adder example directory in your working directory

  2. Compile the program

$ make
  1. Run the program. It will produce the following output:

$ ./adder_ipu
Creating graph
Building engine
v1 sum = 10
v2 sum = 65

More resources for developing software to run on the IPU can be found on the Graphcore developer site and the Graphcore examples and tutorials repositories on GitHub.

4.1. Hardware and software monitoring

The IPU hardware, and any programs running on it, can be monitored and analysed in various ways.

4.1.1. Command line tools

The IPU driver software includes a number of software tools that provide information on the current status of the connected hardware. These include:

  • gc-info: determine what IPU devices are present in the system.

  • gc-monitor: passively monitor IPU activity and telemetry such as power draw, temperature and clock speed.

  • gc-reset: reset one or more IPU devices.

These are in the directory /opt/gc/poplar_sdk-ubuntu_18_04-[ver]/poplar-[os]-[ver]/bin.

The use of these tools is described in the IPU Command Line Tools document.

4.1.2. Trace output

When running a program, you have the option to output a trace from the running code which allows you to see the phases that the graph compiler uses when preparing and compiling the graph processes to execute on the IPU. Going back to the simple adder example in Running a program on the IPU, try running:

$ POPLAR_LOG_LEVEL=DEBUG ./adder_ipu

You will see each stage of the process listed before the program output appears. The logging options are documented in the Poplar & PopLibs User Guide.

4.1.3. Execution profiling

The PopVision analysis tools are available on the Graphcore software download portal.

The PopVision Graph Analyser provides a graphical view of the graph execution trace, showing memory use, tile mapping and other vital information to help you optimise your application.

The PopVision System Analyser provides information about the behaviour of the host-side application code. It shows an interactive graphical view of the timeline of execution steps, helping you to identify any bottlenecks between the CPUs and IPUs.

For more information see the PopVision User Guide.