Accelerator, data processing method, device, medium, program product and system

By dividing the feature matrix in the accelerator and using delay modules and systolic arrays for multiplication and addition processing, the problem of low efficiency of feature fusion operations in machine learning models is solved and efficient feature matrix fusion operations are achieved.

CN118536073BActive Publication Date: 2024-09-20INSPUR (BEIJING) ELECTRONICS INFORMATION IND CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410986270.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-23
Publication Date
2024-09-20
Estimated Expiration
2044-07-23

AI Technical Summary

Technical Problem

In the existing technology, after a machine learning model extracts text or image features, the processing efficiency of the feature fusion operation is limited by the host CPU and memory, resulting in low efficiency.

Method used

Design an accelerator that divides the feature matrix into sub-matrices of preset sizes, and uses delay modules and systolic arrays to perform multiplication and accumulation processing to achieve parallel calculation and accumulation of feature matrices and improve processing efficiency.

Benefits of technology

It realizes efficient fusion operation of feature matrices, supports matrix input of any size, improves processing efficiency, and improves computing efficiency through parallel data reading and calculation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118536073B
    Figure CN118536073B
Patent Text Reader

Abstract

The present application discloses an accelerator, a data processing method, a device, a medium, a program product and a system in the field of computer technology. The present application implements the feature fusion operation of the feature matrix in the accelerator, and the accelerator can complete the automatic segmentation of the feature matrix, and implement the operation logic such as multiplication and addition, accumulation, etc., and support the input of matrices of any size; wherein the first memory and the second memory perform sub-matrix caching in a ping-pong manner, and can realize parallel data reading and calculation of multiple sub-matrices, and the systolic array can achieve faster operation efficiency, which provides the possibility of improving the processing efficiency of the feature fusion operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an accelerator, a data processing method, a device, a medium, a program product and a system. Background Art

[0002] At present, after machine learning models and deep learning models extract features from text or images, the extracted features need to be fused. Currently, feature fusion logic and operations can be implemented through software programs, but the running speed of software programs is limited by the host CPU (Central Processing Unit), memory and other devices, resulting in limited processing efficiency of feature fusion operations.

[0003] Therefore, how to improve the processing efficiency of feature fusion operations is a problem that technical personnel in this field need to solve. Summary of the invention

[0004] In view of this, the purpose of this application is to provide an accelerator, a data processing method, a device, a medium, a program product and a system to improve the processing efficiency of feature fusion operations. The specific scheme is as follows:

[0005] In a first aspect, the present application provides an accelerator, comprising:

[0006] A write control module, used for dividing a feature matrix extracted from model input data into a plurality of sub-matrices of a preset size, and ping-pong-writing the plurality of sub-matrices into a first memory and a second memory; the model input data is text and / or an image;

[0007] A read control module, configured to read at least two target sub-matrices participating in a single calculation from the first memory and the second memory according to the operation logic configuration of the characteristic matrix;

[0008] The first memory and the second memory are used to sequentially store the sub-matrices stored in the write control module;

[0009] A delay module, configured to add a delay to each row of the at least two target sub-matrices so as to deform the at least two target sub-matrices into a parallelogram;

[0010] A systolic array is used to perform multiplication and addition processing on at least two target sub-matrices deformed into parallelograms to obtain a processing result;

[0011] A marking module, used to add identification information to the processing result;

[0012] An accumulation module is used to accumulate the processing results added with different identification information after the sub-matrices in the first memory and the second memory are read and processed by the systolic array to obtain the feature fusion result corresponding to the model input data.

[0013] Optionally, the first memory and the second memory respectively include: a first storage area, a second storage area and a third storage area;

[0014] The first storage area is used to store a first matrix for feature fusion operation;

[0015] The second storage area is used to store a second matrix of feature fusion operation;

[0016] The third storage area is used to store a third matrix of the feature fusion operation;

[0017] The characteristic matrix includes: a first matrix, a second matrix and a third matrix.

[0018] Optionally, the third matrix is ​​a row matrix, a column matrix or an all-0 matrix.

[0019] Optionally, both the first memory and the second memory are single-port.

[0020] Optionally, the delay module is used to add a delay of one time unit more than the previous row to each row of the at least two target sub-matrices row by row.

[0021] Optionally, the systolic array includes M×N multiplication-addition units, and the preset size is M×N.

[0022] Optionally, the data types supported by the multiplication and addition unit include FP16, FP32 and / or INT8.

[0023] Optionally, it also includes:

[0024] The transpose module is used to transpose the matrix in the input itself according to the transpose mark.

[0025] Optionally, the systolic array is used to transmit the processing result to the transposition module when the transposition mark is detected.

[0026] Optionally, it also includes:

[0027] The delay recovery module is used to delete the delay of each row of the processing result so that the processing result is restored from a parallelogram to a rectangle.

[0028] Optionally, the delay recovery module is used to delete, for each line of the processing result, a delay that is one time unit longer than that of the previous line.

[0029] Optionally, the systolic array is used to transmit the processing result to the delay recovery module when the transposition mark is not detected.

[0030] Optionally, the delayed recovery module is used to restore the processing result from a parallelogram to a rectangle and then transmit the corresponding result to the marking module.

[0031] Optionally, the accumulation module includes: an accumulation write controller, an accumulation read controller, an accumulation memory and an accumulator;

[0032] An accumulation write controller, used for writing the processing result into the accumulation memory;

[0033] An accumulation read controller, used for reading the data stored last time from the accumulation memory;

[0034] An accumulation memory, used for storing the processing results stored in the accumulation write controller;

[0035] The accumulator is used to accumulate the data read by the accumulation read controller and the current processing result, and store the accumulation result in the accumulation memory.

[0036] Optionally, the accumulation module is used to transmit the accumulated processing result of each processing result added with different identification information to another accumulation module, so that the other accumulation module stores and accumulates the received accumulated processing results.

[0037] Optionally, the transposition module is used to splice multiple matrix blocks to obtain a large matrix, and transpose each matrix block in the large matrix.

[0038] In a second aspect, the present application provides a data processing method, applied to the accelerator described in any of the above items, comprising:

[0039] Cutting a feature matrix extracted from model input data into a plurality of sub-matrices of preset sizes, and ping-pong-writing the plurality of sub-matrices into a first memory and a second memory; the model input data is text and / or an image;

