CN117193469A - Residual error calibration method and system for optical multiply-add device - Google Patents

Residual error calibration method and system for optical multiply-add device Download PDF

Info

Publication number
CN117193469A
CN117193469A CN202311094457.9A CN202311094457A CN117193469A CN 117193469 A CN117193469 A CN 117193469A CN 202311094457 A CN202311094457 A CN 202311094457A CN 117193469 A CN117193469 A CN 117193469A
Authority
CN
China
Prior art keywords
optical
matrix
adder
mzi
compensation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311094457.9A
Other languages
Chinese (zh)
Inventor
肖瑶
唐泳
彭析竹
唐鹤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
University of Electronic Science and Technology of China
Original Assignee
University of Electronic Science and Technology of China
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by University of Electronic Science and Technology of China filed Critical University of Electronic Science and Technology of China
Priority to CN202311094457.9A priority Critical patent/CN117193469A/en
Publication of CN117193469A publication Critical patent/CN117193469A/en
Pending legal-status Critical Current

Links

Landscapes

  • Complex Calculations (AREA)

Abstract

The invention belongs to the technical field of information, and particularly relates to a residual error calibration method and system for an optical multiplier-adder. The invention provides a residual error calibration method and a residual error calibration system for an optical multiplier-adder, which are used for error compensation of the optical multiplier-adder, can reduce the equivalent matrix offset of the optical multiplier-adder caused by non-ideal factors such as process errors, limited configuration voltage precision and the like, and realize the effects of improving the calculation precision of the optical multiplier-adder and the application accuracy such as picture pattern recognition and the like. The beneficial effects of the invention are as follows: (1) The compensation method and the system of the optical multiply adder can realize the effect of improving the matrix multiplication calculation precision and the application accuracy such as pattern recognition and the like; (2) The compensation effect can be controlled by setting an arbitrary number of times of compensation.

Description

