Executable

#include <poplar/Executable.hpp>
namespace poplar

Poplar classes and functions.

A VectorList is a list of vectors with a specific layout and with the usage semantics of a 2D vector.

A 1D vector must be laid out in a contiguous memory region. A 2D vector is a vector of 1D vectors. Each of these 1D vectors that make up a 2D vector is called a “sub-vector” for the remainder of this document. The elements of a 2D vector can be accessed by indexing the 2D vector along the outer and inner dimensions as A[outer][inner].

The following two categories of layouts are supported:

  1. VectorListLayout::DELTANELEMENTS is a memory efficient 2D vector layout. For legacy systems VectorListLayout::DELTAN served a similar purpose. Each sub-vector must be laid out as a contiguous memory region but the sub-vectors may may not be laid out contiguous with respect to each other in memory. Each sub-vector may have a different length.

  2. VectorListLayout::ONE_PTR and other VectorListLayout layouts that are prefixed by SCALED_PTR are for Poplar runtime use only.

class Executable
#include <Executable.hpp>

An instance of poplar::Executable contains all of the information needed to run a program on an IPU device.

It can be saved to or loaded from disk.

Public Functions

~Executable()
Executable()
Executable(Executable &&other) noexcept
Executable &operator=(Executable &&other) noexcept
void serialize(std::ostream &out) const

Serialize an executable to a stream.

All of the binary files and metadata needed to run a Poplar executable will be written to the stream. Currently the format is opaque, and compatibility between different versions of Poplar is not guaranteed.

Parameters

out – The stream to write to. It must be seekable.

Throws

poplar_error – if the target is not an IPU - this cannot be used to serialise CPU or IPU_MODEL executables.

explicit Executable(std::unique_ptr<core::Executable> impl)
inline const core::Executable &getImpl() const

Public Static Functions

static Executable deserialize(std::istream &in, bool checkPackageHash = true)

Load an executable from a stream.

Parameters
  • in – The stream to read from. It must be seekable.

  • checkPackageHash – Flag to control package hash check (true by default).

static Executable deserialize(std::unique_ptr<std::istream> in, bool checkPackageHash = true)

Load an executable from a stream.

Note

This overload used to be more efficient by avoiding copying the archive from the executable to a temporary file. However now the executable needs to be decompressed this interface also stores the decompressed archive in a temporary file and so is equivalent to the other overload.

Parameters
  • in – The stream to read from.

  • checkPackageHash – Flag to control package hash check (true by default).

Private Members

std::unique_ptr<core::Executable> impl

Friends

friend class Engine
namespace core