ProfileValue

#include <poplar/ProfileValue.hpp>
namespace poplar

Poplar classes and functions.

Functions

void serializeToJSON(std::ostream &out, const ProfileValue &val, bool prettyPrint = false)
void serializeToCBOR(std::ostream &out, const ProfileValue &val, bool withTag = true)
std::ostream &operator<<(std::ostream &os, const ProfileValue &v)

Dumps the JSON representation to an output stream.

void printGraphSummary(std::ostream &out, const std::string &databasePath, const OptionFlags &opts)

Print a summary of the static graph profiling information - primarily memory use.

  • showOptimizations (true, false) [=false]

    If true, information about the optimisations performed are included in the summary output.

  • showPerIpuMemoryUsage (true, false) [=false]

    If true, total memory usage per-IPU is included in the summary output in addition to memory usage for the whole device.

  • showVarStorage (true, false) [=false]

    If true, information about variable storage liveness is included in the summary output. This is provided for some tiles with the highest maximum live bytes as well as a total for all tiles. The maximum live bytes is output along with information about always-live variables.

  • colours (true, false)

    Specify whether colours should be displayed in the profile report. If not set, colours will be displayed only if outputting to a supported terminal. If not set, using environment variable CLICOLOR_FORCE=1 forces colours to be displayed, while CLICOLOR=0 disables colours.

Parameters
  • out – The output stream to which the summary will be written.

  • databasePath – The full pathname of the profile.pop file for which the summary will be printed.

  • opts – The set of option flags configuring the contents of the summary. The available options are:

void printExecutionSummary(std::ostream &out, const std::string &databasePath, const OptionFlags &opts)

Print a summary of the execution profiling information - primarily cycle counts.

The information printed depends on the target and the execution profiling mode. IPUModel always prints a simulation of execution.

  • showExecutionSteps (true, false) [=false]

    If true, the program execution sequence with cycle estimates is included in the summary output.

  • colours (true, false)

    See printGraphSummary().

Parameters
  • out – The output stream to which the summary will be written.

  • databasePath – The full pathname of the profile.pop file for which the summary will be printed.

  • opts – The set of option flags configuring the contents of the summary. The available options are:

void printProfileSummary(std::ostream &out, const std::string &databasePath, const OptionFlags &opts = {})

Equivalent to calling printGraphSummary() followed by printExecutionSummary().

Parameters
  • out – The output stream to which the summary will be written.

  • databasePath – The full pathname of the profile.pop file for which the summary will be printed.

  • opts – The set of option flags configuring the contents of the summary. See printGraphSummary() and printExecutionSummary().

class ProfileValue
#include <ProfileValue.hpp>

ProfileValue represents a read-only JSON-like tree of values that are used to store the output of the profiler.

Each value can be one of:

  • A boolean

  • A string

  • A double-precision number

  • A vector<> of child values

  • A map<string, …> of child values. Only string keys are supported.

If an invalid access is made, for example an out-of-range access or accessing the wrong type, then an exception is thrown. It is possible to write code that should never throw an exception by using type().

See the Poplar and PopLibs User Guide for details of the data in the report.

Public Types

enum class Type

Values:

enumerator BOOL_
enumerator STRING
enumerator NUMBER
enumerator VECTOR
enumerator MAP
using Boolean = bool
using Number = double
using String = std::string
using Vector = std::vector<ProfileValue>
using Map = std::map<std::string, ProfileValue>

Public Functions

Type type() const
const String &asString() const
Boolean asBool() const
std::int64_t asInt() const
std::uint64_t asUint() const
double asDouble() const
const ProfileValue &operator[](StringRef s) const
const ProfileValue *getOrNull(StringRef s) const
const Map &asMap() const
const ProfileValue &operator[](std::size_t i) const
const Vector &asVector() const
std::vector<std::uint64_t> toUintVector() const
std::size_t size() const
double sumDouble() const
std::int64_t sumInt() const
std::uint64_t sumUint() const
std::int64_t sum2DInt() const
std::uint64_t sum2DUint() const
bool operator==(const ProfileValue &other) const
bool operator!=(const ProfileValue &other) const
inline ProfileValue()
ProfileValue(String init)
ProfileValue(Vector init)
ProfileValue(Map init)
ProfileValue(Number init)
explicit ProfileValue(Boolean init)
template<class T, typename = typename std::enable_if<std::is_integral<T>::value>::type>
inline ProfileValue(T init)
inline ProfileValue(const char *init)
~ProfileValue()
ProfileValue(const ProfileValue &other)
ProfileValue(ProfileValue &&other) noexcept
ProfileValue &operator=(const ProfileValue &other)
ProfileValue &operator=(ProfileValue &&other) noexcept
ProfileValue &operator=(Boolean init)
ProfileValue &operator=(Number init)
ProfileValue &operator=(String init)
ProfileValue &operator=(Vector init)
ProfileValue &operator=(Map init)
template<class T, typename = typename std::enable_if<std::is_integral<T>::value>::type>
inline ProfileValue &operator=(T init)

Private Members

Storage v
Type t

Friends

friend class core::MutableProfileValue
struct Storage

Public Members

std::aligned_union<1, Boolean, Number, String, Vector, Map>::type buffer
namespace core