Convolution implementation method, device and equipment based on support for additive write storage medium

CN123012325APending Publication Date: 2026-10-30SHANGHAI SMARTLOGIC TECHNOLOGY LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611142155.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-30
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0004]然而,该方法易导致输入矩阵中的同一元素可能被复制到展开矩阵中的多个位置,当输入矩阵和卷积核矩阵的尺寸较大、卷积步长较小时,展开矩阵可能占用较大的存储空间,并产生较大的数据搬移开销,且在单输出通道场景下,展开后的卷积核与展开矩阵相乘实际上是向量-矩阵乘法,而现有的计算设备中,矩阵-矩阵乘法的运算部件运算效率显著高于向量-矩阵乘法的运算部件,im2col方法无法充分利用高效计算部件

Benefits of technology

[0009]根据本发明的另一方面,提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机指令,所述计算机指令用于使处理器执行时实现本发明任一实施例所述的基于支持加法写入存储介质的卷积实现方法。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123012325A_ABST
    Figure CN123012325A_ABST
Patent Text Reader

Abstract

The application discloses a convolution implementation method, device and equipment based on a support addition write storage medium. The method comprises the following steps: performing padding processing on an input matrix, obtaining a padding matrix, and initializing an accumulation storage area; each row in the padding matrix is determined as a to-be-processed row; for each to-be-processed row, a plurality of continuous data segments are extracted from the to-be-processed row, and the plurality of continuous data segments are combined as column vectors to form a row expansion matrix; a product matrix output by a matrix multiplication operation unit is obtained, and the product matrix is flipped up and down in a row sequence to obtain a row inversion matrix; each row of the row inversion matrix is accumulated in the accumulation storage area to obtain a target data row; and after all the to-be-processed rows are processed, an output matrix is obtained in the accumulation storage area. The above technical scheme can reduce the amount of intermediate expansion data required when the convolution is converted into a matrix multiplication operation, the core operation is all matrix multiplication operation, and the loss of computing power utilization rate caused by vector matrix multiplication is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a method, apparatus, and device for implementing convolution based on a storage medium that supports addition writing. Background Technology

[0002] Two-dimensional convolution is widely used in image processing, signal processing, and neural network inference. Conventional two-dimensional convolution is typically implemented by sliding a convolution kernel matrix horizontally and vertically across the input matrix. After the kernel matrix moves to a certain position, each element of the kernel matrix is ​​multiplied by the corresponding element of the input matrix, and the products are summed to obtain an element of the output matrix.

[0003] In order to improve the efficiency of convolution operations, the im2col (image data column unrolling) method is often used in the existing technology. This method unrolls each sliding window in the input matrix into column vectors, combines multiple column vectors into an unrolled matrix, and multiplies the unrolled convolution kernel with the unrolled matrix.

[0004] However, this method is prone to the same element in the input matrix being copied to multiple positions in the unfolded matrix. When the size of the input matrix and the convolution kernel matrix is ​​large and the convolution stride is small, the unfolded matrix may occupy a large amount of storage space and generate a large data transfer overhead. Moreover, in the single output channel scenario, the multiplication of the unfolded convolution kernel and the unfolded matrix is ​​actually a vector-matrix multiplication. In existing computing devices, the computational efficiency of the matrix-matrix multiplication unit is significantly higher than that of the vector-matrix multiplication unit. The im2col method cannot make full use of the efficient computing unit. Summary of the Invention

[0005] This invention provides a method, apparatus, and device for implementing convolution based on a storage medium that supports addition writing. When the vertical convolution stride is 1, it reduces the amount of intermediate unfolded data required when converting convolution into matrix multiplication. The core operations are all matrix multiplication operations, thus avoiding the loss of computing power utilization caused by vector-matrix multiplication.

[0006] According to one aspect of the present invention, a convolution implementation method based on a storage medium supporting addition write is provided, applied to a convolution calculation system including a matrix multiplication unit and a storage medium supporting addition write, comprising: The input matrix is ​​padded according to the size of the convolution kernel matrix to obtain the padded matrix, and the accumulation storage area is initialized in the storage medium that supports addition writing. When the vertical convolution stride is 1, each row in the filling matrix is ​​determined as a row to be processed. For each row to be processed, multiple consecutive data segments are extracted from the row to be processed based on the horizontal convolution stride and the number of columns in the convolution kernel matrix, and the multiple consecutive data segments are combined as column vectors to form a row expansion matrix. The convolution kernel matrix and the row unfolding matrix are input into the matrix multiplication unit to obtain the product matrix output by the matrix multiplication unit, and the row order of the product matrix is ​​flipped vertically to obtain the row-reversed matrix. By using the storage medium that supports addition, each row of the row inversion matrix is ​​accumulated to the target data row in the accumulation storage area; After all rows to be processed have been processed, the output matrix is ​​obtained in the accumulated storage area.

