7. The PopLibs libraries

The PopLibs libraries provide application-level functions that can be used in programs for the IPU. The available libraries are listed in the table below.

Library

Description

poplin

Linear algebra functions (matrix multiplications, convolutions)

popnn

Functions used in neural networks (for example, non-linearities, pooling and loss functions)

popops

Functions for operations on tensors in control programs (elementwise functions and reductions)

poprand

Functions for populating tensors with random numbers

popsparse

Functions for operating on sparse tensors

poputil

General utility functions for building graphs

Examples using the library functions can be found in the Graphcore GitHub tutorials repository, including a tutorial on PopLibs operations.

For details of all the functions in the PopLibs libraries, see the Poplar and PopLibs API Reference.

7.1. Using PopLibs

The PopLibs libraries are in the lib directory of the Poplar installation. Each library has its own include directory and library object file. For example, the include files for the popops library are in the include/popops directory:

#include <include/popops/ElementWise.hpp>

You will need to link the relevant PopLibs libraries with your program, in addition to the Poplar library. For example:

$ g++ -std=c++11 my-program.cpp -lpoplar -lpopops

Some libraries are dependent on other libraries, which you will also need to link with your program. See the Poplar and PopLibs API Reference for details.