2. Setup quick start

This section describes how to set up your system to start using TensorFlow 1 for the IPU.

Note

From Poplar SDK 3.1, TensorFlow 1 will only be supported in CentOS 7. In addition, Examples and Tutorials for TensorFlow 1 are only available up to version 3.0 of the SDK. There has been limited testing of the 3.0 versions of the TensorFlow 1 tutorials and examples with later versions of the Poplar SDK.

Ensure you have completed the steps described in the getting started guide for your system before completing the steps in this section.

2.1. Enable Poplar SDK

You need to enable the Poplar SDK before you can use TensorFlow 1.

$ source [path-to-sdk]/enable

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

You can verify that Poplar has been successfully set up by running:

$ popc --version

This will display the version of the installed software.

2.2. Create and enable a Python virtual environment

It is recommended that you work in a Python virtual environment. You can create and activate a virtual environment as follows:

$ python[py_ver] -m venv ~/[base_dir]/[venv_name]
$ source ~/[base_dir]/[venv_name]/bin/activate

where [base_dir] is a location of your choice and [venv_name] is the name of the directory that will be created for the virtual environment. [py_ver] is the version of Python you are using and it depends on your OS.

You can get more information about the versions of Python and other tools supported in the Poplar SDK for different operating systems in the Poplar SDK 3.3.0 Release Notes. You can check which OS you are running with lsb_release -a.

2.3. Install the TensorFlow 1 wheels and validate

There are two TensorFlow 1 wheels included in the Poplar SDK, one for AMD processors and one for Intel processors. Check which processor is used on your system by running:

$ lscpu | grep name

Install the wheel files needed to run TensorFlow 1 on the IPU.

$ python -m pip install ${POPLAR_SDK_ENABLED?}/../tensorflow-1.*+amd_*.whl
$ python -m pip install ${POPLAR_SDK_ENABLED?}/../ipu_tensorflow_addons-1.*.whl
$ python3 -c "from tensorflow.python import ipu"