Modular Simulation Framework for Process Variation Analysis of MRAM-based Deep Belief Networks

Magnetic Random-Access Memory (MRAM) based p-bit neuromorphic computing devices are garnering increasing interest as a means to compactly and efficiently realize machine learning operations in Restricted Boltzmann Machines (RBMs). When embedded withi…

Authors: Paul Wood, Hossein Pourmeidani, Ronald F. DeMara

Modular Simulation Framework for Process Variation Analysis of   MRAM-based Deep Belief Networks
Abs tra ct — Magne tic Random -Ac ces s Memor y (MRA M) based p- bit neu rom orph ic com puti ng devi ce s are garner ing incr ea sing int er est as a means to com pac tly and effic ie ntly re aliz e machi ne le arni ng ope rat ions i n Re str icte d Bol tzm ann Mac hin es (R BMs) . Whe n embe dde d wit hin an RB M res ist ive c ros sba r arra y, the p-bi t bas ed ne uron r eal ize s a tuna ble si gmoid al ac tiv atio n f unc tio n. Si nce the stoc has tici ty of act iva tion is depe nde nt on th e ener gy bar rie r of the MRA M devi ce, it is es sent ial to as se ss th e imp act of proc ess var iati on on the volt age -de pe ndent beha vior of the sigmo id fu nct ion . Ot her in flue nti al per for manc e fac tor s aris e from varyin g ene rgy bar rie rs on powe r consu mpti on req uir ing a si mula tion en vir onme nt to fac ilit ate t he multi- obj ect ive optim iza tion of de vic e and networ k par amet er s. He re in, t ran spor tabl e Pyt hon scr ipt s ar e dev elo ped to anal yze t he output va ria tion u nder c hang es in de vice dime nsio ns on the ac cur acy of ma chi ne lea rnin g app lic atio ns. Eva luat io n wi th RB M circu its using the MNIST dat ase t reve al impa cts and limit s for pro ce ssin g varia tion of devi ce fa bri cat ion in te rms of the res ult ing ene rg y vs. acc urac y tr ade offs, and t he r es ulti ng s imul atio n fr amew ork is ava ilab le via a Cr eat ive Co mmons li ce nse . Ke ywo rds — Neu rom orph ic Computi ng Hard war e, Python -Scr ipt Dr ive n Simu lati on , Magne ti c Ran dom-A cc es s Memory (MRAM ) De vic e, Stoc has tic Neur on, R estr icte d B oltz man n Ma chi ne (RBM ). I. I NTRODUCTION AND B ACKGROUN D A probabilistic bit (p-bit) device is a two-terminal voltage - controlled Magnetic Random -Access Memory (MRAM) component realizing a sigmoidal ac tivation function as an artificial neuron suitable for machine lear ning applicatio ns such as Restricted Boltzmann Machine s (RBMs ) [1]. A p-bit is formed by combining a common sou rce NMOS transistor with an in -plane MTJ ( IMTJ) between V DD and th e dr ain of the NMOS transistor followed by a CMOS inv erter. This creates an oscillating voltag e at the drain of the NMOS tr ansistor that can then be pinned to V DD when V IN is V DD or alternatively to ground when V IN is b elow the NMOS thresh old voltage. The sigmoid fu nction is realized via the stochastic ou tput of the p- bit due to t hermal noise induced switching [1]. Deep Belief Networks (DBNs), specifically Restricted Boltzmann Machines ( RBMs), can be p hysically realized b y utilizing a resistive weight crossbar array with a p -bit neuro n to realize the sigmoid al activation function. To date, a simulation framework called Probabilistic Inference Network (PIN -sim) was develo ped in order to create, train, and test RBM circuit models [1 ]. The framework is compo sed of five blocks: 1) TrainDBN: a MATLAB train ing algorithm 2) MapWeight: a MATLAB algorithm used to c onvert neuron weig hts and biases into resistor values 3) MapDBN: a python script that rea lizes the weights and biases into a circu it model 4) Neuron: the SPICE m odel of the p -bit 5) TestDBN: a p ython script that tests the error and power consumptio n of the DBN. To interp ret th e results of the probabilistic reasoning process as a defin itive selection , a co nversion cir c uit is needed to transfo rm the time -varying stochastic analog signal into a digital ou tput such as a Probabilistic Infer ence Recoder (PIR) . While functionally simil ar to an Analog Dig ital Converter ( ADC ), PIR circuits realize sign ificant area and power consumptio n reduction of 48% and 74% versus ADCs, respectively [2]. T o achieve pr actical fabrication of m achine learning hardware , it is of particular interest to analy ze how RBM models using PIR cir cuits beh ave in the presence of manufacturing variations p revalent at the 45nm process node and b elow . Herein, a Py thon script-based simulation framework was develop ed to extend PIN-sim that invo kes SPICE neuron models at different ener gy barriers and collates the data into a format suitable for the designer to balance tradeoffs invo lved . II. P YTHON -D RI VEN S IMULATION F RAMEWOR K The goal with this script is to gather data on h ow process variation will affect th e energy barr ier o f the MTJ, thus changing the realization of the sigmoid function and potentially adverse effects to energy consumptio n. The Python script invokes SPICE to gather ou tpu ts un der consecutiv e voltage data points applied to the p-bit device as shown in Figure 1. Given a SPICE n euron f ile with the small magnetic anisotropy field , H K , defined in the parameter file, the script c hanges H K v alues based on the propagated energy barrier value . It then runs the simulation while piping the bash out put to a text file in case of any SPICE errors . Finally, it extracts the neuron output voltage data points and collates them within the results text file. Multiple energy barrier values can be run sequentially if a te xt file containing a list of en ergy barrier s with each entry is passed as an argum e nt to the script. Figure 1 : MTJ Energy barrier simulation using Python scripting. Modular Simula tion Framework for Process V ariation Analysis of MRAM-ba sed Deep Belief Networ ks Paul Wood , Ho ssein Pourmeidani, and Ron ald F. DeMara Department o f Electrical and Computer Engineer ing University of Central Florida , Orlan do, FL 32816-236 2 pwood9 @kni ghts.ucf .e du , hossein.pourmeidani@knigh ts.ucf.edu , and r onald.dem ara@ucf.edu Data po ints can then be plo tte d in MATLAB to view the effect that the energy barrier has on th e realization of the sigmoid activation f unction. The formula used by th e Python script f or calculating the energy barrier , E b , is:           (1) where V is th e volume an d M S is the magnetiza tion saturatio n of the MTJ. The pseu docode for th e scri pt is identified in Algorithm 1 . Algorithm 1 : Effect of Process Variation on th e MTJ Sigmoid Activation Fu nction Realization Input: energy barriers, neuron source file Output: neu ron output voltage for each energy barrier, E: calculate         search for “HK = “ in SPICE code replace anisotr opy field value with calculated value run SPICE simulation pip ing bash output to text file search for voltag e output and write to results file Another tool developed was a Python script to aid testing of the DBN’s accurac y with th e MNIST dataset. The development o f these scripts extends PIN-sim and will aid future developm e nt and testing of p-bit based, DBN networks wi th a PIR digitization ou tput stage. III. MNIST D ATASET E VALUATION To analyze the performance of the PIR circuit, a Pyth on script was developed to compare th e large amounts o f data commonly found in machine learning datasets. This accuracy analysis script operated as follows : first, it reads one line of the MNIST dataset f ile to find the expected output for that testcase and the testcase label. Secondly, it locates each instance of th e testcase label in the PIR output file. Third , it reads the neuron data into a list until it en counters the subsequent case. Upon finding the next testcase, all the neurons for the current testcase have been read and now can be pr ocessed. The list is sorted by constituent prob abilities fro m high to low. Nex t, the f irst two neurons are examin ed to see if eith er of them is the neuron indicating the expected o utput from t he MNIST dataset. If any output digit neuron subsequent to the top two neur ons have the same probability, t hen the output of th e PIR circuit counts as a fail ev en if the expected outp ut was within the top two confiden ce selection s, whereas the circuit was no t able to tell a clear difference between which neuron was co rrect. If the expected outpu t was a neuron in the top two likelihood categori es , th en the testcase is regarded as a pass . The p rocess is repeated until either file r eaches its end . Upon fin ishing all testcases, then th e total number of testcase passes and failures are tabulated so that the overall error rate is determined . The corresp on ding pseudocode is listed in Algorithm 2. The script was tested by compar i ng the error rat es generated against p revious work s [2]. Nam ely, the script was fed outputs o f a PIR circu it with 100 testcases and the MNIST dataset. The resu lts obtained are listed in Table I. Algorithm 2 : MNIST DBN Performan ce Analysis Input: MNIST dataset, PI R output Output: nu mber of testcases that passed/failed for each testcase for each neu ron append neuron data to lis t sort list by n e uron probab ili ty high t o low if the expected outpu t was i n the to p two neurons AND its probability do es n’t match any neurons beyond the top two neurons then testcase passes else testcase fails Table I : Op timization of precision, area, and accuracy for handwritten digit recognition using MN IST dataset. PIR Precision Energy Consump tion Error Rate 3 bits 90.75 fJ 24% 4 bits 124.2 fJ 17% 5 bits 176.0 fJ 18% IV. C ONCLUSION MRAM-based p- bit neuromorp hic arch itectures offer an emerging device approach to realize true intrinsic machine learning within accelerators and IoT edge d e vices . A simulation framework using Py thon scripts can thoroug hly address two important areas requ iring an alysis prior to fabricatio n: effects of the variation on the p-bit sigmo id functio n and network optimization for accu racy vs area using an appropriate an alog signal digitization strategy, su ch as a PIR circut. Because the p- bit’s stochasticity is depen dent o n oxide barrier thickness, a one script ran a SPICE script multiple times, each changing the magnetic anisotropy f ield determined b y the oxide thickness and thus permu tin g the energy barrier as a process variatio n yielding repeatable results to the desire d conf idence interval. The resulting simu lation framework is transportable, adaptable, and av ailable to other machine learning researchers via a Creative Common s license upon request to the authors. A CKNOWLEDG MENTS This work was supported in p art by the Center fo r Probabilistic Sp in Lo gic for Lo w-Energy Boolean and Non- Boolean Computing ( CAPSL), one of the Nanoelectronic Computing Research ( nCORE) Centers as task 2759.006, a Semiconducto r Research Corporatio n (SRC) p rogram sponsored by the NSF through CCF- 1739635. R EFERENCES [1] R. Za nd, K. Y. Camsari, S. Datta, and R. F. DeMara, “Composable Probabilistic Inference Networks Using MRAM-based Stochastic Neurons,” ACM Journal on Emerging Technologies in C om puting Systems, Vol. 15, No. 2, June 20 19. [2] H. P ourmeidani, S. Sh eik hfaal, R. Zand, and R. F . De Mara, "P robabilistic Interpolation Recoder for Energy-Error-Produc t Efficient DBNs with p - bit Devices," IEEE Tr ansactions on Emergin g Topics in Computin g, 2020.

Original Paper

Loading high-quality paper...

Comments & Academic Discussion

Loading comments...

Leave a Comment