aihwkit.simulator.configs.configs module
Configurations for resistive processing units.
- class aihwkit.simulator.configs.configs.DigitalRankUpdateRPUConfig(tile_class=<class 'aihwkit.simulator.tiles.analog.AnalogTile'>, runtime=<factory>, pre_post=<factory>, tile_array_class=<class 'aihwkit.simulator.tiles.array.TileModuleArray'>, mapping=<factory>, forward=<factory>, backward=<factory>, update=<factory>, device=<factory>)[source]
Bases:
IOManagedRPUConfig
Configuration for an analog (unit cell) resistive processing unit where the rank update is done in digital.
Note that for forward and backward, an analog crossbar is still used, and during update the digitally computed rank update is transferred to the analog crossbar using pulses.
- Parameters:
tile_class (Type) –
runtime (RuntimeParameter) –
pre_post (PrePostProcessingParameter) –
tile_array_class (Type) –
mapping (MappingParameter) –
forward (IOParameters) –
backward (IOParameters) –
update (UpdateParameters) –
device (DigitalRankUpdateCell) –
- device: DigitalRankUpdateCell
Parameter that modify the behavior of the pulsed device.
- tile_array_class
Tile class used for mapped logical tile arrays.
alias of
TileModuleArray
- tile_class
Tile class that corresponds to this RPUConfig.
alias of
AnalogTile
- class aihwkit.simulator.configs.configs.FloatingPointRPUConfig(tile_class=<class 'aihwkit.simulator.tiles.floating_point.FloatingPointTile'>, runtime=<factory>, pre_post=<factory>, tile_array_class=<class 'aihwkit.simulator.tiles.array.TileModuleArray'>, mapping=<factory>, device=<factory>)[source]
Bases:
MappableRPU
,PrePostProcessingRPU
Configuration for a floating point resistive processing unit.
- Parameters:
tile_class (Type) –
runtime (RuntimeParameter) –
pre_post (PrePostProcessingParameter) –
tile_array_class (Type) –
mapping (MappingParameter) –
device (FloatingPointDevice) –
- device: FloatingPointDevice
Parameter that modify the behavior of the pulsed device.
- tile_array_class
Tile class used for mapped logical tile arrays.
alias of
TileModuleArray
- tile_class
Tile class that corresponds to this RPUConfig.
alias of
FloatingPointTile
- class aihwkit.simulator.configs.configs.IOManagedRPUConfig(tile_class, runtime=<factory>, pre_post=<factory>, tile_array_class=None, mapping=<factory>, forward=<factory>, backward=<factory>, update=<factory>)[source]
Bases:
MappableRPU
,PrePostProcessingRPU
Configuration for an analog (pulsed device) resistive processing unit.
- Parameters:
tile_class (Type) –
runtime (RuntimeParameter) –
pre_post (PrePostProcessingParameter) –
tile_array_class (Type | None) –
mapping (MappingParameter) –
forward (IOParameters) –
backward (IOParameters) –
update (UpdateParameters) –
- as_bindings()[source]
Return a representation of this instance as a simulator bindings object.
- Return type:
Any
- backward: IOParameters
Input-output parameter setting for the backward direction.
- forward: IOParameters
Input-output parameter setting for the forward direction.
- update: UpdateParameters
Parameter for the update behavior.
- class aihwkit.simulator.configs.configs.InferenceRPUConfig(tile_class=<class 'aihwkit.simulator.tiles.inference.InferenceTile'>, runtime=<factory>, pre_post=<factory>, tile_array_class=<class 'aihwkit.simulator.tiles.array.TileModuleArray'>, mapping=<factory>, forward=<factory>, noise_model=<factory>, drift_compensation=<factory>, clip=<factory>, remap=<factory>, modifier=<factory>)[source]
Bases:
IOManagedRPUConfig
Configuration for an analog tile that is used only for inference.
Training is done in hardware-aware manner, thus using only the non-idealities of the forward-pass, but backward and update passes are ideal.
During inference, statistical models of programming, drift and read noise can be used.
- Parameters:
tile_class (Type) –
runtime (RuntimeParameter) –
pre_post (PrePostProcessingParameter) –
tile_array_class (Type) –
mapping (MappingParameter) –
forward (IOParameters) –
noise_model (BaseNoiseModel) –
drift_compensation (BaseDriftCompensation | None) –
clip (WeightClipParameter) –
remap (WeightRemapParameter) –
modifier (WeightModifierParameter) –
- backward: IOParameters
perfect.
- Type:
Input-output parameter setting for the backward direction
- clip: WeightClipParameter
Parameter for weight clip.
If a clipping type is set, the weights are clipped according to the type specified.
Caution
The clipping type is set to
None
by default, setting parameters of the clipping will not be taken into account, if the clipping type is not specified.
- compatible_with(tile_class_name)[source]
Tests whether the RPUConfig is compatile with a given
TileModule
class.- Parameters:
tile_class_name (str) – name of the TileModule class
- Returns:
Whether the class is compatible. By default only the class that is defined in the
tile_class
property of the RPUConfig- Return type:
bool
- device: IdealDevice
ideal device.
- Type:
Parameter that modify the behavior of the pulsed device
- drift_compensation: BaseDriftCompensation | None
For compensating the drift during inference only.
- forward: IOParameters
Input-output parameter setting for the forward direction.
This parameters govern the hardware definitions specifying analog MVM non-idealities.
Note
This forward pass is applied equally in training and inference. In addition, materials effects such as drift and programming noise can be enabled during inference by specifying the
noise_model
- modifier: WeightModifierParameter
Parameter for weight modifier.
If a modifier type is set, it is called once per mini-match in the
post_update_step
and modifies the weight in forward and backward direction for the next mini-batch during training, but updates hidden reference weights. In eval mode, the reference weights are used instead for forward.The modifier is used to do hardware-aware training, so that the model becomes more noise robust during inference (e.g. when the
noise_model
is employed).
- noise_model: BaseNoiseModel
Statistical noise model to be used during (realistic) inference.
This noise models establishes a phenomenological model of the material which is applied to the weights during inference only, when
program_analog_weights
ordrift_analog_weights
is called.
- remap: WeightRemapParameter
Parameter for remapping.
Remapping can be enabled by specifying a remap
type
. If enabled, it ensures that the weights are mapped maximally into the conductance units during training. It will be called after each mini-batch.
- tile_array_class
Tile class used for mapped logical tile arrays.
alias of
TileModuleArray
- tile_class
Tile class that corresponds to this RPUConfig.
alias of
InferenceTile
- update: UpdateParameters
NONE
pulse type.- Type:
Parameter for the update behavior
- class aihwkit.simulator.configs.configs.SingleRPUConfig(tile_class=<class 'aihwkit.simulator.tiles.analog.AnalogTile'>, runtime=<factory>, pre_post=<factory>, tile_array_class=<class 'aihwkit.simulator.tiles.array.TileModuleArray'>, mapping=<factory>, forward=<factory>, backward=<factory>, update=<factory>, device=<factory>)[source]
Bases:
IOManagedRPUConfig
Configuration for an analog (pulsed device) resistive processing unit.
- Parameters:
tile_class (Type) –
runtime (RuntimeParameter) –
pre_post (PrePostProcessingParameter) –
tile_array_class (Type) –
mapping (MappingParameter) –
forward (IOParameters) –
backward (IOParameters) –
update (UpdateParameters) –
device (PulsedDevice) –
- device: PulsedDevice
Parameter that modify the behavior of the pulsed device.
- tile_array_class
Tile class used for mapped logical tile arrays.
alias of
TileModuleArray
- tile_class
Tile class that corresponds to this RPUConfig.
alias of
AnalogTile
- class aihwkit.simulator.configs.configs.TorchInferenceRPUConfig(tile_class=<class 'aihwkit.simulator.tiles.inference_torch.TorchInferenceTile'>, runtime=<factory>, pre_post=<factory>, tile_array_class=<class 'aihwkit.simulator.tiles.array.TileModuleArray'>, mapping=<factory>, forward=<factory>, noise_model=<factory>, drift_compensation=<factory>, clip=<factory>, remap=<factory>, modifier=<factory>, simulator_tile_class=<class 'aihwkit.simulator.tiles.torch_tile.TorchSimulatorTile'>)[source]
Bases:
InferenceRPUConfig
TorchInference configuration.
This configuration defaults to a tile module implementation that supported a subset of functions of the
InferenceRPUConfig
but uses native torch instead of the RPUCuda library for simulating the analog MVM.The advantage is that autograd is more fully supported and hardware aware training is more flexible to be modified. However, some nonidealities are not supported.
Note
For features that are not supported a
NotImplementedError
or aTorchTileConfigError
is raised.- Parameters:
tile_class (Type) –
runtime (RuntimeParameter) –
pre_post (PrePostProcessingParameter) –
tile_array_class (Type) –
mapping (MappingParameter) –
forward (IOParameters) –
noise_model (BaseNoiseModel) –
drift_compensation (BaseDriftCompensation | None) –
clip (WeightClipParameter) –
remap (WeightRemapParameter) –
modifier (WeightModifierParameter) –
simulator_tile_class (Type) –
- simulator_tile_class
alias of
TorchSimulatorTile
- tile_array_class
Tile class used for mapped logical tile arrays.
alias of
TileModuleArray
- tile_class
Tile class that corresponds to this RPUConfig.
alias of
TorchInferenceTile
- class aihwkit.simulator.configs.configs.TorchInferenceRPUConfigIRDropT(tile_class=<class 'aihwkit.simulator.tiles.inference_torch.TorchInferenceTile'>, runtime=<factory>, pre_post=<factory>, tile_array_class=<class 'aihwkit.simulator.tiles.array.TileModuleArray'>, mapping=<factory>, forward=<factory>, noise_model=<factory>, drift_compensation=<factory>, clip=<factory>, remap=<factory>, modifier=<factory>, simulator_tile_class=<class 'aihwkit.simulator.tiles.torch_tile_irdrop_t.TorchSimulatorTileIRDropT'>)[source]
Bases:
TorchInferenceRPUConfig
Inference configuration using time-dependent IR drop.
This configuration defaults to a tile module implementation that supported a subset of functions of the
InferenceRPUConfig
but uses native torch instead of the RPUCuda library for simulating the analog MVM.The advantage is that autograd is more fully supported and hardware aware training is more flexible to be modified. However, some nonidealities are not supported.
Note
For features that are not supported a
NotImplementedError
or aTorchTileConfigError
is raised.- Parameters:
tile_class (Type) –
runtime (RuntimeParameter) –
pre_post (PrePostProcessingParameter) –
tile_array_class (Type) –
mapping (MappingParameter) –
forward (IOParametersIRDropT) –
noise_model (BaseNoiseModel) –
drift_compensation (BaseDriftCompensation | None) –
clip (WeightClipParameter) –
remap (WeightRemapParameter) –
modifier (WeightModifierParameter) –
simulator_tile_class (Type) –
- forward: IOParametersIRDropT
Input-output parameter setting for the forward direction.
This parameters govern the hardware definitions specifying analog MVM non-idealities.
Note
This forward pass is applied equally in training and inference. In addition, materials effects such as drift and programming noise can be enabled during inference by specifying the
noise_model
- simulator_tile_class
alias of
TorchSimulatorTileIRDropT
- class aihwkit.simulator.configs.configs.UnitCellRPUConfig(tile_class=<class 'aihwkit.simulator.tiles.analog.AnalogTile'>, runtime=<factory>, pre_post=<factory>, tile_array_class=<class 'aihwkit.simulator.tiles.array.TileModuleArray'>, mapping=<factory>, forward=<factory>, backward=<factory>, update=<factory>, device=<factory>)[source]
Bases:
IOManagedRPUConfig
Configuration for an analog (unit cell) resistive processing unit.
- Parameters:
tile_class (Type) –
runtime (RuntimeParameter) –
pre_post (PrePostProcessingParameter) –
tile_array_class (Type) –
mapping (MappingParameter) –
forward (IOParameters) –
backward (IOParameters) –
update (UpdateParameters) –
device (UnitCell | TransferCompound) –
- device: UnitCell | TransferCompound
Parameter that modify the behavior of the pulsed device.
- tile_array_class
Tile class used for mapped logical tile arrays.
alias of
TileModuleArray
- tile_class
Tile class that corresponds to this RPUConfig.
alias of
AnalogTile