[0007] According to another aspect of the present invention, a convolution implementation apparatus based on a storage medium supporting addition write is provided, applied to a convolution calculation system including a matrix multiplication unit and a storage medium supporting addition write, comprising: The preliminary processing module is used to fill the input matrix according to the size of the convolution kernel matrix, obtain the filling matrix, and initialize the accumulation storage area in the storage medium that supports addition writing. The unprocessed row determination module is used to determine each row in the filling matrix as the unprocessed row when the vertical convolution stride is 1. The row unfolding matrix generation module is used to extract multiple continuous data segments from each row to be processed based on the horizontal convolution stride and the number of columns in the convolution kernel matrix, and combine the multiple continuous data segments as column vectors to form a row unfolding matrix. The inverted matrix generation module is used to input the convolution kernel matrix and the row unfolding matrix into the matrix multiplication unit, obtain the product matrix output by the matrix multiplication unit, and flip the row order of the product matrix to obtain the row inverted matrix. The inverted matrix writing module is used to accumulate each row of the row inverted matrix into the target data row in the accumulation storage area through the additive writing storage medium. The output matrix acquisition module is used to acquire the output matrix in the accumulated storage area after all rows to be processed have been processed.

[0008] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the convolution implementation method based on a storage medium that supports addition writing, as described in any embodiment of the present invention.

[0009] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions, the computer instructions being configured to cause a processor to execute and implement the convolution implementation method based on a storage medium supporting addition writing as described in any embodiment of the present invention.

[0010] The technical solution of this invention involves filling the input matrix according to the size of the convolution kernel matrix to obtain a filling matrix, and initializing an accumulation storage area in a storage medium that supports addition writing. When the vertical convolution stride is 1, each row in the filling matrix is ​​determined as a row to be processed. For each row to be processed, multiple continuous data segments are extracted from the row according to the horizontal convolution stride and the number of columns in the convolution kernel matrix, and these multiple continuous data segments are combined as column vectors to form a row unfolded matrix. The convolution kernel matrix and the row unfolded matrix are input to the matrix multiplication unit to obtain the product matrix output by the matrix multiplication unit, and the row order of the product matrix is ​​flipped vertically to obtain a row-reversed matrix. The addition process writes data to the storage medium, accumulating each row of the row-reversed matrix into the target data row in the accumulation storage area. After all rows to be processed are completed, the output matrix is ​​obtained from the accumulation storage area. This method solves the problem of existing technologies requiring a large amount of space to store process data in scenarios with large convolution kernel sizes, effectively reducing intermediate memory usage. Moreover, the core operations are all matrix multiplications, avoiding the loss of computational efficiency caused by vector-matrix multiplications. The accumulation operation is completed directly in-situ within the storage medium, significantly reducing the number of data transfers. Furthermore, it only requires adjusting the movement interval of the sliding window to adapt to any positive integer horizontal convolution stride, enabling convolution operations to be performed in a low-storage-occupancy and high-efficiency manner.

[0011] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0012] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0013] Figure 1 This is a flowchart of a convolution implementation method based on a storage medium that supports addition writing, according to Embodiment 1 of the present invention; Figure 2 This is a schematic diagram of in-situ addition writing according to an embodiment of the present invention; Figure 3 This is a flowchart of another convolution implementation method based on a storage medium that supports addition writing, provided in Embodiment 2 of the present invention; Figure 4 This is a schematic diagram of a convolution implementation device based on a storage medium that supports addition writing, according to Embodiment 3 of the present invention. Figure 5 This is a schematic diagram of the structure of an electronic device that implements the convolution implementation method based on a storage medium that supports addition writing, according to an embodiment of the present invention. Detailed Implementation

[0014] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0015] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0016] Example 1 Figure 1This is a flowchart of a convolution implementation method based on an additive write-enabled storage medium provided in Embodiment 1 of the present invention. This embodiment is applicable to the case where the vertical convolution stride is 1, and two-dimensional convolution is performed using a matrix multiplication unit and an additive write-enabled storage medium. This method can be executed by a convolution implementation device based on an additive write-enabled storage medium. This convolution implementation device can be implemented in hardware and / or software and can be configured in a convolution calculation system that includes a matrix multiplication unit and an additive write-enabled storage medium. Figure 1 As shown, the method includes: S110. Based on the size of the convolution kernel matrix, the input matrix is ​​padded to obtain the padded matrix, and the accumulation storage area is initialized in the storage medium that supports addition writing.

[0017] Optionally, storage media that support addition writing refers to storage devices with in-situ operation capabilities. When performing a write operation, the data to be written can be directly added to the original data in the storage unit, and the result can be directly stored in the original storage unit. This eliminates the need for multiple steps such as reading the original data, performing the operation, and finally writing back the result, which can significantly reduce data movement overhead.

[0018] Optionally, the input matrix can refer to the two-dimensional data array input for the convolution operation. The input matrix can be an image pixel matrix, a feature map matrix, a sensor data matrix, or other two-dimensional data matrices. In embodiments of the present invention, the number of columns of the input matrix can be represented by Ix, and the number of rows can be represented by Iy.

[0019] Optionally, the convolution kernel matrix refers to the two-dimensional weight matrix of the convolution operation. In embodiments of the present invention, the number of columns of the convolution kernel matrix can be represented by Kx, and the number of rows can be represented by Ky.

[0020] Optionally, the padding matrix can refer to the matrix formed by adding padding elements to at least one of the top, bottom, left, and right sides of the input matrix. It is used to adjust the output size. The padding elements can be determined according to the pre-set padding rules. For example, 0 can be used as the padding element.

[0021] Optionally, the number of rows in the padding matrix is ​​the sum of the number of rows in the input matrix and the number of rows in the convolution kernel matrix minus 1, and the number of columns in the padding matrix is ​​the sum of the number of columns in the input matrix and the number of columns in the convolution kernel matrix minus 1.

