Modeling method and device for storage and calculation integrated chip, electronic equipment and medium
By constructing a neural network model of the Fourier layer and deploying it to the integrated storage and computing chip, the problem of the inability of the neural network model to adapt to the integrated storage and computing chip is solved, and the model efficiency and energy efficiency performance are improved.
Patent Information
- Application Number
- CN202410009322.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-02
- Publication Date
- 2024-10-18
AI Technical Summary
The existing neural network model cannot effectively adapt to the integrated storage and computing chip, resulting in the inability to give full play to its high-efficiency computing power and low energy consumption characteristics.
Construct the first neural network model including the Fourier layer, process the input data through Fourier transform, train and quantify the model, deploy it to the integrated storage and computing chip, and replace the self-attention layer to achieve adaptation .
The efficiency of the model is improved, and the parallel and efficient matrix multiplication and addition performance of the integrated storage and calculation chip is fully utilized to achieve high energy efficiency and low energy consumption.
Smart Images

Figure CN118798260A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of semiconductor technology, and in particular to a modeling method, device, electronic device and medium for a storage-computing integrated chip. Background Art
[0002] The integrated storage and computing chip is a chip that integrates near-memory computing, in-memory processing, and in-memory computing. It has innovated in materials, devices, computing paradigms, and architecture. It can use storage units to complete computing functions to achieve zero-distance storage and computing, greatly improving computing power and energy efficiency. It is widely used in artificial intelligence reasoning scenarios.
[0003] Transformer (a neural network model based on the self-attention mechanism) is also widely used in artificial intelligence reasoning scenarios. Its core idea is the self-attention mechanism. The input matrices Q (query matrix), K (key matrix), and V (value matrix) in this self-attention mechanism are temporary variables for dynamic calculation processing and need to be written into the storage space for the next step of calculation. However, non-volatile storage and computing chips such as RRAM and Flash have problems with slow data writing speed and writing errors, and cannot give full play to the efficient computing advantages of storage and computing technology. The electrical characteristics and circuit structure of storage and computing chips make Transformer unable to adapt well. A neural network model that adapts to storage and computing chips is needed to give full play to the strong computing power and high energy efficiency of storage and computing chips. Summary of the invention
[0004] The purpose of the technical solution of the present invention is to provide a modeling method, device, electronic device and medium for a storage-computing integrated chip, which is used to solve the problem in the prior art that the neural network model cannot be adapted to the storage-computing integrated chip.
[0005] To achieve the above object, the present invention is achieved by:
[0006] In a first aspect, an embodiment of the present invention provides a modeling method for a storage-computing integrated chip, comprising:
[0007] Constructing a first neural network model including a Fourier layer, wherein the Fourier layer is used to perform a Fourier transform on input data to be calculated;
[0008] Training the first neural network model according to the input data to be calculated to obtain a target neural network model;
[0009] The target neural network model is deployed into a storage and computing integrated chip.
[0010] Optionally, in the modeling method for the integrated storage and computing chip, constructing a first neural network model including a Fourier layer includes:
[0011] Construct the first neural network model including at least one Fourier layer, wherein each Fourier layer is used to perform a one-dimensional Fourier transform on the input data to be calculated.
[0012] Optionally, in the modeling method for the integrated storage and computing chip, the Fourier transform is used to perform multiplication and addition operations on the input data to be calculated based on the Fourier transform matrix.
[0013] Optionally, the modeling method for the integrated storage and computing chip, wherein the first neural network model is trained according to the input data to be calculated to obtain a target neural network model, comprises:
[0014] Determine, according to the array size of the storage-computing integrated chip, the length of the input data to be calculated, the number of layers of the encoder in the first neural network model, and the number of layers of the decoder in the first neural network model;
[0015] Training the first neural network model according to the input data to be calculated to obtain a second neural network model;
[0016] The second neural network model is quantized to obtain the target neural network model.
[0017] Optionally, the modeling method for the integrated storage and computing chip, wherein the second neural network model is quantized to obtain the target neural network model, includes at least one of the following:
[0018] Using a fine-tuning quantization method, quantizing the Fourier layer in the second neural network model to obtain the target neural network model;
[0019] The first target layer in the second neural network model is quantized by using a perceptual quantization method to obtain the target neural network model, wherein the first target layer is a layer in the second neural network model excluding the Fourier layer.
[0020] Optionally, the modeling method for the storage-computing integrated chip, wherein the storage-computing integrated chip includes at least two simulation modules; deploying the target neural network model into the storage-computing integrated chip includes:
[0021] Mapping the weight array of the Fourier layer in the target neural network model to the array of the first simulation module;
[0022] The weight array and the corresponding bias array of the feedforward fully connected layer in the target neural network model are mapped to the array of the second simulation module.
[0023] In a second aspect, an embodiment of the present invention provides an electronic device, including a processor, wherein the processor is configured to:
[0024] Constructing a first neural network model including a Fourier layer, wherein the Fourier layer is used to perform a Fourier transform on input data to be calculated;
[0025] Training the first neural network model according to the input data to be calculated to obtain a target neural network model;
[0026] The target neural network model is deployed into a storage and computing integrated chip.
[0027] In a third aspect, an embodiment of the present invention provides a modeling device for a storage-computing integrated chip, including:
[0028] A construction module, used to construct a first neural network model including a Fourier layer, wherein the Fourier layer is used to perform Fourier transform on input data to be calculated;
[0029] A training module, used for training the first neural network model according to the input data to be calculated to obtain a target neural network model;
[0030] A deployment module is used to deploy the target neural network model into a storage and computing integrated chip.
[0031] In a fourth aspect, an embodiment of the present invention provides an electronic device, comprising: a processor, a memory, and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, the modeling method for a storage-computing integrated chip as described in any one of the above items is implemented.
[0032] In a fifth aspect, an embodiment of the present invention further provides a readable storage medium, on which a program is stored, and when the program is executed by a processor, the modeling method for a storage-computing integrated chip as described in any of the above items is implemented.
[0033] The beneficial effects of the above technical solution of the present invention are as follows:
[0034] The modeling method for the storage-computing integrated chip described in the embodiment of the present invention is adopted to construct a first neural network model including a Fourier layer, wherein the Fourier layer is used to perform Fourier transform on the input data to be calculated; the first neural network model is trained according to the input data to be calculated to obtain a target neural network model; the target neural network model is deployed in the storage-computing integrated chip. In this way, the target neural network model with the Fourier layer can achieve adaptation to the storage-computing integrated chip only from the model structure, thereby improving the model efficiency, and at the same time giving full play to the parallel and efficient matrix multiplication and addition operation performance of the storage-computing integrated chip, thereby achieving high energy efficiency and low energy consumption. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 A schematic diagram of a flow chart of a modeling method for a storage-computing integrated chip according to an embodiment of the present invention;
[0036] Figure 2 This is a schematic diagram of the structure of the first neural network model according to an embodiment of the present invention;
[0037] Figure 3 A schematic diagram of the structure of one implementation of the electronic device described in an embodiment of the present invention;
[0038] Figure 4 It is a structural schematic diagram of a modeling device for a storage-computing integrated chip according to an embodiment of the present invention;
[0039] Figure 5 It is a schematic structural diagram of another implementation manner of the electronic device described in an embodiment of the present invention. DETAILED DESCRIPTION
[0040] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.
[0041] In order to solve the problem that the neural network model in the prior art cannot be adapted to the storage and computing integrated chip, an embodiment of the present invention provides a modeling method for the storage and computing integrated chip, constructing a first neural network model including a Fourier layer, and the Fourier layer is used to perform Fourier transform on the input data to be calculated; according to the input data to be calculated, the first neural network model is trained to obtain a target neural network model; the target neural network model is deployed to the storage and computing integrated chip. Therefore, by adopting this implementation method, the target neural network model has a Fourier layer, and the adaptation to the storage and computing integrated chip is achieved only from the model structure, thereby improving the model efficiency, and at the same time giving full play to the parallel and efficient matrix multiplication and addition operation performance of the storage and computing integrated chip, thereby achieving high energy efficiency and low energy consumption.
[0042] The embodiment of the present invention, as Figure 1 As shown, a modeling method for a storage-computing integrated chip is provided, comprising:
[0043] Step 101, constructing a first neural network model including a Fourier layer, wherein the Fourier layer is used to perform Fourier transform on input data to be calculated.
[0044] The first neural network model in the embodiment of the present invention is obtained based on Transformer, specifically, Figure 2 As shown, the self-attention layer in the Transformer is replaced by a Fourier layer that contains no parameters at all, thereby constructing the first neural network model including the Fourier layer.
[0045] The Fourier layer is used to perform Fourier transform on the input data to be calculated. The function of Fourier transform is to transform a non-periodic continuous signal in the time domain into a non-periodic and continuous signal in the frequency domain. If the continuous token sequence is regarded as a non-periodic continuous signal in the time domain, the Fourier transform can transform the continuous token sequence (natural language) into a non-periodic continuous signal in the frequency domain space, which is a new representation for the token sequence. Moreover, compared with the self-attention layer in the Transformer, the Fourier layer can perform faster feature operations without the need to learn parameters, which greatly saves memory usage and computation.
[0046] Below, see Figure 2 The first neural network model of the embodiment of the present invention is described.
[0047] The input data to be calculated (Inputs) passes through the input embedding (Input Embedding) layer, and the obtained vector value and positional encoding (Positional Encoding) are added. The blocks of N encoders (Encoder) are stacked together. Each encoder block has two sublayers. The first sublayer includes two connected Fourier (Fourier) layers, residual connections and normalization (Add&Norm) layers, and the second sublayer includes a feedforward fully connected (Feed Forward) layer, residual connections and normalization layers. Some outputs (Outputs) of the decoder (Decoder) at the previous moment are used as inputs at this time, shifted right one by one, and passed through the output embedding (Output Embedding) layer. The obtained vector value and positional encoding (Positional Encoding) are added. The blocks of N decoders are stacked together. Each encoder block has three sublayers, the first sublayer includes two connected Fourier layers, residual connections and normalization layers, the second sublayer includes two connected Fourier layers, residual connections and normalization layers, and the third sublayer includes a feedforward fully connected layer, a residual connection and a normalization layer. In addition, the first neural network model also includes a linear layer and an activation function (Softmax) layer to obtain output probabilities.
[0048] In one implementation mode, optionally, step 101 includes:
[0049] Construct the first neural network model including at least one Fourier layer, wherein each Fourier layer is used to perform a one-dimensional Fourier transform on the input data to be calculated.
[0050] It should be noted that in artificial intelligence reasoning scenarios, such as NLP (Natural Language Processing) scenarios and CV (Computer Vision) scenarios, the input data to be calculated is mostly two-dimensional, so a two-dimensional Fourier transform is required. The embodiment of the present invention adopts a combination of two one-dimensional Fourier transforms, such as Figure 2 As shown, two consecutive Fourier layers, each of which is used to perform a one-dimensional Fourier transform on the calculation data, can reduce the difficulty of calculation, improve the calculation efficiency of the model, and give full play to the strong computing power and high energy efficiency of the integrated storage and computing.
[0051] Therefore, the embodiment of the present invention combines two one-dimensional Fourier transforms and is suitable for the two-dimensional characteristics of the input data to be calculated in NLP and CV.
[0052] In one implementation manner, optionally, the Fourier transform is used to perform multiplication and addition operations on the input data to be calculated based on a Fourier transform matrix.
[0053] The calculation formula of the Fourier layer described in this embodiment of the present invention is as follows, ω is the Fourier transform matrix, a is the input data to be calculated, and y is the output data.
[0054]
[0055] Where ω = e -i2π / n , n is the length of the input data to be calculated.
[0056] Through the above calculation formula, the first neural network model converts the self-attention layer in the Transformer into a Fourier layer that only requires multiplication and addition operations. Taking the storage and computing integrated chip based on memristors as an example, since the memristor makes the circuit into a cross array structure, which is similar to the shape of a matrix, Kirchhoff's law and Ohm's law can be used to efficiently complete matrix multiplication and addition transportation. Therefore, the first neural network model has completed the adaptation to the storage and computing integrated chip in terms of model structure.
[0057] Step 102: training the first neural network model according to the input data to be calculated to obtain a target neural network model.
[0058] In one implementation mode, optionally, step 102 includes:
[0059] Determine, according to the array size of the storage-computing integrated chip, the length of the input data to be calculated, the number of layers of the encoder in the first neural network model, and the number of layers of the decoder in the first neural network model;
[0060] Training the first neural network model according to the input data to be calculated to obtain a second neural network model;
[0061] The second neural network model is quantized to obtain the target neural network model.
[0062] In the embodiment of the present invention, the length of the input data to be calculated is determined according to the array size of the storage-computing integrated chip, and the number of layers of the encoder and the number of layers of the decoder are determined.
[0063] For example, in the NLP scenario, the input data to be calculated is the mosaic result of a continuous sentence (length n), and the mosaic dimension is d; in the CV scenario, the input data to be calculated is an image divided into n blocks, where the size of each block is p×p×3. In order to prevent data overflow problems, in the NLP scenario, n and d are not greater than the array size of the storage and computing integrated chip, and in the CV scenario, n and p×p×3 are not greater than the array size of the storage and computing integrated chip.
[0064] Figure 2 The N in represents the number of encoder layers and the number of decoder layers.
[0065] Here, taking the use of a storage-computing integrated chip for image classification and reasoning tasks as an example, the training of the target neural network model is explained. In this image classification and reasoning task, the input data to be calculated is an image.
[0066] First, according to the array size of the storage and computing chip (e.g., W×H), the length of the image and the number of layers of the encoder and decoder are determined;
[0067] Then, the image is resized to w0×h0 (generally, in order to simplify the calculation, w0=h0), and the resized image is divided into d×d blocks, each block is p×p, where p×p×3<W, d×d is less than H;
[0068] Further, the segmented images are used to train the first neural network to obtain a second neural network model;
[0069] Finally, the second neural network model is quantized to obtain the target neural network model.
[0070] In one implementation manner, optionally, quantizing the second neural network model to obtain the target neural network model includes at least one of the following:
[0071] Using a fine-tuning quantization method, quantizing the Fourier layer in the second neural network model to obtain the target neural network model;
[0072] The first target layer in the second neural network model is quantized by using a perceptual quantization method to obtain the target neural network model, wherein the first target layer is a layer in the second neural network model excluding the Fourier layer.
[0073] Since the calculation accuracy of the integrated storage and computing chip is relatively low, generally 4 bits or 8 bits, the model needs to be quantized before the target neural network model is obtained after training. Because the Fourier transform matrix is a parameter-free matrix and its value cannot be changed by back propagation, the embodiment of the present invention adopts a hybrid quantization method for quantization, specifically including using a fine-tuning quantization method to quantize the Fourier layer in the second neural network model, and using a perceptual quantization method to quantize the layers other than the Fourier layer in the second neural network model.
[0074] Step 103: deploy the target neural network model into a storage and computing integrated chip.
[0075] In one implementation mode, optionally, the integrated storage and computing chip includes at least two simulation modules; step 103 includes:
[0076] Mapping the weight array of the Fourier layer in the target neural network model to the array of the first simulation module;
[0077] The weight array and the corresponding bias array of the feedforward fully connected layer in the target neural network model are mapped to the array of the second simulation module.
[0078] The storage-computing integrated chip for deploying the target neural network model in the embodiment of the present invention includes at least two simulation modules. After the training is completed and the target neural network model is obtained, the trained model weights and structure information are transmitted to the hardware module interface of the storage-computing integrated chip, and the model weights are deployed layer by layer to the array of the storage-computing integrated chip.
[0079] The first simulation module is used to store the Fourier transform matrix, and the weight array of the Fourier layer is deployed into the array of the first simulation module;
[0080] The second simulation module is used to store the feedforward fully connected layer, and deploy the weight array and the corresponding bias array of the feedforward fully connected layer into the array of the second simulation module.
[0081] Data can be transferred between two analog modules.
[0082] In addition, the storage and computing integrated chip also includes digital circuits, which use digital circuits to implement other computing layers of the target neural network model except the Fourier layer and the feedforward fully connected layer, such as residual connections and normalization layers.
[0083] It should be noted that, after step 103, the method further includes:
[0084] The storage-computing integrated chip is used to perform reasoning tasks and obtain reasoning results.
[0085] In summary, by adopting the modeling method for the storage and computing integrated chip described in the embodiment of the present invention, the self-attention layer in the Transformer is replaced with the Fourier layer, so as to construct a first neural network model including the Fourier layer. The adaptation to the storage and computing integrated chip is completed only from the model structure, without changing the circuit or adding additional processors to assist in the calculation. Moreover, the Fourier transform can perform feature calculations faster and greatly reduce the calculation degree, thereby giving full play to the computing advantages of storage and computing integrated.
[0086] One embodiment of the present invention further provides an electronic device, such as Figure 3 As shown, the electronic device 300 includes a processor 301, and the processor 301 is used to:
[0087] Constructing a first neural network model including a Fourier layer, wherein the Fourier layer is used to perform a Fourier transform on input data to be calculated;
[0088] Training the first neural network model according to the input data to be calculated to obtain a target neural network model;
[0089] The target neural network model is deployed into a storage and computing integrated chip.
[0090] Optionally, in the electronic device, the processor 301 is configured to:
[0091] Construct the first neural network model including at least one Fourier layer, wherein each Fourier layer is used to perform a one-dimensional Fourier transform on the input data to be calculated.
[0092] Optionally, in the electronic device, the Fourier transform is used to perform multiplication and addition operations on the input data to be calculated based on the Fourier transform matrix.
[0093] Optionally, in the electronic device, the processor 301 is configured to:
[0094] Determine, according to the array size of the storage-computing integrated chip, the length of the input data to be calculated, the number of layers of the encoder in the first neural network model, and the number of layers of the decoder in the first neural network model;
[0095] Training the first neural network model according to the input data to be calculated to obtain a second neural network model;
[0096] The second neural network model is quantized to obtain the target neural network model.
[0097] Optionally, in the electronic device, the processor 301 is configured to perform at least one of the following:
[0098] Using a fine-tuning quantization method, quantizing the Fourier layer in the second neural network model to obtain the target neural network model;
[0099] The first target layer in the second neural network model is quantized by using a perceptual quantization method to obtain the target neural network model, wherein the first target layer is a layer in the second neural network model excluding the Fourier layer.
[0100] Optionally, in the electronic device, the integrated storage and computing chip includes at least two analog modules; and the processor 301 is used for:
[0101] Mapping the weight array of the Fourier layer in the target neural network model to the array of the first simulation module;
[0102] The weight array and the corresponding bias array of the feedforward fully connected layer in the target neural network model are mapped to the array of the second simulation module.
[0103] like Figure 4 As shown, an embodiment of the present invention further provides a modeling device for a storage-computing integrated chip, comprising:
[0104] A construction module 401 is used to construct a first neural network model including a Fourier layer, wherein the Fourier layer is used to perform Fourier transform on input data to be calculated;
[0105] A training module 402 is used to train the first neural network model according to the input data to be calculated to obtain a target neural network model;
[0106] The deployment module 403 is used to deploy the target neural network model into the storage and computing integrated chip.
[0107] Optionally, in the modeling device for the integrated storage and computing chip, the construction module 401 is specifically used for:
[0108] Construct the first neural network model including at least one Fourier layer, wherein each Fourier layer is used to perform a one-dimensional Fourier transform on the input data to be calculated.
[0109] Optionally, in the modeling device for the integrated storage and computing chip, the Fourier transform is used to perform multiplication and addition operations on the input data to be calculated based on the Fourier transform matrix.
[0110] Optionally, in the modeling device for the integrated storage and computing chip, the training module 402 includes:
[0111] A determination unit, configured to determine, according to the array size of the storage-computation integrated chip, the length of the input data to be calculated, the number of layers of the encoder in the first neural network model, and the number of layers of the decoder in the first neural network model;
[0112] A training unit, configured to train the first neural network model according to the input data to be calculated to obtain a second neural network model;
[0113] A processing unit is used to perform quantization processing on the second neural network model to obtain the target neural network model.
[0114] Optionally, in the modeling device for the integrated storage and computing chip, the processing unit is specifically used to:
[0115] Using a fine-tuning quantization method, quantizing the Fourier layer in the second neural network model to obtain the target neural network model;
[0116] The first target layer in the second neural network model is quantized by using a perceptual quantization method to obtain the target neural network model, wherein the first target layer is a layer in the second neural network model excluding the Fourier layer.
[0117] Optionally, the modeling device for the integrated storage and computing chip, wherein the integrated storage and computing chip includes at least two simulation modules; the deployment module 403 is specifically used to:
[0118] Mapping the weight array of the Fourier layer in the target neural network model to the array of the first simulation module;
[0119] The weight array and the corresponding bias array of the feedforward fully connected layer in the target neural network model are mapped to the array of the second simulation module.
[0120] like Figure 5 As shown, an embodiment of the present invention also provides an electronic device, including: a processor 501; and a memory 502 connected to the processor 501 through a bus interface, the memory 502 is used to store programs and data used by the processor 501 when performing operations, and the processor 501 calls and executes the programs and data stored in the memory 502.
[0121] The electronic device further includes a transceiver 503, which is connected to the bus interface and is used to receive and send data under the control of the processor 501;
[0122] Specifically, the processor 501 executes the following process:
[0123] Constructing a first neural network model including a Fourier layer, wherein the Fourier layer is used to perform a Fourier transform on input data to be calculated;
[0124] Training the first neural network model according to the input data to be calculated to obtain a target neural network model;
[0125] The target neural network model is deployed into a storage and computing integrated chip.
[0126] Optionally, in the electronic device, the processor 501 performs the following process:
[0127] Construct the first neural network model including at least one Fourier layer, wherein each Fourier layer is used to perform a one-dimensional Fourier transform on the input data to be calculated.
[0128] Optionally, in the electronic device, the Fourier transform is used to perform multiplication and addition operations on the input data to be calculated based on the Fourier transform matrix.
[0129] Optionally, in the electronic device, the processor 501 performs the following process:
[0130] Determine, according to the size of the integrated storage and computing chip, the array length of the input data to be calculated, the number of layers of the encoder in the first neural network model, and the number of layers of the decoder in the first neural network model;
[0131] Training the first neural network model according to the input data to be calculated to obtain a second neural network model;
[0132] The second neural network model is quantized to obtain the target neural network model.
[0133] Optionally, in the electronic device, the processor 501 performs at least one of the following:
[0134] Using a fine-tuning quantization method, quantizing the Fourier layer in the second neural network model to obtain the target neural network model;
[0135] The first target layer in the second neural network model is quantized by using a perceptual quantization method to obtain the target neural network model, wherein the first target layer is a layer in the second neural network model excluding the Fourier layer.
[0136] Optionally, in the electronic device, the integrated storage and computing chip includes at least two analog modules; and the processor 501 performs at least one of the following:
[0137] Mapping the weight array of the Fourier layer in the target neural network model to the array of the first simulation module;
[0138] The weight array and the corresponding bias array of the feedforward fully connected layer in the target neural network model are mapped to the array of the second simulation module.
[0139] Among them, Figure 5 In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically linking together various circuits of one or more processors represented by processor 501 and memory represented by memory 502. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides a user interface 504. The transceiver 503 may be a plurality of components, i.e., including a transmitter and a receiver, providing a unit for communicating with various other devices on a transmission medium. The processor 501 is responsible for managing the bus architecture and general processing, and the memory 502 may store data used by the processor 501 when performing operations.
[0140] In addition, a specific embodiment of the present invention further provides a readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the modeling method for a storage-computing integrated chip as described in any one of the above is implemented.
[0141] Specifically, the readable storage medium is applied to the above-mentioned electronic device. When applied to the electronic device, the execution steps in the modeling method applied to the storage and computing integrated chip are described in detail above and will not be repeated here.
[0142] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0143] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may be physically included separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0144] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform some steps of the sending and receiving methods described in various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store program codes.
[0145] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A modeling method for a storage-computing integrated chip, characterized in that: include: Constructing a first neural network model including a Fourier layer, wherein the Fourier layer is used to perform a Fourier transform on input data to be calculated; Training the first neural network model according to the input data to be calculated to obtain a target neural network model; The target neural network model is deployed into a storage and computing integrated chip.
2. The modeling method for a storage-computing integrated chip according to claim 1, characterized in that: Construct a first neural network model including a Fourier layer, including: Construct the first neural network model including at least one Fourier layer, wherein each Fourier layer is used to perform a one-dimensional Fourier transform on the input data to be calculated.
3. The modeling method for a storage-computing integrated chip according to claim 1 or 2, characterized in that: The Fourier transform is used to perform multiplication and addition operations on the input data to be calculated based on the Fourier transform matrix.
4. The modeling method for a storage-computing integrated chip according to claim 1, characterized in that: The first neural network model is trained according to the input data to be calculated to obtain a target neural network model, including: Determine, according to the array size of the storage-computing integrated chip, the length of the input data to be calculated, the number of layers of the encoder in the first neural network model, and the number of layers of the decoder in the first neural network model; Training the first neural network model according to the input data to be calculated to obtain a second neural network model; The second neural network model is quantized to obtain the target neural network model.
5. The modeling method for a storage-computing integrated chip according to claim 4, characterized in that: The second neural network model is quantized to obtain the target neural network model, including at least one of the following: Using a fine-tuning quantization method, quantizing the Fourier layer in the second neural network model to obtain the target neural network model; The first target layer in the second neural network model is quantized by using a perceptual quantization method to obtain the target neural network model, wherein the first target layer is a layer in the second neural network model excluding the Fourier layer.
6. The modeling method for a storage-computing integrated chip according to claim 1, characterized in that: The storage-computing integrated chip includes at least two simulation modules; deploying the target neural network model into the storage-computing integrated chip includes: Mapping the weight array of the Fourier layer in the target neural network model to the array of the first simulation module; The weight array and the corresponding bias array of the feedforward fully connected layer in the target neural network model are mapped to the array of the second simulation module.
7. An electronic device, characterized in that: comprising a processor configured to: Constructing a first neural network model including a Fourier layer, wherein the Fourier layer is used to perform a Fourier transform on input data to be calculated; Training the first neural network model according to the input data to be calculated to obtain a target neural network model; The target neural network model is deployed into a storage and computing integrated chip.
8. A modeling device for a storage-computing integrated chip, characterized in that: include: A construction module, used to construct a first neural network model including a Fourier layer, wherein the Fourier layer is used to perform Fourier transform on input data to be calculated; A training module, used for training the first neural network model according to the input data to be calculated to obtain a target neural network model; A deployment module is used to deploy the target neural network model into a storage and computing integrated chip.
9. An electronic device, characterized in that: include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, the modeling method for a storage-computing integrated chip as described in any one of claims 1 to 6 is implemented.
10. A readable storage medium, characterized in that: The readable storage medium stores a program, and when the program is executed by the processor, the modeling method for a storage-computing integrated chip as described in any one of claims 1 to 6 is implemented.
