Skip to content
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

synaptic bit-slicing #287

Open
saba-er opened this issue Sep 15, 2021 · 4 comments
Open

synaptic bit-slicing #287

saba-er opened this issue Sep 15, 2021 · 4 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@saba-er
Copy link

saba-er commented Sep 15, 2021

Hi,
I was wondering if and how synaptic bit-slicing is supported by the simulator? For example, the needed weight precision is 4 bits but the device only supports 2 bits and hence you need to use 2 devices per synaptic weight. Then, the analog computation (e.g. multiplication) will take into account the fact that the two devices combined represent a single weight (might be partially handled in the digital periphery?).

@maljoras maljoras added enhancement New feature or request good first issue Good for newcomers labels Sep 15, 2021
@maljoras
Copy link
Collaborator

maljoras commented Sep 15, 2021

Hi @SaBaKa2020 ,
thanks again! Currently, the simulator does not do bit-slicing in the way you are describing it by default, however, this is definitely on our roadmap to add tools to support that in a convenient way. With the VectorUnitCell multiple devices per crosspoint can be used, as well as a significance factor, however, the currents would always be added up "in analog" i.e. before the ADC.

Having said this, it is actually very easy to build your own bit slicing layer that sums the outputs of the weight slices in digital: You could just define an new module (e.g. AnalogLinearBitSlicing) that internally has two analog tiles, e.g. linear_1 = AnalogLinear() and linear_2 = AnalogLinear() and combine the output in the forward method, e.g. y = linear_1(x) + factor * linear_2(x). In case you would implement it in this way, we would highly appreciate if you would contribute it to the toolkit by making pull request!

@HeatPhoenix
Copy link
Contributor

Hi @SaBaKa2020 , thanks again! Currently, the simulator does not do bit-slicing in the way you are describing it by default, however, this is definitely on our roadmap to add tools to support that in a convenient way. With the VectorUnitCell multiple devices per crosspoint can be used, as well as a significance factor, however, the currents would always be added up "in analog" i.e. before the ADC.

@maljoras, can a VectorUnitCell setup be combined with, say, InferenceRPUConfig in the sense of rpu_config contains a vector of devices -> with each device is (inference only w/ a given noise model) contributing a part of the full weight. In other words, can we achieve this bit-slicing within an inference only setup?

I could not find an example describing such a usage, only this example.

@HeatPhoenix
Copy link
Contributor

Opened a pull request in #631 to hopefully help implement this and solve this issue.

@maljoras-sony
Copy link
Contributor

maljoras-sony commented Oct 8, 2024

VectorUnitCell is more meant to explore multiple devices during in-situ training, that are also combine currents before the ADC conversion. The example I gave above using AnalogLinaer would do the gradient through the bit-sliced layers. On the other hand, if the ConductanceConverter of InferenceRPUConfig is used (where one could also use multiple weight slices), then the slicing is done after convergence (that is training the DNN without the bit-sliced weights). So these are all valid approaches, but slightly different concepts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

5 participants