aihwkit.inference.noise.hermes module

Phenomenological noise models for PCM devices for inference.

class aihwkit.inference.noise.hermes.HermesNoiseModel(prog_coeff=None, g_converter=None, num_devices=2, g_max=None, t_read=5.12e-07, t_0=None, prog_noise_scale=1.0, read_noise_scale=1.0, drift_scale=1.0, prog_coeff_g_max_reference=None)[source]

Bases: BaseNoiseModel

A Noise model that was fitted and characterized on the PCM devices of the platform IBM HERMES Project Chip, see `Le Gallo et al. Nat. Electronics (2023)`_ and Khaddam-Aljameh et al. JSSC (2022)

Expected weight noise at assumed time of inference with expected programming noise at 0.

See also Nandakumar et al. ICECS (2019) for details about the statistical modelling methodology that was used.

NOTE: The argument num_devices changes the programming method and the drift behavior of the model. When num_devices is 1, a conventional single device programming method is used. When num_devices is 2, the method from the work Vasilopoulos et al. TED (2023) is employed (MSF), which is optimal and yields higher programming accuracy. For the drift characterization, though, when num_devices is 2 the model is applied as if the two devices host the same conductance and not as described in the aforementioned reference, due to it using a dynamic conductance mapping step which requires feedback from the chip in question. This simplification yields worse drift behavior in the current model than the one measured on-chip in the aforementioned work.

Parameters:
  • prog_coeff (List[float] | None) – Programming polynomial coeffs in \(\sum_i c_i \left(\frac{g_t}{g_\max}\right)^i\)

  • g_converter (BaseConductanceConverter | None) – instantiated class of the conductance converter (defaults to single pair)

  • num_devices (int) – The number of devices that are used to map a weight. Hermes supports either 1 or 2 devices per weight. When num_devices is 2, higher programming accuracy and less drift variability is measured. Defaults to 2.

  • g_max (float | None) – In \(\mu S\), the maximal conductance, ie the value the absolute max of the weights will be mapped to. When num_devices = 2, the maximum characterized conductance is 20.7 \(\mu S\). When num_devices = 1 the maximum characterized value is 10.35 \(\mu S\). When None is passed (by default) the maximum conductance for the corresponding num_devices is selected.

  • t_read (float) – Parameter of the 1/f fit (in seconds).

  • t_0 (float | None) –

    Parameter of the drift fit (first reading time). When num_devices = 2 that time corresponds to 300s, while in the case that num_devices = 1 it is 200s. If None is passed (by default) the time is selected according to the num_devices selection.

    Note

    The t_inference is relative to this time t0 e.g. t_inference counts from the completion of the programming of a device.

  • prog_noise_scale (float) – Scale for the programming noise.

  • read_noise_scale (float) – Scale for the read and accumulated noise.

  • drift_scale (float) – Scale for the drift coefficient.

  • prog_coeff_g_max_reference (float | None) – reference \(g_\max\) value when fitting the coefficients, since the result of the polynomial fit is given in uS. If prog_coeff_g_max_reference is not given and prog_coeffs are given explicitly, it will be set to g_max of the conductance converter.

apply_drift_noise_to_conductance(g_prog, drift_noise_param, t_inference)[source]

Apply the noise and drift up to the assumed inference time point based on PCM measurements.

Parameters:
  • g_prog (Tensor)

  • drift_noise_param (Tensor)

  • t_inference (float)

Return type:

Tensor

apply_programming_noise_to_conductance(g_target)[source]

Apply programming noise to a target conductance Tensor.

Programming noise with additive Gaussian noise with conductance dependency of the variance given by a 3-degree polynomial.

Parameters:

g_target (Tensor)

Return type:

Tensor

generate_drift_coefficients(g_target)[source]

Return drift coefficients nu based on PCM measurements.

Parameters:

g_target (Tensor)

Return type:

Tensor