[0040] Reading at least two target sub-matrices participating in a single calculation from the first memory and the second memory according to the operation logic configuration of the characteristic matrix;

[0041] adding delays to each row of the at least two target sub-matrices so that the at least two target sub-matrices are deformed into a parallelogram;

[0042] Performing multiplication and addition processing on at least two target sub-matrices deformed into parallelograms to obtain a processing result;

[0043] Adding identification information to the processing result;

[0044] After the sub-matrices in the first memory and the second memory are read and processed by the systolic array, each processing result with different identification information added is accumulated to obtain a feature fusion result corresponding to the model input data.

[0045] In a third aspect, the present application provides an electronic device, including:

[0046] Memory for storing computer programs;

[0047] The processor is used to execute the computer program to implement the data processing method disclosed above.

[0048] In a fourth aspect, the present application provides a non-volatile storage medium for storing a computer program, wherein the computer program implements the aforementioned disclosed data processing method when executed by a processor.

[0049] In a fifth aspect, the present application provides a computer program product, comprising a computer program / instruction, which implements the steps of the aforementioned disclosed data processing method when executed by a processor.

[0050] In a sixth aspect, the present application provides a data processing system, comprising: at least one host, each host being connected to at least one accelerator as described in any of the foregoing items.

[0051] It can be seen from the above scheme that the present application provides an accelerator, including: a write control module, which is used to divide the feature matrix extracted from the model input data into multiple sub-matrices of preset size, and write the multiple sub-matrices into a first memory and a second memory in a ping-pong manner; the model input data is text and / or image; a read control module, which is used to read at least two target sub-matrices participating in a single calculation from the first memory and the second memory according to the operation logic configuration of the feature matrix; the first memory and the second memory are used to sequentially store the sub-matrices stored in themselves by the write control module; a delay module, which is used to add delays to each row of the at least two target sub-matrices so that the at least two target sub-matrices are deformed into parallelograms; a systolic array, which is used to perform multiplication and addition processing on the at least two target sub-matrices deformed into parallelograms to obtain processing results; a marking module, which is used to add identification information to the processing results; an accumulation module, which is used to accumulate the processing results added with different identification information after the sub-matrices in the first memory and the second memory are read and processed by the systolic array to obtain the feature fusion result corresponding to the model input data.

[0052] It can be seen that the beneficial effects of the present application are: the feature fusion operation of the feature matrix is ​​implemented in the accelerator, the accelerator can complete the automatic segmentation of the feature matrix, and implement operation logic such as multiplication and addition, accumulation, etc., and support the input of matrices of any size; the first memory and the second memory perform sub-matrix caching in a ping-pong manner, which can realize parallel data reading and calculation of multiple sub-matrices, and the systolic array can achieve faster computing efficiency, which provides the possibility of improving the processing efficiency of the feature fusion operation.

[0053] Correspondingly, a data processing method, device, medium, program product and system provided by the present application also have the above-mentioned technical effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0055] Figure 1 A schematic diagram of an accelerator disclosed in this application;

[0056] Figure 2 A design diagram for a matrix multiplication calculation disclosed in this application;

[0057] Figure 3 A design diagram of another matrix multiplication calculation disclosed in this application;

[0058] Figure 4 (a) is a schematic diagram of data storage of a DDR disclosed in this application;

[0059] Figure 4 (b) is a schematic diagram of data storage of an SRAM disclosed in this application;

[0060] Figure 5 A schematic diagram of a matrix deformation disclosed in this application;

[0061] Figure 6 A schematic diagram of a matrix transposition before and after comparison provided in this application;

[0062] Figure 7 A flow chart of a data processing method disclosed in this application;

[0063] Figure 8 A server structure diagram provided for this application;

[0064] Fig. 9 A terminal structure diagram provided for this application. DETAILED DESCRIPTION

[0065] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other examples obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0066] At present, after machine learning models and deep learning models extract features from text or images, the extracted features need to be fused. Currently, feature fusion logic and operations can be implemented through software programs, but the running speed of the software program is limited by the host CPU, memory and other devices, resulting in limited processing efficiency of feature fusion operations. To this end, the present application provides a data processing solution that can implement feature fusion operations of feature matrices in an accelerator. The accelerator can complete the automatic segmentation of feature matrices, and implement operation logic such as multiplication and addition, accumulation, etc., and support the input of matrices of any size; wherein the first memory and the second memory perform sub-matrix caching in a ping-pong manner, which can realize parallel data reading and calculation of multiple sub-matrices, and the systolic array can achieve faster operation efficiency, which provides the possibility of improving the processing efficiency of feature fusion operations.

[0067] See also Figure 1 As shown, the embodiment of the present application discloses an accelerator, comprising:

[0068] The writing control module is used to divide the feature matrix extracted from the model input data into multiple sub-matrices of preset size, and ping-pong write the multiple sub-matrices into the first memory and the second memory; the model input data is text and / or image.

[0069] The read control module is used to read at least two target sub-matrices participating in a single calculation from the first memory and the second memory according to the operation logic configuration of the characteristic matrix. The operation logic configuration includes: the definition of the preset size, whether transposition is required, whether to skip the calculation and directly transpose, and the size of the characteristic matrix.

[0070] The first memory and the second memory are used to sequentially store the sub-matrices stored in the write control module.

[0071] The delay module is used to add delay to each row of at least two target sub-matrices so as to deform the at least two target sub-matrices into parallelograms.

[0072] The systolic array is used to perform multiplication and addition processing on at least two target sub-matrices transformed into parallelograms to obtain a processing result. The systolic array can be replaced by a multiplication-addition tree.

[0073] The marking module is used to add identification information to the processing results.

[0074] The accumulation module is used to accumulate the processing results added with different identification information after the sub-matrices in the first memory and the second memory are read and processed by the systolic array to obtain the feature fusion result corresponding to the model input data.

[0075] In one example, the feature matrix extracted from the model input data can be of any size. Specifically, the feature extraction can be performed by any neural network module. The model input data can specifically be: images, videos, texts, etc.