[0022] Optionally, the accumulation storage area refers to a dedicated storage space in a storage medium that supports addition writing, used to store the intermediate accumulation results of convolution operations, and finally extract the valid output matrix from it.

[0023] The process of padding the input matrix according to the size of the convolution kernel matrix to obtain the padding matrix can include: Based on the size of the convolution kernel matrix, determine the number of rows and columns to be filled, and then fill the input matrix according to the number of rows and columns to obtain the filled matrix; Wherein, the number of rows to be filled is the number of rows in the convolution kernel matrix minus 1, and the number of columns to be filled is the number of columns in the convolution kernel matrix minus 1.

[0024] Optionally, the number of rows to fill and the number of columns to fill are parameters for the filling process. The number of rows to fill describes the total number of rows added to the input matrix, and the number of columns to fill describes the total number of columns added to the input matrix.

[0025] Optionally, when the size of the convolution kernel matrix is ​​Kx columns and Ky rows, the number of rows to be filled is Ky-1 and the number of columns to be filled is Kx-1. If the number of columns of the input matrix is ​​represented by Ix and the number of rows is represented by Iy, then the total number of rows to be filled is Iy+Ky-1 and the total number of columns to be filled is Ix+Kx-1.

[0026] In an optional example, if the input matrix convolution kernel matrix The number of rows to be filled is 2, and the number of columns to be filled is 2. If 0 is used as the filling element, filling the input matrix with 2 rows and 2 columns will yield the filled matrix. .

[0027] Initializing the accumulation storage area in the additive write-supported storage medium may include: The row number of the convolution kernel matrix is ​​reduced by 1 as the single-sided row increment, and the single-sided row increment is multiplied by 2 and added to the row number of the output matrix. The result is used as the row number of the accumulated storage area. Use the number of columns in the output matrix as the number of columns in the accumulated storage area; The accumulation storage area is initialized in the addition-write-supported storage medium according to the number of rows and columns of the accumulation storage area.

[0028] Optionally, the output matrix refers to the final result matrix of the convolution operation. The number of columns in the output matrix can be represented by Ox, and the number of rows can be represented by Oy.

[0029] Optionally, the size of the accumulated storage area is actually based on the output matrix, with additional data rows added above and below to meet the single-side row increase amount.

[0030] Optionally, if the number of rows in the convolution kernel matrix is ​​represented by Ky, then the increase in rows on one side is Ky-1, and the number of rows in the accumulated storage area is Ky-1+Oy+Ky-1, that is, Oy+2Ky-2. The number of columns in the accumulated storage area is equal to the number of columns in the output matrix, which is Ox.

[0031] Optionally, after initialization, all elements in the accumulated storage region are 0. Continuing the previous example, if the size of the convolution kernel matrix is ​​3 columns and 3 rows, the size of the padding matrix is ​​5 columns and 5 rows, and both the vertical and horizontal convolution strides are set to 1, then the number of columns in the output matrix can be calculated as Ox=3, the number of rows as Oy=3, and the single-side row increase is 2. Further, the total number of rows in the accumulated storage region is 3+2+2=7, and the total number of columns in the accumulated storage region is 3. After initialization, the accumulated storage region can be represented as: .

[0032] S120. When the vertical convolution stride is 1, each row in the filling matrix is ​​determined as the row to be processed.

[0033] Optionally, the row to be processed refers to the data row of the filling matrix used to generate a row expansion matrix separately. When the vertical convolution stride is 1, each data row in the filling matrix is ​​a row to be processed.

[0034] S130. For each row to be processed, extract multiple continuous data segments from the row to be processed according to the horizontal convolution stride and the number of columns of the convolution kernel matrix, and combine the multiple continuous data segments as column vectors to form a row expansion matrix.

[0035] Optionally, a continuous data segment can refer to a continuous segment of elements extracted from the row to be processed, with a length equal to the number of columns in the convolution kernel matrix, corresponding to a horizontal sliding window of the convolution kernel in the current row.

[0036] Optionally, the row expansion matrix can refer to a two-dimensional matrix composed of multiple consecutive data segments arranged in the form of column vectors. The number of rows of the row expansion matrix is ​​equal to the number of columns of the convolution kernel Kx, and the number of columns of the row expansion matrix is ​​equal to the number of columns of the output matrix Ox or the length of the consecutive data segments. The row expansion matrix can transform one-dimensional row data into a two-dimensional form that can perform standard matrix multiplication with the convolution kernel.

[0037] Continuing from the previous example, since the first row of the filling matrix P is all 0, all elements in its corresponding row expansion matrix and row reversal matrix are also 0, which cannot be directly illustrated. Here, we take the second row of the filling matrix P[2]=[0 1 2 3 0] as an example. When the number of columns of the convolution kernel matrix Kx=3, the length of each continuous data segment is 3. Starting from the first element, with a sliding window of length equal to 3, continuous data segments are successively cut off with a step size of 1 to obtain [0 1 2], [1 2 3], and [2 3 0]. It can be seen that there are not enough elements after 0 to form continuous data segments. Therefore, three data segments are finally obtained. The above three data segments are arranged in the form of column vectors according to the order of cutting. That is, [0 1 2] are the three elements of the first column, [1 2 3] are the three elements of the second column, and [2 3 0] are the three elements of the third column. Finally, the row expansion matrix corresponding to the second row is obtained. .

[0038] Optionally, for each row to be processed, the corresponding row expansion matrix can be extracted in the manner described above.

