Mathematical-Write: a counterpoint of analog computing
crossbars exemplified by photonics
Raphael Cardoso1∗ , Clément Zrounba1 , Mohab Abdalla12 , Paul Jimenez1 , Mauricio Gomesde Queiroz1 , Fabio Pavanello1 , Ian O’Connor1 , Sébastien Le Beux3
1. Univ. Lyon - CNRS, Ecole Centrale de Lyon, INSA Lyon, Université Claude Bernard Lyon 1, CPE Lyon - INL,
UMR5270 - Écully, F-69134, France
2. Integrated Photonics and Applications Centre (InPAC), School of Engineering, RMIT University, Melbourne, VIC
3000, Australia
3. Department of Electrical and Computer Engineering, Concordia University - Montreal, Canada*raphael.cardoso@ec-lyon.frSummary. In this work, we propose a new paradigm as alternative to analog computing crossbars forneuromorphic applications, in which the output result is written to memory as part of the operation.
This leads to energy savings in terms of data movement, and further allows systems that integrate
both learning (writing) and inferencing (reading) in the same circuit. Our results indicate thatmathematical-Write can lead to a 33% energy reduction when performing convolution in memory.

As new AI models surpass the count of one billion parameters being processed by sequences of multiplications and accumulations (MACs), their energy consumption grows exponentially due to the costly
data movement between processor and memory. Consequently, new analog computing architectures havebeen explored to accelerate and increase the energy efficiency of MACs while using non-volatile memory
technologies (FeFET, PCM, ReRAM) [1]. Equivalents of electronic crossbars can also be seen in photonics, with its basic cell illustrated by Fig. 1a. In such cells, multiplication is performed by encoding
one operand as the intensity of an optical pulse, while the other is the optical transmission through aphase-change material (PCM) [2]. This multiplication is analogous to a memory readout, where a pulse
with fixed known power is used, and by verifying the output power it is possible to infer the value stored
in memory. In an analog crossbar, the input power carries extra information, so the output will represent
the product between input and stored values. Such method, to which we refer as mathematical-Read(m − R), allows high-speed MACs with low energy consumption if the input stored in the non-volatiledevice is constant. However, if the operation results are to be used elsewhere, they will be written toRAM, spending more energy to move and write data.

input Bb

amplitude
modulator
n-bit

PCM

waveguide

PinTransmission (TPCM)

Pout = Pin × TPCM

input A
input Bc

input A

0.98

Amorphous
0.86

010

2030

4050

60

Crystalline

SNG

input B

00101011

00101010

10111110
SNG
6/8 = 0.75

SNG
1-bit

Pout+

3/80.375

4/8 = 0.5

SNG1-bitd+37654Amorphous %a input A3/8210A 0 0 1 0 1 0 1 1 = 0.5
B 1 0 1 1 1 1 1 0 = 0.75
timeFigure 1: (a) mathematical-Read cell in photonics based on PCMs [2]; (b) primitive for stochastic multiplication, in which the output probability is the product of the input probabilities; (c) mathematical-Writecell in photonics based on PCMs [3]; (d) incremental accumulation between PCM state changes.
In this paper, we propose a different paradigm: mathematical-Write (m − W ), where both inputs aresent to a memory cell that performs the operation and writes the result at the same time. One possible
implementation was proposed in [4], treating optical PCMs as an abacus. Alternatively, we recently
proposed a cell based on stochastic computing [3], as illustrated in Fig. 1b-d. In this case, the opticalpulses have only two levels (low and high), and the pulse power must be carefully chosen such that astate change will be triggered in the PCM only when two inputs are high simultaneously (logical AND).
Furthermore, each new state change accumulates on the previous, as shown by Fig. 1d, for a maximumof 2nb − 1 increments per product, where nb is the bit encoding. This cell can be included in circuits
capable of convolution, as shown in Fig. 2a.

abMemory banks
BA

photodiode

Memorycontrol

12

grating coupler(optical I/O)

SNG
B

E-O Control
Laser

4c

Energy economy (%)

SNGAIN/OUT control

3Registerbank# of moved bits # of written bits
m-R
m-W
m-R
m-W
N2nb
- N2nb+M2nb
N2nb
N2nb
2N2nb
N2nb
2N2nbM nb
N2nb
06050

Ewrite= 40 pJ
Emove= 10 pJ

403020

PCM technology
improvements

264
Ewrite/Emove

810Figure 2: (a) Augmented optical PCM memory bank, capable of convolution between a matrix A and akernel B; (b) number of bits moved and written for m − R and m − W as function of the operand sizes
and bit encoding; (c) total energy saved by m − W in its best case as the cost of write is reduced.
Our idea is therefore to augment optical PCM memory banks, such as the one in [5], with m − W ,resulting in the architecture shown in Fig. 2a. To assess the possible gains of such architecture, wecompare m − W with m − R in photonics. The number of data movements and memory writes in bothmethods is shown in Fig. 2b in a convolution between an M × M matrix and an N × N kernel using
nb bits encoding for different cases: 1 none of the inputs are stored in memory; 2 only the kernel ispreviously stored (this is always the case in m − R); 3 only the input matrix is previously stored; 4 both
inputs are previously stored. A unique characteristic of m − W is that it can bring the data movement
between memory and processor (or accelerator) down to zero in case 4 .
After including the energy costs of Ewrite to write a bit and Emove to move a bit, using an encodingof nb = 4, we realized that the total energy cost is independent of the operand sizes, depending only on
the ratio between Emove and Ewrite . This analysis assumes: i) Emove and Ewrite dominate the energy
consumption per bit; ii) both methods use the same underlying memory technology, iii) each increment in
Fig. 1d costs nb Ewrite /(2nb − 1), amounting to Ewrite per written bit of information, iv) the convolution
result remains in nb = 4 encoding. Under these assumptions, using realistic energy costs of Ewrite = 40
pJ [5] and Emove = 10 pJ, it is possible to achieve a 33% reduction in the best case ( 4 ) for m − W asshown in Fig. 2c. Even larger reductions are possible as Ewrite is improved from better PCM technology.
These results illustrate the biggest advantage of mathematical-Write: after performing the operation,
there is no need to move the data and store it somewhere else, as it is automatically stored in the PCM
cells. The proposed method also represents a change of paradigm, allowing the creation of new hybridarchitectures that may be used in writing or reading mode as necessary, that could be useful for on-chiptraining. Lastly, the proposed strategy is not restricted to PCMs in photonics, but can also be applied
to other non-volatile electronic technologies.

References[1] A. Shafiee, A. Nag, N. Muralimanohar, R. Balasubramonian, J. P. Strachan, M. Hu, R. S. Williams,and V. Srikumar, “Isaac: A convolutional neural network accelerator with in-situ analog arithmetic
in crossbars,” ACM SIGARCH Computer Architecture News, vol. 44, no. 3, pp. 14–26, 2016.
[2] J. Feldmann et al., “Parallel convolutional processing using an integrated photonic tensor core,”
Nature, vol. 589, no. 7840, pp. 52–58, 2021.
[3] R. Cardoso et al., “Towards a robust multiply-accumulate cell in photonics using phase-change materials,” in 2023 Design, Automation and Test in Europe Conference (DATE), 2023. In press.
[4] J. Feldmann et al., “Calculating with light using a chip-scale all-optical abacus,” Nature communications, vol. 8, no. 1, pp. 1–8, 2017.
[5] A. Narayan, Y. Thonnart, P. Vivet, A. Coskun, and A. Joshi, “Architecting optically controlled phasechange memory,” ACM Transactions on Architecture and Code Optimization, vol. 19, no. 4, pp. 1–26,2022.