Residual error calibration method and system for optical multiply-add device
Technical Field
The invention belongs to the technical field of information, and particularly relates to a residual error calibration method and system for an optical multiplier-adder.
Background
Matrix multiplication is the most widely used computing tool in the scientific and engineering fields, and occupies most of the computing overhead in modern signal processing and artificial intelligence algorithms. Multiply-add devices are computing units for implementing matrix multiplication, and various multiply-add device structures have been proposed to accelerate the matrix multiplication process, where optical methods provide a highly parallel, low-power-consumption, high-speed solution.
Currently, optical computing chips based on Mach-Zehnder interferometer (Mach-Zehnder interferometer, MZI) arrays are one of the mainstream implementations of optical multiplier-adder. Such an optical multiplier-adder includes a plurality of modulators, a configurable MZI array, and a plurality of detectors. The incident light is encoded by the modulator and then propagates in the MZI array, and matrix multiplication calculation is realized by utilizing the controllable interference of the optical signals. And then receiving the output optical signals of the optical multiplier-adder by using a plurality of detectors and converting the electrical signals, thereby obtaining a calculation result.
Because the optical multiplier-adder belongs to analog calculation, the calculation result is sensitive to errors in the system, and the calculation accuracy of the optical multiplier-adder is reduced due to hardware processing process errors of the multiplier-adder, limited configuration voltage accuracy, working environment temperature and the like.
Disclosure of Invention
Aiming at the problems, the invention provides a residual error calibration method and a residual error calibration system for an optical multiplier-adder, which are used for providing the optical multiplier-adder with higher calculation accuracy.
The technical scheme of the invention is as follows:
residual calibration method for an optical multiply-add device, calculating the task y=ax for the real number domain, wherein Configuring MZI array to +.>Modulating an optical signal into x and inputting the x into an MZI array, wherein the obtained output signal t meets t=Sx, and the y=sigma is calculated by a digital circuit 1,A t to compensate for the scaling factor, defining the actual matrix of the optical multiplier-adder with errors as +.>Error matrix is +.>The calculation result of the optical multiplier-adder is:
wherein sigma k,A Representing the maximum singular value of matrix a, k representing the rank of matrix a;
the residual error calibration method comprises the following steps:
defining a residual matrixRepresenting the gap between the actual system and the target, < +.>Is the whole equivalent matrix of the optical multiplier-adder, and R is stretched out and drawn back to obtain +>The MZI array is configured as S ', the optical signal is modulated into x again and is input into the MZI array, the obtained output signal t' meets t '=S' x, then the digital circuit calculates the compensation expansion coefficient, and the actual matrix and the error matrix of the optical multiplier-adder with errors are respectively ++>And->The compensated calculation result is as follows:
therefore, the whole accuracy of the calculation task is improved by selecting the target matrix of the optical multiplier-adder as R with smaller maximum singular value.
A residual error calibration system for an optical multiplier-adder comprises a host, a data transmission module, an electro-optic conversion module, an MZI array, a photoelectric conversion module and a configuration module;
the host computer sends a calculation task to the electro-optical conversion module through the data transmission module, the electro-optical conversion module converts the digital signal into an optical signal and sends the optical signal to the MZI array, and the calculation task is defined as a matrix A and N input vectors { x } 1 ,x 2 ,...,x N }, wherein
The MZI array is used for calculating the received optical signals, transmitting the calculation result to the photoelectric conversion module to be converted into digital signals, and finally transmitting the digital signals to the host through the data transmission module;
the configuration module is used for receiving and storing voltage signals required by the calculation of the MZI array issued by the host through the data transmission module;
the specific method for calculating and calibrating the MZI array under the control of the host is as follows:
host computingAccording to matrix R (k) Calculating a set of phase shift values required for each MZI phase shifterWherein k means the kth compensation, +.>Initial value +.>The driving voltage required by the MZI array to compensate is obtained by the phase shifter voltage-phase shift formula>
The host acquires the actual matrix with the error of the MZI arrayCalculating the overall equivalent matrix->Wherein sigma 1,(·) Representing the maximum singular value of the matrix (), and the configuration module outputs the voltage value V during the kth compensation (k) Send to the MZI array;
intermediate results are obtained by the MZI array when calculating the ith vector of the taskAnd send to the host computer, the host computer calculates +.>After all N input vectors are calculated and compensated K times, N final calculated result vectors are obtained>
The beneficial effects of the invention are as follows: (1) The compensation method and the system of the optical multiply adder can realize the effect of improving the matrix multiplication calculation precision and the application accuracy such as pattern recognition and the like; (2) The compensation effect can be controlled by setting an arbitrary number of compensation times K.
Drawings
FIG. 1 is a schematic diagram of the method of the present invention.
Fig. 2 is a configuration voltage measurement flow chart of a residual calibration method for an optical multiplier-adder.
Fig. 3 is a task calculation flow chart of a residual calibration method for an optical multiply-add.
Fig. 4 is a graph of the change in the optical multiply-add equivalent matrix before and after introducing the different times of compensation.
Fig. 5 is a comparison of image pattern recognition accuracy based on an optical multiply-add before and after introducing residual compensation.
Detailed Description
The present invention will be described in detail with reference to the accompanying drawings and simulation examples.
The residual error calibration method for the optical multiply-add device is based on the following principle:
assume that there is a real-number domain calculation task y=ax, whereFrom singular value decomposition, a=uΣv * Wherein U is an mxm-order unitary matrix; v (V) * I.e., the conjugate transpose of V is an n×n unitary matrix; Σ=diag (σ) 1,A2,A ,…,σ k,A ) Wherein sigma 1,(·) Represents the maximum singular value of the matrix (), k represents the rank of matrix a. An optical multiplier-adder based on an MZI array cannot realize a diagonal matrix with element values greater than 1, so that the MZI array needs to be configured to +.>The optical signal is modulated into x and input into the MZI array, the resulting output signal t satisfies t=sx, and then y=σ is calculated by the digital circuit 1,A t to compensate for the scaling factor, define the process as an "original term" calculation. Let the actual matrix with errors of the optical multiplier-adder be +.>Defining an error matrix->The actual calculation result of the optical multiplier-adder is
The overall equivalent matrix of the optical multiplier-adder isI.e. the final calculation of the system->Error magnitude using the mean square error estimation matrix:
let element delta of residual matrix delta ij Satisfy independent same distribution (Gauss)Then the MSE is expectedVariance->Therefore, the maximum singular value σ can be reduced by reasonably selecting the target matrix A of the optical multiplier-adder 1,A The calculation accuracy of the optical multiplier-adder can be improved, and the specific implementation method is as follows:
defining a residual matrixR represents the gap between the actual system and the target. Stretching R to obtainThe MZI array is configured as S ', the optical signal is modulated again as x and input into the MZI array, the resulting output signal t' satisfies t '=s' x, and then the compensation scaling factor is calculated by the digital circuit, defining the process as a "compensation term" calculation for compensating the error of the original term. It is assumed that the actual matrix and the error matrix with errors of the optical multiplier-adder are +.>Andthen supplementThe calculation result after compensation is
The overall equivalent matrix of the optical multiplier-adder isError is formed by sigma 1,A Delta to sigma 1,R Delta', desired +.>Variance->Thus, when sigma 1,A <σ 1,R When the MSE is compensated, the expected standard deviation and the standard deviation are reduced, and the calculation is more accurate. Due to->Thus sigma 1,R =σ 1,A σ 1,Δ Condition sigma 1,A <σ 1,R Conversion to sigma 1,Δ And (2) when the matrix configuration of the MZI array is sufficiently accurate, the target matrix of the optical multiplier-adder is selected as R with smaller maximum singular value, and the original term is compensated by using the compensation term with smaller error, so that the overall accuracy of the calculation task is improved.
The residual calibration method can be expanded into multiple compensations, the compensation item of the kth compensation is regarded as the original item of the k+1 compensation, a new residual matrix is calculated, and further compensation and improvement of calculation accuracy are realized.
The present invention provides a residual calibration system for an optical multiplier-adder, comprising:
the calculation module is used for realizing efficient and rapid matrix multiplication calculation and comprises a plurality of electro-optical conversion modules, MZI arrays and photoelectric conversion modules. The electro-optical conversion module is used for converting a calculation task issued by the host from a binary electric signal to an analog optical signal and then inputting the analog optical signal to the MZI array; the input optical signals propagate in the MZI array and interfere, so that the optical signals at the output end can be expressed as the multiplication and addition result of the input optical signals and a certain matrix, and the matrix is regulated and controlled by a plurality of paths of direct current signals provided by a configuration module; the photoelectric conversion module is used for converting the output of the MZI array from an analog optical signal to a binary electric signal and uploading the binary electric signal to the host.
The configuration module is used for regulating and controlling matrix values of the calculation module and comprises a memory and a voltage driving circuit. The memory is used for storing the regulation voltage required by the calculation module, and the regulation voltage is calculated and issued by the host; the voltage driving circuit is used for outputting analog direct-current voltage corresponding to the memory, driving the phase shifter in the MZI array of the calculation module, controlling the local temperature of the phase shifter by utilizing the Joule heat generated by the voltage, and further controlling the local refractive index of the material to realize the configuration of the matrix.
And the data transmission module is used for uploading and transmitting data among the calculation module, the configuration module and the host.
The host computer is used for calculating the regulation and control voltage required by the calculation module, sending calculation tasks, receiving calculation results, compensating the expansion coefficient and summing the original item and the compensation item.
As shown in fig. 1, a schematic diagram of a specific logic module of the system of the present invention is shown, and specific execution steps are as follows:
s1, confirming a calculation task, wherein the task comprises 1 matrix A and N input vectors { x } 1 ,x 2 ,...,x N }, wherein
S2, building optical multiplier-adder hardware, as shown in FIG. 1: in the electro-optic conversion module 141, the digital signal 105a is encoded into a complex polarization of a set of optical signals 105b as an input signal to an optical multiplier-adder; MZI array 142 is formed of one or more interconnected MZI's, performing a multiply-add operation on input signal 105b, the matrix value being controlled by the output voltage value of drive circuit 131 in configuration module 130; the photoelectric conversion module 143 converts the detected optical MZI array output optical signal 105c into a digital signal 105d; the system time sequence and various parameters are controlled by the host 110, and the data transmission module 120 completes the issuing and uploading of the instructions and data.
S3, confirming a voltage set required by configuration of the original term and the compensation term matrix, wherein the voltage set is shown in a flow chart in FIG. 2, and specifically comprises the following steps:
s31, confirming the super-parameters of the optical multiplier adder, including half-wave voltage v of the MZI phase shifter π Total compensation times K; definition of the definitionk=0;
S32, at the kth compensation, the host 110 calculates the residual errorAccording to matrix R (k) Calculating the set of phase shift values required for each MZI phase shifter +.>From the phase shifter voltage-phase shift formula
Confirming the output voltage value of the driving circuit 131The host 110 will have a voltage value V (k) The transmitter 121 in the data transmission module 120 issues the data to the configuration module 130 and stores the data in the memory 132; the driving circuit 131 outputs a corresponding driving voltage according to the digital value in the memory 132;
s33, the host sequentially transmits n-order unit vectors I n Is issued by the transmitter 121 in the data transmission module 120 to the electro-optical conversion module 141 of the calculation module 140; the photoelectric conversion module 143 uploads the calculation result 105d from the receiver 122 in the data transmission module 120 to the host 110 to obtain an actual matrix with errors of the MZI array
S34, the host 110 calculates the integral equivalent matrix of the optical multiplier-adderK=k+1; the host 110 judges whether the calibration times K is less than or equal to K, if yes, the steps S32-S34 are repeated, otherwise, the step S4 is skipped;
s4, executing a computing task, wherein the computing task is specifically as follows in the flowchart shown in FIG. 3:
s41, defining k=0;
s42, in the kth compensation, the host 110 outputs the voltage value V (k) The transmitter 121 in the data transmission module 120 issues the data to the configuration module 130 and stores the data in the memory 132; the driving circuit 131 outputs a corresponding driving voltage according to the digital value in the memory 132;
s43, defining i=1,
s44, when the ith vector is calculated in the task, the host sends x i ∈{x 1 ,x 2 ,...,x N The column vector 105a is sent by the transmitter 121 in the data transmission module 120 to the electro-optical conversion module 141 of the calculation module 140; the photoelectric conversion module 143 uploads the calculation result 105d from the receiver 122 in the data transmission module 120 to the host 110 to obtain a calculation intermediate result
S45, the host 110 calculatesI=i+1; the host 110 judges whether i satisfies i.ltoreq.N, if so, repeats step S44, otherwise calculates k=k+1 and jumps to step S42;
s5, the host 110 outputs N final calculation result vectorsWherein->
Simulation example:
a random Gaussian coupler error and phase shifter error model is adopted in the simulation, and then the offset of the MZI array equivalent matrix is introduced.
And simulating the residual error compensation effect calculated by the matrix vector along with the change of the compensation times, adopting a random matrix as a target matrix of a calculation task, and continuing residual error calibration, wherein the simulation result is shown in figure 4. In fig. 4, the visual results of the optical multiplier-adder equivalent matrix are shown from top to bottom with no error, with error but without compensation, with error and with compensation, respectively; from left to right are different random target matrix samples, respectively. As can be seen from fig. 4, the equivalent matrix error of the optical multiplier-adder after compensation is improved, and the greater the number of compensation, the higher the optical multiplier-adder accuracy.
And simulating residual error compensation applied to image pattern recognition based on an optical multiplier adder, and adopting an MNIST handwriting digital recognition image as a data set applied to pattern recognition. Pattern recognition is implemented by convolutional neural networks, where the multiply-add operation of the convolutional layers is performed by optical multiply-add devices, the experimental results of which are shown in fig. 5. In fig. 5, from left to right, there are confusion matrices for MNIST handwritten digital image pattern recognition based on optical multiply-add devices, respectively, without error, but without compensation, with error, and with compensation. As can be seen from fig. 5, the accuracy of the image pattern recognition after compensation increases.

Claims (2)

1. Residual calibration method for an optical multiply-add device, calculating the task y=ax for the real number domain, wherein Configuring MZI array to +.>Modulate an optical signal to x and inputMZI array, the resulting output signal t satisfies t=sx, and y=σ is calculated by digital circuitry 1,A t to compensate for the scaling factor, defining the actual matrix of the optical multiplier-adder with errors as +.>Error matrix is +.>The calculation result of the optical multiplier-adder is:
wherein sigma k,A Representing the maximum singular value of matrix a, k representing the rank of matrix a;
the residual error calibration method is characterized by comprising the following steps:
defining a residual matrixRepresenting the gap between the actual system and the target, < +.>Is the whole equivalent matrix of the optical multiplier-adder, and R is stretched out and drawn back to obtain +>The MZI array is configured as S ', the optical signal is modulated into x again and is input into the MZI array, the obtained output signal t' meets t '=S' x, then the digital circuit calculates the compensation expansion coefficient, and the actual matrix and the error matrix of the optical multiplier-adder with errors are respectively ++>And->The compensated calculation result is as follows:
therefore, the whole accuracy of the calculation task is improved by selecting the target matrix of the optical multiplier-adder as R with smaller maximum singular value.
2. The residual error calibration system for the optical multiplier-adder is characterized by comprising a host, a data transmission module, an electro-optical conversion module, an MZI array, a photoelectric conversion module and a configuration module;
the host computer sends a calculation task to the electro-optical conversion module through the data transmission module, the electro-optical conversion module converts the digital signal into an optical signal and sends the optical signal to the MZI array, and the calculation task is defined as a matrix A and N input vectors { x } 1 ,x 2 ,...,x N }, wherein
The MZI array is used for calculating the received optical signals, transmitting the calculation result to the photoelectric conversion module to be converted into digital signals, and finally transmitting the digital signals to the host through the data transmission module;
the configuration module is used for receiving and storing voltage signals required by the calculation of the MZI array issued by the host through the data transmission module;
the specific method for calculating and calibrating the MZI array under the control of the host is as follows:
host computingAccording to matrix R (k) Calculating a set of phase shift values required for each MZI phase shifterWherein k means the kth compensation, +.>Initial value +.>The driving voltage required by the MZI array to compensate is obtained by the phase shifter voltage-phase shift formula>
The host acquires the actual matrix with the error of the MZI arrayCalculating the overall equivalent matrix->Wherein sigma 1,(·) Representing the maximum singular value of the matrix (), and the configuration module outputs the voltage value V during the kth compensation (k) Send to the MZI array;
intermediate results are obtained by the MZI array when calculating the ith vector of the taskAnd send to the host computer, the host computer calculates +.>After all N input vectors are calculated and K times of compensation are carried out, N final calculated result vectors are obtained
CN202311094457.9A 2023-08-28 2023-08-28 Residual error calibration method and system for optical multiply-add device Pending CN117193469A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311094457.9A CN117193469A (en) 2023-08-28 2023-08-28 Residual error calibration method and system for optical multiply-add device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311094457.9A CN117193469A (en) 2023-08-28 2023-08-28 Residual error calibration method and system for optical multiply-add device