[0039] S140. Input the convolution kernel matrix and the row expansion matrix into the matrix multiplication unit, obtain the product matrix output by the matrix multiplication unit, and flip the row order of the product matrix to obtain the row-reversed matrix.

[0040] Optionally, the matrix multiplication unit refers to a computation module specifically designed to perform two-dimensional general matrix multiplication. The matrix multiplication unit is used to receive the convolution kernel matrix and the row expansion matrix, and to perform matrix multiplication on the convolution kernel matrix and the row expansion matrix.

[0041] Optionally, the product matrix can refer to the intermediate result matrix obtained by performing standard matrix multiplication on the convolution kernel matrix and the row expansion matrix. The number of rows in the product matrix is ​​equal to the number of rows in the convolution kernel Ky, and the number of columns is equal to the number of columns in the output matrix Ox.

[0042] Optionally, a row-reversed matrix is ​​a matrix obtained by flipping the row order of the product matrix vertically. Row reversal is used to align the vertical positional correspondence of the convolution operation, ensuring that the result of row-by-row accumulation is completely equivalent to that of standard two-dimensional convolution.

[0043] It is understandable that flipping the row order of a product matrix means swapping the first row with the last row, swapping the second row with the second-to-last row, and so on. For example, if the product matrix consists of 5 rows r1, r2, r3, r4 and r5 arranged in order, then the corresponding row-flipped matrix consists of r5, r4, r3, r2 and r1 arranged in order.

[0044] Continuing the previous example, if the convolution kernel matrix... The row expansion matrix corresponding to the second row of the filling matrix P Then the product matrix KM corresponding to the second row of the filling matrix P is equal to Reversing the row order of the product matrix KM results in a row-reversed matrix. .

[0045] It is understandable that by processing each row to be processed in the above manner, a row flip matrix corresponding to each row to be processed can be obtained.

[0046] S150. By supporting addition writing to the storage medium, the rows of the row inversion matrix are accumulated to the target data row in the accumulation storage area.

[0047] Optionally, the target data row can refer to the storage row in the accumulation storage area that corresponds to a row of the row inversion matrix and requires in-situ addition to be written.

[0048] The process of accumulating each row of the row inversion matrix to the target data row in the accumulation storage area via the additive write-supported storage medium may include: In the accumulated storage area, the target write row corresponding to the row inversion matrix is ​​determined, the first row of the row inversion matrix is ​​written to the target write row, and the remaining rows of the row inversion matrix are written sequentially to the consecutive rows following the target write row in row order. Specifically, when writing each row, the data to be written is added to the original data in the corresponding target data row, and the result is stored in the target data row.

[0049] Optionally, the target write row can refer to the data row corresponding to the first row of the row inverted matrix in the accumulation storage area. The first row of the row inverted matrix is ​​added and written to the target write row, and the remaining rows are added and written to the subsequent consecutive data rows in sequence.

[0050] Optionally, for the first row to be processed, that is, the first row of the filling matrix, the target write row of the corresponding row inversion matrix is ​​the first row in the accumulation storage area. After each row inversion matrix is ​​written, the target write row is shifted down one row as the target write row of the next row inversion matrix.

[0051] Optionally, to better illustrate the in-situ accumulation characteristic of storage media supporting additive writes during data writing, Figure 2 A schematic diagram of an optional in-situ addition write is shown. Figure 2 This example illustrates how the accumulated storage area is ultimately obtained, based on the embodiments described in this document. Figure 2As shown, m=1, m=2, m=3, m=4, and m=5 represent 5 rows to be processed, i.e., rows 1-5 of the filling matrix. The leftmost 7 rows of the matrix represent the initialized accumulation storage area. The 3x3 matrix below m=1, m=2, m=3, m=4, and m=5 represent the row reversal matrix corresponding to each row to be processed. Each reversal matrix is ​​arranged according to... Figure 2 The accumulation is performed as shown.

[0052] Continuing the previous example, the row inversion matrix corresponding to the first row of the filling matrix P is a matrix of all zeros. At this time, the target write row is the first row of the accumulation storage area. That is, [0 0 0] is written to the first to third rows of the accumulation storage area. Since the initial elements in the accumulation storage area are all 0, based on the storage medium that supports addition, [0 0 0] is accumulated in place to the first to third rows of the accumulation storage area. The first to third rows are still [0 0 0] after accumulation.

[0053] Furthermore, after the above calculation process, the second row of the filling matrix P results in a row-reversed matrix. At this point, the target write line corresponding to the inverted matrix is ​​the second row in the accumulation storage area. Based on the storage medium that supports addition write, [10 20 18] is added in place to the second row in the accumulation storage area, and the second row becomes [10 20 18] after the in-place accumulation. [7 14 13] is added in place to the third row in the accumulation storage area, and the third row becomes [7 14 13] after the in-place accumulation. [4 8 8] is added in place to the fourth row in the accumulation storage area, and the fourth row becomes [4 8 8] after the in-place accumulation.

[0054] Furthermore, according to Figure 2 As shown, continue writing the row-reversed matrices corresponding to the remaining rows to be processed, and finally obtain the accumulated storage area. .

[0055] S160. After all rows to be processed have been processed, the output matrix is ​​obtained from the accumulation storage area.

[0056] Optionally, after all rows to be processed have been processed, all rows in the accumulation storage area are traversed, the number of accumulations for each row is counted, and the rows whose number of accumulations equals the number of rows in the convolution kernel Ky are determined as valid output data rows. The valid output data rows are then arranged in order to form an output matrix.