[0076] In one embodiment, the first memory and the second memory respectively include: a first storage area, a second storage area and a third storage area; the first storage area is used to store a first matrix of a feature fusion operation; the second storage area is used to store a second matrix of a feature fusion operation; the third storage area is used to store a third matrix of a feature fusion operation; wherein the feature matrix includes: a first matrix, a second matrix and a third matrix. In one example, the feature fusion operation is specifically expressed as a matrix multiplication: A×B+C, then the first matrix is ​​A, the second matrix is ​​B, and the third matrix is ​​C.

[0077] In one implementation, the third matrix is ​​a row matrix (ie, the C matrix has only one row), a column matrix (ie, the C matrix has only one column), or an all-0 matrix (ie, the C matrix is ​​0). Of course, the C matrix can also be a data matrix of any size.

[0078] In one implementation, both the first memory and the second memory are single-ported to reduce the area of ​​the hardware circuit.

[0079] In one embodiment, the delay module is used to add a delay of one time unit more than the previous row to each row of at least two target sub-matrices, for example, the first row is delayed by one time unit, the second row is delayed by two time units, the third row is delayed by three time units, and the other rows are delayed by analogy until the last row.

[0080] In one embodiment, the systolic array includes M×N multiplication-addition units, and the preset size is M×N. That is, the size of the systolic array may be consistent with the size of the submatrix.

[0081] In one embodiment, the data types supported by the multiply-add unit include FP16, FP32 and / or INT8.

[0082] In one embodiment, the accelerator further comprises a transposition module, which is used to transpose the matrix in the input itself according to the transposition mark. The systolic array is used to transmit the processing result to the transposition module when the transposition mark is detected.

[0083] In one embodiment, the accelerator further comprises: a delay recovery module, which is used to delete the delay of each row of the processing result so as to restore the processing result from a parallelogram to a rectangle. The systolic array is used to transmit the processing result to the delay recovery module when the transposition mark is not detected.

[0084] In one implementation, the delay recovery module is used to delete, for each line of the processing result, a delay that is one time unit longer than that of the previous line.

[0085] In one embodiment, the delayed recovery module is used to restore the processing result from a parallelogram to a rectangle and then transmit the corresponding result to the marking module.

[0086] In one embodiment, the accumulation module includes: an accumulation write controller, an accumulation read controller, an accumulation memory and an accumulator; the accumulation write controller is used to write the processing result into the accumulation memory; the accumulation read controller is used to read the data stored previously from the accumulation memory; the accumulation memory is used to store the processing result stored by the accumulation write controller itself; the accumulator is used to accumulate the data read by the accumulation read controller and the current processing result, and store the accumulation result into the accumulation memory.

[0087] In one embodiment, the accumulation module is used to transmit the accumulated processing results of each processing result with different identification information added to another accumulation module, so that the other accumulation module stores and accumulates the received accumulated processing results. The structure of the other accumulation module is consistent with that of the aforementioned accumulation module.

[0088] It can be seen that this embodiment implements the feature fusion operation of the feature matrix in the accelerator. The accelerator can complete the automatic segmentation of the feature matrix, and implement operation logic such as multiplication and addition, accumulation, etc., and support the input of matrices of any size; the first memory and the second memory therein cache sub-matrices in a ping-pong manner, which can realize parallel data reading and calculation of multiple sub-matrices, and the systolic array can achieve faster computing efficiency, which provides the possibility of improving the processing efficiency of the feature fusion operation.

[0089] See also Figure 2, the following is a specific implementation circuit of the matrix multiplication operation in the accelerator in a hierarchical design. The bottom layer is a systolic array or multiplication-addition tree with configurable parameters. After the parameters are configured, the matrix multiplication calculation of a fixed size is completed, such as 32×32 or 64×64. This layer is called sub_matrix_top. The middle layer (matrix_top) hardware completes the accumulation of the matrix multiplication results of the bottom layer to achieve medium-sized matrix multiplications of 64×64, 128×128, and 256×256, and supports matrix transposition. The outermost layer (smatrix_top) software completes the super-large matrix segmentation, accumulates the medium-sized matrix multiplication results, and directly outputs the final super-large matrix multiplication calculation results.

[0090] Figure 2 The specific structure of the three layers shown can be referred to Figure 3 .like Figure 3 As shown, the input part uses a ping-pong buffer, including: sram0 (first memory) and sram1 (second memory). Sram0 includes three parts, namely feature_sram0 (first storage area), weight_sram0 (second storage area) and bias_sram0 (third storage area), which correspond to the three input matrices A, B, and C of the matrix multiplication, where the matrix multiplication is A×B+C; Sram1 is the same as Sram0 and will not be repeated. Ping-pong buffer can ensure that the data input time and the calculation time can overlap, making full use of precious computing resources. Furthermore, the bias (i.e., matrix C) input supports four modes, mode 0 is bias is a matrix, the size is the same as the matrix multiplication output matrix; mode 1 is bias has only one column; mode 2 is bias has only one row; mode 3 is bias is all 0; so that the calculation mode is suitable for various calculation occasions and reduces unnecessary memory reading and writing.

[0091] Sram_wctrl_top (write control module, used to determine whether data is written to Sram1 or Sram0) writes the input data to sram0 or sram1. The external DDR (Double Data Rate, double rate synchronous dynamic random access memory) stores data such as Figure 4 As shown in (a), it is continuous row storage; sram0 and sram1 store sub-matrices in block storage, such as Figure 4 As shown in (b) in the figure, it is convenient for subsequent calculations to read a complete sub-matrix for matrix multiplication.

[0092] Sram_rctrl_top (read control module, used to read data in sram0 / sram1) reads out the complete sub-matrix in sequence according to the operation logic configuration, and sends it to matrix_top for matrix segmentation of medium-sized matrix multiplication. Among them, sram0 and sram1 use single ports to facilitate circuit layout and reduce hardware resource consumption.

[0093] The delay module is used to arrange the read data into the shape required by the systolic array. The systolic array needs to arrange the data into a parallelogram as input, such as Figure 5 As shown, a delay is added to each row of a submatrix, specifically: one delay is added to the first row, two delays are added to the second row, three delays are added to the third row, and so on for other rows, thereby transforming the submatrix from a rectangle to a parallelogram.

