3. Running an application

Note

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

This section describes how to run a simple application, the MNIST example, using PopART.

  1. Install example requirements

    You can now install the requirements that the model needs.

    $ cd $TUTORIALS_DIR/simple_applications/popart/mnist/
    $ pip install -r requirements.txt
    
  2. Get the data

    $ ./get_data.sh
    
  3. Run example

    You run the code with:

    $ python3 popart_mnist.py
    

or with:

$ python3 popart_mnist_conv.py

There are some command line options which you can change.

If the code has run successfully, you should see an output similar to that in Listing 3.1.

Listing 3.1 Example of output for PopART application.
  Creating ONNX model.
  Compiling the training graph.
  Compiling the validation graph.
  Running training loop.
  Epoch #1
    Loss=16.2605
    Accuracy=88.88%
  Epoch #2
    Loss=13.9930
    Accuracy=89.63%
  Epoch #3
    Loss=13.1049
    Accuracy=89.83%
  Epoch #4
    Loss=12.5232
    Accuracy=90.01%
  Epoch #5
    Loss=12.1029
    Accuracy=90.12%
  Epoch #6
    Loss=11.7830
    Accuracy=90.22%
  Epoch #7
    Loss=11.5327
    Accuracy=90.40%
  Epoch #8
    Loss=11.3332
    Accuracy=90.59%
  Epoch #9
    Loss=11.1712
    Accuracy=90.65%
  Epoch #10
    Loss=11.0370
    Accuracy=90.70%

You have run a model that demonstrates how to use the IPU to train a simple model on the MNIST dataset using PopART.