Added a notebook on device non_idealities
Description
Phase-change memory devices have found applications in in-memory computing where the physical attributes of these devices are exploited to compute in places without the need to shuttle data between memory and processing units. However, “device nonidealities” in the electrical resistance have a detrimental impact on the achievable computational precision. In this tutorial, we will learn about these non-idealities. We will specifically look into each non-ideality and how they impact computational precision. We will also discuss the software correction schemes to reduce their impact.
Details
- Notebook example added
Many thanks for the contribution, @GhaziSyed !
Could write a quick summary above what your PR is about? Thanks!
Phase-change memory devices have found applications in in-memory computing where the physical attributes of these devices are exploited to compute in places without the need to shuttle data between memory and processing units. However, “device nonidealities” in the electrical resistance have a detrimental impact on the achievable computational precision. In this tutorial, we will learn about these non-idealities. We will specifically look into each non-ideality and how they impact computational precision. We will also discuss the software correction schemes to reduce their impact.
Hi @kaoutar55
Thanks for the nice feedback. I created a pull request, but realized I did not address all your comments yet. Please ignore the request as I am working on the newer version
I have added the updated file now.
Thanks @GhaziSyed for the updates. Can you please fix the signify issue so we can merge your notebook. Here is how to fix it: https://github.com/IBM/aihwkit/pull/437/checks?check_run_id=9931546596
Thanks and Done !
To be more specific one could show how to write a new class based on the BaseNoiseModel e.g.
from aihwkit.inference.noise.pcm import PCMLikeNoiseModel
class MyPCMNoiseModel(PCMLikeNoiseModel):
def generate_drift_coefficients(self, g_target):
# define new nu coefficients like you did
def apply_programming_noise_to_conductance(g_target):
# define programming noise like you did
and then one could use that model with
my_noise = MyPCMNoiseModel()
noise_weights = my_noise.apply_noise(weight, t_inference=3600.0)
Or use that directly to generate tiles / or modules e.g.
from aihwkit.simulator.tiles.inference import InferenceTile
from aihwkit.simulator.config import InferenceRPUConfig
rpu_config = InferenceRPUConfig(noise_model=MyPCMNoiseModel())
analog_tile = InferenceTile(50, 50, rpu_config=rpu_config)
analog_tile.set_weights(randn(50,50))
analog_tile.program_weights() # applied noise model
analog_tile.forward(x) # forward pass with applied programming noise + other non-idealities
Or just using a linear module instead of an InferenceTile (a module could have multiple tiles):
from aihwkit.nn import AnalogLinear
rpu_config = InferenceRPUConfig(noise_model=MyPCMNoiseModel())
linear = AnalogLinear(50, 50, rpu_config=rpu_config)
linear.drift_analog_weights(t_inference=100.0)
y = linear(x)
Hi! @GhaziSyed Thank you for all the work done, we are reviewing the open PR and we have noticed that this PR has been unanswered for 2 years, would you be interested in addressing the changes suggested by @maljoras , we could help you with them if needed.
If not, we would proceed to close at least temporarily this PR, being able to reopen it when you need it.
The PR has been under review for over 3 months. Do you foresee a review happening sooner. Could you please follow up on this soon (we missed some important places to cite the tutorial and do not want to miss another that is end of next week)
Hi @GhaziSyed!! @PabloCarmona is trying to running the notebook and you are getting problems with step 3 it seems that there are some errors in the code and also some problems in the imports. We are trying to run the notebook that you have in the notebooks folder. Another question we have is if the notebook added to an examples folder, is it still valid or is it obsolete? it seems to match in code with the one we found in notebook but it is in notebook that you have been doing the last modifications.
If we solve these problems in step three and we can successfully execute this step, we could close this PR and merge it to master.
Best regards and sorry for the delay
@GhaziSyed is this PR related to the new one you opened? the #682? Let us know to link them and close this one in preference to the new one. Thanks!
@GhaziSyed can we close this since you opened a new PR that is doing the same?
Closed since is outdated and duplicate of https://github.com/IBM/aihwkit/pull/682