-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Major update #512
Merged
Merged
Major update #512
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…nter/aihwkit into IBM-AI-Hardware-Center-release/0.7.0
kkvtran
previously approved these changes
Jun 26, 2023
Signed-off-by: Malte Rasch <[email protected]>
kkvtran
approved these changes
Jun 27, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
AnalogTiles
for increased modularity (TileWithPeriphery
,SimulatorTile
,SimulatorTileWrapper
). Analog tile modules (that might have multiple simulator tiles) are now also torchModule
and used by analog layers. New analog tiles can be customized.CustomTile
TorchInferenceTile
for a fully torch-based analog tile for inference (not using the C++ RPUCuda engine), supporting a subset of MVM nonidealitiesStandardHWATrainingPreset
ReRamWan2022NoiseModel
(see also Noise model fitted and characterized on RRAM devices (programming noise and output-referred read noise) #394)analog_model.analog_tiles()
now loops over all available tiles (in all modules)analog_layers()
loops over layer modules (exceptAnalogSequential
) and is replacinganalog_modules()
build_rpu_config
script for generatingRPUConfigs
for analog in-memory SGDRPUConfig
related things fromaihwkit.simulator.config
convert_to_digital
utilityconvert_to_analog
now also considered mapping. Setmapping.max_out_size = 0
andmapping.max_out_size = 0
to avoid this.TileModuleArray
for logical weight matrices large than a single tile. Mapped layers now use this tile arrayutils.legacy_load
provides a way to load old checkpointsrealistic_read_write
is removed from some high-level function. Useprogram_weights
(after setting the weights) orread_weights
for realistic reading (using weight estimation technique).ReRamArrayOMPresetDevice
,ReRamArrayHfO2PresetDevice
,ChoppedTTv2*
,AGAD*
apply_write_noise_on_set
for pulsed devicesSoftBoundsReference
,PowStepReference
for explicit reference subtraction of symmetry point in Tiki-takaoutput_noise_std
)per_batch_sample
weight noise injections forTorchInferenceRPUConfig
Details
make black
for code formatting.FIXED:
Read_weights
could have applied the scales wrongly (if learning of out scaling was used)Now forward is called, not analog_forward. To avoid confusion
analog_forward
is renamed tojoint_forward
as it calledpre_forward
,tile.forward
, andpost_forward
. It applied the mapping scales but not the learnable parts like digital bias and out scaling alpha.ADDED: Output noise per output column support
Here
forward.out_noise_std
parameter is introduced which enables a systematic output-to-output variation of the output noise std dev. This is in relative terms, eg. 0.3 means 30% relative variation aroundout_noise
.The parameter values are drawn at instantiation. However, the can be modified, eg.:
CHANGED: Generators
analog_modules
generator loops through allAnalogModuleBase
instances includingAnalogSequantial
,AnalogWrapper
analog_layers
generator loops through allAnalogModuleBase
instances excludingAnalogSequantial
,AnalogWrapper
ADDED: Plot the error for a particular device
Each analog training tile has the
program_weights
method which uses SGD and pulsed update to program the weights using the device properties. This can be used to make a weight error plot which could be compared to inference results with the phenomenologicalnoise_model
.Example:
This would produce:

ADDED: presets for new training algorithms and convenient way to define new presets
Here a new function is added to generate presets for any analog training algorithm and device.
For example,
would generate a valid configuration for training
algorithm
which could besgd
,tiki-taka
,ttv2
,mp
,c-ttv2
, oragad
ADDED: Torch inference tile
It was hard to make quick changes to the c++ backend, and we, therefore, created a pure torch-based version.
Added code for a pure torch-based tile. However, note that it supports only a subset of all non-idealities of the RPUCuda based tile.