[0094] The core computing unit matrix_top is a systolic array, which completes the calculation of the minimum matrix multiplication. It can be configured as 32×32, 64×64, or 128×128, and can be flexibly configured according to hardware resources and application requirements. Among them, a PE multiplication-addition unit in the systolic array can complete multiplication and addition at the same time. This multiplication-addition unit supports data types such as FP16, FP32, and INT8. The PE multiplication-addition unit can reduce the data normalization and rounding logic once, and can minimize the circuit area while ensuring accuracy.

[0095] The output result of the systolic array can be transposed according to the configuration to convert the output shape from a parallelogram to a square. Mout (marking module) is used to label the matrix multiplication results of the smallest block to identify the smallest block matrix multiplication result. The minimum block matrix multiplication results are stored in the on-chip sram (accumulation memory), and the configuration determines which sub-matrices need to be accumulated and output, thereby completing the calculation of medium-sized matrix multiplications such as 64×64, 128×128 or 256×256.

[0096] The smatrix_top software configuration accumulates several medium-sized matrix multiplications to obtain the final matrix multiplication result, thereby realizing matrix multiplication of any size, for example: (256×768)×(768×768×4) or (256×64)×(64×256).

[0097] It should be noted that Figure 3The circuit shown supports Direct mode. In this mode, the size of the matrix to be calculated is equal to the size of the systolic array, so all accumulation logic is skipped and the output of the systolic array is directly obtained. At the same time, you can choose whether to transpose. In this mode, multiple blocks of matrix multiplication data can be moved into SRAM at one time, and multiple matrix multiplication results can be calculated by starting a calculation. Taking the systolic array as 32×32 and the maximum middle layer matrix as 256×256 as an example, 64 32×32 matrix multiplication data can be moved at one time and the calculation can be started at one time, which has a high hardware utilization efficiency; the smallest block is 32×32, and multiple 32×32 are sent to the systolic array for calculation at one time, which improves hardware utilization.

[0098] In one example, taking the systolic array as 32×32 and the middle layer matrix as a maximum of 256×256, if the application requires any one of the three matrix multiplications of 64×64, 128×128 or 256×256, the configuration of the relevant register hardware can automatically split the matrix into 32×32, and automatically complete the accumulation of the sub-matrices to obtain the final result.

[0099] In one example, taking the systolic array as 32×32 and the maximum intermediate layer matrix as 256×256 as an example, if the application is 512×512 or 1024×1024, etc., the software is required to divide the matrix into 256×256 sub-matrices and input them into the hardware SRAM. After the hardware completes the medium-sized matrix multiplication (256×256), it will accumulate and output multiple medium-sized matrix multiplication results according to the configuration.

[0100] In one example, taking the systolic array as 32×32 and the maximum intermediate layer matrix as 256×256 as an example, if the application is (256×768)×(768×768×4), the software splits it into multiple medium-sized matrix multiplications (256×256), and the hardware completes the matrix multiplication calculation and accumulation.

[0101] In one example, taking the systolic array as 32×32 and the maximum intermediate layer matrix as 256×256 as an example, if the application is (256×64)×(64×256), the software splits it into multiple medium-sized matrix multiplications (64×64), and the hardware completes the matrix multiplication calculation and accumulation, thereby completing a variety of matrix multiplications of arbitrary sizes.

[0102] Trans (transpose module) supports the transposition of matrix multiplication results, such as Figure 6 The comparison diagram before and after transposition is shown. Whether to transpose depends on whether it is required in the calculation logic, and the transposition result is written to the accumulator memory. It can be seen that the transposition module is used to splice multiple matrix blocks to obtain a large matrix and transpose each matrix block in the large matrix.

[0103] This embodiment also supports direct transposition of a matrix, that is, the input is a matrix, all calculation logics are skipped, and the result is output after completing the transposition of the matrix.

[0104] It can be seen that this embodiment designs the software and hardware in a hierarchical manner. The hardware completes the systolic array calculation, medium-sized matrix multiplication split accumulation and large-scale matrix multiplication hardware accumulation, and the software completes the large-scale matrix multiplication split; the software and hardware cooperate to complete the calculation of matrix multiplication of any size; supports FP16 / FP32 multiplication and addition fusion design, data ping-pong cache, data reading and calculation parallelism, multiple bias input modes, direct transposition and matrix multiplication transposition; and can also configure the size of the minimum matrix block and the size of the systolic array.

[0105] The solution provided in this embodiment can be used in heterogeneous accelerators of different architectures, such as FPGA, ASIC, etc., to execute related matrix multiplication operations in Transformer models, BERT, and CLIP, which can improve computing efficiency.

[0106] A data processing method provided in an embodiment of the present application is introduced below. The data processing method described below can be referenced with other embodiments described in this document.

[0107] See also Figure 7 As shown, an embodiment of the present application discloses a data processing method, which is applied to the accelerator described in any of the above embodiments, including:

[0108] S701, dividing a feature matrix extracted from model input data into multiple sub-matrices of preset sizes, and ping-pong-writing the multiple sub-matrices into a first memory in an accelerator and a second memory in the accelerator; the model input data is text and / or image.

[0109] S702 . Read at least two target sub-matrices participating in a single calculation from a first memory and a second memory according to the operation logic configuration of the characteristic matrix.

[0110] S703: Add delay to each row of at least two target sub-matrices, so that the at least two target sub-matrices are deformed into a parallelogram.

[0111] S704: Perform multiplication and addition processing on at least two target sub-matrices transformed into parallelograms to obtain a processing result.

[0112] S705: Add identification information to the processing result.

[0113] S706: After the sub-matrices in the first memory and the second memory are read and processed by the systolic array, the processing results with different identification information added are accumulated to obtain the feature fusion result corresponding to the model input data.

[0114] In one embodiment, the first memory and the second memory respectively include: a first storage area, a second storage area and a third storage area; the first storage area is used to store a first matrix of a feature fusion operation; the second storage area is used to store a second matrix of a feature fusion operation; the third storage area is used to store a third matrix of a feature fusion operation; wherein the feature matrix includes: a first matrix, a second matrix and a third matrix. In one example, the feature fusion operation is specifically expressed as a matrix multiplication: A×B+C, then the first matrix is ​​A, the second matrix is ​​B, and the third matrix is ​​C.

[0115] In one implementation, the third matrix is ​​a row matrix (ie, the C matrix has only one row), a column matrix (ie, the C matrix has only one column), or an all-0 matrix (ie, the C matrix is ​​0). Of course, the C matrix can also be a data matrix of any size.

