3. Device attributes

Each IPU device within a system has a set of attributes associated with it. The attributes contain information relating to the IPU such as the current power usage, current process, IPU activity level, and so on.

The gcipuinfo library provides a public API to retrieve this information. The library defines both the lookup functions and the available attributes.

You can query device attributes at the command line with the gc-info and gc-inventory tools. These tools are part of the Graphcore command line tools.

Note that there are some additional attributes visible in the gc-info and gc-inventory tools which are only used internally. These are not exported or documented through the gcipuinfo library.

The lookup functions are defined in gcipuinfo. The available attributes and the labels used to access them are defined in Section 6.1, Attribute labels.

3.1. Querying attributes

gcipuinfo provides a collection of methods for querying attributes.

gcipuinfo will query all of the available attributes for all devices when the class is created.

By default, subsequent calls to query any of the data will return the original data. Some attributes can dynamically change (such as power usage or IPU utilization). To force gcipuinfo to update the attributes you can call the gcipuinfo::updateData() method. Alternatively, you can call the gcipuinfo::setUpdateMode() method to force gcipuinfo to update the IPU attributes on each and every call to query the data.

By default only attributes of devices in the current partition will be retrieved. You can request that gcipuinfo return device attributes of devices in other partitions, by supplying DiscoverAllPartitionIPUs as the discoveryMode argument of the gcipuinfo::gcipuinfo() object constructor. This is demonstrated in the gc-get-attributes-for-all-devices example program.

Note

It is not possible to use both DiscoverAllPartitionIPUs and DiscoverActivePartitionIPUs modes in the same process.

Note

Information about available partitions is only retrieved once, at program start up. If partitions are added or removed any monitoring programs will need to be restarted to obtain updated partition information.