TileAllocation

#include <gcl/TileAllocation.hpp>

Defines

GCL_NO_DISCARD

Produce compile time warning for unused return values.

namespace gcl

Graphcore Communications Library.

CrossReplica functions

Collective operations working across replicas.

WithinReplica functions

Collective operations working within replicas.

Functions

unsigned 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 in perIPUTiles() for it to be a valid graph for GCL operations.

Parameters

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

Returns

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

std::vector<unsigned> 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.)

Parameters
  • 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 tiles IDs to return.

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

  • tilePairs – Override the default behaviour and return tile pairs. Tiles used for host IO must be allocated in pairs.

Returns

A vector of tile IDs.