Large-scale artificial neural-network accelerators based on coherent detection and optical data fan-out
11604978 · 2023-03-14
Assignee
Inventors
Cpc classification
G06N3/0675
PHYSICS
International classification
Abstract
Deep learning performance is limited by computing power, which is in turn limited by energy consumption. Optics can make neural networks faster and more efficient, but current schemes suffer from limited connectivity and the large footprint of low-loss nanophotonic devices. Our optical neural network architecture addresses these problems using homodyne detection and optical data fan-out. It is scalable to large networks without sacrificing speed or consuming too much energy. It can perform inference and training and work with both fully connected and convolutional neural-network layers. In our architecture, each neural network layer operates on inputs and weights encoded onto optical pulse amplitudes. A homodyne detector computes the vector product of the inputs and weights. The nonlinear activation function is performed electronically on the output of this linear homodyne detection step. Optical modulators combine the outputs from the nonlinear activation function and encode them onto optical pulses input into the next layer.
Claims
1. An optical neural network comprising: a first optical fan-out element to produce M copies of N optical weight signals; a second optical fan-out element to create N copies of M optical input signals; a two-dimensional array of homodyne receivers, in optical communication with the first optical fan-out element and the second optical fan-out element, to produce electronic signals representing interference of each of the N copies of the M optical input signals with a corresponding copy of the M copies of the N optical weight signals; electronic circuitry, operably coupled to the two-dimensional array of homodyne receivers, to apply a nonlinear function to the electronic signals; and a light source, operably coupled to the electronic circuitry, to emit an optical output signal representing a matrix multiplication of the M optical input signals with the N optical weight signals, wherein M and N are positive integers.
2. The optical neural network of claim 1, wherein the first optical fan-out element, the second optical fan-out element, the two-dimensional array of homodyne receivers, the electronic circuitry, and the light source form a convolutional layer in a series of layers in the optical neural network.
3. The optical neural network of claim 2, wherein the series of layers comprises additional convolutional layers and at least one fully connected layer.
4. The optical neural network in claim 2, further comprising: another series of layers to compute a matrix multiplication of the N optical weight signals with another M optical input signals.
5. The optical neural network of claim 1, wherein Nis about 1,000 to about 10,000,000.
6. The optical neural network of claim 1, wherein the N copies of the M optical input signals propagate in free space between the second optical fan-out element and the two-dimensional array of homodyne receivers.
7. The optical neural network of claim 1, wherein each optical input signal encodes a vector of length N and each corresponding optical weight signal represents a row of a weight matrix.
8. The optical neural network of claim 1, wherein each homodyne receiver in the two-dimensional array of homodyne receivers comprises: a two-port beam splitter to interfere the copy of the corresponding optical input signal and the corresponding optical weight signal; and a differential detector, in optical communication with the two-port beam splitter, to detect light emitted by outputs of the two-port beam splitter.
9. The optical neural network of claim 1, wherein the electronic circuitry comprises: an array of analog-to-digital converters (ADCs), each ADC in the array of ADCs operably coupled to a corresponding homodyne receiver in the two-dimensional array of homodyne receivers comprises and configured to digitize the electronic signal emitted by the corresponding homodyne receiver; and digital logic, operably coupled to the array of ADCs, to apply the nonlinear function to the electronic signals from the array of ADCs; and an array of digital-to-analog converters (DACs), operably coupled to the digital logic and the light source, to convert the electronic signals into analog signals for modulating the light source.
10. The optical neural network in claim 1, further comprising: an array of optical modulators to modulate copies of an optical pulse train with weights representing a corresponding row in a weight matrix to produce the N optical weight signals.
11. The optical neural network in claim 1, further comprising: a beam splitter, in optical communication with the first optical fan-out element and the second optical fan-out element, to combine each of the N copies of the M optical input signals with the corresponding copy of the M copies of the N optical weight signals.
12. A method of computing an output of a layer of an optical neural network, the method comprising: producing N optical weight signals, where N is a positive integer; producing M copies of the N optical weight signals, where M is a positive integer; creating N copies of M optical input signals; transducing, with an array of homodyne receivers, interference of each of the N copies of the M optical input signals with a corresponding copy of the M copies of the N optical weight signals into electronic signals; applying a nonlinear function to the electronic signals; and emitting an optical output signal representing a matrix multiplication of the M optical input signals with the N optical weight signals.
13. The method of claim 12, wherein the layer is a convolutional layer in the optical neural network.
14. The method of claim 12, further comprising: computing a matrix multiplication of the N optical weight signals with another M optical input signals.
15. The method of claim 12, wherein the N copies of the M optical input signals propagate in free space to the array of homodyne receivers.
16. The method of claim 12, wherein each optical input signal encodes a vector of length N and each corresponding optical weight signal represents a row of a weight matrix.
17. A convolutional layer for a coherent optical neural network, the convolutional layer comprising: an image-plane transceiver array to emit an array of input signals; a weight server transmitter array to emit an array of weight signals; a beam splitter, in optical communication with the image-plane transceiver array and the weight server transmitter array, to combine the array of input signals with the array of weight signals; and a Fourier-plane transceiver array, in a Fourier plane of the image-plane transceiver array and in optical communication with the beam splitter, to detect a homodyne product of a spatial Fourier transform of the array of input signals and a spatial Fourier transform of the array of weight signals.
18. The convolutional layer of claim 17, wherein the Fourier-plane transceiver array is configured to emit an array of product signals representing the homodyne product of the spatial Fourier transform of the array of input signals and the spatial Fourier transform of the array of weight signals and the image-plane transceiver array is configured to coherently detect a spatial Fourier transform of the array of product signals.
19. The convolutional layer of claim 17, wherein each transceiver in the Fourier-plane transceiver array is configured to detect an in-phase component and a quadrature component of the product of the spatial Fourier transform of the array of input signals and the spatial Fourier transform of the array of weight signals.
20. The convolutional layer of claim 17, wherein each transceiver in the Fourier-plane transceiver array comprises at least one detector element per output channel of the convolutional layer.
21. A method for fanning out data in a digital optical neural network, the method comprising: for each image in a set of images, the set of images representing an input to a layer in the digital optical neural network, breaking the image into a set of patches, each patch in the set of patches comprising K.sub.x×K.sub.y pixels; and for each patch in the set of patches, spatially convolving the patch with a box function; spatially convolving a corresponding kernel with a size of K.sub.x×K.sub.y with a lattice function having a horizontal lattice spacing of K.sub.x and a vertical lattice spacing of K.sub.y; and imaging the patch and the corresponding kernel onto a detector array.
Description
BRIEF DESCRIPTIONS OF THE DRAWINGS
(1) The skilled artisan will understand that the drawings primarily are for illustrative purposes and are not intended to limit the scope of the inventive subject matter described herein. The drawings are not necessarily to scale; in some instances, various aspects of the inventive subject matter disclosed herein may be shown exaggerated or enlarged in the drawings to facilitate an understanding of different features. In the drawings, like reference characters generally refer to like features (e.g., functionally similar and/or structurally similar elements).
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
(10)
(11)
(12)
(13)
(14)
(15)
(16)
(17)
(18)
(19)
(20)
(21)
(22)
(23)
(24)
(25)
(26)
(27)
(28) .sup.−1 [{tilde over (K)}*{tilde over (x)}])* as part of an optical implementation of the convolution process in
(29)
(30)
(31)
(32)
(33)
(34)
(35)
(36)
(37)
(38)
DETAILED DESCRIPTION
(39) The Detailed Description of this specification is divided into different sections. Section 1 discloses additional details and examples of optical neural network accelerators, including a coherent optical matrix-vector multiplier (
(40) 1. Large-Scale Optical Neural Networks Based on Coherent Detection
(41) A system that performs the matrix-vector multiplication for a neural network optically using coherent (homodyne) detection can be fast, low-power, compact, and readily scalable to large (N≳10.sup.6) numbers of neurons. In contrast to other systems, it encodes both the inputs and weights in optical signals, allowing the weights to be changed on the fly at high speed. The ultra-high data bandwidth of multimode free-space optics and the high pixel density of CMOS photodetectors allows this system to scale to far more neurons than can be supported in nanophotonics. The optical energy consumption is subject to a fundamental standard quantum limit (SQL) arising from the effects of shot noise in the homodyne detectors, which lead to classification errors. Simulations based on MNIST neural networks empirically show the SQL to be 50-100 zJ/MAC. Using realistic laser, modulator, and detector energies, performance at the sub-fJ/MAC level should be possible with present technology. The optical system can be used for both fully connected and convolutional layers. Finally, backpropagation is straightforward to implement in this optical system, allowing both inference and training to be performed in the same optical device.
(42) Coherent Matrix Multiplier
(43)
x.sub.i.sup.(k+1)=ƒ(Σ.sub.jA.sub.ij.sup.(k)x.sub.j.sup.(k)) (1)
This optical processor 100 can work with both fully-connected and convolutional neural-network layers.
(44)
(45) Referring again to
(46) Circuitry 228 coupled to the differential homodyne detectors 226 applies a nonlinear function (e.g., a Sigmoid function) in the electrical domain to each detector output, which are read out and used to serially modulate a light source 230, such as a laser, that emits a coherent optical carrier modulated with the layer output. This circuitry 228 may include an array of analog-to-digital converters (ADCs), an array of digital logic elements, and an array of digital-to-analog converters (DACs). Each ADC is coupled to a corresponding homodyne detector 226 and converts the analog detector output into a digital signal. A corresponding digital logic element applies the nonlinear function to the digital signal, which is then converted back into the analog domain by a corresponding DAC. The resulting analog signal modulates the light source 230 in series with the analog signals from the other DACs in the circuitry 228. This modulated optical signal emitted by the light source 230 becomes the input to the next layer 110 in the optical neural network 100. Alternatively, the electrical-domain outputs from the nonlinear step can be combined and encoded onto the optical domain using optical modulators, producing a pulse sequence that is combined with a fan-in element, such as another beam splitter, fed into the next layer 110 of the deep neural network 100.
(47) The light source 230 in each layer 110 emits light (optical output signals) that is coherent with the light used to generate the optical weights for the subsequent layer 110. More specifically, the light source 230 in layer 110-1 emits light that is coherent with the light used to generate the optical weights in layer 110-2. This allows the weights and optical input signals for a given layer 110 to interfere at the homodyne detectors 226 in that layer 110. This can be accomplished by using a single pulsed laser to generate light that is distributed and modulated to provide weights and optical input/output signals for all of the layers (that is, one laser split 2K ways by a 1×K beam splitter); by using one laser per layer to generate the optical weights and optical input signals for that layer (that is, K lasers, each split two ways, for K layers 110); or by using pairs or arrays of lasers that are coherent with each other.
(48) For a given layer 110, let N and N′ be the number of input and output neurons, respectively. Input (output) data are encoded temporally as N (N′) pulses on a single channel as shown in
(49)
(50) Note that, due to properties of the Fourier transform, it is also possible to the encode the input (output) data in the frequency domain (e.g., in amplitudes of the teeth of a frequency comb) or in a hybrid fashion (e.g., a pulse train combined with wavelength multiplexing).
(51) Here E.sup.(in)(t) and E.sub.i.sup.(wt)(t) are the input and weight fields for receiver i, which are taken to be sequences of pulses with amplitudes proportional to x.sub.j and A.sub.ij, respectively (x.sub.j, A.sub.ij∈) Thus, each receiver 226 performs a vector-vector product between {right arrow over (x)} and a column {right arrow over (A)}.sub.i of the weight matrix; taken together, the N′ electronic outputs give the matrix-vector product A{right arrow over (x)}. Fields are normalized so that power is given by P(t)=|E(t)|.sup.2, and η is the detector efficiency. A serializer 228 reads out these values one by one, applies the nonlinear function ƒ(.Math.) in the electrical domain, and outputs the result to a modulated source 230 to produce the next layer's inputs.
(52) The inset of
(53) Coherent detection greatly simplifies the setup compared to alternative approaches. With a given set of weight inputs, the layer 110 in
(54) The optical neural network accelerator in
(55) Compared to all-electronic neural network processors, such as CMOS integrated circuits, the optical neural network accelerator shown in
(56) The optical neural network accelerator in
(57) Deep Learning at the Standard Quantum Limit
(58) As energy consumption is a primary concern in neuromorphic and computing hardware generally, an optical approach should outperform electronics by a large factor to justify investment in a new technology. In addition, optical systems should show great potential for improvement, e.g., by many orders of magnitude, to allow continued scaling beyond the physical limits of Moore's Law. Thus, it is worth investigating (1) the fundamental, physical limits to the energy consumption of an optical neural network and (2) the energy consumption of a practical, near-term optical neural network using existing technology.
(59) Without being bound by any particular theory, the fundamental energy consumption limit for an optical neural network stems from quantum-limited noise. In an electrical signal, energy is quantized at a level E.sub.el=h/τ.sub.el, where τ.sub.el˜10.sup.−10 s is the signal duration. Optical energy is quantized at a level E.sub.opt=h/τ.sub.opt, where τ.sub.opt ≡c/λ˜(2-5)×10.sup.−15 s, which is 10.sup.4-10.sup.5 times higher. As a result, E.sub.opt>>kT>>E.sub.el and electrical signals can be treated in a classical limit governed by thermal noise, while optical signals operate in a zero-temperature quantum limit where vacuum fluctuations dominate. These fluctuations are read out on the photodetectors 234, where the photoelectric effect produces a Poisson-distributed photocurrent. While the photocurrents are subtracted in homodyne detection, the fluctuations add in quadrature, and Eq. (1) is replaced by:
(60)
(61) Here the w.sub.i.sup.(k)˜N(0,1) are Gaussian random variables, ∥.Math.∥ is the L.sub.2 norm, and n.sub.mac is the number of photons per MAC, related to the total energy consumption of the layer by n.sub.tot=NN′n.sub.mac. The noise term in Eq. (3) scales as n.sub.mac.sup.−1/2, and therefore the signal-to-noise ratio (SNR) of each layer 220 should scale as SNR ∝n.sub.mac. Since noise adversely effects the network's performance, the energy minimum should correspond to the value of n.sub.mac at which the noise becomes significant.
(62) To quantify this statement, we perform benchmark simulations using two versions of the three-layer, fully connected neural network shown in
(63)
(64) The SQL is network-dependent, and not all layers contribute equally. For each MAC, we have SNR a n.sub.mac; however, the signal adds linearly while the errors add in quadrature. As a result, the larger network is more resilient to individual errors because each output is averaging over more neurons. Moreover, the solid curves in
(65) Energy Budget
(66)
(67)
(68)
(69) The detector electronics also affect the energy budget. The homodyne signal from each neuron is sent through a nonlinear function y.sub.i.fwdarw.ƒ(y.sub.i) and converted to the optical domain using a modulator or by modulating a light source directly (e.g., as in
(70) For context, the ˜1 pJ/MAC figure from state-of-the-art ASICs is shown in
(71) A final consideration is the energy required to generate the weights in the first place. There is one weight pulse per MAC, so at the minimum this may be 1 fJ/MAC for the modulator and may rise above 1 pJ/MAC once the driver electronics and memory access are included. However, once the optical signal is generated, it can be fanned out to many neural networks in parallel, reducing this cost by a factor of B, the batch size. Large batch sizes should enable this contribution to E.sub.mac to reach the few-femtojoule regime, and potentially much lower.
(72) Training and Convolutions with Optical GEMM
(73) As discussed above, the optical unit in
(74)
(75)
(76) From the accumulated charge at each pixel in the detector array 530, one can extract the matrix elements of the product (M.sub.1M.sub.2.sup.T).sub.m×n. This operation uses m.Math.n.Math.k MACs, with a total energy consumption (and energy per MAC) of:
(77)
where E.sub.in, E.sub.out are the transmitter and receiver energy use, per symbol, which include all optical energy plus electronic driving, serialization, DAC/ADC, etc. If the matrix dimensions (m, n, k) are large, significant energy savings per MAC are possible if E.sub.in,E.sub.out can be kept reasonably small.
(78)
∇.sub.AL=(∇.sub.YL)X.sup.T,∇.sub.XL=A.sup.T(∇.sub.YL) (5)
Once the derivative has been propagated to ∇.sub.X.sub.
(79) In addition to fully-connected layers, it is also possible to run convolutional layers on the optical GEMM unit by employing a technique called patching. In a convolutional layer, the input x.sub.ij;k is a W×H image with C channels. This is convolved to produce an output y.sub.ij;k of dimension W′×H′ with C′ channels:
y.sub.ij;k=Σ.sub.i′j′,lK.sub.i′j′,klx.sub.(s.sub.
Here K.sub.i′j′,kl is the convolution kernel, a 4-dimensional tensor of size K.sub.x×K.sub.y×C′×C, and (s.sub.x, s.sub.y) are the strides of the convolution. Naïvely vectorizing Eq. (6) and running it as a fully-connected matrix-vector multiply is very inefficient because the resulting matrix is sparse and contains many redundant entries.
(80)
(81) On virtually any microprocessor, GEMM is a highly-optimized function with very regular patterns of memory access; the benefits of rewriting the convolution as a GEMM greatly outweigh the redundancy of data storage arising from overlapping patches. The time to rearrange the image as a patch matrix is typically very small compared to the time to compute the GEMM; therefore, by accelerating the GEMM, the optical matrix multiplier significantly increases the speed and energy efficiency of convolutional layers.
(82) Since the optical processor performs the convolution as a matrix-matrix (rather than matrix-vector) operation, it is possible to obtain energy savings even without running the neural network on large batches of data. Computing the convolution requires W′H′K.sub.xK.sub.yC′C MACs. Following Eq. (4), the energy per MAC (not including memory rearrangement for patching) is:
(83)
(84) The coefficients c.sub.in=(1/C+1/W′H′).sup.−1 and c.sub.out=K.sub.xK.sub.yC govern the energy efficiency when the optical processor 500 is limited by input/output energies (transmitter/receiver and associated electronics). Since reading a 32-bit register takes pJ of energy, a reasonable lower bound for near-term systems is E.sub.in, E.sub.out ≳0. Thus, the optical processor 500 should have c.sub.in, c.sub.out>>1 for its energy performance to beat an ASIC (˜pJ/MAC).
(85) TABLE-US-00001 TABLE 1 Layers in AlexNet. Values of c.sub.in, c.sub.out are calculated from Eq. (7). Max-pooling layers after CONV1, CONV2 and CONV5 are used to reduce the image size, but the relative computational cost for these layers is negligible. Layer Input Output Kernel Stride MACs c.sub.in c.sub.out CONV1 227 × 227 × 3 55 × 55 × 96 11 × 11 × 96 × 3 4 105M 93 363 (pool) 55 × 55 × 96 27 × 27 × 96 — 2 — — — CONV2 27 × 27 × 96 27 × 27 × 256 5 × 5 × 256 × 96 1 448M 189 2400 (pool) 27 × 27 × 256 13 × 13 × 256 — 2 — — — CONV3 13 × 13 × 256 13 × 13 × 384 3 × 3 × 384 × 256 1 150M 117 2304 CONV4 13 × 13 × 384 13 × 13 × 384 3 × 3 × 384 × 384 1 224M 117 3456 CONV5 13 × 13 × 384 13 × 13 × 256 3 × 3 × 256 × 384 1 150M 102 3456 (pool) 13 × 13 × 256 6 × 6 × 256 — 2 — — — FC1 6 × 6 × 256 4096 — — 38M — — FC2 4096 4096 — — 17M — — FC2 1000 1000 — — 4M — — 1.08 G 132 1656 59M — —
(86) As a benchmark problem, consider AlexNet, shown in c.sub.in
>100 and
c.sub.out
>1000. Thus, even under extremely conservative assumptions of E.sub.in, E.sub.out ≳100 pJ (comparable to DRAM read energies), it is still possible to achieve sub-pJ/MAC performance. More advanced technology, such as few-fJ optical interconnects, may significantly reduce E.sub.in and E.sub.out, and therefore the energy per MAC. However, the performance is still fundamentally limited by detector shot noise (e.g., Eq. (3) for FC layers).
(87) Using a pre-trained AlexNet model,
(88) The dashed lines in
(89) Discussion
(90) This architecture for optically accelerated deep learning is scalable to large problems and can operate at high speeds with low energy consumption. It takes advantage of the photoelectric effect, via the relation I∝|E|.sup.2, to compute the required matrix products opto-electronically, obviating the need for all-optical nonlinearity that has hobbled past approaches to optical computing. Since the device can be constructed with free-space optical components, it can scale to much larger sizes than nanophotonic implementations, being ultimately limited by the size of the detector array (e.g., N≳10.sup.6).
(91) One advantage to this optical processor is that the multiplication is performed passively by optical interference, so the main speed and energy costs are associated with routing data into and out of the optical processor. For a matrix multiplication C.sub.m×n=A.sub.m×kB.sub.n×k, the input/output (I/O) energy scales as O(mk)+O(nk)+O(mn), while the number of MACs scales as O(mnk). For moderately large problems found in convolutional neural-network layers (e.g., m, n, k≥100) with moderate input/output (I/O) energies (e.g., ˜pJ), performance in the ˜10 fJ/MAC range should be feasible, which is 2-3 orders of magnitude smaller than state-of-the-art CMOS circuits. Advances in optical interconnects may reduce the I/O energies by large factors, translating to further reductions in energy per MAC.
(92) The fundamental limits to optical processors affect their long-term scaling. For the optical neural network presented here, detector shot noise presents a standard quantum limit (SQL) to neural network energy efficiency. Because this limit is physics-based, it cannot be engineered away unless non-classical states of light are employed. Monte Carlo simulations of pre-trained models for MNIST digit recognition (fully-connected) and ImageNet image classification (convolutional) show that optical neural network performance is a function of the number of photons used, which sets a lower bound on the energy per MAC. This bound is problem- and network-dependent and lies in the range 50 zJ-5 aJ/MAC. By contrast, the Landauer limit for electronic neural networks is 3 aJ/MAC (assuming 1,000 bit operations per MAC); sub-Landauer performance is possible in optical neural networks because the multiplication is performed through optical interference, which is reversible and not bounded by Landauer's principle.
(93) 2. Digital Optical Neural Networks with Holographic Optical Fan-Out Interconnects
(94) Convolutional neural networks (CNNs) are a key tool in machine learning. As neural networks grow larger and deeper, so do the energy requirements of the convolutional layers. Even small CNNs (by 2018 standards) like AlexNet use nearly 0.5 GMACs per classification step, and more modern CNNs use orders of magnitude more. Thus, there is strong motivation to find special-purpose hardware to both speed up and increase the energy efficiency of CNNs.
(95) Taxonomy of Convolutional ONNs
(96) The section above describes an analog optical neural network (ONN) based on homodyne imaging. This section describes a digital optical CNN. In a conventional processor, both the logic and the interconnections are done in electronics. The digital ONN retains the electronics for logic, but does interconnection using optics. Holography and Fourier optics are especially well-suited to realize the data and weight fan-out in a convolutional network, which reduces the number of memory-access calls per MAC by a large factor, significantly reducing the total energy consumption.
(97) TABLE 2 lists differences between electronic CNNs, digital ONNs, analog ONNs, and coherent ONNs. An analog ONN uses analog circuits in place of the digital logic in a digital ONN. Because energy consumption in the digital ONN is limited by the arithmetic logic units (ALUs), replacing digital logic with analog circuits can deliver several orders of magnitude of speed and efficiency gains despite analog noise and calibration issues. While analog, this system is still optically incoherent and relies on the optics only for communication. The most powerful neural network is the coherent ONN, which performs both logic and communication optically, relying on electronics merely as a buffer for integration and readout. The coherent system beats the energy consumption analog and digital ONN by several orders of magnitude; however, it is the most complex of the three systems and uses coherent sources and detection.
(98) TABLE-US-00002 TABLE 2 Comparison between different CNN hardware platforms. GPU/ ONN ONN ONN TPU (digital) (analog) (coherent) Logic Digital Digital Analog Optical ALUs ALUs electronics (homodyne) Interconnects Wires Optical Optical Optical (incoherent) (incoherent) (coherent) Energy/MAC ≳20 pJ <1 pJ ≳fJ aJ-fJ
(99) Before describing the digital ONN in greater detail below, it is useful to discuss the differences between fully-connected (FC) and convolutional (CONV) layers so that one can glean insight into how optical connections can save energy. An FC layer has all-to-all connectivity between neurons: y.sub.j=Σ.sub.j A.sub.ij x.sub.j. Therefore, one desires a broadcast connection (one-to-all) for the data, while the weight connections are one-to-one (Sec. 1). Significant savings are possible by routing the data optically, but most of the energy in FC layers comes from accessing the weights; reducing this contribution depends on careful engineering of the weight server and running multiple neural networks in parallel, amortizing the cost of the weights.
(100) A convolutional layer, by contrast, implements a far more structured map:
(101)
(102) Here (k,l) are the x- and y-indices of a pixel, and m is the channel index. Typical dimensions are W, H, W′, H′=10-50, K.sub.x, K.sub.y=3-5, and C, C′=100-400 in the hidden layers. Each input x.sub.ij;m is fanned out to K.sub.xK.sub.yC′ outputs, while each weight is fanned out W′H′ times. This is an extraordinary amount of redundancy, both for inputs and for weights. Therefore, significant performance improvements are possible if one can passively perform the required fan-out. As I will show in the following section, free-space optics can be adapted to precisely this end, both in the digital and analog (incoherent) cases.
(103) Interconnects for a Digital ONN
(104)
(105) Patch Method for Input Fan-Out: Maximum Input Fan-Out
(106) Each input maps to K.sub.xK.sub.yC′ outputs. This fan-out can be achieved if each input pixel can be mapped to a K.sub.x×K.sub.y patch of output pixels, with each output pixel comprising C′ detectors (sub-pixels), one for each channel. This effectively down-samples the image, and channel data is sent in sequentially, so K.sub.xK.sub.yC clock cycles are used to transfer the data, but since the total number of MACs is K.sub.xK.sub.yW′H′C′C and approximately (W′/K.sub.x)(H′/K.sub.y)C′ MACs are performed per clock cycle, the ALUs are operating at near 100% utilization in this scheme, which is very efficient.
(107)
(108) Following Eq. (8) and
(109) Each K.sub.x×K.sub.y patch is weighted with a (flipped) kernel (e.g., as in
(110) The input and kernel signals are imaged onto a detector chip (808), which has W′×H′ pixels with C′ sub-pixels per pixel and within each sub-pixel, an ALU to do MACs, and one detector each for x.sub.ij;n and K.sub.kl;mn. For each step, within a given pixel the x sub-pixel inputs are the same (broadcast of optical data), while the K sub-pixel inputs are different. During frame (k,l), each pixel (i,j) is performing an all-to-all matrix-vector multiply between matrix K.sub.kl;mn and vector x.sub.i+k,j+l;n (Eq. (8)). Within each pixel, the process is identical to the digital ONN for FC layers disclosed above.
(111) TABLE-US-00003 TABLE 3 Comparison between D.sup.2NN, a coherent Fourier ONN, and a digital ONN Fourier ONN Digital D.sup.2NN (Sec. 3) ONN Encoding Analog Analog Digital Coherence? Yes Yes No Inputs x.sub.ij,m Optical Optical Optical Kernel K.sub.ij;mn SLMs/ Optical Optical diffraction layers Use of Fourier Perform Perform Fan out optics convolution convolution data # channels 1 >>1 >>1
(112) A convolution can be implemented with two Fourier transforms and a filter:
A*.Math.B=√{square root over (2π)}.sup.−1[
(A)*
(B)] (9)
(113) Since the convolutions in the method 800 of
(114) Performing the optical fan-out efficiently can be tricky in practice. If the phase of the light should be constant, there will be an N-fold power reduction when fanning out one mode to N modes. This can be seen by inputting a plane wave (all pixels on with same amplitude). Since the convolution of a constant is also a constant, without the factor-of-N hit, the output power would be greater than the input power. In terms of Eq. (9), the input light is a series of tightly confined dots with most power at large spatial frequencies. This power is filtered out by the box convolution, which is a tightly-peaked sin h. Fortunately, the patch method 800 for the digital ONN does not rely on the optical phase. Relaxing the phase constraints, some results from Fourier holography can be used here.
(115)
(116) While the input fan-out is extremely efficient, the kernel fan-out is less so. Each kernel weight is called W′H′ times, however, the fan-out in
(117) Another complication arises from the kernel “shifting” done to ensure the kernel patches lined up with the data patches. If done electronically, this may incur a large communication cost if the chip is not sufficiently small (the amount of memory required for weights is actually quite large—K.sub.x and K.sub.y are minimal, but C and C′ can be in the hundreds). The shifting could be done optically using programmable nanophotonic processors (PNPs) or a fast beam-steering SLM if one can be developed, but these technologies are in their infancy and may be power-hungry (and there are many modes to shift: K.sub.xK.sub.yC′ in all). The added energy costs of shifting should be sufficiently diluted by the fan-out that they become irrelevant.
(118) Shift Method for Input and Kernel Fan-Out: Maximum Kernel Fan-Out
(119)
(120) Each kernel element K.sub.kl;mn, which is a C′×C fully-connected matrix, is convolved with a lattice of delta-functions (1014) and broadcast to all pixels during the frame (there are C steps per frame and C′ sub-pixels per pixel, allowing C′C matrix elements to be transferred during the frame) for detection by a detector array (1008). Thus, the weight fan-out is W′H′, the maximum possible fan-out (1016). Typically, this is around 100-2000 for CONV layers. As in the patch method 800 (
(121) The price for maximizing kernel fan-out is a reduced fan-out for the inputs and some added complexity in sending them in. The input fan-out is C′ rather than K.sub.xK.sub.yC′ since the pixels are mapped one-to-one (convolution and fan-out still happen because each input maps to all C′ sub-pixels). However, the channel number is large in hidden CONY layers, so this is typically hundreds.
(122) In addition, the shift method 1000 uses shifted images rather than the originals. The shifting can be done electronically at a cost of higher energy per bit (because we need to send data between pixels in each step). However, reading data from a Network-on-Chip (NoC) or local buffer is usually only 2-6 times more costly than reading from a register, so fan-out should win out over this added cost.
(123) Finding an efficient optical steering mechanism to do the shifts is not essential to this scheme (or the patch method 800 in
(124) The initial layers of CNNs down-sample using a stride s.sub.x, s.sub.y>1. Thus, the convolution function becomes:
(125)
(126) Stride reduces the output size (W′, H′) as well as fan-out because we are no longer taking a convolution over every K.sub.x×K.sub.y block. While the kernel fan-out is unaffected, input fan-out is reduced to ┌K.sub.x/s.sub.x┐┌K.sub.y/s.sub.y┐C′ for the patch method 800 of
(127) TABLE-US-00004 TABLE 4 Comparison of patch and shift methods for optical fan-out. Input fan-out Kernel fan-out Steps Complexity Theoretical [K.sub.x/s.sub.x][K.sub.y/s.sub.y]C' W'H' — — Limit Patch [K.sub.x/s.sub.x][K.sub.y/s.sub.y]C' W'H'/K.sub.xK.sub.y K.sub.xK.sub.yC Kernel shifting Method Shift C' W'H' K.sub.xK.sub.yC Input shifting Method
(128) Incoherent Analog ONN
(129) The same optical fan-out can be ported to an incoherent analog ONN, which may be orders of magnitude more efficient than a digital ONN. In the best-case scenario, the memory-access costs can be rendered negligible. Since this comprises 80-90% of the energy in CNNs like AlexNet, as shown in
(130)
(131) CMOS photodetectors and reasonably short wires (e.g., about 10 μm in length) have a capacitance of several fF, so fJ/MAC seems to be a lower bound in the incoherent analog case. Whether this bound is reached in practice depends on the memory-access costs. The overall energy per MAC, E.sub.mac, can be estimated with the following equation:
(132)
(133) The various energy costs are tabulated below in TABLE 5.
(134) TABLE-US-00005 TABLE 5 Parameters in Eq. (11). Value Value Name Description (digital).sup.‡ (analog) Notes E.sub.logic Logic gate (n/32).sup.2 × pj fJ See Refs. E.sub.pd Photodetection.sup.* (n/32) × 32 fJ fJ fJ/bit E.sub.mem Memory read.sup.† (n/32) × pJ (??) 30 fJ/bit (register) E.sub.mod Modulator (n/32) × 32 fJ fJ fJ/bit E.sub.dac DAC 0 pJ (??) F.sub.x, F.sub.K Fan-out for x.sub.ij;m, K.sub.ij;mn .sup.*Optical plus electrical (receiver) power. .sup.†Read from register file. Non-register local memory is 2-6 times larger. .sup.‡n = number of bits.
(135) Several factors make the analog approach more complicated. Process variations may make some transistors more responsive than other, leading to a non-uniform weighting function ƒ(K); this will need to be corrected for, perhaps by tuning the resistor values. Also, while the box/lattice convolution kernels which perform the optical fan-out in
(136) 3. Convolutional Neural Network Based on Fourier Optics
(137) The ONN in Sec. 1 uses coherent (homodyne) detection to combine the weights and neuron activations, thus performing a matrix-vector multiplication to implement a fully-connected (FC) layer. However, convolutional (CONV) layers are used in many neural networks, especially in image processing. This section describes a modified ONN that uses combines Fourier optics and coherent detection to efficiently implement a CONV layer.
(138) Convolutional Neural Networks
(139) Convolutional neural networks are used to process data with structure, particularly images. For large feature vectors, convolutions are much faster than all-to-all matrix multiplications and have fewer degrees of freedom, which speeds up training.
(140) In a convolutional network, the data is represented as a 3-dimensional (W×H×C) array: x.sub.ij;m. Here (i,j) are the physical coordinates, while m is the channel index. Equivalently, one can view the data as a collection of C feature maps, each of dimension W×H. Each CONY layer convolves the feature-map array with a kernel K.sub.kl;mn to produce the synaptic inputs:
y.sub.ij;m=Σ.sub.kl,nK.sub.kl;mnx.sub.i+k,j+l;n (12)
(141) The kernel has a dimension (K.sub.x×K.sub.y×C′×C), giving the output the shape (W′×H′×C′), where W′=W K.sub.x+1, H′=H K.sub.y+1. A nonlinear function (e.g., sigmoid, ReLU, etc.) maps each y to the neuron activations: x.sub.ij;m=ƒ(y.sub.ij;m). These are the feature-maps input to the next layer of the network.
(142) For a single input and output channel, Eq. (12) is a simple convolution. However, the feature-maps in real neural networks have many channels, e.g., C, C′>>1. K acts as a matrix multiplication in the channel index m, and as a 2D convolution for the coordinate indexes (i,j).
(143) In the deeper layers, the images are quite small, but involve a large number of channels (e.g., as in the AlexNet shown in
(144) TABLE-US-00006 TABLE 6 Layers in AlexNet. Max pooling is done before FC1 to reduce 13 × 13 × 256 feature-vector to 6 × 6 × 256. Most of the weights are in the FC layers, while most of the MACs are in the CONV layers. Layer Feature-map (size) Kernel (size) MACs CONV1 227 × 227 × 3 150 k 11 × 11 × 96 × 3 35 k 105M CONV2 55 × 55 × 96 290 k 5 × 5 × 256 × 96 615 k 448M CONV3 27 × 27 × 256 186 k 3 × 3 × 384 × 256 885 k 150M CONV4 13 × 13 × 384 65 k 3 × 3 × 384 × 384 1.3M 224M CONV5 13 × 13 × 384 65 k 3 × 3 × 256 × 384 885 k 150M FC1 6 × 6 × 256 9 k 4096 × 9216 (FC) 37M 37M FC2 4096 4 k 4096 × 4096 (FC) 16M 16M FC3 4096 4 k 1000 × 4096 (FC) 4M 4M
(145) Several approaches can be taken to compute a convolution efficiently. One approach is to vectorize the kernel and convert the feature-map to a Toeplitz matrix (with redundant data). Another vectorization approach called patching has been implemented on GPUs and is amenable to all-optical computation with time-encoded data if delay lines are used, however, the total delay length needed is quite large and may not be practical in the near term.
(146) Convolution via Fourier Optics
(147)
(A.Math.B).sub.i=Σ.sub.iA.sub.iB.sub.i+j(discrete)
[A.Math.B](x)=∫A(y)B(x+y)dy(continuous) (13)
(148) With the symmetric normalization for the Fourier transform (.sup.−1 obtained by flipping the sign in the exponent) (1202)
(149)
the convolution may be computed by an elementwise multiplication in Fourier space (1204) followed for an inverse Fourier transform (1206) back to real space:
A*ÐB=√{square root over (N)}.sup.−1[
(A)*
(B)](discrete)
A*.Math.B=√{square root over (2π)}.sup.−1[
(A)*
(B)](continuous)
(150) In the digital electronic domain, this process 1200 uses three fast Fourier transforms (FFTs). Since an FFT involves 0 (N log N) steps while a straightforward approach (banded matrix-vector multiply) involves 0 (NK) steps, the FFT is advantageous when the kernel is sufficiently large.
(151) Optical diffraction in the Fraunhofer limit also implements a 2D Fourier transform. A convolution can be implemented by hard-coding the kernel with an SLM and using a pair of lenses to perform the Fourier transform, e.g., as shown in
(152) .sup.−1[{tilde over (K)}*{tilde over (x)}])*. Like the D.sup.2NN, this system uses the optical Fourier transform to perform the convolution. However, the weights are encoded optically and are thus tunable.
(153) The CONV layer 1220 includes a coherent transceiver array 1230 in the image plane and a coherent transceiver array 1240 in the Fourier plane. The neurons reside on the image plane. A separate transmitter array 1250 (Weight Server) provides the kernel weights. A beam splitter 1270 and other optional optics (not shown) are arranged so that signals at the image-plane transceiver array 1230 and weight server 1250 are Fourier-transformed when they arrive at the Fourier-plane transceiver array 1240.
(154) In the first step of the convolution, shown in
(155) In the second step of the convolution, shown in
(156)
(157) Multiple Channels
(158) The hidden layers of a convolutional neural network have relatively small image dimensions, but a very large number of channels, with the number of channels increasing deeper in the network. This feature of convolutional networks allows high-resolution spatial information to be collapsed into low-resolution “contextual” information enabling the detection of edges, polygons, and more complex features, such as faces.
(159) Time Encoding
(160)
(161) This approach is also problematic because of the multiple read/write steps for each memory element. The problem exists regardless of whether the matrix is C-ordered, as in
(162) Frequency Encoding
(163)
(164) One downside with frequency encoding is the added complexity of the WDM channels. For the deeper layers of AlexNet with C′=384, this is a very large number of channels, which may not be practical. However, existing WDM systems rely on fast modulators where the data rate per channel is 25 Gbps, so the channel spacing is usually ≳50 GHz. The C-band is 30 nm wide and accommodates 80 channels with 50 GHz spacing. By working at lower speeds (e.g., GHz), the C-band can accommodate more than 80 channels, e.g., using thermally stabilized high-Q filters.
(165)
(166) Chromatic aberration presents a separate problem. The FFT performs the mapping
(167)
(168) The maximum phase in the exponential is O(N), occurring when k=l=N−1. In optics, however, the phase is proportional to wavelength. If the wavelength is changed by Δλ, all phases in the optical FFT scale by ϕ.fwdarw.(1+Δk/k)ϕ≈(1−Δλ/λ)ϕ. If the optical FFT has a phase tolerance of Δϕ, the tolerance on Δλ will be:
(169)
(170) Fortunately, N (the width/height of the image) is not that large. For an intermediate layer with N=27 and Δϕ=0.1, the wavelength tolerance is Δλ≲6 nm. This is about 1 THz, which is enough for several hundred channels, each spaced by a couple of GHz. Note the ≲ sign indicates there may be some O(1) factor here too.
(171) Spatial Encoding
(172) It is also possible to encode the data in spatial modes. However, the principle here is more subtle and care should be taken to prevent the Fourier transform from distorting or degrading the spatial encoding. To start, consider several facts about Fourier transforms.
(173) The Fourier transform of a comb is a comb (a sum of evenly spaced delta functions). Of relevance here are the Fourier transforms of functions that are nearly comb-like, but not quite. To begin, recall two definitions: (1) a function ƒ(x) is nearly periodic with period L if |ƒ(x+L)−ƒ(x)|<<ƒ(x) and (2) function ƒ(x) is a spike train with period L if ƒ(x)≈0 for all x unless x≈mL for m∈.
(174) The Fourier transform of a spike-train function with period L is a nearly-periodic function with period 2π/L. To see why, consider a spike-train written as ƒ(x)=Σ.sub.nƒ.sub.n (x−nL), where ƒ.sub.n(x)≈0 unless |x|<<L. Taking the Fourier transform of this spike-train yields:
{tilde over (ƒ)}(k)=Σ.sub.ne.sup.inkL{tilde over (ƒ)}.sub.n(k) (19)
(175) Since the e.sup.inkL term is periodic with period 2π/L (or fractions thereof), displacement by 2π/L gives |{tilde over (ƒ)}(k+2π/L)−{tilde over (ƒ)}(k)|=Σ.sub.n|{tilde over (ƒ)}.sub.n(k+2π/L)−{tilde over (ƒ)}.sub.n(k)|. Now because each ƒ.sub.n(x) is nonzero only for |x|<<L, {tilde over (ƒ)}.sub.k(k) is nearly periodic with period 2π/L, and therefore so is {tilde over (ƒ)}(k).
(176) Similarly, the Fourier transform of a nearly-periodic function with period L is a spike-train function with period 2π/L. This is the converse to the Fourier transform of a spike-train function with period L being a nearly-periodic function with period 2π/L. To see why, recall that any continuous function can be written as a piecewise Fourier series:
ƒ(x)=Σ.sub.me.sup.2πimx/Lƒ.sub.m,n,x∈[(n−½)L,(n+½)L] (20)
(177) If ƒ(x) is nearly periodic, then |ƒ.sub.m,n−ƒ.sub.m,n+1|<<|ƒ.sub.m,n|. With a little perturbation theory, one can trade the discrete ƒ.sub.m,n for a continuous ƒ.sub.m(x) that is slowly-varying, i.e. |ƒ.sub.m(y)−ƒ.sub.m(x)|<<|ƒ.sub.m(x)| if |y−x|≤L. The Fourier transform of each summand of Eq. (20) is the convolution of a delta function δ(k−m(2πm/L)) and {tilde over (ƒ)}.sub.m(k). The latter is highly concentrated around |k|=0. Thus {tilde over (ƒ)}(k) is a spike-train function with period 2π/L.
(178) It follows from the above two points that the Fourier transform of a nearly-periodic spike-train is another nearly-periodic spike-train. A nearly-periodic spike train may be expressed as:
ƒ(x)=Σ.sub.n=−∞.sup.+∞F(x−nL,nL) (21)
where F(x,y) (replaces ƒ.sub.n(x−nL) above) is a continuous function that is sharply peaked around x=0 (F(x,y)≈0 unless |x|<<L) and slowly-varying in y (F(x,y)≈F(x, y′) for |y−y′|≲L). The Fourier transform is:
(179)
where {tilde over (F)}(k.sub.x, k.sub.y) is the 2D Fourier transform of F(x,y). It is slowly-varying in k.sub.x and sharply peaked around k.sub.y=0. As an aside, this technique of reducing the 1D Fourier transform of a slowly varying pulse train to a much smaller and more manageable 2D Fourier transform has unrelated applications in frequency-comb simulations, e.g., in extracting radio-frequency (RF) beat-note spectra of micro-combs or synchronously-pumped optical parametric oscillators (OPOs).
(180) Additional math shows how the Fourier transform properties of spike trains can be used to perform a discrete Fourier transform (DFT) in the optical domain.
(181)
E′(x′)∝∫E(x)e.sup.2πixx′/λƒdx (23)
(182) This is the optical Fourier transform.
(183)
(184) Each transceiver 1740 in the Fourier plane is composed of sub-pixels 1742. There are C′ sub-pixels 1742 per transceiver 1740, one for each output channel. The following derivation is for a 1D detector array, but 2D is a straightforward extension. Suppose that the sub-pixels 1742 are evenly spaced with positions x′.sub.k;m=(k+m/C′)s, where s=√{square root over (λƒ/N)}. The field from the neuron inputs x.sub.l;n is:
(185)
The channels are piped in one at a time, so the n.sup.th input channel arrives at time-step n. At time-step n, the field from the weight-server emitters 1750 takes the form:
(186)
(187) (Note the subtle difference between {circumflex over (K)} and the Fourier transform Eq. (14).) The convolution kernel K is much smaller than the image. As a result, its Fourier transform is relatively smooth: {tilde over (K)}.sub.k;mn≈{tilde over (K)}.sub.k+1;mn. This means that, for a given sub-pixel index m, the input field from the weight-server emitters 1750 is also slowly varying; therefore E′(x′)|.sub.weights is a nearly periodic function in the sense described above. As a result, the output at the weight server E(x)|.sub.weights takes the form of a spike train. In particular, for C′ sub-pixels 1742 per pixel 1740, the weight server's outputs C′ clusters of K.sub.x, spaced every N pixels, where N and K.sub.x are the sizes of the image and kernel, and N>>K.sub.x.
(188) In total, the weight server 1750 has C′K.sub.x independent outputs in each time-step, for CC′K.sub.x total. This is the total number of weights for a (1D) kernel, giving enough degrees of freedom to make it work. There is a Fourier-series relation between the weight-server outputs and the desired weights (e.g., Eq. 19), but this can be pre-computed.
(189) After C time steps, the (conjugated) heterodyne output from Eqs. (24) and (25) gives the quantity:
Σ.sub.l;ne.sup.−2πi(k+m/c′)l({circumflex over (K)}.sub.k;mn*x.sub.l;n)* (26)
(190) This has an extra m/C′ term. This extra term can be eliminated by performing a proper inverse Fourier transform. Recall that in step 2 of the optical Fourier transform (shown in
(191)
The final step of Eq. (27) uses the identity
Σ.sub.k=0.sup.N−1e.sup.2πi(k+ξ)l/N=Nδ.sub.l,0 (28)
which holds for all ξ (the case ξ=0 is the traditional DFT).
(192) Recall that in the original FC optical neural network, the neurons fired sequentially, and their signals were broadcast to the neurons of the next layer and then weighted. In the present scheme, each channel fires sequentially, but the neurons fire simultaneously. In the Fourier plane, within each pixel 1740, the channel output n at wave-vector k is likewise broadcast to all m sub-pixels 1742, corresponding to the output channels. C steps implement a C′×C FC matrix-vector multiplication at every point in k-space. Looking inside each pixel 1740, the operational principle of this CONV unit is the same as the original FC unit. The tricky part was to decorate the input and output with Fourier optics to convert this FC problem (technically block-diagonal FC, one block for each pixel 1740) into a convolutional problem.
(193) TABLE 7 summarizes the three channel-encoding schemes from this section. Time-encoding is the simplest but is slowest and requires a large number or reads or writes, which may lead to signal degradation in analog and/or higher energy costs. Frequency encoding is an elegant solution, but requires many modes and WDM elements, and suffers from chromatic aberration in the Fourier transform (which is intrinsically chromatic), limiting its bandwidth. Spatial encoding achieves the same performance as frequency encoding but uses multiple sub-pixel detectors (and transmitters) per pixel. But it has no other apparent defects, so it may be the way to go. Hybrids are also possible.
(194) TABLE-US-00007 TABLE 7 Different channel-encoding methods Time steps Complexity Time (Sec. 3.4) CC′ Multiple reads/writes per (analog) memory. Frequency (Sec. 3.5) C′ C WDM channels. Separate WDM per pixel. Space (Sec. 3.6) C C′ sub-pixels per pixel.
(195) 4. Realizing Optical CNNs without Fourier Optics
(196) Many deep neural networks make extensive use of convolutional layers. The original homodyne-optical approach was designed for fully-connected networks (Sec. 1) and thus not well-suited to the convolutional case; however, a clever use of Fourier optics could realize the convolution with optically-encoded weights (Sec. 3). However, that scheme involves simultaneous measurement of both quadratures (heterodyne detection), as well as (possibly) co-integration of sources and detectors. Finally, the math of the spatial channel multiplexing (sub-pixels) was quite involved. An easier scheme implemented the digital neural network with optical fan-out via Fourier holography (Sec. 2). However, the phases of Fourier holograms are generally scrambled, making coherent detection problematic in this digital optical neural network. Fortunately, it is possible to realize an optical CNN in a coherent mode without the Fourier optics of Sec. 3 using many of the optical fan-out components from Sec. 2. In this type of optical CNN, Fourier optics can be used to fan out optical-domain data but are not used for the convolution itself.
(197) Row-Column Method
(198)
(199) The input is an array of dimension W×H×C (1802). The channels are sent in one at a time over a total of C time steps. In time step l, the l.sup.th channel is zero-padded and serialized (1804) and transmitted as a vertical array of beams (e.g., using Rui's fan-out circuit with fast modulators, arranging the couplers on a line). This signal passes through an optical fan-out circuit like the one shown in
(200) The kernel is a K.sub.x×K.sub.y×C′×C array (1812). Like the input (1802), the kernel is loop over the input channel index over C time steps. In time step l, the kernel of the l.sup.th channel (dimension K.sub.x×K.sub.y×C′) is sent in as a horizontal line of pixels (1814), from a similar device (e.g., grating array or edge coupler array). The line is divided into C′ blocks, each of size K.sub.xK.sub.y. This is fanned out in the vertical direction giving approximately (W+K.sub.x)(H+K.sub.y) copies of the l.sup.th channel of the kernel, one on each row (1816).
(201) Finally, the kernel and image outputs are combined onto a photodetector array (1820). Since the photodetector array only needs to collect light (unlike the photodetectors coupled to logic in Sec. 3), this photodetector array can be very slow, simple, compact, cheap, and high-resolution. Reading out the photodetector array twice with opposite phases makes it possible to compute the homodyne signal, which gives the product between the fields (assuming the phases are controlled for).
(202) The photodetector array has dimension (K.sub.xK.sub.yC′)×(W′H′). Each row corresponds to a pair of image coordinates y.Math.(i,j) (there are W′H′ rows for an image of size W′×H′). The columns are grouped into C′ blocks for the channels, and each block containing K.sub.xK.sub.y columns which can be indexed by coordinates (i′<K.sub.x, j′<K.sub.y). Thus, each point on the grid can be uniquely assigned five indices (i, i′, j, j′, k). The homodyne signal is:
z.sub.ij,i′j′,k=K.sub.i′j′,klx.sub.i+i′,j+j′,l (29)
(203) Read-out circuitry integrates the photocurrent over all C input channels. This sums over l. Next, within each block, the photocurrents in each row are summed (light-blue box in figure). This sums over (i′, j′). At the end, one obtains:
y.sub.ij,k=Σ.sub.i′j′lz.sub.ij,i′j′,k=Σ.sub.i′j′lK.sub.i′j′,klx.sub.i+i′,j+j′,l (30)
This is exactly the desired convolution function.
(204) One potential problem with this scheme is achieving the desired phase relation between image and kernel. Recall that the image data is fanned out with Fourier holography. The fan-out kernel for the Fourier hologram includes an array of dots with equal amplitude and different phases. Since there is one dot per column, the phase is column-dependent and is denoted ϕ.sub.x (see
(205) Another way to fix this problem is to correct the phase ϕ.sub.x optically using an optical phase shifter before each grating coupler to apply a phase ψ.sub.x=ϕ.sub.x to the kernel outputs (
(206) Displaced Image Method
(207)
(208) Simultaneously, for each channel, the displaced image method 1900 iterates over the (i′,j′) indices of the kernel (1912). For a particular index pair (i′,j′), the kernel K.sub.i′j′,kl has C′ elements (denoted by index k, the other indices fixed); these elements are encoded onto the sub-pixels of the center pixel (1914). A Fourier hologram fans this out with equal intensity to all pixels of the image (1916). This kernel is interfered with the image on the detector array, computing the homodyne product (1920).
(209) The photodetector array has (W+K.sub.x−1) (H+K.sub.y−1) pixels, with C′ sub-pixel detectors per pixel. Each detector reads out the convolution y.sub.ij,k, where (i,j) are the (pixel) coordinates and k is the sub-pixel index.
(210) As before, the fan-out phases ϕ.sub.ij and ϕ.sub.k should be corrected so that the signals interfere correctly at the detector array. Fortunately, this can be done by placing phase modulators before every grating coupler at the transmitter chips for the image and kernel. These are denoted in
(211) Convolution Processor
(212)
(213) The processor 2000 includes a first 4ƒ optical system 2010 that displaces and fans out the optical image data 2003 in the row-column method or fans out the optical image data 2003 in the displaced image method. More specifically, the first 4ƒ optical system 2010 has a first lens 2012 that spatially Fourier transforms the optical image data 2003. A first SLM 2014 in the Fourier plane (the focal plane of the first lens 2012) spatially phase modulates the Fourier-transformed optical image data; the result is spatially Fourier transformed by a second lens 2016 to produce a desired spatial shift at the output of the first 4ƒ optical system 2010.
(214) A kernel transmitter array 2052 serializes kernel data (weights) 2051 in the row-column method or displaces the kernel data 2051 in the displaced image method. The kernel transmitter array 2052 does this by modulating an electrical-domain representation of the image data 2051 onto many copies of an optical pulse train to produce optical kernel data 2053. This optical pulse train is coherent with the optical pulse train used to drive the image transmitter array 2002. Both optical pulse trains may be produced by the same source, such as a pulsed laser whose output is split by a beam splitter.
(215) A second 4ƒ optical system 2060 displaces and fans out the optical kernel data 2053 in the row-column method or fans out the optical kernel data 2053 in the displaced image method. Like the first 4ƒ optical system 2010, the second 4ƒ optical system has a first lens 2062 that spatially Fourier transforms the optical kernel data 2053. A second SLM 2064 in the Fourier plane (the focal plane of the first lens 2062) spatially phase modulates the Fourier-transformed optical kernel data, and the result is spatially Fourier transformed by a second lens 2066 to produce a desired spatial shift at the output of the second 4ƒ optical system 2060.
(216) A mirror 2070 reflects the output of the second 4ƒ optical system 2060 to a beam splitter 2020 that combines the outputs of the first 4ƒ optical system 2010 and the second 4ƒ optical system 2060. A detector array 2090 senses combined output, which is a convolution of the image data 2001 and the kernel data 2051. When implementing the row-column method, a 2D phase mask 2084 in an image plane of the output of the second 4ƒ optical system 2060 applies a 2D phase modulation ψ.sub.y=−ϕ.sub.y to the kernel output after fan-out to compensate for the row-dependent phase ϕ.sub.y. When implementing the displaced image method, this 2D phase mask 2084 may be omitted in favor of phase modulators in the image transmitter array 2002 and kernel transmitter array 2052 that apply fan-out phases ϕ.sub.ij and ϕ.sub.k, respectively, the signals interfere correctly at the detector array 2090.
(217) Resource Consumption
(218) These neural network architectures can be compared by looking at how they perform on certain resource metrics. These metrics include (1) number of time steps, (2) number of transmitters and detectors, and (3) input- and kernel-fanout. TABLE 8 compares these figures for the Fourier-transform ONN (Sec. 3), row-column method, and displaced image method, and electronics. Since all of these schemes send the input channels in sequentially, the number of time steps is a multiple of C. However, the displaced image method displaces the image K.sub.xK.sub.y times, so it performs CK.sub.xK.sub.y steps, as does the standard electronic process.
(219) TABLE-US-00008 TABLE 8 Resource consumption of different neural network architectures including electronics, the Fourier-Transform optical neural network (FT-ONN), the Row-Column (RC) method, and the Displaced Image (DI) method. Assuming stride of 1 with W′ = W, H = H. .sup.†FT-ONN has 2 steps with fan-out C′K.sub.xK.sub.y per step. FT-ONN RC Method DI Method Electronics (Sec. 3) (Sec. 4.1) (Sec. 4.2) Time steps ≥CK.sub.xK.sub.y 2 C C CK.sub.xK.sub.y Input transmitters — 2 W′H′ W′H′ W′H′ Kernel — C′K.sub.xK.sub.y C′K.sub.xK.sub.y K.sub.xK.sub.y transmitters Detectors N.sub.det — 2 W′H′C′ W′H′C′K.sub.xK.sub.y W′H′C′ Detectors/output — 2 K.sub.xK.sub.y 1 Input reads W′H′C′CK.sub.xK.sub.y 2 W′H′C 2 W′H′C W′H′C′K.sub.xK.sub.y Input fan-out F.sub.in — 1/2 C′CK.sub.xK.sub.y.sup.† C′K.sub.xK.sub.y C′ Kernel reads W′H′C′CK.sub.xK.sub.y 2 C′CK.sub.xK.sub.y C′CK.sub.xK.sub.y C′CK.sub.xK.sub.y Kernel fan-out — 1/2 W′H′.sup.† W′H′ W′H′ F.sub.ker Complexity — Optical FT Extra detectors Image shifting
(220) TABLE 8 shows that there is a tradeoff between spatial and temporal complexity. The row-column method uses C time steps, but it uses K.sub.xK.sub.y detectors per output, while the displaced image method uses one detector per output. The product between the number of time-steps and the number of detectors is conserved (N.sub.stepN.sub.det=W′H′C′CK.sub.xK.sub.y), consistent with the fact that both of these networks are performing the convolution in the conventional way, which involves W′H′C′CK.sub.xK.sub.y MACs. Without wavelength multiplexing, each detector performs one MAC per time step. However, with the aid of a Fourier transform, the convolution uses just W′H′C′C MACs plus three FT's. As a result, the FT-ONN is more efficient than the row-column and displaced image methods with N.sub.stepN.sub.det=2 W′H′C′C (the factor of 2 comes from the need for detectors at both image plane and Fourier plane). However, the FT-ONN also uses an optical Fourier transform.
(221) Detector count is significant because the pixel count of the camera limits the size of images used in the row-column method much more severely than the displaced image method, especially for large kernels, and because each pixel has finite size and thus finite capacitance. Suppose each detector uses an energy E.sub.det to get a reasonable readout SNR. In the displaced image method, the optical energy per output is thus ≥E.sub.det. But in the row-column method, each output is the average of K.sub.xK.sub.y detectors, giving an energy≥K.sub.xK.sub.yE.sub.det. This may be significant depending on how large E.sub.det is. The optical energy bound per MAC for sufficient detector charging will be:
(222)
(223) Another factor is input- and kernel-fanout (F.sub.in, F.sub.ker). Since memory reads dominate energy consumption in digital neural networks, a significant savings can be obtained by reading the memory once and fanning the result out to many detectors. Let E.sub.tr be the total transmitter energy, including the memory read, conversion to analog, and the electrical cost of driving a modulator. Then the electrical energy per MAC is:
(224)
The total energy per MAC is E.sub.mac=E.sub.el+η.sup.−1E.sub.opt, where η is the product of various efficiencies—detector, modulator, lightsource, etc.
CONCLUSION
(225) While various inventive embodiments have been described and illustrated herein, those of ordinary skill in the art will readily envision a variety of other means and/or structures for performing the function and/or obtaining the results and/or one or more of the advantages described herein, and each of such variations and/or modifications is deemed to be within the scope of the inventive embodiments described herein. More generally, those skilled in the art will readily appreciate that all parameters, dimensions, materials, and configurations described herein are meant to be exemplary and that the actual parameters, dimensions, materials, and/or configurations will depend upon the specific application or applications for which the inventive teachings is/are used. Those skilled in the art will recognize or be able to ascertain, using no more than routine experimentation, many equivalents to the specific inventive embodiments described herein. It is, therefore, to be understood that the foregoing embodiments are presented by way of example only and that, within the scope of the appended claims and equivalents thereto, inventive embodiments may be practiced otherwise than as specifically described and claimed. Inventive embodiments of the present disclosure are directed to each individual feature, system, article, material, kit, and/or method described herein. In addition, any combination of two or more such features, systems, articles, materials, kits, and/or methods, if such features, systems, articles, materials, kits, and/or methods are not mutually inconsistent, is included within the inventive scope of the present disclosure.
(226) Also, various inventive concepts may be embodied as one or more methods, of which an example has been provided. The acts performed as part of the method may be ordered in any suitable way. Accordingly, embodiments may be constructed in which acts are performed in an order different than illustrated, which may include performing some acts simultaneously, even though shown as sequential acts in illustrative embodiments.
(227) All definitions, as defined and used herein, should be understood to control over dictionary definitions, definitions in documents incorporated by reference, and/or ordinary meanings of the defined terms.
(228) The indefinite articles “a” and “an,” as used herein in the specification and in the claims, unless clearly indicated to the contrary, should be understood to mean “at least one.”
(229) The phrase “and/or,” as used herein in the specification and in the claims, should be understood to mean “either or both” of the elements so conjoined, i.e., elements that are conjunctively present in some cases and disjunctively present in other cases. Multiple elements listed with “and/or” should be construed in the same fashion, i.e., “one or more” of the elements so conjoined. Other elements may optionally be present other than the elements specifically identified by the “and/or” clause, whether related or unrelated to those elements specifically identified. Thus, as a non-limiting example, a reference to “A and/or B”, when used in conjunction with open-ended language such as “comprising” can refer, in one embodiment, to A only (optionally including elements other than B); in another embodiment, to B only (optionally including elements other than A); in yet another embodiment, to both A and B (optionally including other elements); etc.
(230) As used herein in the specification and in the claims, “or” should be understood to have the same meaning as “and/or” as defined above. For example, when separating items in a list, “or” or “and/or” shall be interpreted as being inclusive, i.e., the inclusion of at least one, but also including more than one, of a number or list of elements, and, optionally, additional unlisted items. Only terms clearly indicated to the contrary, such as “only one of” or “exactly one of,” or, when used in the claims, “consisting of,” will refer to the inclusion of exactly one element of a number or list of elements. In general, the term “or” as used herein shall only be interpreted as indicating exclusive alternatives (i.e., “one or the other but not both”) when preceded by terms of exclusivity, such as “either,” “one of,” “only one of,” or “exactly one of” “Consisting essentially of,” when used in the claims, shall have its ordinary meaning as used in the field of patent law.
(231) As used herein in the specification and in the claims, the phrase “at least one,” in reference to a list of one or more elements, should be understood to mean at least one element selected from any one or more of the elements in the list of elements, but not necessarily including at least one of each and every element specifically listed within the list of elements and not excluding any combinations of elements in the list of elements. This definition also allows that elements may optionally be present other than the elements specifically identified within the list of elements to which the phrase “at least one” refers, whether related or unrelated to those elements specifically identified. Thus, as a non-limiting example, “at least one of A and B” (or, equivalently, “at least one of A or B,” or, equivalently “at least one of A and/or B”) can refer, in one embodiment, to at least one, optionally including more than one, A, with no B present (and optionally including elements other than B); in another embodiment, to at least one, optionally including more than one, B, with no A present (and optionally including elements other than A); in yet another embodiment, to at least one, optionally including more than one, A, and at least one, optionally including more than one, B (and optionally including other elements); etc.
(232) In the claims, as well as in the specification above, all transitional phrases such as “comprising,” “including,” “carrying,” “having,” “containing,” “involving,” “holding,” “composed of,” and the like are to be understood to be open-ended, i.e., to mean including but not limited to. Only the transitional phrases “consisting of” and “consisting essentially of” shall be closed or semi-closed transitional phrases, respectively, as set forth in the United States Patent Office Manual of Patent Examining Procedures, Section 2111.03.