[0057] The process of obtaining the output matrix in the accumulated storage area after all rows to be processed has been completed may include: Determine the number of times each data row in the accumulation storage area participates in row data accumulation, and determine the number of rows in the convolution kernel matrix as the target number of accumulations; The data rows whose number of accumulations equals the target number of accumulations are determined as valid output data rows; The valid output data rows are arranged sequentially according to their row position order in the accumulated storage area to obtain the output matrix.

[0058] Optionally, the number of times a data row participates in row data accumulation refers to the total number of times that data row receives row data from the row inversion matrix and performs addition write operations.

[0059] Continuing the previous example, the convolution kernel matrix has 3 rows, corresponding to a target accumulation count of 3. According to... Figure 2 It can be seen that in the final accumulated storage area In the output matrix, rows 3-5 each perform three accumulation operations. Therefore, rows 3-5 are determined as valid output data rows and extracted in sequence to form the output matrix. The final output matrix is ​​obtained as follows. .

[0060] The technical solution of this invention involves filling the input matrix according to the size of the convolution kernel matrix to obtain a filling matrix, and initializing an accumulation storage area in a storage medium that supports addition writing. When the vertical convolution stride is 1, each row in the filling matrix is ​​determined as a row to be processed. For each row to be processed, multiple continuous data segments are extracted from the row according to the horizontal convolution stride and the number of columns in the convolution kernel matrix, and these multiple continuous data segments are combined as column vectors to form a row unfolded matrix. The convolution kernel matrix and the row unfolded matrix are input to the matrix multiplication unit to obtain the product matrix output by the matrix multiplication unit, and the row order of the product matrix is ​​flipped vertically to obtain a row-reversed matrix. The addition process writes data to the storage medium, accumulating each row of the row-reversed matrix into the target data row in the accumulation storage area. After all rows to be processed are completed, the output matrix is ​​obtained from the accumulation storage area. This method solves the problem of existing technologies requiring a large amount of space to store process data in scenarios with large convolution kernel sizes, effectively reducing intermediate memory usage. Moreover, the core operations are all matrix multiplications, avoiding the loss of computational efficiency caused by vector-matrix multiplications. The accumulation operation is completed directly in-situ within the storage medium, significantly reducing the number of data transfers. Furthermore, it only requires adjusting the movement interval of the sliding window to adapt to any positive integer horizontal convolution stride, enabling convolution operations to be performed in a low-storage-occupancy and high-efficiency manner.

[0061] Example 2 Figure 3 This is a flowchart illustrating a convolution implementation method based on a storage medium supporting additive writing, provided in Embodiment 2 of the present invention. This embodiment, based on the above embodiments, specifically describes a convolution implementation method based on a storage medium supporting additive writing. Figure 3As shown, the method includes: S210. Based on the size of the convolution kernel matrix, determine the number of rows and columns to be filled, and fill the input matrix according to the number of rows and columns to obtain the filling matrix.

[0062] S220. Subtract 1 from the number of rows in the convolution kernel matrix as the single-sided row increment, multiply the single-sided row increment by 2 and add it to the number of rows in the output matrix. The result is used as the number of rows in the accumulated storage area.

[0063] S230. Use the number of columns in the output matrix as the number of columns in the accumulation storage area.

[0064] S240. Initialize the accumulation storage area in the addition-write-supported storage medium according to the number of rows and columns of the accumulation storage area.

[0065] S250. When the vertical convolution stride is 1, each row in the filling matrix is ​​determined as the row to be processed.

[0066] S260. For each row to be processed, extract multiple continuous data segments from the row to be processed according to the horizontal convolution stride and the number of columns of the convolution kernel matrix, and combine the multiple continuous data segments as column vectors to form a row expansion matrix.

[0067] Specifically, based on the horizontal convolution stride and the number of columns in the convolution kernel matrix, multiple consecutive data segments are extracted from the row to be processed, and these multiple consecutive data segments are combined as column vectors to form a row expansion matrix, including: Starting from the first element of the row to be processed, a continuous data segment is extracted using a sliding window; wherein the length of the continuous data segment is equal to the number of columns of the convolution kernel matrix; After each truncation, the sliding window is moved backward by the number of elements corresponding to the horizontal convolution stride. When it is determined that the continuous data segment covered by the sliding window does not exceed the element range of the row to be processed, the continuous data segment covered by the moved sliding window is truncated until the continuous data segment covered by the sliding window exceeds the element range of the row to be processed. Based on the positional order of each continuous data segment in the row to be processed, each continuous data segment is arranged as a column vector in sequence to obtain the row expansion matrix.

[0068] Optionally, for any row to be processed, a sliding window is set starting from the first element of the row to be processed. The number of elements covered by the sliding window is equal to the number of columns Kx of the convolution kernel matrix. The number of elements that the sliding window moves backward each time is equal to the horizontal convolution stride. The continuous data segment covered by the sliding window is truncated only when the sliding window after the movement is completely within the element range of the row to be processed.

[0069] Optionally, each extracted continuous data segment can be treated as a column vector and arranged sequentially according to the position of the continuous data segments in the row to be processed, forming a row expansion matrix.

[0070] S270. Input the convolution kernel matrix and the row expansion matrix into the matrix multiplication unit, obtain the product matrix output by the matrix multiplication unit, and flip the row order of the product matrix to obtain the row-reversed matrix.

[0071] S280. Determine the target write row corresponding to the row inversion matrix in the accumulation storage area, write the first row of the row inversion matrix to the target write row, and write the remaining rows of the row inversion matrix sequentially to the consecutive rows after the target write row in row order.

[0072] Determining the target write row corresponding to the row inversion matrix in the accumulated storage area may include: In the accumulated storage area, an initial write line is determined, and the initial write line is determined as the target write line of the row inversion matrix corresponding to the first line to be processed; After all rows of the current row inversion matrix have been written, the next row of the current target row is determined as the target row of the row inversion matrix corresponding to the next row to be processed.

[0073] Optionally, the first row of the accumulated storage area can be used as the initial write row, and the first row to be processed can be the first data row in the filling matrix.

[0074] It is understandable that if the target write row of the row inversion matrix corresponding to the first row to be processed is the first row, then the target write row of the row inversion matrix corresponding to the next row to be processed is the second row, and so on.

[0075] S290. Determine the number of times each data row in the accumulation storage area participates in the row data accumulation, and determine the number of rows in the convolution kernel matrix as the target accumulation number.

[0076] S2100. Data rows whose number of accumulations equals the target number of accumulations are determined as valid output data rows.

[0077] S2110. Arrange the valid output data rows sequentially according to their row positions in the accumulation storage area to obtain the output matrix.

[0078] The technical solution of this invention involves filling the input matrix according to the size of the convolution kernel matrix to obtain a filling matrix, and initializing an accumulation storage area in a storage medium that supports addition writing. When the vertical convolution stride is 1, each row in the filling matrix is ​​determined as a row to be processed. For each row to be processed, multiple continuous data segments are extracted from the row according to the horizontal convolution stride and the number of columns in the convolution kernel matrix, and these multiple continuous data segments are combined as column vectors to form a row unfolded matrix. The convolution kernel matrix and the row unfolded matrix are input to the matrix multiplication unit to obtain the product matrix output by the matrix multiplication unit, and the row order of the product matrix is ​​flipped vertically to obtain a row-reversed matrix. The addition process writes data to the storage medium, accumulating each row of the row-reversed matrix into the target data row in the accumulation storage area. After all rows to be processed are completed, the output matrix is ​​obtained from the accumulation storage area. This method solves the problem of existing technologies requiring a large amount of space to store process data in scenarios with large convolution kernel sizes, effectively reducing intermediate memory usage. Moreover, the core operations are all matrix multiplications, avoiding the loss of computational efficiency caused by vector-matrix multiplications. The accumulation operation is completed directly in-situ within the storage medium, significantly reducing the number of data transfers. Furthermore, it only requires adjusting the movement interval of the sliding window to adapt to any positive integer horizontal convolution stride, enabling convolution operations to be performed in a low-storage-occupancy and high-efficiency manner.

[0079] Example 3 Figure 4 This is a schematic diagram of a convolution implementation device based on a storage medium that supports addition writing, provided in Embodiment 3 of the present invention. Figure 4 As shown, the device includes: a preliminary processing module 310, a row determination module 320, a row expansion matrix generation module 330, a reverse matrix generation module 340, a reverse matrix writing module 350, and an output matrix acquisition module 360.

[0080] The preliminary processing module 310 is used to fill the input matrix according to the size of the convolution kernel matrix, obtain the filling matrix, and initialize the accumulation storage area in the storage medium that supports addition writing.

[0081] The pending row determination module 320 is used to determine each row in the filling matrix as a pending row when the vertical convolution stride is 1.

[0082] The row unfolding matrix generation module 330 is used to extract multiple continuous data segments from each row to be processed based on the horizontal convolution stride and the number of columns in the convolution kernel matrix, and combine the multiple continuous data segments as column vectors to form a row unfolding matrix.

[0083] The inverted matrix generation module 340 is used to input the convolution kernel matrix and the row unfolding matrix into the matrix multiplication unit, obtain the product matrix output by the matrix multiplication unit, and flip the row order of the product matrix to obtain the row inverted matrix.

[0084] The inverted matrix writing module 350 is used to accumulate each row of the row inverted matrix into the target data row in the accumulation storage area through the additive writing storage medium.

[0085] The output matrix acquisition module 360 ​​is used to acquire the output matrix in the accumulation storage area after all rows to be processed have been processed.

[0086] The technical solution of this invention involves filling the input matrix according to the size of the convolution kernel matrix to obtain a filling matrix, and initializing an accumulation storage area in a storage medium that supports addition writing. When the vertical convolution stride is 1, each row in the filling matrix is ​​determined as a row to be processed. For each row to be processed, multiple continuous data segments are extracted from the row according to the horizontal convolution stride and the number of columns in the convolution kernel matrix, and these multiple continuous data segments are combined as column vectors to form a row unfolded matrix. The convolution kernel matrix and the row unfolded matrix are input to the matrix multiplication unit to obtain the product matrix output by the matrix multiplication unit, and the row order of the product matrix is ​​flipped vertically to obtain a row-reversed matrix. The addition process writes data to the storage medium, accumulating each row of the row-reversed matrix into the target data row in the accumulation storage area. After all rows to be processed are completed, the output matrix is ​​obtained from the accumulation storage area. This method solves the problem of existing technologies requiring a large amount of space to store process data in scenarios with large convolution kernel sizes, effectively reducing intermediate memory usage. Moreover, the core operations are all matrix multiplications, avoiding the loss of computational efficiency caused by vector-matrix multiplications. The accumulation operation is completed directly in-situ within the storage medium, significantly reducing the number of data transfers. Furthermore, it only requires adjusting the movement interval of the sliding window to adapt to any positive integer horizontal convolution stride, enabling convolution operations to be performed in a low-storage-occupancy and high-efficiency manner.

[0087] Based on the above embodiments, the preliminary processing module 310 may include a filling matrix generation unit and an accumulation storage area initialization unit. The filling matrix generation unit can be specifically used for: Based on the size of the convolution kernel matrix, determine the number of rows and columns to be filled, and then fill the input matrix according to the number of rows and columns to obtain the filled matrix; Wherein, the number of rows to be filled is the number of rows in the convolution kernel matrix minus 1, and the number of columns to be filled is the number of columns in the convolution kernel matrix minus 1.

[0088] Based on the above embodiments, the accumulated storage area initialization unit can be specifically used for: The row number of the convolution kernel matrix is ​​reduced by 1 as the single-sided row increment, and the single-sided row increment is multiplied by 2 and added to the row number of the output matrix. The result is used as the row number of the accumulated storage area. Use the number of columns in the output matrix as the number of columns in the accumulated storage area; The accumulation storage area is initialized in the addition-write-supported storage medium according to the number of rows and columns of the accumulation storage area.

[0089] Based on the above embodiments, the row expansion matrix generation module 330 can be specifically used for: Starting from the first element of the row to be processed, a continuous data segment is extracted using a sliding window; wherein the length of the continuous data segment is equal to the number of columns of the convolution kernel matrix; After each truncation, the sliding window is moved backward by the number of elements corresponding to the horizontal convolution stride. When it is determined that the continuous data segment covered by the sliding window does not exceed the element range of the row to be processed, the continuous data segment covered by the moved sliding window is truncated until the continuous data segment covered by the sliding window exceeds the element range of the row to be processed. Based on the positional order of each continuous data segment in the row to be processed, each continuous data segment is arranged as a column vector in sequence to obtain the row expansion matrix.

[0090] Based on the above embodiments, the inverted matrix writing module 350 can be specifically used for: In the accumulated storage area, the target write row corresponding to the row inversion matrix is ​​determined, the first row of the row inversion matrix is ​​written to the target write row, and the remaining rows of the row inversion matrix are written sequentially to the consecutive rows following the target write row in row order. Specifically, when writing each row, the data to be written is added to the original data in the corresponding target data row, and the result is stored in the target data row.

[0091] Based on the above embodiments, the inverted matrix writing module 350 can be further specifically used for: In the accumulated storage area, an initial write line is determined, and the initial write line is determined as the target write line of the row inversion matrix corresponding to the first line to be processed; After all rows of the current row inversion matrix have been written, the next row of the current target row is determined as the target row of the row inversion matrix corresponding to the next row to be processed.

[0092] Based on the above embodiments, the output matrix acquisition module 360 ​​can be specifically used for: Determine the number of times each data row in the accumulation storage area participates in row data accumulation, and determine the number of rows in the convolution kernel matrix as the target number of accumulations; The data rows whose number of accumulations equals the target number of accumulations are determined as valid output data rows; The valid output data rows are arranged sequentially according to their row position order in the accumulated storage area to obtain the output matrix.

[0093] The convolution implementation apparatus based on a storage medium that supports addition writing provided in the embodiments of the present invention can execute the convolution implementation method based on a storage medium that supports addition writing provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the method execution.

[0094] Example 4 Figure 5 A schematic diagram of an electronic device 10, which can be used to implement embodiments of the present invention, is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0095] like Figure 5 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0096] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0097] Processor 11 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, central processing unit (CPU), graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as the convolution implementation method based on a storage medium supporting addition writing as described in the embodiments of the present invention. That is: The input matrix is ​​padded according to the size of the convolution kernel matrix to obtain the padded matrix, and the accumulation storage area is initialized in the storage medium that supports addition writing. When the vertical convolution stride is 1, each row in the filling matrix is ​​determined as a row to be processed. For each row to be processed, multiple consecutive data segments are extracted from the row to be processed based on the horizontal convolution stride and the number of columns in the convolution kernel matrix, and the multiple consecutive data segments are combined as column vectors to form a row expansion matrix. The convolution kernel matrix and the row unfolding matrix are input into the matrix multiplication unit to obtain the product matrix output by the matrix multiplication unit, and the row order of the product matrix is ​​flipped vertically to obtain the row-reversed matrix. By using the storage medium that supports addition, each row of the row inversion matrix is ​​accumulated to the target data row in the accumulation storage area; After all rows to be processed have been processed, the output matrix is ​​obtained in the accumulated storage area.

[0098] In some embodiments, the convolution implementation method based on an additive write-enabled storage medium can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or mounted on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the convolution implementation method based on an additive write-enabled storage medium described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to execute the convolution implementation method based on an additive write-enabled storage medium by any other suitable means (e.g., by means of firmware).

