2. Quick start for experts

Complete any necessary setup to use your IPU system (see Section 1.1, IPU systems) before the following steps.

2.1. Enable the Poplar SDK

$ source [path-to-sdk]/enable
$ popc --version

where [path-to-sdk] is the path to the Poplar SDK.

2.2. Create and enable a Python virtual environment

$ virtualenv -p python3 [venv_name]
$ source [venv_name]/bin/activate

where [venv_name] is the location of the virtual environment.

2.3. Install the TensorFlow 2 wheels and validate

Install the TensorFlow wheels suitable for your CPU type.

$ python -m pip install ${POPLAR_SDK_ENABLED?}/../tensorflow-2.*+amd_*.whl
$ python -m pip install --force-reinstall --no-deps ${POPLAR_SDK_ENABLED?}/../keras-2.*.whl
$ python -m pip install ${POPLAR_SDK_ENABLED?}/../ipu_tensorflow_addons-2.*.whl
$ python3 -c "from tensorflow.python import ipu"
$ python3 -c "import keras"
$ python3 -c "from ipu_tensorflow_addons.keras import layers"

See Section 3.3, Install the TensorFlow 2 wheels and validate for details.

2.4. Clone the Graphcore examples

You may need to clone the Graphcore examples GitHub repository in order to run the example application. For convenience we set an environment variable to the tutorials directory.

To clone the examples repository for the latest version of the Poplar SDK:

$ cd ~/[base dir]
$ git clone https://github.com/graphcore/examples.git
$ cd examples/tutorials
$ export POPLAR_TUTORIALS_DIR=$(pwd)

where [base_dir] is a location of your choice.

Note

If you are using a version of the Poplar SDK prior to version 3.2, then refer to Section A, Install examples and tutorials for older Poplar SDK versions for how to install examples and tutorials.

2.5. Run the application

$ cd ${POPLAR_TUTORIALS_DIR?}/simple_applications/tensorflow2/mnist
$ pip install -r requirements.txt
$ python mnist.py

2.6. Exit the virtual environment

When you are done, exit the virtual environment.

The examples repo contains other tutorials and applications you can try. See Section 4, Next steps for more information.