3. Running a program on the IPU‑POD

You can now run one of the example programs from the SDK. The Poplar examples are in the poplar-[os]-[ver]/examples under the SDK installation.

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 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

This simple example just runs on one IPU. Further examples and tutorials can be found in the Graphcore GitHub repositories examples and tutorials, such as a simple pipelining example using TensorFlow.

See Section 5, Next steps for more information.

3.1. Software monitoring

3.1.1. 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 Section 3, Running a program on the IPU‑POD, 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.

3.1.2. Execution profiling

The PopVision Graph Analyser tool is available on the Graphcore software download portal.

This provides a graphical view of the graph execution trace, showing memory use, tile mapping and other vital information to help you optimise your application. For more information see the PopVision User Guide.

3.2. Hardware monitoring

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

3.2.1. Web interface

The IPU-POD DA system provides a web interface for viewing and controlling the hardware resources. See Section 4, IPU-POD web UI for more information.

3.2.2. 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 which 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 poplar-os-version/bin under the Poplar SDK directory (where os is the host operating system, and version is the current software version number).

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

Examining the hardware resources

You can see the IPUs that are now available using the gc-info command that was installed with the SDK. For example, an IPU‑POD4 will show output similar to the following:

$ gc-info -l
-+- Id: [0], type:    [Fabric], PCI Domain: [3]
-+- Id: [1], type:    [Fabric], PCI Domain: [2]
-+- Id: [2], type:    [Fabric], PCI Domain: [1]
-+- Id: [3], type:    [Fabric], PCI Domain: [0]
-+- Id: [4], type: [Multi IPU]
 |--- PCIe Id: [0], DNC Id: [0], PCI Domain: [3]
 |--- PCIe Id: [1], DNC Id: [1], PCI Domain: [2]
-+- Id: [5], type: [Multi IPU]
 |--- PCIe Id: [2], DNC Id: [2], PCI Domain: [1]
 |--- PCIe Id: [3], DNC Id: [3], PCI Domain: [0]
-+- Id: [6], type: [Multi IPU]
 |--- PCIe Id: [0], DNC Id: [0], PCI Domain: [3]
 |--- PCIe Id: [1], DNC Id: [1], PCI Domain: [2]
 |--- PCIe Id: [2], DNC Id: [2], PCI Domain: [1]
 |--- PCIe Id: [3], DNC Id: [3], PCI Domain: [0]

Here, the four individual IPUs have the IDs 0 to 3.

The multi-IPU devices are listed below that. A multi-IPU device always represents a number of IPUs which is a power of two. Here there are three multi-IPU devices:

  • ID 4 contains IPUs 0 and 1

  • ID 5 contains IPUs 2 and 3

  • ID 6 contains all four IPUs

Different Poplar programs can make use of these devices concurrently. A device ID that is attached to by a Poplar program is removed from the list of available device IDs while that Poplar program is running.