2. Software installation¶
In order to run models on an IPU-POD you will need to download and install some software packages. The software can be downloaded from the Graphcore software download portal.
You need to install the Poplar SDK, which includes the development tools and also command line tools for managing the IPU hardware.
You also need to install the user-level V-IPU software.
2.1. SDK installation¶
Download the SDK tarball and unpack it using the following command:
$ tar -xvzf poplar_sdk-[os]-[ver].tar.gz
[os] is the host OS and
[ver] is the software version number of the package.
The main components under the SDK installation directory are shown in Table 2.1.
File or directory
Directory containing the Graphcore drivers and utilities.
Directory containing the PopART framework.
Directory containing the Poplar graph programming framework and PopLibs libraries
HTML and PDF documentation for the SDK tools and libraries. The documentation on the Graphcore documentation portal may contain updates made after the SDK release and includes other documents not packaged with the SDK.
File to install the Graphcore port of TensorFlow v1.15 for Python 3.
File to install the Graphcore port of TensorFlow v2.4 for Python 3.
File to install PopTorch (to run PyTorch models on the IPU).
File to install Horovod to support distributed training in PopART (see Distributed training with Horovod for more information).
Source code for the PopLibs libraries (also available on GitHub).
The Graphcore end user license agreement (EULA).
Release notes for this version of the SDK, in HTML and XML (Docbook) format.
There are two versions of each of the TensorFlow wheel files, optimised for Intel and AMD processors respectively.
These are indicated by the
arch component of the filename.
You must install the correct wheel file for your host processor type.
2.2. Setting up the SDK environment¶
To use the Graphcore tools and Poplar libraries, several environment variables (such as library and binary paths) need to be set up, as shown below:
$ cd poplar_sdk-[os]-[ver] $ source poplar-[os]-[ver]/enable.sh $ source popart-[os]-[ver]/enable.sh
[os] is the host OS and
[ver] is the current software version number of each package.
You will need to source both the Poplar and the PopART enable scripts if you are using PyTorch or PopART.
Each of these scripts must be sourced every time the Bash shell is reset. If you attempt to run any Poplar software without having first enabled these scripts, you’ll get an error from the C++ compiler similar to the following (the exact message will depend on your code).
fatal error: 'poplar/Engine.hpp' file not found
You can verify that Poplar has been successfully set up by running:
$ popc --version
This will display the version number of the installed software.
PopTorch and TensorFlow for the IPU are provided as Python wheel files that can
be installed using
pip as described in the following sections.
2.3. Setting up PyTorch for the IPU¶
PopTorch is part of the Poplar SDK. It provides functions to allow PyTorch models to run on the IPU.
Before running PopTorch, you must source the
enable.sh scripts for
Poplar and PopART as described in Section 2.2, Setting up the SDK environment.
PopTorch is packaged as a Python wheel file that can be
pip version 18.1 or later, so it important to
make sure you have the latest version before installing PopTorch.
We recommend creating a virtual environment, using
virtualenv, to isolate
your PopTorch environment from the system Python environment. You can create a
virtual environment in a
workspace directory and install PopTorch as shown below:
$ virtualenv -p python3 ~/workspace/poptorch_env $ source poptorch_env/bin/activate $ pip3 install -U pip $ pip3 install poptorch-[ver].whl
[ver] is the SDK version version.
To confirm that PopTorch has been installed, you can use
pip list, which should include the
poptorch package in the output.
You can also test that the module has been installed correctly by attempting to import it in Python, for example:
$ python3 -c "import poptorch; print(poptorch.__version__)"
For more information, refer to PyTorch for the IPU: User Guide.
2.4. Setting up TensorFlow for the IPU¶
Before running TensorFlow, you must source the
enable.sh scripts for
Poplar as described in Section 2.2, Setting up the SDK environment.
To use the Graphcore port of TensorFlow, you must set up a Python virtual environment.
You can create a virtual environment in a
workspace directory and install
TensorFlow as shown below:
$ virtualenv -p python3.6 ~/workspace/tensorflow_env
Then activate it.
$ source tensorflow_env/bin/activate
Now all installations will be local to that virtual environment.
We support TensorFlow 1 and TensorFlow 2. There are versions of these compiled for Intel and AMD processors to provide the best performance on those hosts.
As a result, there are four Python wheel files that can be installed with
You must install the correct wheel file for your host CPU. You can
use the command
lscpu to determine the CPU type, if you are not sure.
For example, to install Graphcore’s TensorFlow distribution, compatible with v2.1.0 of TensorFlow, you would use a command similar to the following:
$ pip install tensorflow-2.1.0+[ver]+[arch].whl
[ver] is the TensorFlow version you have downloaded, and
[arch] is the host CPU architecture (Intel or AMD).
To confirm that
tensorflow has been installed, you can use
which should include the
tensorflow package in the output, for example:
(tensorflow_env) jsp$ pip list Package Version ------------- ---------- future 0.18.2 numpy 1.19.5 pip 20.3.3 pkg-resources 0.0.0 tensorflow_env 2.1.0 setuptools 51.1.2 torch 1.6.0+cpu wheel 0.36.2
You can also test that the module has been installed correctly by importing it in Python, for example:
$ python -c "from tensorflow.python import ipu"
For the next steps with TensorFlow, refer to the appropriate user guide:
2.5. Installing the V-IPU command-line tools¶
You can omit this step if
vipu is already installed on the system.
You can check if it is installed by running
You can download the V-IPU client software from the Graphcore software download portal. It can be installed on any computer that can communicate with the V-IPU controller.
Extract the contents of the downloaded archive:
$ tar xzvf vipuusertools-$VERSION.tar.gz
$VERSION is the version of the software.
Add the directory containing the extracted package to the
PATH environment variable:
$ export PATH=$PWD/vipu-$VERSION:$PATH
Now, confirm that the
vipu executable is found and that it reports the expected version:
$ vipu --version