Publications (1)

Publication Number Publication Date
CN117193469A true CN117193469A (en) 2023-12-08

Family

ID=88984244

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311094457.9A Pending CN117193469A (en) 2023-08-28 2023-08-28 Residual error calibration method and system for optical multiply-add device

Country Status (1)

Country Link
CN (1) CN117193469A (en)

Similar Documents

Publication Publication Date Title
Pai et al. Parallel programming of an arbitrary feedforward photonic network
US11775779B2 (en) Hybrid analog-digital matrix processors
Costa et al. Lyapunov-based adaptive control of MIMO systems
Lu et al. Synchronization-based approach for parameters identification in delayed chaotic neural networks
Chu et al. H∞ observer-based event-triggered sliding mode control for a class of discrete-time nonlinear networked systems with quantizations
WO2021248810A1 (en) Calculation device, calculation method and calculation system
TW202112074A (en) Systems and methods for analog computing using a linear photonic processor
CN109784485B (en) Optical neural network processor and calculation method thereof
Gu et al. ROQ: A noise-aware quantization scheme towards robust optical neural networks with low-bit controls
Wang et al. Stability analysis of nonlinear switched systems with sampled-data controllers
Liu et al. Robust H-infinity control for a class of neutral-type systems via sliding mode observer
Wen et al. Novel data-driven two-dimensional Q-learning for optimal tracking control of batch process with unknown dynamics
Chen et al. Information-based distributed extended Kalman filter with dynamic quantization via communication channels
Wang et al. Asynchronous finite-time state estimation for semi-Markovian jump neural networks with randomly occurred sensor nonlinearities
Filipovich et al. Monolithic silicon photonic architecture for training deep neural networks with direct feedback alignment
Huang et al. Easily scalable photonic tensor core based on tunable units with single internal phase shifters
Oikonomou et al. A robust, quantization-aware training method for photonic neural networks
CN117193469A (en) Residual error calibration method and system for optical multiply-add device
Zheng et al. Robust guaranteed cost control of networked Takagi–Sugeno fuzzy systems with local nonlinear parts and multiple quantizations
Najarro et al. Nonlinear compensation using artificial neural network in radio-over-fiber system
Wen et al. Optimal fast-response sliding-mode control for flexible-substrate measurement
Ikeda et al. Integrated 16× 16 photonic analog vector-matrix multiplier with task-specific tuning after deterministic calibration
Zhou et al. Output feedback control for MIMO nonlinear systems using factorization
Baudzus et al. Modified downhill simplex method for fast adaption of optical filters in optical communication systems
US12038777B2 (en) Fast prediction processor

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination