Virtual Environments
Poplar SDK Setup
The Poplar SDK is downloaded onto the graphcore systems at the /software/graphcore/poplar_sdk/
location. The default poplar
version (3.3.0) is enabled automatically upon logging into a graphcore node.
Check if Poplar is setup correctly:
One should see:
If the Poplar SDK is not enabled, it can be enabled with
To disable the current Poplar SDK, e.g. if one wants to use a different Poplar SDK, follow the steps below. (Otherwise, skip to section Miscellaneous Environment Variables.) This example assumes that the current installed SDK is 3.1.0 and you want to move to 3.3.0
- Check the current version
- Unset the current version
- Enable poplar and popart
- Recheck for the new version.
-
Set SDK env variable
-
Create a new virtual environment with this SDK and install popTorch and or other frameworks as needed.
Miscellaneous Environment Variables
mkdir ~/tmp
export TF_POPLAR_FLAGS=--executable_cache_path=~/tmp
export POPTORCH_CACHE_DIR=~/tmp
export POPART_LOG_LEVEL=WARN
export POPLAR_LOG_LEVEL=WARN
export POPLIBS_LOG_LEVEL=WARN
export PYTHONPATH=/software/graphcore/poplar_sdk/3.3.0/poplar-ubuntu_20_04-3.3.0+7857-b67b751185/python:$PYTHONPATH
PopTorch Environment Setup
PopTorch is an extension of the Pytorch framework that is optimized for the IPU specific functionality. To activate the PopTorch environment, first create a virtual environment and activate it.
mkdir -p ~/venvs/graphcore
virtualenv ~/venvs/graphcore/poptorch33_env
source ~/venvs/graphcore/poptorch33_env/bin/activate
Use the following commands to install the PopTorch environment.
POPLAR_SDK_ROOT=/software/graphcore/poplar_sdk/3.3.0
export POPLAR_SDK_ROOT=$POPLAR_SDK_ROOT
pip install $POPLAR_SDK_ROOT/poptorch-3.3.0+113432_960e9c294b_ubuntu_20_04-cp38-cp38-linux_x86_64.whl
TensorFlow 2 Environment Setup
The Poplar SDK provides TensorFlow and Keras wheels built on 2.6 that includes the IPU specific functionality and optimized for the AMD processors. It can be installed as follows.
Create virtual environment.
virtualenv ~/venvs/graphcore/tensorflow2_33_env
source ~/venvs/graphcore/tensorflow2_33_env/bin/activate
Install the TensorFlow and Keras wheels.
POPLAR_SDK_ROOT=/software/graphcore/poplar_sdk/3.3.0
export POPLAR_SDK_ROOT=$POPLAR_SDK_ROOT
pip install $POPLAR_SDK_ROOT/tensorflow-2.6.3+gc3.3.0+251580+08d96978c7f+amd_znver1-cp38-cp38-linux_x86_64.whl
pip install $POPLAR_SDK_ROOT/keras-2.6.0+gc3.3.0+251582+a3785372-py2.py3-none-any.whl
Verify Installation
You should see:
2023-08-22 21:53:26.109934: I tensorflow/compiler/plugin/poplar/driver/poplar_platform.cc:43] Poplar version: 3.3.0 (de1f8de2a7) Poplar package: b67b751185
Installing Packages
Install packages in the normal manner such as:
For more details see Use pip for installing.
To install a different version of a package that is already installed in one's environment, one can use:
Note: Conda is not supported on the Graphcore system.