[0099] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0100] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0101] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0102] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0103] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0104] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0105] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0106] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A convolution implementation method based on a storage medium supporting addition and writing, applied to a convolution calculation system including a matrix multiplication unit and a storage medium supporting addition and writing, characterized in that, include: The input matrix is ​​padded according to the size of the convolution kernel matrix to obtain the padded matrix, and the accumulation storage area is initialized in the storage medium that supports addition writing. When the vertical convolution stride is 1, each row in the filling matrix is ​​determined as a row to be processed. For each row to be processed, multiple consecutive data segments are extracted from the row to be processed based on the horizontal convolution stride and the number of columns in the convolution kernel matrix, and the multiple consecutive data segments are combined as column vectors to form a row expansion matrix. The convolution kernel matrix and the row unfolding matrix are input into the matrix multiplication unit to obtain the product matrix output by the matrix multiplication unit, and the row order of the product matrix is ​​flipped vertically to obtain the row-reversed matrix. By using the storage medium that supports addition, each row of the row inversion matrix is ​​accumulated to the target data row in the accumulation storage area; After all rows to be processed have been processed, the output matrix is ​​obtained in the accumulated storage area.

2. The method according to claim 1, characterized in that, The input matrix is ​​padded according to the size of the convolution kernel matrix to obtain the padded matrix, including: Based on the size of the convolution kernel matrix, determine the number of rows and columns to be filled, and then fill the input matrix according to the number of rows and columns to obtain the filled matrix; Wherein, the number of rows to be filled is the number of rows in the convolution kernel matrix minus 1, and the number of columns to be filled is the number of columns in the convolution kernel matrix minus 1.

3. The method according to claim 1, characterized in that, Initializing the accumulation storage area in the additive write-supported storage medium includes: The row number of the convolution kernel matrix is ​​reduced by 1 as the single-sided row increment, and the single-sided row increment is multiplied by 2 and added to the row number of the output matrix. The result is used as the row number of the accumulated storage area. The number of columns in the output matrix is ​​used as the number of columns in the accumulated storage area; The accumulation storage area is initialized in the addition-write-supported storage medium according to the number of rows and columns of the accumulation storage area.

4. The method according to claim 1, characterized in that, Based on the horizontal convolution stride and the number of columns in the convolution kernel matrix, multiple consecutive data segments are extracted from the row to be processed, and these multiple consecutive data segments are combined as column vectors to form a row expansion matrix, including: Starting from the first element of the row to be processed, a continuous data segment is extracted using a sliding window; wherein the length of the continuous data segment is equal to the number of columns of the convolution kernel matrix; After each truncation, the sliding window is moved backward by the number of elements corresponding to the horizontal convolution stride. When it is determined that the continuous data segment covered by the sliding window does not exceed the element range of the row to be processed, the continuous data segment covered by the moved sliding window is truncated until the continuous data segment covered by the sliding window exceeds the element range of the row to be processed. Based on the positional order of each continuous data segment in the row to be processed, each continuous data segment is arranged as a column vector in sequence to obtain the row expansion matrix.

5. The method according to claim 1, characterized in that, By using the additive write-enabled storage medium, the rows of the row inversion matrix are cumulatively added to the target data row in the accumulation storage area, including: In the accumulated storage area, the target write row corresponding to the row inversion matrix is ​​determined, the first row of the row inversion matrix is ​​written to the target write row, and the remaining rows of the row inversion matrix are written sequentially to the consecutive rows following the target write row in row order. Specifically, when writing each row, the data to be written is added to the original data in the corresponding target data row, and the result is stored in the target data row.

6. The method according to claim 5, characterized in that, Determining the target write row corresponding to the row inversion matrix in the accumulated storage area includes: In the accumulated storage area, an initial write line is determined, and the initial write line is determined as the target write line of the row inversion matrix corresponding to the first line to be processed; After all rows of the current row inversion matrix have been written, the next row of the current target row is determined as the target row of the row inversion matrix corresponding to the next row to be processed.

7. The method according to claim 1, characterized in that, After all rows to be processed have been processed, the output matrix is ​​obtained from the accumulated storage area, including: Determine the number of times each data row in the accumulation storage area participates in row data accumulation, and determine the number of rows in the convolution kernel matrix as the target number of accumulations; The data rows whose number of accumulations equals the target number of accumulations are determined as valid output data rows; The valid output data rows are arranged sequentially according to their row position order in the accumulated storage area to obtain the output matrix.

8. A convolution implementation device based on a storage medium supporting addition and writing, applied to a convolution calculation system including a matrix multiplication unit and a storage medium supporting addition and writing, characterized in that, include: The preliminary processing module is used to fill the input matrix according to the size of the convolution kernel matrix, obtain the filling matrix, and initialize the accumulation storage area in the storage medium that supports addition writing. The unprocessed row determination module is used to determine each row in the filling matrix as the unprocessed row when the vertical convolution stride is 1. The row unfolding matrix generation module is used to extract multiple continuous data segments from each row to be processed based on the horizontal convolution stride and the number of columns in the convolution kernel matrix, and combine the multiple continuous data segments as column vectors to form a row unfolding matrix. The inverted matrix generation module is used to input the convolution kernel matrix and the row unfolding matrix into the matrix multiplication unit, obtain the product matrix output by the matrix multiplication unit, and flip the row order of the product matrix to obtain the row inverted matrix. The inverted matrix writing module is used to accumulate each row of the row inverted matrix into the target data row in the accumulation storage area through the additive writing storage medium. The output matrix acquisition module is used to acquire the output matrix in the accumulated storage area after all rows to be processed have been processed.

9. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, which enables the at least one processor to perform the convolution implementation method based on a storage medium supporting addition writing as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the convolution implementation method based on a storage medium supporting addition writes as described in any one of claims 1-7.