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

Weight refresh for one-sided materials like PCM #209

Merged
merged 2 commits into from
Apr 21, 2021
Merged

Weight refresh for one-sided materials like PCM #209

merged 2 commits into from
Apr 21, 2021

Conversation

maljoras
Copy link
Collaborator

Related issues

#208

Description

  1. To model PCM-like uni-directional materials in training mode realistically, we need to have a one sided unit cell, where the positive update is done on one and negative update on the other device and the effective weight is the difference of these two. This was available as the DifferenceUnitCell previosuly. However, since that caused quite some confusion, here it is renamed to OneSidedUnitCell and the underlying rpucuda device to OneSidedRPUDevice accordingly.

  2. Since the two devices comprising the OneSidedUnitCell cell have only positive updates, they will quickly saturate. It thus needs a refresh mechanism, which we provide in this PR. The refresh is here implemented as a full weight refresh every refresh_every vector operations (MACS), (however: at most once per mini-batch for CUDA). Refresh is done by:
    a. Reading pos an neg device weight using an analog forward pass with unit vectors (defined in refresh_forward)
    b. Determining whether weight needs to be refreshed (by comparing to refresh_upper_thres and refresh_lower_thres)
    c. Resetting those weights which need refresh (with device-to-device and cycle-to-cycle variation setting reset_dtod, reset_std, respectively)
    d. Rewrite the difference to one of the devices using the update pass given in refresh_update. Note that this is an open-loop write, and thus might result in significant errors.

Example:
image

Details

@maljoras maljoras self-assigned this Apr 20, 2021
@maljoras maljoras requested a review from diego-plan9 April 20, 2021 18:08
@maljoras maljoras added the enhancement New feature or request label Apr 20, 2021
@diego-plan9 diego-plan9 merged commit bf9dade into IBM:master Apr 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants