Exceptions

#include <poplar/exceptions.hpp>
namespace poplar

Poplar classes and functions.

Enums

enum class RecoveryAction

An enumeration that specifies how to recover from a recoverable_runtime_error.

Values:

enumerator IPU_RESET

Reset the IPU and reload IPU memory.

enumerator PARTITION_RESET

Reset the IPU partition. This retrains the IPU-links between IPUs.

enumerator FULL_RESET

Power cycle the system.

Functions

std::string toString(RecoveryAction recoveryAction)

Convert the recovery action to a string.

std::ostream &operator<<(std::ostream &os, RecoveryAction recoveryAction)
struct application_runtime_error : public poplar::runtime_error
#include <exceptions.hpp>

This exception is thrown when running a program fails due to an error in the program or a misuse of an API.

Public Functions

explicit application_runtime_error(const std::string &s)
explicit application_runtime_error(const char *s)
~application_runtime_error() override
struct control_program_error : public poplar::poplar_error
#include <exceptions.hpp>

This exception is thrown when the construction of a graph program is invalid.

Public Functions

explicit control_program_error(const std::string &msg)
~control_program_error() override
struct file_load_error : public poplar::poplar_error

Public Functions

explicit file_load_error(const std::string &path)
~file_load_error() override
struct graph_connection_error : public poplar::poplar_error
#include <exceptions.hpp>

This exception is thrown during construction of an Engine object if there is an error in the structure of graph, for example, if there are no edges to a vertex input or if there are multiple edges to a vertex input.

Public Functions

explicit graph_connection_error(const std::string &s)
explicit graph_connection_error(const char *s)
~graph_connection_error() override
struct graph_cycle_error : public poplar::poplar_error
#include <exceptions.hpp>

This exception is thrown during the construction of an Engine object if there are any cycles in the graph that are not broken by recurrent edges.

Public Functions

explicit graph_cycle_error(const std::string &s)
explicit graph_cycle_error(const char *s)
~graph_cycle_error() override
struct graph_memory_allocation_error : public poplar::poplar_error
#include <exceptions.hpp>

This exception is thrown when an memory allocation fails.

Public Functions

explicit graph_memory_allocation_error(const std::string &s)
explicit graph_memory_allocation_error(const char *s)
~graph_memory_allocation_error() override

Public Members

std::string profilePath

Holds the absolute path to the profile.pop file that was produced when this error occurred.

Empty if no profile.pop file was produced.

struct graph_object_creation_error : public poplar::poplar_error
#include <exceptions.hpp>

This exception is thrown in the construction of a GraphProgEnv object if there was an error in the creation of the graph program object file.

Public Functions

explicit graph_object_creation_error(const std::string &s)
explicit graph_object_creation_error(const char *s)
~graph_object_creation_error() override
struct graph_object_load_error : public poplar::poplar_error
#include <exceptions.hpp>

This exception is thrown in the construction of a GraphProgEnv object if there was an error in loading the graph program object file.

Public Functions

explicit graph_object_load_error(const std::string &path, const std::string &error)
~graph_object_load_error() override
struct graph_program_compilation_error : public poplar::poplar_error
#include <exceptions.hpp>

This exception is thrown in the construction of a GraphProgEnv object if there are any compilation errors in the graph program.

Public Functions

explicit graph_program_compilation_error(const std::string &s)
explicit graph_program_compilation_error(const char *s)
~graph_program_compilation_error() override
struct graph_recursion_error : public poplar::poplar_error
#include <exceptions.hpp>

This exception is thrown during the construction of an Engine object if there are recursive calls.

Public Functions

explicit graph_recursion_error(const std::string &s)
explicit graph_recursion_error(const char *s)
~graph_recursion_error() override
struct graph_replication_error : public poplar::poplar_error
#include <exceptions.hpp>

This exception is thrown when an invalid operation is carried out on a replicated graph.

Public Functions

explicit graph_replication_error(const std::string &s)
explicit graph_replication_error(const char *s)
~graph_replication_error() override
struct index_error : public poplar::poplar_error
#include <exceptions.hpp>

This exception is thrown if the index of a subscript is out of the bounds of the field it is accessing or if a index of a tensor is invalid.

Public Functions

explicit index_error(const std::string &s)
explicit index_error(const char *s)
index_error(const std::string &vertexDotField, std::size_t index)
~index_error() override
struct invalid_machine_model : public poplar::poplar_error
#include <exceptions.hpp>

This exception is thrown when an invalid model of the IPU (for performance model profiling) has been specified.

Public Functions

explicit invalid_machine_model(const std::string &s)
explicit invalid_machine_model(const char *s)
~invalid_machine_model() override
struct invalid_option : public poplar::poplar_error
#include <exceptions.hpp>

This exception is thrown when an unrecognised or invalid option is passed to a Poplar API.

Public Functions