[0116] In one implementation, both the first memory and the second memory are single-ported to reduce the area of ​​the hardware circuit.

[0117] In one embodiment, the delay module in the accelerator is used to add a delay of one time unit more than the previous row to each row of at least two target sub-matrices, for example, the first row is added with a delay of one time unit, the second row is added with a delay of 2 time units, the third row is added with a delay of 3 time units, and so on for other rows until the last row.

[0118] In one embodiment, the systolic array in the accelerator includes M×N multiplication-addition units, and the preset size is M×N. That is, the size of the systolic array can be consistent with the size of the submatrix.

[0119] In one embodiment, the data types supported by the multiply-add unit include FP16, FP32 and / or INT8.

[0120] In one embodiment, the accelerator further comprises a transposition module, which is used to transpose the matrix in the input itself according to the transposition mark. The systolic array is used to transmit the processing result to the transposition module when the transposition mark is detected.

[0121] In one embodiment, the accelerator further comprises: a delay recovery module, which is used to delete the delay of each row of the processing result so as to restore the processing result from a parallelogram to a rectangle. The systolic array is used to transmit the processing result to the delay recovery module when the transposition mark is not detected.

[0122] In one implementation, the delay recovery module in the accelerator is used to delete, for each row of the processing result, a delay that is one time unit longer than that of the previous row.

[0123] In one implementation, the delay recovery module in the accelerator is used to restore the processing result from a parallelogram to a rectangle and then transmit the corresponding result to the marking module.

[0124] In one embodiment, the accumulation module in the accelerator includes: an accumulation write controller, an accumulation read controller, an accumulation memory and an accumulator; the accumulation write controller is used to write the processing result into the accumulation memory; the accumulation read controller is used to read the data previously stored from the accumulation memory; the accumulation memory is used to store the processing result stored by the accumulation write controller itself; the accumulator is used to accumulate the data read by the accumulation read controller and the current processing result, and store the accumulation result into the accumulation memory.

[0125] In one embodiment, the accumulation module in the accelerator is used to transmit the accumulated processing results of each processing result with different identification information added to another accumulation module in the accelerator, so that the other accumulation module stores and accumulates the received accumulated processing results. The structure of the other accumulation module is consistent with that of the aforementioned accumulation module.

[0126] Among them, for more specific working processes of each step in this embodiment, reference can be made to the corresponding contents disclosed in the aforementioned embodiments, which will not be repeated here.

[0127] It can be seen that this embodiment provides a data processing method that can quickly implement feature fusion operations.

[0128] In one example, the calculation of Q, K, and V matrices and full connection calculations in any network are processed according to this application. Taking VIT (Vision Transforme) as an example, the input data of the network is: an image of size 224×224, which is divided into patches of fixed size, and the patch size is 16×16. Then each image will generate 224×224 / 16×16=196 patches, then the input sequence length is 196, and the dimension of each patch is 16×16×3=768. The dimension of the linear projection layer in the network is 768×768, so the dimension of each patch after being processed by the linear projection layer is still 196×768, that is, there are a total of 196 tokens, and the dimension of each token is 768. A special character needs to be added here, so the final dimension is 197×768. Then, the accelerator calculates the matrix multiplication of (197×768)×(768×768) to realize the calculation of the Q, K, and V matrices and the full connection calculation in the above network.

[0129] In one example, when the model input data is an image, the pre-processing of the image can be implemented by the image processing module in the accelerator as follows: obtaining an image data set. The image data set includes a number of original images, which can be downloaded from the network, sent by other devices, directly read from a readable storage medium, or acquired by real-time image acquisition through an image acquisition system.

[0130] In one embodiment of the present application, acquiring an image data set includes: acquiring images from different data sources; cleaning the acquired images, and storing the cleaned images in a newly created data set to obtain an image data set.

[0131] Considering that images acquired from different data sources have different qualities or sizes, in this embodiment, after acquiring the image, the image can be cleaned, and of course the image can also be normalized in terms of size, color, and other dimensions. Data cleaning can specifically remove duplicate, incomplete, or unusable images. After data cleaning is completed, the cleaned image can be stored in a new data set, thereby obtaining an image data set.

[0132] Afterwards, the structured information in the original image is identified to obtain structured data. Structured data is also called row data. It is data that is logically expressed and implemented by a two-dimensional table structure. It strictly follows the data format and length specifications and is mainly stored and managed through a relational database. The image itself has structured content. For example, if an original image corresponds to a photo of a dog, then the object in the original image is a dog. Furthermore, the dog's category, size, color and other characteristics can also be clarified. In this embodiment, a corresponding relationship between images and texts can also be established to directly identify the structured information in the original image, thereby obtaining structured data. Structured data refers to what specific structured information exists in the original.

[0133] In one embodiment of the present application, structured information in an original image is identified to obtain structured data, including: inputting the original image into a structured model to identify structured information to obtain structured data; wherein the structured information includes at least one of objects, scenes and emotions; accordingly, after constructing a graphic data set using graphic samples corresponding to several original images, it also includes: training an image processing model using the graphic data set; wherein the image processing model is at least one of object recognition, scene recognition and emotion recognition.

[0134] The structured model may be a general structured model or a face structured model. General structured models (including all types of image recognition such as faces and landscapes) include R-CNN (Region-CNN, the first algorithm that successfully applied deep learning to target detection) and YOLO (You Only Look Once, an algorithm that uses convolutional neural networks for target detection).

[0135] Face structured models (open source), such as MTCNN (Multi-task Cascaded Convolutional Networks) and OpenCV (Open Source Computer Vision Library), an open source computer vision and machine learning software library.

[0136] For example, an image recognition model (a structured model) generates structured data: First, the original image is fed into the image recognition model, which can analyze and understand the original image and identify structured information such as objects, scenes, and emotions. These structured data can be object labels, scene descriptions, sentiment analysis results, etc., providing a detailed understanding of the image content.

[0137] Accordingly, since the structured information recognized by the graphic and text dataset includes at least one of objects, scenes and emotions; accordingly, the subsequently generated descriptive text also corresponds to at least one of the corresponding objects, scenes and emotions, therefore, the subsequently obtained graphic and text dataset can train at least one image processing model of object recognition, scene recognition and emotion recognition.

[0138] After that, the structured data is used to generate natural language descriptions to obtain description text.

[0139] After obtaining the structured data, a natural language description generation process can be performed based on the structured data to obtain a description text about the original image. For specific information on how to generate the description text based on the structured data, reference can be made to the relevant natural language description generation scheme, which will not be described in detail here.

[0140] In one embodiment of the present application, a natural language description generation process is performed using structured data to obtain a description text, including: inputting the structured data into a text generation model for description generation processing to obtain the description text. In other words, the structured data can be passed to the text generation model. The text generation model can convert the structured data into a natural language description and generate a description text related to the image content in the original image. Specifically, the text generation model can generate rich and vivid text descriptions based on information such as objects and emotions in the structured data, thereby enhancing the expression and understanding of the image content.

[0141] It should be noted that since structured data is used to form sentences, the structured data actually corresponds to multiple words, so the generated description text will contain all the words provided and will not arbitrarily add additional nouns, thus avoiding the creation of hallucinations, that is, the generated text will not contain object nouns other than the multiple words provided.

[0142] Finally, the original image is associated with the corresponding description text to obtain the image and text samples corresponding to the original image.

[0143] The generated text description is associated with the corresponding original image to form the final image-text sample data. In other words, in each image-text sample, the original image has a description text associated with it. Such an image-text sample contains both the visual information of the image and the semantic understanding of the image content, providing rich information for subsequent applications and analysis.

[0144] In one embodiment of the present application, an original image is associated with a corresponding description text to obtain a graphic sample corresponding to the original image, including: creating a blank label for the original image; writing the description text corresponding to the original image in the blank label; and determining the original image with a non-empty label as a graphic sample. It can be seen that in order to establish an association relationship between image and text, in this embodiment, a blank label can be created for each original image, and then the description text corresponding to the original image can be written in the blank label. In this way, for an original image, if it has a non-empty label, it is a graphic sample, and a graphic data set can be obtained. For each sample in the graphic data set, it can be used as model input data.

[0145] Of course, in practical applications, a key-value pair method may also be used to establish an association relationship between the original image and the text description corresponding to the original image, which will not be described in detail here.

[0146] In the image-text dataset, each image has a description text associated with it. Such a dataset contains both the visual information of the image and the semantic understanding of the image content, providing rich information for subsequent applications and analysis. In this way, the relevant image-text multimodal pre-training model can be trained based on the image-text dataset.

[0147] Apply the method provided in the embodiment of the present application to obtain an image data set; wherein the image data set includes several original images; identify the structured information in the original images to obtain structured data; use the structured data to perform natural language description generation processing to obtain description text; associate the original images with the corresponding description text to obtain image and text samples corresponding to the original images; and use the image and text samples corresponding to the several original images to construct an image and text data set.

[0148] In the present application, structured information recognition is directly performed on the original image to obtain structured data of the original image. Then, when generating the description text corresponding to the original image, the text generation process is not performed directly on the original image based on the prompt, but the description text is generated based on the structured data. Finally, the original image and the description text are associated to obtain a graphic sample. A graphic data set is finally constructed based on the graphic sample. It can be seen that in the present application, structured data is directly extracted from the original image, and then description text is generated based on the structured data, which can effectively improve the reliability of the graphic data set. Among them, the image processing module in the accelerator can use each sample in the graphic data set as model input data, and extract the feature matrix of the model input data therefrom.

[0149] An electronic device provided in an embodiment of the present application is introduced below. The electronic device described below can be referenced to other embodiments described in this document.

[0150] The present application discloses an electronic device, including:

[0151] Memory, used to store computer programs;

[0152] A processor is used to execute the computer program to implement the method disclosed in any of the above embodiments.

[0153] In this embodiment, when the processor executes the computer program stored in the memory, the following steps can be specifically implemented: the feature matrix extracted from the model input data is divided into a plurality of sub-matrices of a preset size, and the plurality of sub-matrices are ping-pong-written into the first memory in the accelerator and the second memory in the accelerator; the model input data is text and / or image. According to the operation logic configuration of the feature matrix, at least two target sub-matrices participating in a single calculation are read from the first memory and the second memory. Delays are added to each row of at least two target sub-matrices so that at least two target sub-matrices are deformed into parallelograms. Multiplication and addition processing is performed on at least two target sub-matrices deformed into parallelograms to obtain processing results. Identification information is added to the processing results. After the sub-matrices in the first memory and the second memory are read and processed by the systolic array, each processing result with different identification information added is accumulated to obtain a feature fusion result corresponding to the model input data.

[0154] In this embodiment, when the processor executes the computer program stored in the memory, the following steps may be specifically implemented: for each row of at least two target sub-matrices, a delay of one time unit more than that of the previous row is added row by row.

[0155] In this embodiment, when the processor executes the computer program stored in the memory, the following steps may be specifically implemented: when a transposition mark is detected, the processing result is transmitted to the transposition module in the accelerator.

[0156] In this embodiment, when the processor executes the computer program stored in the memory, the following steps may be specifically implemented: deleting the delay of each row of the processing result so that the processing result is restored from a parallelogram to a rectangle.

[0157] In this embodiment, when the processor executes the computer program stored in the memory, the following steps may be specifically implemented: for each line of the processing result, the delay that is one time unit longer than that of the previous line is deleted line by line.

[0158] In this embodiment, when the processor executes the computer program stored in the memory, the following steps may be specifically implemented: when the transposition mark is not detected, transmitting the processing result to the delay recovery module.

[0159] In this embodiment, when the processor executes the computer program stored in the memory, the following steps may be specifically implemented: after restoring the processing result from a parallelogram to a rectangle, the corresponding result is transmitted to the marking module.

[0160] In this embodiment, when the processor executes the computer program stored in the memory, the following steps can be specifically implemented: the accumulated processing results of each processing result with different identification information added are transmitted to another accumulation module, so that the other accumulation module stores and accumulates the received accumulated processing results.

[0161] Furthermore, the present application also provides an electronic device. The electronic device can be Figure 8 The server shown can also be Fig. 9 Terminal shown. Figure 8 and Fig. 9 All of them are structural diagrams of electronic devices according to an exemplary embodiment, and the contents in the diagrams cannot be regarded as any limitation on the scope of use of the present application.

