6.3. TileAllocation

#include <gcl/TileAllocation.hpp>
unsigned gcl::getMinIoTiles(const poplar::Graph &graph)

Get the minimum number of IO tiles required for GCL operations.

This is the minimum number of tiles you must ask for with perIPUTiles() in order for the graph to be valid for GCL operations.


graph – The graph to check. It assumes that all tiles in the graph will be used for IO operations.


The smallest number of IO tiles that must be allocated for GCL operations.

std::vector<unsigned> gcl::perIPUTiles(const poplar::Graph &graph, unsigned offset, unsigned count, bool sorted = true, bool tilePairs = true)

Return a list of tile IDs optimal for GCL collective operations.

A set of tiles are chosen with an optimal distribution across exchange blocks and exchange-block contexts. (Exchange blocks provide the hardware interface to off-chip IO.)

  • graph – The graph on which to allocate tiles.

  • offset – Skip a number of tiles and allocate from an offset. This is useful if you want to call the function multiple times, for example to get a set of tiles for IO and another set of tiles for compute. In that case, you could it twice: first with an offset of zero to get the IO tiles, and then with offset equal to the number of IO tiles in order to get the compute tiles.

  • count – Number of tile IDs to return.

  • sorted – If true the function will sort the returned list of IDs. This is normally required and is the default.

  • tilePairs – If set to false, return individual tiles instead of pairs. Note: tiles used for host IO must be allocated in pairs.


A vector of tile IDs.