Quantum matrix operator and quantum matrix operation method for artificial neural network
The quantum matrix operator and calculation method address the flexibility and scalability issues of existing accelerators by using quantum superposition and inner product circuits for efficient large-scale parallel processing, effectively handling exponentially increasing data sizes in artificial neural networks.
Patent Information
- Application Number
- PCT/KR2023/016743
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-02-20
- Filing Date
- 2023-10-26
- Publication Date
- 2024-08-29
Smart Images

Figure KR2023016743_29082024_PF_FP_ABST
Abstract
Description
Quantum matrix operator and quantum matrix operation method for artificial neural networks
[0001] The present invention relates to a quantum matrix operator and a quantum matrix operation method for an artificial neural network.
[0002] Recently, artificial neural networks, which are configured to process various information in a similar way to the brain by imitating the way the human brain recognizes patterns, are being applied and used in various fields.
[0003] These artificial neural networks require learning based on massive amounts of data, and in the process, they must perform a large number of addition and multiplication operations. Therefore, the chip structure that performs operations for artificial neural networks must be equipped with a large number of operation circuits, such as MAC (multiply-accumulate operaters).
[0004] Therefore, a new type of hardware accelerator specialized in deep learning of artificial neural networks has recently attracted significant attention.
[0005] Deep learning accelerators come in different forms depending on their intended use and environment. For example, GPUs (Graphics Processing Units) are primarily used in performance-focused servers and workstations, while edge devices like smartphones prioritize low power consumption, primarily utilizing dedicated hardware designed using FPGAs (Field Programmable Gate Arrays) or ASICs (Application Specific Integrated Circuits), namely Neural Processing Units (NPUs).
[0006] However, many accelerators released to date lack the flexibility to handle the diverse layers or tensors used in various artificial neural networks due to their dedicated hardware characteristics. This shortcoming presents a problem in that it hinders their ability to support the wide variety of deep learning applications and models currently in use.
[0007] Meanwhile, in order to variably use multiple computational devices, the control circuit becomes complex, and as a result, some computational devices may not be used and remain idle during the computational process of the artificial neural network, which may cause inefficiency and additional unnecessary power consumption.
[0008] Prior art document 1 (publication number 10-2021-0014897, published on February 10, 2021) relates to a matrix operator and a matrix operation method for an artificial neural network.
[0009] Prior art document 1 provides a matrix operator and a matrix operation method that can increase computational efficiency and reduce power consumption by simultaneously performing multiplication and addition operations in parallel according to a pipeline technique, and is characterized by reducing the number of addition operations through an accumulator.
[0010] However, according to prior literature 1, as the number of parameters of an artificial neural network increases, the size of the matrix required for operation increases proportionally, and as the number of matrix elements required for parallel processing increases, the number of PEs and accumulators must increase, and the number of pipelines (SIMDL) also increases. In order to process parameters in the order of hundreds of billions, matrix operations in the order of thousands to tens of thousands are required, and there is a disadvantage in that a bottleneck occurs in the parallel operation process for this, or even in parallel processing, the total operation time inevitably increases due to the increase in the number of unit processing times.
[0011] Prior art document 1 only accelerates matrix multiplication operations through parallel operations (algorithms), but the present invention utilizes a matrix multiplication operation technique through quantum superposition and quantum inner product circuits, and provides a new matrix operation method that obtains a high-dimensional parallel matrix weighted sum through circuit execution alone, using a quantum-specific characteristic that does not require sub-modules such as multipliers / adders / accumulators of existing classical computers.
[0012] Prior art document 2 (publication number 10-2021-0137772, published on November 18, 2021) relates to a quantum computation optimization device and method.
[0013] Prior art 2 defines an optimization process for quantum computation for an arbitrary problem. Given an arbitrary problem (code), the corresponding computational process is divided into blocks, and the block modules capable of quantum computation are classified and reused. The classified quantum computation blocks are processed by a quantum computation identification module, which determines whether to process them using quantum simulation or a quantum computer, based on metrics and reference values such as TEPTc (estimated processing time of a quantum computer), TEPTs (estimated processing time of a quantum simulator), and TEEA (estimated error amount of a quantum computer).
[0014] However, prior art document 2 omits the specific processes of actual quantum computation and is defined abstractly. Furthermore, prior art document 1 does not specifically specify the types of problems that can be computed by quantum computers or the resulting solutions.
[0015] Prior art document 2 is a technique that simply divides computational units into blocks to increase reusability and classifies simulator and hardware computations, whereas the present invention can secure progress due to the effects or influences of quantum computing by specifying computational techniques in detail, and can be used universally in any quantum environment regardless of simulator or hardware.
[0016] The present invention aims to solve the above-mentioned problems and other problems, and aims to provide a matrix operator and a matrix operation method for an artificial neural network capable of performing quantum matrix multiplication in an optimized manner.
[0017] According to one aspect of the present invention to achieve the above or other purposes, a quantum matrix operator according to an embodiment of the present invention includes a quantum embedding circuit that converts weight values and input data stored in a memory into quantum states, a quantum inner product circuit that performs matrix multiplication using quantized values, and a quantum activation function circuit that converts the result of the matrix multiplication operation into a value before quantization to reflect the weight values.
[0018] In an embodiment, the quantum embedding circuit is characterized by converting weight values and input data stored in a memory into a quantum superposition state so that quantum operations are possible.
[0019] In an embodiment, the quantum history circuit is characterized by performing a matrix multiplication operation on quantized values and outputting the result in the form of a probability distribution.
[0020] In an embodiment, the quantum activation function circuit is characterized by applying a nonlinear activation function of an artificial neural network.
[0021] In an embodiment, the quantum activation function circuit is characterized by using a RUS (Repeat Until Success) circuit.
[0022] In an embodiment, the quantum embedding circuit is characterized by separating the weight matrix of the artificial neural network model by layer.
[0023] In an embodiment, the quantum embedding circuit is characterized in that it quantum embedding-processes a weight matrix for each separated layer.
[0024] In an embodiment, the quantum embedding circuit is characterized in that it determines whether the layer to be subjected to quantum embedding processing is the last layer and performs different processing depending on whether it is the last layer.
[0025] In an embodiment, the quantum embedding circuit is characterized in that, when the layer to be quantum embedding processed is not the last layer, the result value of the previous layer is quantum embedding processed.
[0026] In an embodiment, the quantum embedding circuit is characterized in that, when the layer to be quantum embedding processed is the last layer, the final result is stored.
[0027] In an embodiment, the method further includes a post-processing module that processes a result value measured through quantum operation processing, and the post-processing module is characterized in that it processes the result value measured through the quantum operation processing and transmits it to the quantum active function circuit.
[0028] In an embodiment, the quantum active function circuit further includes a buffer unit that applies matrix data with weights reflected to a memory.
[0029] According to the present invention, in the case of quantum matrix multiplication, even if the size of data and artificial neural network (matrix) increases exponentially, processing is possible with a linear number of qubits, making it effective for large-scale parallel processing.
[0030] In particular, it is expected to become an essential element in the development of ultra-large-scale artificial intelligence, which has recently been expanding into various forms.
[0031] FIG. 1 is a block diagram illustrating a quantum matrix operator according to an embodiment of the present invention.
[0032] FIG. 2 is a flowchart for explaining a quantum matrix operation method according to an embodiment of the present invention.
[0033] Figures 3, 4, 5, 6, 7, 8, and 9 are conceptual diagrams for explaining the quantum matrix operation method examined in Figure 2.
[0034] It should be noted that the technical terms used herein are used merely to describe specific embodiments and are not intended to limit the present invention. Furthermore, singular expressions used herein include plural expressions unless the context clearly dictates otherwise. The suffixes "module" and "part" used in the following description for components are assigned or used interchangeably solely for the convenience of writing the specification, and do not in themselves have distinct meanings or roles.
[0035] In this specification, the terms “comprises” or “includes” should not be construed to necessarily include all of the components or steps described in the specification, and some of the components or steps may not be included, or additional components or steps may be included.
[0036] In addition, when describing the technology disclosed in this specification, if it is determined that a detailed description of a related known technology may obscure the gist of the technology disclosed in this specification, the detailed description is omitted.
[0037] Furthermore, the attached drawings are merely intended to facilitate understanding of the embodiments disclosed herein, and should not be construed as limiting the technical concepts disclosed herein, but rather encompassing all modifications, equivalents, and alternatives within the spirit and technical scope of the present invention. Furthermore, not only the individual embodiments described below, but also combinations of embodiments may fall within the spirit and technical scope of the present invention, as modifications, equivalents, and alternatives.
[0038] Hereinafter, the configuration and operation of the present invention will be described in more detail with reference to a number of drawings related to the present invention.
[0039] FIG. 1 is a block diagram illustrating a quantum matrix operator according to an embodiment of the present invention.
[0040] Referring to FIG. 1, the quantum matrix operator of the present invention may include a computer (100) (or computing device) and a quantum computer (200) (or quantum computing device).
[0041] For convenience of explanation, in this specification, the quantum matrix operator is described as including a computer and a quantum computer, respectively; however, the quantum matrix operator may be implemented as a single device including components of a computer and a quantum computer.
[0042] With the advent of super-large-scale artificial intelligence, a key element in artificial neural network learning / processing is emerging: a computational technique that can secure the execution time to match the increase in the number of parameters resulting from the increase in the complexity of artificial intelligence models.
[0043] Quantum computing is an innovative information processing technique that reflects the unique characteristics of quantum computing, unlike accelerators such as GPUs and TPUs (ASIC devices) developed within the framework of existing classical computing. It has the scalability to process hundreds of millions of data in parallel with dozens of qubits.
[0044] Although various types of specialized hardware accelerators (GPUs, TPUs, etc.) and parallel processing techniques have been introduced to accelerate deep learning of artificial neural networks, it is still difficult to secure a usable level of learning and inference time due to the exponentially increasing number of parameters and data expansion.
[0045] Existing parallel matrix operation processing techniques focus on supporting parallel processing by architecturally expanding the circuit or algorithmically reducing the amount of calculation through an accumulator, but they are insufficient to cope with the exponential increase in the amount of calculation.
[0046] Research on new computational techniques utilizing quantum computing is active, but it is limited to somewhat abstract definitions of techniques without specifying specific methods of application.
[0047] The present invention utilizes such quantum computing to provide a quantum matrix operator and a quantum matrix operation method capable of performing large-scale parallel processing by processing with a linear number of qubits even when the size of data and an artificial neural network (matrix) increases exponentially.
[0048] The artificial neural network described in this specification may include, for example, a convolutional neural network (CNN).
[0049] To this end, the computer (100) included in the quantum matrix operator of the present invention may include an operation control unit (110), a first buffer unit (120), a second buffer unit (130), an operation circuit generator (140), and a post-processing unit (150).
[0050] In addition, the quantum computer (200) included in the quantum matrix operator of the present invention may include an operation circuit performer (210) and an activation function performer (220).
[0051] The configurations described above can be used as modules of an artificial neural network.
[0052] The operation control unit (110) receives a plurality of matrices on which operations are to be performed in each layer of the artificial neural network. Here, the plurality of matrices on which operations are to be performed may be at least one feature map (or input image) applied to a layer and at least one kernel specified for each layer.
[0053] The operation control unit (110) selects two matrices on which an operation is to be performed among a plurality of authorized matrices, and transmits the two selected matrices together with an operation command to the first buffer unit (120) and the second buffer unit (130).
[0054] For example, a multiplicand matrix for at least one feature map applied to a layer of an artificial neural network may be applied to the first buffer unit (120), and a multiplier matrix for a kernel specified in a layer of an artificial neural network may be applied to the second buffer unit (130).
[0055] And the operation control unit (110) can receive the matrix operation result from the operation circuit generator (140) and transmit it to a memory (not shown) and store it.
[0056] The operation control unit (110) authorizes the selected matrix together with the operation command so that the elements of each matrix can be selected to perform a matrix multiplication operation based on the matrix multiplication algorithm according to the present embodiment described later.
[0057] The first buffer unit (120) selects elements in units of columns from the multiplicand matrix applied from the operation control unit (110) according to the operation command and transfers them to the operation circuit generator (140). In addition, the second buffer unit (130) selects elements in units of rows from the multiplier matrix applied according to the operation command and transfers them to the operation circuit generator (140).
[0058] For example, the operation circuit generator (140) may include a plurality of operation processing lanes (SIMDL). Each of the plurality of operation processing lanes (SIMDL) may include a plurality of process elements (PEs) and SIMD units (SIMDUs).
[0059] To improve computational efficiency, recent matrix processors typically utilize Single Instruction Multiple Data (SIMD) techniques, allowing complex operations to be processed in a single command. SIMD techniques allow multiple processor elements (PEs) to simultaneously apply the same (or similar) operations to multiple data sets. This technique is primarily used in vector processors.
[0060] In the SIMD technique, in order to maximize the efficiency of commands, multiple sets of commands that can process multiple data with a single command are stored. Each stored command set is then used to perform operations in parallel simultaneously for multiple process elements (PEs) using data level parallelism (DLP). That is, the SIMD unit (SIMDU) performs the same operation in parallel on multiple process elements (PEs) assigned to elements applied in units of rows or columns from the first and second buffer units (120, 130).
[0061] Here, the SIMD unit (SIMDU) may be implemented as hardware within the operation circuit generator (140), but may also be implemented as software that specifies the operations performed in the operation circuit generator (140). In some cases, it may also be implemented within the operation control unit (110).
[0062] Each of a plurality of process elements (PE) receives elements of a multiplicand matrix and a multiplier matrix that must be operated on each other from the first and second buffer units (120, 130) and performs a multiplication or addition operation. Each of the plurality of process elements (PE) can be implemented as a MAC operator (multiply-accumulate operator).
[0063] Meanwhile, the present invention may include a quantum embedding circuit that converts the weight values and input data (including the result values of the previous step) of an artificial neural network into a quantum state, a quantum inner product circuit that performs quantum matrix multiplication, and a quantum activation function circuit.
[0064] A quantum embedding circuit can be generated in an operation circuit generator (140) (or an operation circuit performer (210)).
[0065] Quantum embedding circuits can perform the role of converting weight values and input data in memory into a quantum superposition state to enable quantum computation.
[0066] The operation circuit performer (210) can create and execute a quantum inner product circuit (or quantum matrix multiplication circuit) that performs a matrix multiplication operation using quantum-reduced values.
[0067] A quantum inner circuit can be generated in an operation circuit performer (210) (or an operation circuit generator (140)).
[0068] A quantum inner circuit is a circuit that performs matrix multiplication operations based on quantized values, and can return results in the form of a probability distribution or a specific state through measurement.
[0069] In addition, the quantum inner circuit can reflect the characteristics of the originally learned weights by passing the operation result (in the form of a probability distribution) through a quantum activation function circuit (or quantum activation circuit) after converting it to the original value.
[0070] The quantum active function circuit can be generated and / or executed by the active function performer (220), and can perform the role of reflecting the weight value by converting the result of the matrix multiplication operation into a value before quantization.
[0071] The operation control unit (110) can control the entire circuit configuration.
[0072] The buffer unit (120, 130) can accept matrix data from memory.
[0073] The post-processing unit (150) (or post-processing module) can process the measured result values through quantum operation processing.
[0074] The quantum embedding circuit (140) can convert the weight values and input data stored in the memory into a quantum superposition state to enable quantum operations.
[0075] The above quantum history circuit (210) can perform matrix multiplication operation on quantized values and output the result in the form of a probability distribution.
[0076] The above quantum activation function circuit (220) can apply a nonlinear activation function of an artificial neural network. For example, the above quantum activation function circuit can utilize a RUS (Repeat Until Success) circuit.
[0077] FIG. 2 is a flowchart for explaining a quantum matrix operation method according to an embodiment of the present invention.
[0078] Referring to FIG. 2, a quantum matrix operation method according to an embodiment of the present invention may include a step in which a quantum embedding circuit separates a weight matrix of an artificial neural network model by layer (S210).
[0079] The above quantum embedding circuit can perform quantum embedding processing on a weight matrix for each separated layer (S220).
[0080] Thereafter, the quantum embedding circuit can determine whether the layer to be subjected to quantum embedding processing is the last layer and perform different processing depending on whether it is the last layer (S230).
[0081] For example, the above quantum embedding circuit can quantum embedding-process the result value of the previous layer if the layer that needs to be quantum embedding-processed is not the last layer (S240).
[0082] Thereafter, the operation circuit performer (210) (or operation circuit generator) (140) can generate a quantum inner product circuit (quantum matrix multiplication circuit) (S250) and perform (execute) the quantum circuit for the quantum embedding-processed layer (S260).
[0083] As described above, the quantum matrix operator of the present invention may further include a post-processing module (150) that processes the result values measured through quantum operation processing.
[0084] The post-processing module (150) can process the result value measured through the quantum operation processing and transmit it to the quantum active function circuit (220) (S270).
[0085] The quantum activation function circuit (220) included in the activation function performer (220) can perform (execute) the activation function circuit on the transmitted result value (S280) and store the final result in memory (S290).
[0086] On the other hand, the quantum embedding circuit can store the final result if the layer that needs to be quantum embedding processed is the last layer (S290).
[0087] The buffer unit (specifically, the second buffer unit (130)) can apply matrix data with weights reflected in the quantum active function circuit to the memory.
[0088] Figures 3, 4, 5, 6, 7 and 8 are conceptual diagrams for explaining the quantum matrix operation method examined in Figure 2.
[0089] Figure 3 is a diagram showing an example of an artificial neural network and the computational process.
[0090] Figure 4 is a diagram showing a circuit that performs quantum embedding of a weight matrix.
[0091] Figure 5 is a diagram showing a circuit that performs quantum embedding of an input (data) matrix.
[0092] Figure 6 is a conceptual diagram showing an example of a quantum inner product circuit (quantum matrix multiplication circuit).
[0093] Figure 7 is a diagram showing the postprocessing result.
[0094] Fig. 8 illustrates an example of a quantum activation function circuit (quantum activation circuit), and the circuit of Fig. 8 illustrates, as an example, a (Quantum Activation Function: RUS circuit).
[0095] Figure 9 is a diagram illustrating the quantum matrix multiplication operation of the present invention.
[0096] According to the present invention, the present invention performs quantum embedding processing on matrix A (a_0,0, a_1,0, …, a_0,m) and matrix B (b_0,0, …, b_m,0), and then performs matrix multiplication operation using quantized values in a quantum inner product circuit of a quantum circuit that performs quantum matrix multiplication, and outputs a result value (C_0,0) with weights reflected as a result value through post-processing and a quantum activation function circuit.
[0097] In the case of the previous patent for “Matrix operator and matrix operation method for artificial neural network,” the size and complexity of the circuit increase in proportion to the size (number of parameters) of the artificial neural network, whereas the technique using a quantum computer of the present invention can process data of an exponent of 2n in parallel and simultaneously with n qubits, so it can be seen that it is a groundbreaking structure in terms of expansion and processing complexity.
[0098] In addition, compared to the previous “quantum calculation optimization device and method”, it is an abstract definition that receives input as arbitrary code and classifies it into block units to increase reusability, and processes it by distinguishing between quantum simulation (SW) and computer (HW), whereas the present invention can provide a technique that can be universally applied regardless of whether it is quantum simulation (SW) or quantum computer (HW).
[0099]
[0100] In summary, the process of performing quantum matrix multiplication of the present invention has the following characteristics: 1) Amplitude / Basic Embedding 2) Quantum Inner Product (SWAP test) / Quantum arithmetic with the Quantum Fourier Transform 3) Quantum activation circuit (RUS (Repeat-until-success)).
[0101] The first technique for performing quantum embedding is Amplitude Embedding, which maps the probability distribution (Amplitude) through measurement and the size of input data directly into a quantum state, allowing quantum arithmetic operations on large-scale data with exponential powers to be performed.
[0102] Second, in the case of quantum inner product circuits (quantum matrix multiplication circuits), a method utilizing the Quantum Inner Product circuit (using the probability distribution of measurement results) and a matrix multiplication (Weighted Sum) technique utilizing Quantum Fourier Transformation, which is a technique that applies the Discrete Fourier Transform by utilizing the quantum phase, can be utilized.
[0103] Third, in the case of quantum activation function circuits (quantum activation circuits), the non-linear activation function of an artificial neural network can be computed through a quantum circuit (RUS (Repeat-until-success)).
[0104] Accordingly, the quantum matrix multiplication of the present invention is expected to be effective for large-scale parallel processing, as it can be processed with a linear number of qubits even when the size of the data and artificial neural network (matrix) increases exponentially. In particular, it is expected to become an essential element in the development of ultra-large-scale artificial intelligence, which is currently expanding in various forms.
[0105] The present invention described above can be implemented as computer-readable code on a medium in which a program is recorded. The computer-readable medium includes all types of recording devices that store data that can be read by a computer system. Examples of the computer-readable medium include a hard disk drive (HDD), a solid state disk (SSD), a silicon disk drive (SDD), a ROM, a RAM, a CD-ROM, magnetic tape, a floppy disk, an optical data storage device, etc., and also includes media implemented in the form of a carrier wave (e.g., transmission via the Internet). In addition, the computer may include a control unit of a quantum matrix calculator according to an embodiment of the present invention.
[0106] Accordingly, the above detailed description should not be construed as limiting in all respects, but rather as illustrative. The scope of the present invention should be determined by a reasonable interpretation of the appended claims, and all modifications within the equivalent scope of the present invention are intended to be included within the scope of the present invention.
Claims
1. A quantum embedding circuit that converts weight values and input data stored in memory into quantum states; A quantum inner product circuit that performs matrix multiplication using quantized values, and A quantum matrix operator including a quantum activation function circuit that converts the result of a matrix multiplication operation into a value before quantization and reflects the weight value.
2. In paragraph 1, The above quantum embedding circuit, A quantum matrix calculator characterized by converting weight values and input data stored in memory into a quantum superposition state to enable quantum operations.
3. In paragraph 1, The above quantum history circuit is, A quantum matrix operator characterized by performing matrix multiplication operations on quantized values and outputting results in the form of a probability distribution.
4. In paragraph 1, The above quantum active function circuit is, A quantum matrix operator characterized by applying a nonlinear activation function of an artificial neural network.
5. In paragraph 1, The above quantum active function circuit is, A quantum matrix operator characterized by using a RUS (Repeat Until Success) circuit.
6. In paragraph 1, The above quantum embedding circuit, A quantum matrix operator characterized by separating the weight matrix of an artificial neural network model by layer.
7. In paragraph 6, The above quantum embedding circuit, A quantum matrix operator characterized by quantum embedding processing of weight matrices for each separated layer.
8. In paragraph 7, The above quantum embedding circuit, A quantum matrix operator characterized in that it determines whether the layer to be subjected to quantum embedding processing is the last layer and performs different processing depending on whether it is the last layer.
9. In paragraph 8, The above quantum embedding circuit, A quantum matrix operator characterized in that, when the layer that needs to be quantum embedding processed is not the last layer, the result value of the previous layer is quantum embedding processed.
10. In paragraph 8, The above quantum embedding circuit, A quantum matrix operator characterized in that it stores the final result when the layer that must process quantum embedding is the last layer.
11. In paragraph 9, It further includes a post-processing module that processes the measured results through quantum computation. The above post-processing module, A quantum matrix calculator characterized in that it processes the result value measured through the above quantum operation processing and transmits it to the quantum active function circuit.
12. In paragraph 1, A quantum matrix operator further comprising a buffer section for applying matrix data with weights reflected in the above quantum active function circuit to a memory.
Citation Information
Patent Citations
Apparatus and method for identifying real-time biometric image
KR1020220111526A
Operating method for electronic apparatus for providing page information and electronic apparatus supporting thereof
KR102506225B1
Quantum neural network training method and device, electronic equipment and medium
CN114219076A
Methods and systems for solving a stochastic differential equation using a hybrid computer system
EP4131075A1
Quantum deep learning
US20170364796A1