[0162] Figure 8 A schematic diagram of the structure of a server provided in an embodiment of the present application. The server may specifically include: at least one processor, at least one memory, a power supply, a communication interface, an input / output interface, and a communication bus. The memory is used to store a computer program, which is loaded and executed by the processor to implement the relevant steps in the data processing disclosed in any of the aforementioned embodiments.

[0163] In this embodiment, the power supply is used to provide working voltage for each hardware device on the server; the communication interface can create a data transmission channel between the server and external devices, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0164] In addition, the memory as a carrier for resource storage can be a read-only memory, random access memory, disk or CD, etc. The resources stored thereon include operating system, computer programs and data, etc. The storage method can be temporary storage or permanent storage.

[0165] The operating system is used to manage and control the hardware devices and computer programs on the server to realize the operation and processing of the data in the memory by the processor, and it can be Windows Server, Netware, Unix, Linux, etc. In addition to computer programs that can be used to complete the data processing method disclosed in any of the above embodiments, the computer program can also further include computer programs that can be used to complete other specific tasks. In addition to data such as application update information, the data can also include data such as application developer information.

[0166] Fig. 9 A schematic diagram of the structure of a terminal provided in an embodiment of the present application, the terminal may specifically include but is not limited to a smart phone, a tablet computer, a laptop computer or a desktop computer, etc.

[0167] Generally, the terminal in this embodiment includes: a processor and a memory.

[0168] Among them, the processor may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0169] The memory may include one or more computer non-volatile storage media, which may be non-transitory. The memory may also include high-speed random access memory, and non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory is at least used to store the following computer program, wherein, after the computer program is loaded and executed by the processor, it can implement the relevant steps in the data processing method performed by the terminal side disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory may also include an operating system and data, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system may include Windows, Unix, Linux, etc. The data may include, but is not limited to, update information of the application.

[0170] In some embodiments, the terminal may also include a display screen, an input and output interface, a communication interface, a sensor, a power supply, and a communication bus.

[0171] Those skilled in the art will understand that Fig. 9 The structure shown in the figure does not constitute a limitation on the terminal, and may include more or fewer components than those shown in the figure.

[0172] A non-volatile storage medium provided in an embodiment of the present application is introduced below. The non-volatile storage medium described below can be cross-referenced with other embodiments described herein.

[0173] A non-volatile storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the data processing method disclosed in the above-mentioned embodiment. The non-volatile storage medium is a computer-readable non-volatile storage medium, which, as a carrier for storing resources, may be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon include an operating system, a computer program and data, etc., and the storage method may be temporary storage or permanent storage.

[0174] In this embodiment, when the processor executes the computer program stored in the non-volatile storage medium, the following steps can be specifically implemented: the feature matrix extracted from the model input data is divided into a plurality of sub-matrices of a preset size, and the plurality of sub-matrices are ping-pong-written into the first memory in the accelerator and the second memory in the accelerator; the model input data is text and / or image. According to the operation logic configuration of the feature matrix, at least two target sub-matrices participating in a single calculation are read from the first memory and the second memory. Delays are added to each row of the at least two target sub-matrices so that the at least two target sub-matrices are deformed into parallelograms. Multiplication and addition processing is performed on the at least two target sub-matrices deformed into parallelograms to obtain processing results. Identification information is added to the processing results. After the sub-matrices in the first memory and the second memory are read and processed by the systolic array, each processing result with different identification information added is accumulated to obtain a feature fusion result corresponding to the model input data.

[0175] In this embodiment, when the processor executes the computer program stored in the non-volatile storage medium, the following steps may be specifically implemented: for each row of at least two target sub-matrices, a delay of one time unit more than that of the previous row is added row by row.

[0176] In this embodiment, when the processor executes the computer program stored in the non-volatile storage medium, the following steps may be specifically implemented: when a transposition mark is detected, the processing result is transmitted to the transposition module in the accelerator.

[0177] In this embodiment, when the processor executes the computer program stored in the non-volatile storage medium, the following steps may be specifically implemented: deleting the delay of each row of the processing result so that the processing result is restored from a parallelogram to a rectangle.

[0178] In this embodiment, when the processor executes the computer program stored in the non-volatile storage medium, the following steps may be specifically implemented: for each line of the processing result, the delay that is one time unit longer than that of the previous line is deleted line by line.

[0179] In this embodiment, when the processor executes the computer program stored in the non-volatile storage medium, the following steps may be specifically implemented: when the transposition mark is not detected, transmitting the processing result to the delay recovery module.

[0180] In this embodiment, when the processor executes the computer program stored in the non-volatile storage medium, the following steps may be specifically implemented: after restoring the processing result from a parallelogram to a rectangle, the corresponding result is transmitted to the marking module.

[0181] In this embodiment, when the processor executes the computer program stored in the non-volatile storage medium, the following steps can be specifically implemented: the accumulated processing results of each processing result with different identification information added are transmitted to another accumulation module, so that the other accumulation module stores and accumulates the received accumulated processing results.

[0182] A computer program product provided in an embodiment of the present application is introduced below. The computer program product described below can be cross-referenced with other embodiments described in this document.

[0183] A computer program product comprises a computer program / instruction, which implements the steps of the aforementioned disclosed data processing method when executed by a processor.

[0184] In this embodiment, when the computer program / instruction is executed by the processor, the following steps can be specifically implemented: the feature matrix extracted from the model input data is divided into multiple sub-matrices of preset size, and the multiple sub-matrices are ping-pong-written into the first memory in the accelerator and the second memory in the accelerator; the model input data is text and / or image. According to the operation logic configuration of the feature matrix, at least two target sub-matrices participating in a single calculation are read from the first memory and the second memory. Delays are added to each row of the at least two target sub-matrices so that the at least two target sub-matrices are deformed into parallelograms. Multiplication and addition processing is performed on the at least two target sub-matrices deformed into parallelograms to obtain processing results. Identification information is added to the processing results. After the sub-matrices in the first memory and the second memory are read and processed by the systolic array, each processing result with different identification information added is accumulated to obtain a feature fusion result corresponding to the model input data.

[0185] In this embodiment, when the computer program / instruction is executed by the processor, the following steps may be specifically implemented: for each row of at least two target sub-matrices, a delay of one time unit more than that of the previous row is added row by row.