explicit invalid_option(const std::string &s)
explicit invalid_option(const char *s)
~invalid_option() override
struct invalid_tile_mapping : public poplar::poplar_error
#include <exceptions.hpp>

This exception is thrown when the tile mapping passed to the UserTilePartitioner is invalid.

Public Functions

explicit invalid_tile_mapping(const std::string &s)
explicit invalid_tile_mapping(const char *s)
~invalid_tile_mapping() override
#include <exceptions.hpp>

This exception is thrown when the linking stage for codelets fails.

output is the output from the linker command.

Public Functions

Public Members

struct memory_elem_constraints_error : public poplar::poplar_error
#include <exceptions.hpp>

This exception is thrown when an invalid memory element constraint has been provided in a codelet.

Public Functions

explicit memory_elem_constraints_error(const std::string &s)
explicit memory_elem_constraints_error(const char *s)
~memory_elem_constraints_error() override
struct missing_graph_profile : public poplar::poplar_error
#include <exceptions.hpp>

This exception is thrown if the graph and/or execution profile is required but the graph profile that should had been generated during compilation is not found.

Public Functions

explicit missing_graph_profile(const std::string &s)
explicit missing_graph_profile(const char *s)
~missing_graph_profile() override
struct missing_perf_estimate : public poplar::poplar_error
#include <exceptions.hpp>

This exception is thrown when an Engine is constructed with profiling enabled but a vertex does not have a getPerfEstimate method specified.

Public Functions

explicit missing_perf_estimate(const std::string &vertexName)
~missing_perf_estimate() override
struct missing_profile_data : public poplar::poplar_error
#include <exceptions.hpp>

This exception is thrown if a profile is requested after compilation but the data that is required to generate it is not present in the executable.

Public Functions

missing_profile_data()
~missing_profile_data() override
struct no_environment : public poplar::poplar_error
#include <exceptions.hpp>

This exception is thrown, in the construction of a GraphProgEnv object, in mixed-mode compilation, if there is no graph-programming environment available, in particular if the program has not been compiled with the ‘popc’ command-line tool.

Public Functions

explicit no_environment(const std::string &s)
explicit no_environment(const char *s)
~no_environment() override
struct no_size_specified : public poplar::poplar_error
#include <exceptions.hpp>

This exception is thrown if the size of a field is not specified in a Graph object when an EngineBuilder object is constructed.

Public Functions

explicit no_size_specified(const std::string &s)
explicit no_size_specified(const char *s)
no_size_specified(const std::string &fieldName, const std::string &vertexName)
~no_size_specified() override
struct overflow_error : public poplar::poplar_error
#include <exceptions.hpp>

This exception is thrown when an arithmetic overflow occurs within Poplar.

Public Functions

explicit overflow_error(const std::string &s)
explicit overflow_error(const char *s)
~overflow_error() override
struct parse_error : public poplar::poplar_error
#include <exceptions.hpp>

This exception is thrown when an input file or string cannot be parsed.

Public Functions

explicit parse_error(const std::string &s)
explicit parse_error(const char *s)
~parse_error() override
struct poplar_error : public runtime_error
#include <exceptions.hpp>

Base class for Poplar exceptions.

Subclassed by poplar::control_program_error, poplar::file_load_error, poplar::graph_connection_error, poplar::graph_cycle_error, poplar::graph_memory_allocation_error, poplar::graph_object_creation_error, poplar::graph_object_load_error, poplar::graph_program_compilation_error, poplar::graph_recursion_error, poplar::graph_replication_error, poplar::index_error, poplar::invalid_machine_model, poplar::invalid_option, poplar::invalid_tile_mapping, poplar::link_error, poplar::memory_elem_constraints_error, poplar::missing_graph_profile, poplar::missing_perf_estimate, poplar::missing_profile_data, poplar::no_environment, poplar::no_size_specified, poplar::overflow_error, poplar::parse_error, poplar::profiling_disabled, poplar::runtime_error, poplar::stream_connection_error, poplar::stream_memory_allocation_error, poplar::symbol_error, poplar::tensor_creation_error, poplar::tensor_io_state_error, poplar::tensor_metadata_error, poplar::type_error, poplar::unknown_field, poplar::unknown_vertex_type

Public Functions

explicit poplar_error(const std::string &s)
explicit poplar_error(const char *s)
void attachSourceLocation(const DebugContext &context)
const char *what() const noexcept override
~poplar_error() override

Public Members

std::string type

Private Members

std::string msg
struct profiling_disabled : public poplar::poplar_error
#include <exceptions.hpp>

This exception is thrown if profiling information is requested from an Engine but that Engine has not been constructed with profiling enabled.

Public Functions

profiling_disabled()
~profiling_disabled() override
struct recoverable_runtime_error : public poplar::system_runtime_error
#include <exceptions.hpp>

This exception is thrown when when running a program fails due to a system error that is likely to be transient.

getRecoveryAction() indicates what to do to recover from this error.

Public Functions

inline RecoveryAction getRecoveryAction() const

Return the action required to recover from error.

explicit recoverable_runtime_error(RecoveryAction recoveryAction, const std::string &s)
explicit recoverable_runtime_error(RecoveryAction recoveryAction, const char *s)
~recoverable_runtime_error() override

Private Members

RecoveryAction recoveryAction
struct runtime_error : public poplar::poplar_error
#include <exceptions.hpp>

This exception is thrown when running a program on a system fails.

Subclassed by poplar::application_runtime_error, poplar::system_runtime_error

Public Functions

explicit runtime_error(const std::string &s)
explicit runtime_error(const char *s)
~runtime_error() override

Public Members

std::vector<ErrorInfo> errors

Additional information about why the exception was thrown.

Can be empty. The order of ErrorInfo objects is not necessarily deterministic.

struct ErrorInfo

Public Members

ErrorCode code

A unique number to identify the error.

ErrorLocation location

An object that uniquely specifies the location of an error in a device.

If this attribute has not been set (bool)location will be false.

bool isSimulated

True if the exception has been simulated and false otherwise.

struct stream_connection_error : public poplar::poplar_error
#include <exceptions.hpp>

This exception is thrown when an invalid attempt is made to connect a data stream.

Public Functions

explicit stream_connection_error(const std::string &s)
explicit stream_connection_error(const char *s)
~stream_connection_error() override
struct stream_memory_allocation_error : public poplar::poplar_error
#include <exceptions.hpp>

This exception is thrown when allocation of stream buffers fails.

Public Functions

explicit stream_memory_allocation_error(const std::string &s)
explicit stream_memory_allocation_error(const char *s)
~stream_memory_allocation_error() override
struct symbol_error : public poplar::poplar_error

Public Functions

explicit symbol_error(const std::string &name, const unsigned tile)
~symbol_error() override
struct system_runtime_error : public poplar::runtime_error
#include <exceptions.hpp>

This exception is thrown when running a program fails due to an error in the system it is running on.

Subclassed by poplar::recoverable_runtime_error, poplar::unknown_runtime_error, poplar::unrecoverable_runtime_error

Public Functions

explicit system_runtime_error(const std::string &s)
explicit system_runtime_error(const char *s)
~system_runtime_error() override
struct tensor_creation_error : public poplar::poplar_error
#include <exceptions.hpp>

This exception is thrown in the construction of a tensor if invalid arguments are provided to the tensor creation function or method.

Public Functions

explicit tensor_creation_error(const std::string &s)
explicit tensor_creation_error(const char *s)
~tensor_creation_error() override
struct tensor_io_state_error : public poplar::poplar_error
#include <exceptions.hpp>

This exception is thrown when an attempt is made to mark a tensor as an input or output, but the argument references a view of a tensor, rather than a whole tensor.

Public Functions

explicit tensor_io_state_error(const std::string &s)
explicit tensor_io_state_error(const char *s)
~tensor_io_state_error() override
struct tensor_metadata_error : public poplar::poplar_error
#include <exceptions.hpp>

This exception is thrown if a tensor uses a type that requires metadata and the metadata is not accessible.

Public Functions

explicit tensor_metadata_error(const std::string &s)
explicit tensor_metadata_error(const char *s)
~tensor_metadata_error() override
struct type_error : public poplar::poplar_error
#include <exceptions.hpp>

This exception is thrown when there is an error related to the field types of vertices, for example, when the source of an edge contains an input, the types of inputs and source field between an edge do not match, or when a field cannot be subscripted.

Public Functions

explicit type_error(const std::string &s)
explicit type_error(const char *s)
~type_error() override
struct unknown_field : public poplar::poplar_error
#include <exceptions.hpp>

This exception is thrown when a field name is specified that does not exist in the graph-programming environment.

Public Functions

explicit unknown_field(const std::string &s)
explicit unknown_field(const char *s)
unknown_field(const std::string &fieldName, const std::string &vertexTypeName)
~unknown_field() override
struct unknown_runtime_error : public poplar::system_runtime_error
#include <exceptions.hpp>

This exception is throw when execution fails due to a system error where the cause cannot be automatically determined, for example a timeout without a specific error being raised.

Public Functions

explicit unknown_runtime_error(const std::string &s)
explicit unknown_runtime_error(const char *s)
~unknown_runtime_error() override
struct unknown_vertex_type : public poplar::poplar_error
#include <exceptions.hpp>

This exception is thrown when a vertex type name is specified that does not exist in the graph programming environment.

Public Functions

explicit unknown_vertex_type(const std::string &name)
~unknown_vertex_type() override
struct unrecoverable_runtime_error : public poplar::system_runtime_error
#include <exceptions.hpp>

This exception is thrown when execution fails due to a system error that is likely to persist.

The system should be taken out of operation for analysis and repair.

Public Functions

explicit unrecoverable_runtime_error(const std::string &s)
explicit unrecoverable_runtime_error(const char *s)
~unrecoverable_runtime_error() override