1. Introduction

This document is a practical guide to porting TensorFlow™ models to the Poplar SDK for running on the IPU. It is assumed that the reader is aware of the document Targeting the IPU from TensorFlow, which serves as the primary introduction to developing TensorFlow models for the IPU. It provides not only a conceptual introduction to developing models at the framework level, but also details a number of specific facets of the TensorFlow-to-Poplar API that are pivotal to running models on the IPU. In what follows, this general guide will be referred to as various topics arise.

This document will in turn focus on some of the practical considerations of developing a model for the IPU and provide some guidance on best practices. In doing so, it will attempt to identify those key elements that assist the developer in transitioning to using TensorFlow on the IPU.

Note

This document currently applies to the Graphcore port of TensorFlow 1.15.

The scope of this document includes:

  • How to approach porting in general and which questions to ask up front

  • Code examples that highlight IPU-specific API functions

  • Preliminaries such as Bash environment setup and Python import statements

  • The role of infeeds and outfeeds in boosting computational throughput

  • Profile report generation to help you identify compute or memory inefficiencies

  • The IPUEstimator, a TensorFlow abstraction that facilitates session handling

A working knowledge of the above elements will allow the framework developer to take their first steps in transitioning to the IPU/Poplar/TensorFlow compute stack.

An example application that demonstrates the use of IPUs to train CNNs including ResNet, ResNeXt and EfficientNet is available in the Graphcore examples repository on GitHub: https://github.com/graphcore/examples/tree/master/applications/tensorflow/cnns/training