3. PyTorch setup

This section describes how to install a wheel file containing PopTorch, a set of extensions to enable PyTorch models to run on the IPU.

Note

You should activate the Python virtual environment you created for PyTorch (Section 2.7, Create a Python virtual environment) before performing the setup in this section.

Install the PopTorch wheel file using a command similar to the following:

$ python3 -m pip install $SDK_DIR/poptorch-X+X_X.whl

where $SDK_DIR is the location of the Poplar SDK (Section 2.4, Define environment variables).

An example of the filename for the PopTorch wheel file is:

poptorch-3.0.0+86945_163b7ce462_ubuntu_20_04-cp38-cp38-linux_x86_64.whl

To confirm that PopTorch has been installed, you can use pip list, which should include the poptorch package in the output.

  Package        Version
  -------------  ----------
  numpy          1.19.5
  packaging      21.3
  Pillow         8.4.0
  pip            21.3.1
  pkg_resources  0.0.0
  pluggy         0.13.1
  poptorch       3.0.0+86945
  wheel          0.37.0

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__)"