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

RESET function update #1

Open
YigitDemirag opened this issue Sep 19, 2021 · 0 comments
Open

RESET function update #1

YigitDemirag opened this issue Sep 19, 2021 · 0 comments

Comments

@YigitDemirag
Copy link
Owner

YigitDemirag commented Sep 19, 2021

We noticed a minor bug in the initial version of the 'xbar.reset()` function. This bug is an implementation error, and the paper results are obtained using this old version of the function.

Specifically, the bug causes the device to prevent reinitialization of the programming time variable,tp, to the time of application of the RESET pulse and instead reinitialises tp to 0.

This bug is not so critical because, during e-prop training experiments, we always SET the PCM device just after applying a RESET pulse, which has been updating (hence correcting) the tp variable.

Old version (used in the paper)

    def reset(self, mask, G0=0.1):
        self.Pmem[mask] = 1
        self.tp[mask] = 0 
        self.count[mask] = 0
        self.G[mask] = torch.normal(G0, G0 * 0.1, ((torch.sum(mask),)), device=self.device).clamp(1e-2, self.Gmax)
        self.tracker[mask[:,0,:,:]] = 0 

Corrected version

    def reset(self, tp, mask, G0=0.1):
        ''' Emulates a masked RESET operation on the PCM crossbar.

        Args:
            mask : Mask for selecting PCM device
            G0   : Initial conductance value
        '''
        self.Pmem[mask] = 1
        self.tp[mask] = tp # Please read Issue #1 for more details regarding the change in this line for replication of the results. 
        self.count[mask] = 0
        self.G[mask] = torch.normal(G0, G0 * 0.1, ((torch.sum(mask),)), device=self.device).clamp(1e-2, self.Gmax)
        self.tracker[mask[:,0,:,:]] = 0 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant