aihwkit.simulator.devices module

High level analog devices.

class aihwkit.simulator.devices.BaseResistiveDevice

Bases: object

Base resistive device.

create_tile(x_size, d_size)

Return an analog tile of the specified dimensions.

Parameters
  • x_size (int) – number of rows.

  • d_size (int) – number of columns.

Return type

aihwkit.simulator.rpu_base.tiles.FloatingPointTile

class aihwkit.simulator.devices.ConstantStepResistiveDevice(params_devices=None, params_forward=None, params_backward=None, params_update=None)

Bases: aihwkit.simulator.devices.BaseResistiveDevice

ConstantStep resistive devices.

Device are used as part of an AnalogTile to implement the update once characteristics, i.e. the material response properties when a single update pulse is given (a coincidence between row and column pulse train happened).

The form implemented for ConstantStep is:

\[ \begin{align}\begin{aligned}w_{ij} &\leftarrow& w_{ij} - \Delta w_{ij}^d(1 + \sigma_\text{c-to-c}\,\xi)\\w_{ij} &\leftarrow& \text{clip}(w_{ij},b^\text{min}_{ij},b^\text{max}_{ij})\end{aligned}\end{align} \]

where \(d\) is the direction of the update (product of signs of input and error). \(\Delta w_{ij}^d\) is the update step size of the cross-point ij in direction \(d\) (up or down). Note that each cross-point has separate update sizes so that device-to-device fluctuations and biases in the directions can be given.

Moreover, the clipping bounds of each cross-point ij (i.e. \(b_{ij}^\text{max/min}\)) are also different in general. The mean and the amount of systematic spread from device-to-device can be given as parameters, see below.

For parameters regarding the devices settings, see ConstantStepResistiveDeviceParameters.

Reset:

Resets the weight in cross points to (around) zero with cycle-to-cycle and systematic spread around a mean.

Decay:

\[w_{ij} \leftarrow w_{ij}\,(1-\alpha_\text{decay}\delta_{ij})\]

Weight decay is generally off and has to be activated explicitly by using decay() on an analog tile. Note that the device decay_lifetime parameters (1 over decay rates \(\delta_{ij}\)) are analog tile specific and are thus set and fixed during RPU initialization. \(\alpha_\text{decay}\) is a scaling factor that can be given during run-time.

Diffusion:

Similar to the decay, diffusion is only activated by inserting a specific operator. However, the parameters of the diffusion process are set during RPU initialization and are fixed for the remainder.

\[w_{ij} \leftarrow w_{ij} + \rho_{ij} \, \xi;\]

where \(xi\) is a standard Gaussian variable and \(\rho_{ij}\) the diffusion rate for a cross-point ij

Note

If diffusion happens to move the weight beyond the hard bounds of the weight it is ensured to be clipped appropriately.

create_tile(x_size, d_size)

Returns an analog tile of the specified dimensions.

Parameters
  • x_size (int) – number of rows.

  • d_size (int) – number of columns.

Return type

aihwkit.simulator.rpu_base.tiles.AnalogTile

class aihwkit.simulator.devices.FloatingPointResistiveDevice(params_basic=None)

Bases: aihwkit.simulator.devices.BaseResistiveDevice

Floating point resistive devices.

This implements ideal devices update behavior (floating point update).

create_tile(x_size, d_size)

Return a floating point tile of the specified dimensions.

Parameters
  • x_size (int) –

  • d_size (int) –

Return type

aihwkit.simulator.rpu_base.tiles.FloatingPointTile