[0186] In this embodiment, when the computer program / instruction is executed by the processor, the following steps may be specifically implemented: when the transposition mark is detected, the processing result is transmitted to the transposition module in the accelerator.

[0187] In this embodiment, when the computer program / instruction is executed by the processor, the following steps may be specifically implemented: the delay of each row of the processing result is deleted to restore the processing result from a parallelogram to a rectangle.

[0188] In this embodiment, when the computer program / instruction is executed by the processor, the following steps may be specifically implemented: for each line of the processing result, the delay that is one time unit longer than that of the previous line is deleted line by line.

[0189] In this embodiment, when the computer program / instruction is executed by the processor, the following steps may be specifically implemented: when the transposition mark is not detected, the processing result is transmitted to the delay recovery module.

[0190] In this embodiment, when the computer program / instruction is executed by the processor, the following steps may be specifically implemented: after restoring the processing result from a parallelogram to a rectangle, the corresponding result is transmitted to the marking module.

[0191] In this embodiment, when the computer program / instruction is executed by the processor, the following steps can be specifically implemented: the accumulated processing results of each processing result with different identification information added are transmitted to another accumulation module, so that the other accumulation module stores and accumulates the received accumulated processing results.

[0192] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0193] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of non-volatile storage medium known in the art.

[0194] Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. An accelerator, characterized in that: include: A write control module, used for dividing a feature matrix extracted from model input data into a plurality of sub-matrices of a preset size, and ping-pong-writing the plurality of sub-matrices into a first memory and a second memory; the model input data is text and / or an image; A read control module, configured to read at least two target sub-matrices participating in a single calculation from the first memory and the second memory according to the operation logic configuration of the characteristic matrix; The first memory and the second memory are used to sequentially store the sub-matrices stored in the write control module; A delay module, configured to add a delay to each row of the at least two target sub-matrices so as to deform the at least two target sub-matrices into a parallelogram; A systolic array is used to perform multiplication and addition processing on at least two target sub-matrices deformed into parallelograms to obtain a processing result; A marking module, used to add identification information to the processing result; An accumulation module is used to accumulate the processing results added with different identification information after the sub-matrices in the first memory and the second memory are read and processed by the systolic array to obtain the feature fusion result corresponding to the model input data.

2. The accelerator according to claim 1, characterized in that The first memory and the second memory respectively include: a first storage area, a second storage area and a third storage area; The first storage area is used to store a first matrix for feature fusion operation; The second storage area is used to store a second matrix of feature fusion operation; The third storage area is used to store a third matrix of the feature fusion operation; The characteristic matrix includes: a first matrix, a second matrix and a third matrix.

3. The accelerator according to claim 2, characterized in that The third matrix is ​​a row matrix, a column matrix or an all-0 matrix.

4. The accelerator according to claim 1, characterized in that The first memory and the second memory are both single-port.

5. The accelerator according to claim 1, characterized in that: The delay module is used to add a delay of one time unit more than the previous row to each row of the at least two target sub-matrices row by row.

6. The accelerator according to claim 1, characterized in that The systolic array includes M×N multiplication-addition units, and the preset size is M×N.

7. The accelerator according to claim 6, characterized in that The data types supported by the multiply-add unit include FP16, FP32 and / or INT8.

8. The accelerator according to claim 1, characterized in that Also includes: The transpose module is used to transpose the matrix in the input itself according to the transpose mark.

9. The accelerator according to claim 8, characterized in that The transposition module is used to splice multiple matrix blocks to obtain a large matrix, and to transpose each matrix block in the large matrix.

10. The accelerator according to claim 8, characterized in that The systolic array is used to transmit the processing result to the transposition module when the transposition mark is detected.

11. The accelerator according to claim 1, characterized in that: Also includes: The delay recovery module is used to delete the delay of each row of the processing result so that the processing result is restored from a parallelogram to a rectangle.

12. The accelerator according to claim 11, characterized in that The delay recovery module is used to delete the delay of each line of the processing result that is one time unit longer than that of the previous line.

13. The accelerator according to claim 11, characterized in that The systolic array is used to transmit the processing result to the delay recovery module when the transposition mark is not detected.

14. The accelerator according to claim 13, characterized in that The delayed recovery module is used to restore the processing result from a parallelogram to a rectangle and then transmit the corresponding result to the marking module.

15. The accelerator according to any one of claims 1 to 14, characterized in that: The accumulation module includes: an accumulation write controller, an accumulation read controller, an accumulation memory and an accumulator; An accumulation write controller, used for writing the processing result into the accumulation memory; An accumulation read controller, used for reading the data stored last time from the accumulation memory; An accumulation memory, used for storing the processing results stored in the accumulation write controller; The accumulator is used to accumulate the data read by the accumulation read controller and the current processing result, and store the accumulation result in the accumulation memory.

16. The accelerator according to any one of claims 1 to 14, characterized in that: The accumulation module is used to transmit the accumulated processing results of each processing result added with different identification information to another accumulation module, so that the other accumulation module stores and accumulates the received accumulated processing results.

17. A data processing method, characterized in that: The accelerator according to any one of claims 1 to 16 comprises: Cutting a feature matrix extracted from model input data into a plurality of sub-matrices of preset sizes, and ping-pong-writing the plurality of sub-matrices into a first memory and a second memory; the model input data is text and / or an image; Reading at least two target sub-matrices participating in a single calculation from the first memory and the second memory according to the operation logic configuration of the characteristic matrix; adding delays to each row of the at least two target sub-matrices so that the at least two target sub-matrices are deformed into a parallelogram; Performing multiplication and addition processing on at least two target sub-matrices deformed into parallelograms to obtain a processing result; Adding identification information to the processing result; After the sub-matrices in the first memory and the second memory are read and processed by the systolic array, each processing result with different identification information added is accumulated to obtain a feature fusion result corresponding to the model input data.

18. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to execute the computer program to implement the method according to claim 17.

19. A non-volatile storage medium, characterized in that: Used to store a computer program, wherein the computer program implements the method according to claim 17 when executed by a processor.

20. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the method according to claim 17 is implemented.

21. A data processing system, characterized in that: include: At least one host, each host being connected to at least one accelerator according to any one of claims 1 to 16.