Computing device
By disassembling the transformation operation in winograd convolution operation into sum operation and using addition instead of multiplication operation, the problems of high power consumption and long calculation time in the prior art are solved, and more efficient convolution operation is achieved.
Patent Information
- Application Number
- CN201911061951.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-11-01
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2039-11-01
AI Technical Summary
The existing computing devices consume high power and have a long calculation time when performing convolutional operations, which affects the application efficiency of artificial intelligence technology.
A computing device is designed to disassemble the transformation operation in winograd convolution operation into a sum operation, and use addition operation to replace a large number of multiplication operations to accelerate the operation speed and save resources.
Reduces resource consumption of convolutional operations, improves operation speed, reduces operation time, and improves the application efficiency of artificial intelligence technology.
Smart Images

Figure CN112765542B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a computing device. Background Art
[0002] With the development of artificial intelligence technology, various computing devices and networks containing computing devices for implementing artificial intelligence technology have been widely used in fields such as computer vision and natural language processing.
[0003] In order to meet the increasingly high task requirements, the network size of computing devices is getting larger and larger, requiring more computing, especially convolution computing. When performing convolution computing, existing computing devices have high power consumption and long computing time, which affects their application in the field of artificial intelligence technology. Summary of the invention
[0004] Based on this, it is necessary to provide a computing device that can improve computing speed, reduce computing time, and reduce power consumption in response to the above technical problems.
[0005] A first aspect of an embodiment of the present application provides a computing device, the device is used to perform a winograd convolution operation, the device includes: a control unit, a storage unit, and a computing unit;
[0006] The control unit is used to send a control instruction, wherein the control instruction is used to instruct the operation unit to perform a winograd convolution operation.
[0007] The storage unit is used to store data used for winograd convolution operation;
[0008] The operation unit is used to respond to the control instruction, extract data from the storage unit to perform a winograd convolution operation, wherein the operation unit decomposes the transformation operation of the data in the winograd convolution operation into a summation operation, and completes the winograd transformation of the data according to the summation operation.
[0009] A second aspect of an embodiment of the present application provides an artificial intelligence chip, which includes a computing device as described in any one of the first aspects of the present application.
[0010] A third aspect of an embodiment of the present application provides an electronic device, which includes the artificial intelligence chip as described in the second aspect of the present application.
[0011] A fourth aspect of the embodiment of the present application provides a board, the board comprising: a storage device, an interface device, a control device, and an artificial intelligence chip as described in the second aspect of the present application;
[0012] Wherein, the artificial intelligence chip is connected to the storage device, the control device and the interface device respectively;
[0013] The storage device is used to store data;
[0014] The interface device is used to realize data transmission between the artificial intelligence chip and external equipment;
[0015] The control device is used to monitor the status of the artificial intelligence chip.
[0016] A fifth aspect of the embodiments of the present application provides a computing method, which is applied to a computing device, wherein the computing device includes: a control unit, a storage unit, and a computing unit; wherein:
[0017] The control unit sends a control instruction, wherein the control instruction is used to instruct the operation unit to perform a winograd convolution operation,
[0018] The storage unit stores data for winograd convolution operation;
[0019] The operation unit responds to the control instruction and extracts data from the storage unit to perform a winograd convolution operation, wherein the operation unit decomposes the transformation operation of the data in the winograd convolution operation into a summation operation, and completes the winograd transformation of the data according to the summation operation.
[0020] In the above, in the scheme of the embodiment of the present application, the control unit sends a control instruction, the control instruction is used to instruct the operation unit to perform a winograd convolution operation, and the storage unit stores data used for the winograd convolution operation; the operation unit responds to the control instruction, extracts data from the storage unit to perform a winograd convolution operation, wherein the operation unit decomposes the transformation operation of the data in the winograd convolution operation into a summation operation, and completes the winograd transformation of the data according to the summation operation, and accelerates the speed of the winograd convolution operation by replacing a large number of multiplication operations in the transformation operation with addition operations, and also saves computing resources. The scheme provided by the present application can reduce the resource consumption of the convolution operation, improve the speed of the convolution operation, and reduce the operation time. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the description of the prior art.
[0022] Figure 1 is a structural block diagram of a computing device in one embodiment;
[0023] Figure 2 is a structural block diagram of a computing device in another embodiment;
[0024] Figure 3 A structural block diagram of a computing device in yet another embodiment;
[0025] Figure 4 is a structural block diagram of a computing device in yet another embodiment;
[0026] Figure 5 is a schematic flow chart of a calculation method in an embodiment;
[0027] Figure 6 FIG. 4 is a structural block diagram of a board in an embodiment.
[0028] in, Figures 1 to 6 The identifiers in are as follows:
[0029] 10: computing device;
[0030] 11: control unit;
[0031] 12: storage unit;
[0032] 13: Arithmetic unit;
[0033] 131: first operation unit;
[0034] 132: second operation unit;
[0035] 1321: multiplication unit;
[0036] 1322: inverse transform unit;
[0037] 141: Addition unit;
[0038] 142: multiplication unit;
[0039] 389: Chip;
[0040] 390: Storage devices;
[0041] 391: Interface device;
[0042] 392: Control device. DETAILED DESCRIPTION
[0043] The following will be combined with the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.
[0044] It should be understood that the terms "first", "second", "third", and "fourth" in the claims, specifications, and drawings of the present disclosure are used to distinguish different objects rather than to describe a specific order. The terms "include" and "comprise" used in the specifications and claims of the present disclosure indicate the presence of the described features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their collections.
[0045] It should also be understood that the terms used in this disclosure are only for the purpose of describing specific embodiments and are not intended to limit the disclosure. As used in this disclosure and claims, the singular forms of "a", "an", and "the" are intended to include the plural forms unless the context clearly indicates otherwise. It should also be further understood that the term "and / or" used in this disclosure and claims refers to any combination of one or more of the associated listed items and all possible combinations, including these combinations.
[0046] In order to clearly understand the technical solution of the present application, the technical terms involved in the prior art and the embodiments of the present application are explained below:
[0047] Convolution operation: Convolution operation means starting from the upper left corner of the image, opening an active window of the same size as the template. The active window corresponds to a window image, which is the convolution kernel. The window image corresponds to the pixels in the image, multiply and add them, and use the calculation result as the first pixel value of the new image after the convolution operation. Then, the active window moves one column to the right and performs the same operation. And so on, from left to right, from top to bottom, a new image can be obtained.
[0048] Winograd convolution: Winograd convolution is a convolution acceleration implementation based on the polynomial interpolation algorithm. It performs winograd convolution forward transformation on the two inputs of the convolution operation: the first target matrix and the second target matrix, and then performs positional multiplication on the first target matrix and the second target matrix after the forward transformation. Finally, the positional multiplication result is again subjected to winograd convolution inverse transformation to obtain a convolution result equivalent to the original convolution operation.
[0049] Existing artificial intelligence technologies usually realize feature extraction based on the convolution operation of the processor, such as the operation and processing of feature data in a neural network. The convolution layer in the neural network performs convolution processing on the input feature data with a preset convolution kernel and outputs the operation result. Among them, the convolution layer can specifically include multiple convolution layers arranged adjacently, and the operation result obtained by each convolution layer is the feature data input to the convolution layer above it.
[0050] For the operation in each convolution layer, in the existing convolution operation, the convolution kernel containing weight data is used as a window to "slide" on the matrix of the input feature data, and matrix multiplication is performed on the local matrix at each sliding position, and the final operation result is obtained according to the result of the matrix multiplication. It can be seen that in the existing convolution operation, a large number of matrix multiplications are required, and matrix multiplications require the bitwise multiplication and accumulation of each row of matrix elements in the feature data and each column of the convolution kernel matrix elements, which has a huge amount of calculation, low processing efficiency, and high energy consumption of the computing device.
[0051] In order to solve the above problems, the embodiment of the present application provides a computing device for performing a winograd convolution operation. The transformation operation of data in the winograd convolution operation is further decomposed into a summation operation, and the winograd transformation of the data is completed according to the summation operation to accelerate the operation process. Figure 1 , is a structural block diagram of a computing device in one embodiment. Figure 1 The computing device 10 shown includes: a control unit 11, a storage unit 12, and a computing unit 13. The control unit 11 controls the storage unit 12 and the computing unit 13 by issuing instructions, and finally obtains the computing result. In this embodiment, in the process of performing a forward transformation on the feature data, the feature data is the target matrix in the process; in the process of performing a forward transformation on the weight data, the weight data is the target matrix in the process; in the process of performing an inverse transformation on the multiplication result, the multiplication result is the target matrix in the process.
[0052] Continue to see Figure 1 , a control unit 11 is used to send a control instruction, wherein the control instruction is used to instruct the operation unit to perform a winograd convolution operation. For example, the control instruction may include a first instruction and a second instruction, wherein the first instruction includes a forward transformation instruction, and the second instruction includes a bitwise multiplication instruction and an inverse transformation instruction. The control unit 11 is used to send the first instruction and the second instruction to control the operation unit to extract data from the storage unit and perform a corresponding winograd transformation.
[0053] The storage unit 12 is used to store data for winograd convolution operation. The data includes, for example, at least one of feature data and weight data. The winograd transformation includes a forward transformation and / or an inverse transformation. The operation unit 13 is used to respond to the control instruction, extract data from the storage unit for winograd convolution operation, wherein the operation unit decomposes the transformation operation of the data in the winograd convolution operation into a summation operation, and completes the winograd transformation of the data according to the summation operation. In various embodiments of the present application, the winograd convolution operation can be understood as being calculated using the following formula:
[0054] S=A T ((GgG T )⊙(B T dB))A
[0055] Where S represents the convolution matrix, that is, the result matrix obtained by performing convolution operation on feature data and weight data; d represents feature data; g represents weight data; B represents the feature transformation matrix that realizes positive transformation of feature data; B T represents the transpose of B; G represents the weight transformation matrix that realizes the positive transformation of the weight data; G T represents the transpose of G; A represents the transformation matrix that realizes the inverse transformation of the multiplication result after the bitwise multiplication; A T represents the transpose of A.
[0056] As can be seen from the above formula, multiple winograd transformations (forward transformation or inverse transformation) are required in the winograd convolution operation, and these winograd transformations involve a large number of multiplication operations. The present application decomposes the transformation operation of data (such as feature data) in the winograd convolution operation into a summation operation, and completes the winograd transformation of the data according to the summation operation, and replaces a large number of multiplication operations in the transformation operation with addition operations, thereby accelerating the speed of the winograd convolution operation and saving computing resources. The solution provided by the present application can reduce the resource consumption of the convolution operation, increase the speed of the convolution operation, and reduce the computing time.
[0057] In some embodiments, the computing unit 13 is specifically used to decompose the data into multiple sub-tensors; perform transformation operations on the multiple sub-tensors and sum them, and obtain a winograd transformation result of the data according to the result of the summation operation.
[0058] The process of decomposing data into multiple sub-tensors can be understood as: a computing unit, which is specifically used to parse the data to obtain multiple sub-tensors, wherein the data is the sum of the multiple sub-tensors, the number of the multiple sub-tensors is the same as the number of non-0 elements in the data, each of the sub-tensors has a single non-0 element, and the non-0 element in the sub-tensor is the same as the non-0 element in the corresponding position in the data.
[0059] Taking the following X×Y scale feature data d as an example, the operation unit parses the data to obtain multiple sub-tensors.
[0060]
[0061] Decompose the above feature data d into multiple sub-tensors:
[0062]
[0063] Assume that all elements in the feature data d are non-zero elements, thereby obtaining X×Y sub-tensors. In other embodiments, if only 3 elements in the feature data d are non-zero elements, only 3 sub-tensors can be obtained, which will not be specifically exemplified here.
[0064]
[0065] In the above X×Y sub-tensors, take the first sub-tensor as an example, it has a single non-zero element d 00 , the rest of the elements are 0, and the non-zero element of the sub-tensor is the same as the element at the corresponding position in the feature data, both of which are d 00 .
[0066] After disassembling to obtain multiple sub-tensors, the operation unit performs transformation operation on the multiple sub-tensors and sums them, and obtains the winograd transformation result of the data according to the result of the summation operation. Specifically, the operation unit obtains the winograd transformation result of the meta-sub-tensor corresponding to each sub-tensor, wherein the meta-sub-tensor is a tensor with non-0 elements of the sub-tensor set to 1; the non-0 element value in the sub-tensor is used as a coefficient to multiply the winograd transformation result of the corresponding meta-sub-tensor to obtain the winograd transformation result of the sub-tensor; the winograd transformation results of multiple sub-tensors are added to obtain the winograd transformation result of the data.
[0067] Continuing with the above feature data d as an example, taking the first sub-tensor as an example, the non-zero element d 00 After setting it to 1, we can get the following atomic tensor:
[0068]
[0069] The following winograd transformation results can be obtained for the first sub-tensor:
[0070]
[0071] The operation unit is specifically used to multiply the left side of the element sub-tensor corresponding to the sub-tensor by the left multiplication matrix (for example, ), multiply the right side by the right multiplication matrix (for example, B Y×Y ), and obtain the Winograd transformation result of the elementary sub-tensor. Wherein, the left multiplication matrix and the right multiplication matrix are determined by the scale of the sub-tensor and the Winograd transformation type, wherein the Winograd transformation type includes the Winograd transformation type of the forward transformation and the Winograd transformation type of the inverse transformation.
[0072] In a specific implementation, the transformation matrices (e.g., B, G, A) used to realize the forward or inverse transformation of the data are determined by the scale of the data, and the transformation matrices corresponding to data of different scales are all preset known matrices. Therefore, the winograd transformation result of the element sub-tensor of the first sub-tensor mentioned above can be understood as a constant matrix. Then, the X×Y winograd transformation results corresponding to the X×Y sub-tensors are added together to obtain the winograd transformation results of the following feature data.
[0073]
[0074] The winograd transformation includes a forward transformation and / or an inverse transformation. In the above embodiment, the winograd transformation of feature data is used as an example to decompose the transformation operation into a summation operation. However, the above decomposition method can also be used for the forward transformation operation of weighted data ((GgG T )), and A(GgG T ) and (B T dB) The inverse transformation operation of the multiplication result of the bitwise multiplication is not described here.
[0075] In some embodiments, the control instruction includes a first instruction and a second instruction, wherein the first instruction includes a forward transformation instruction, and the second instruction includes a bitwise multiplication instruction and an inverse transformation instruction. The control unit 11 is used to issue the first instruction and the second instruction. In some embodiments, the first instruction and the second instruction issued by the control unit 11 may be extracted from the storage unit 12 in advance, or may be written externally and stored in the control unit 11 in advance. For example, the first instruction and the second instruction both include an operation code and an operation address. The first instruction includes a forward transformation operation code and an operation address corresponding to the forward transformation instruction. The second instruction includes a bitwise multiplication operation code and an operation address corresponding to the bitwise multiplication instruction, and an inverse transformation operation code and an operation address corresponding to the inverse transformation instruction. Each instruction may include an operation code and one or more operation addresses. Among them, the operation address may specifically be a register address.
[0076] Figure 1 The storage unit 12 shown stores data. The data stored in the storage unit 12 may be, for example, data required by the computing device 10 in the winograd convolution operation. In the embodiment in which the first instruction and the second instruction are pre-extracted from the storage unit 12, the data stored in the storage unit 12 includes the first instruction and the second instruction. The structure of the storage unit 12 may include, for example, a register, a cache, and a data input / output unit.
[0077] Continue to see Figure 1 , the operation unit 13 is used to respond to the first instruction, extract the feature data from the storage unit 12, and perform a positive transformation on the feature data, wherein the operation unit 13 decomposes the positive transformation of the feature data into a summation operation, and completes the positive transformation of the feature data according to the summation operation to obtain a feature transformation result. Specifically, for example, when the operation unit 13 obtains the first instruction sent by the control unit 11, the operation unit 13 parses the first instruction to obtain an instruction for performing a positive transformation on the feature data. The operation unit 13 reads the feature data from the storage unit 12, performs a positive transformation on the feature data, and obtains a feature transformation result. Among them, the operation unit 13 can also obtain a feature transformation matrix corresponding to the feature data from the storage unit 12 according to the scale of the feature data.
[0078] Continue to see Figure 1 The operation unit 13 is also used to respond to the second instruction to obtain the weight transformation result after the forward transformation, perform bitwise multiplication on the weight transformation result and the feature transformation result to obtain the multiplication result; perform an inverse transformation on the multiplication result, wherein the operation unit decomposes the inverse transformation of the multiplication result into a summation operation, and completes the inverse transformation of the multiplication result according to the summation operation to obtain the operation result.
[0079] Specifically, for example, when the operation unit 13 obtains the second instruction sent by the control unit 11, it may obtain a bitwise multiplication instruction and an inverse transformation instruction. Among them, the operation unit 13 obtains the weight transformation result and the feature transformation result according to the bitwise multiplication instruction, and performs bitwise multiplication on the two. Among them, when the feature transformation result is obtained, the pre-stored weight transformation result can be obtained from the storage unit 12, and the bitwise multiplication can be performed; or the weight transformation result and the feature transformation result can be calculated at the same time, and then the two can be multiplied. Bitwise multiplication is the multiplication result obtained by multiplying the elements at the same position of the rows and columns of two matrices one by one, and does not change the matrix scale. After the bitwise multiplication, the operation unit 13 obtains the inverse transformation matrix (for example, A) corresponding to the multiplication result according to the inverse transformation instruction, and performs an inverse transformation on the multiplication result with the inverse transformation matrix to obtain the operation result. Exemplarily, if the feature data is the feature data of the image to be processed, then the operation result obtained by the operation unit 13 can be understood as the feature extraction result of the image to be processed. In the above-mentioned process of inverse transforming the multiplication result, the inverse transform of the multiplication result can be decomposed into a summation operation, and the inverse transform of the multiplication result is completed according to the summation operation to obtain the operation result. The decomposition method is the same as the decomposition method of the forward transformation of the feature data in the aforementioned embodiment, and will not be repeated here.
[0080] The above computing device obtains the feature transformation result by forward transformation of the feature data, and performs bitwise multiplication and inverse transformation on the weight transformation result and the feature transformation result, and decomposes the inverse transformation of the multiplication result into a summation operation, thereby replacing a large number of multiplication operations in the existing convolution operation process with addition operations, thereby accelerating the operation speed and reducing resource consumption by reducing multiplication operations.
[0081] In the above embodiment, the weight transformation result may be calculated simultaneously with the feature transformation result, or may be obtained before the feature transformation result is obtained and stored in advance.
[0082] In some embodiments, the storage unit 12 is specifically used to store weight data. Figure 1 The operation unit 13 shown is specifically used to extract the weight data from the storage unit 12 and perform a positive transformation on the weight data, wherein the operation unit decomposes the positive transformation of the weight data into a summation operation, and completes the positive transformation of the weight data according to the summation operation to obtain a weight transformation result.
[0083] In other embodiments, the storage unit 12 is specifically used to receive and store the weight transformation result. The operation unit 13 is specifically used to respond to the second instruction and obtain the weight transformation result from the storage unit 12. Exemplarily, in this embodiment, when the weight data is pre-stored or before the first instruction is received, the operation unit 13 can pre-transform the weight data to obtain the weight transformation result, and store the weight transformation result in the storage unit 12. Then, the operation unit 13 responds to the first instruction to perform a positive transformation on the feature data to obtain the feature transformation result. In this way, the weight transformation result can be directly extracted to reduce the operation time of the winograd convolution operation. Finally, the operation unit 13 responds to the second instruction, extracts the weight transformation result and the feature transformation result from the storage unit 12, performs a bitwise multiplication, and obtains the multiplication result; performs an inverse transformation on the multiplication result, wherein the operation unit 13 decomposes the inverse transformation of the multiplication result into a summation operation, and completes the inverse transformation of the multiplication result according to the summation operation to obtain the operation result. Optionally, the process of the operation unit 13 performing forward transformation on the feature data to obtain the feature transformation result and the process of the operation unit 13 performing bitwise multiplication on the weight transformation result and the feature transformation result can be executed simultaneously to improve the operation speed and efficiency.
[0084] Alternatively, the operation unit 13 responds to the first instruction, obtains the weight data and the feature data from the storage unit 12, and first performs a forward transformation on the weight data and the feature data to obtain a weight transformation result and a feature transformation result. Then, the operation unit 13 responds to the second instruction to perform a bitwise multiplication and an inverse transformation on the weight transformation result and the feature transformation result.
[0085] For the operation unit 13 in the above embodiment, the specific structure can be multiple. For example, one operation unit 13 can include a first operation unit and a second operation unit; another operation unit 13 can include an addition operation unit and a multiplication operation unit. The following is an example of these two possible structures in conjunction with the accompanying drawings.
[0086] See also Figure 2 , is a structural block diagram of a computing device in another embodiment. Figure 2 In the computing device 10 shown, the computing unit 13 may include a first computing unit 131 and a second computing unit 132 .
[0087] The first operation unit 131 is used to respond to the first instruction, extract feature data from the storage unit, and perform a positive transformation on the feature data, wherein the first operation unit 131 decomposes the positive transformation of the feature data into a summation operation, and completes the positive transformation of the feature data according to the summation operation to obtain a feature transformation result. In some embodiments, when the first operation unit 131 performs a positive transformation on the feature data, it can also simultaneously obtain weight data from the storage unit 12, perform a positive transformation on the weight data, and obtain a weight transformation result. Then, the obtained feature transformation result and weight transformation result are sent to the second operation unit 132. In other embodiments, since the transmission bandwidth between the first operation unit 131 and the second operation unit 132 is limited, in order to reduce the bandwidth occupancy, the first operation unit 131 can perform a positive transformation on the weight data in advance before responding to the first instruction to perform a positive transformation on the feature data, for example, before receiving the first instruction, to obtain a weight transformation result, and store the weight transformation result in the storage unit 12. When the first operation unit 131 sends the feature transformation result to the second operation unit 132, the second operation unit 132 can directly obtain the weight transformation result from the storage unit 12. Therefore, there is no need to transmit the weight transformation result between the first operation unit 131 and the second operation unit 132, which reduces the requirement for the transmission bandwidth between the first operation unit 131 and the second operation unit 132 and improves the transmission speed.
[0088] The second operation unit 132 is used to respond to the second instruction to obtain the weight transformation result, perform bitwise multiplication on the weight transformation result and the feature transformation result to obtain the multiplication result; and perform inverse transformation on the multiplication result, wherein the second operation unit 132 decomposes the inverse transformation operation of the multiplication result in the inverse transformation into a summation operation, and completes the inverse transformation of the multiplication result according to the summation operation to obtain the operation result.
[0089] See also Figure 3 , is a structural block diagram of a computing device in yet another embodiment. Figure 3 In the computing device 10 shown, the second computing unit 132 may specifically include a multiplication unit 1321 and an inverse transformation unit 1322 .
[0090] Among them, the multiplication unit 1321 is used to respond to the second instruction, obtain the weight transformation result, perform bitwise multiplication on the weight transformation result and the feature transformation result, and obtain the multiplication result. Figure 3 The multiplication unit 1321 shown may obtain the pre-stored weight transformation result from the storage unit 12, or obtain the calculated weight transformation result from the first operation unit 131, which is not limited here.
[0091] The inverse transformation unit 1322 is used to perform an inverse transformation on the multiplication operation result, wherein the inverse transformation unit 1322 decomposes the inverse transformation of the multiplication operation result in the inverse transformation into a summation operation, and completes the inverse transformation of the multiplication operation result according to the summation operation to obtain the operation result. The inverse transformation unit 1322 can specifically obtain an inverse transformation matrix (for example, A) for inverse transformation of the multiplication operation result from the storage unit 12, and perform an inverse transformation on the multiplication operation result with the inverse transformation matrix to obtain the operation result.
[0092] See also Figure 4 , is a structural block diagram of a computing device in another embodiment. Figure 4 In the illustrated operation device 10, the operation unit 13 includes an addition operation unit 141 and a multiplication operation unit 142. In this embodiment, the addition operation unit 141 is used to perform the operation process that can be completed by addition, and the dedicated multiplication operation unit 142 is used to perform the bitwise multiplication.
[0093] The addition unit 141 is used to respond to the first instruction, obtain feature data from the storage unit 12, and perform a positive transformation on the feature data, wherein the addition unit 141 decomposes the positive transformation of the feature data into a summation operation, and completes the positive transformation of the feature data according to the summation operation to obtain a feature transformation result. The addition unit 141 can perform a positive transformation on the weight data in advance before receiving the first instruction to obtain a weight transformation result, and store the weight transformation result in the storage unit 12. As a result, the weight transformation result does not need to be transmitted between the addition unit 141 and the multiplication unit 142, which reduces the requirements for transmission bandwidth and improves the transmission speed. Alternatively, the addition unit 141 can respond to the first instruction, perform a positive transformation on the feature data, and at the same time perform a positive transformation on the weight data, and after obtaining the weight transformation result, transmit it to the multiplication unit 142 together with the feature transformation result. The weight data can be data stored in the storage unit 12.
[0094] The multiplication unit 142 is used to respond to the second instruction to obtain the weight transformation result, perform bitwise multiplication on the weight transformation result and the feature transformation result, and obtain the multiplication result. The multiplication unit 142 performs multiplication on the elements with the same rows and columns in the weight transformation result and the feature transformation result one by one to obtain the multiplication result. For example, for the 4×4 weight matrix and feature data transformation result after the forward transformation, a total of 16 multiplications need to be performed to obtain a 4×4 multiplication result.
[0095] The addition unit 141 is further used to respond to the second instruction and perform an inverse transformation on the multiplication result, wherein the addition unit 141 decomposes the inverse transformation of the multiplication result into a summation operation, and completes the inverse transformation of the multiplication result according to the summation operation to obtain the operation result. The addition unit 141 obtains the multiplication result from the multiplication unit 142, and can obtain the inverse transformation matrix from the storage unit 12, and performs an inverse transformation on the multiplication result with the inverse transformation matrix to obtain the operation result.
[0096] See also Figure 5 , which is a flowchart of an operation method in an embodiment. Figure 5 The computing method shown is applied to the computing device in the above embodiment, and the computing device includes: a control unit, a storage unit, and a computing unit. Figure 5 The calculation methods shown include:
[0097] S101, the control unit sends a control instruction, where the control instruction is used to instruct the operation unit to perform a winograd convolution operation.
[0098] S102, the storage unit stores data used for the winograd convolution operation.
[0099] S103, the operation unit responds to the control instruction, extracts data from the storage unit to perform a winograd convolution operation, wherein the operation unit decomposes the transformation operation of the data in the winograd convolution operation into a summation operation, and completes the winograd transformation of the data according to the summation operation.
[0100] In the operation method provided by the present application, a control instruction is sent by a control unit, the control instruction is used to instruct the operation unit to perform a winograd convolution operation, and the storage unit stores data used for the winograd convolution operation; the operation unit responds to the control instruction, extracts data from the storage unit to perform a winograd convolution operation, wherein the operation unit decomposes the transformation operation of the data in the winograd convolution operation into a summation operation, and completes the winograd transformation of the data according to the summation operation, and by replacing a large number of multiplication operations in the transformation operation with addition operations, the speed of the winograd convolution operation is accelerated, and operation resources are also saved. The solution provided by the present application can reduce the resource consumption of the convolution operation, increase the speed of the convolution operation, and reduce the operation time.
[0101] In some embodiments, the computing unit decomposes the data into multiple sub-tensors; performs transformation operations on the multiple sub-tensors and sums them, and obtains a winograd transformation result of the data according to a result of the summation operation.
[0102] In some embodiments, the computing unit parses the data to obtain multiple sub-tensors, wherein the data is the sum of the multiple sub-tensors, the number of the multiple sub-tensors is the same as the number of non-0 elements in the data, each of the sub-tensors has a single non-0 element, and the non-0 elements in the sub-tensors are the same as the non-0 elements in the corresponding positions in the data.
[0103] In some embodiments, the operation unit obtains the winograd transformation result of the meta-sub-tensor corresponding to each sub-tensor, wherein the meta-sub-tensor is a tensor in which the non-0 elements of the sub-tensor are set to 1; the non-0 element values in the sub-tensor are used as coefficients to multiply the winograd transformation result of the corresponding meta-sub-tensor to obtain the winograd transformation result of the sub-tensor; and the winograd transformation results of multiple sub-tensors are added to obtain the winograd transformation result of the data.
[0104] In some embodiments, for each of the sub-tensors, the operation unit multiplies the meta-sub-tensor corresponding to the sub-tensor by a left multiplication matrix on the left side and by a right multiplication matrix on the right side to obtain a winograd transformation result of the meta-sub-tensor, wherein the left multiplication matrix and the right multiplication matrix are both determined by the scale of the sub-tensor and the winograd transformation type, wherein the winograd transformation type includes a winograd transformation type of a forward transformation and a winograd transformation type of an inverse transformation.
[0105] In some embodiments, the data includes at least one of feature data and weight data;
[0106] The winograd transformation includes a forward transformation and / or an inverse transformation.
[0107] In some embodiments, the control instruction includes a first instruction and a second instruction, wherein the first instruction includes a forward transformation instruction, and the second instruction includes a bitwise multiplication instruction and an inverse transformation instruction;
[0108] The operation unit responds to the first instruction, extracts the feature data from the storage unit, and performs a winograd convolution operation on the feature data, wherein the operation unit decomposes the transformation operation on the feature data in the winograd convolution operation into a summation operation, and completes a positive transformation of the feature data according to the summation operation to obtain a feature transformation result;
[0109] The operation unit also responds to the second instruction to obtain the weight transformation result after the forward transformation, performs bitwise multiplication on the weight transformation result and the feature transformation result to obtain the multiplication result; and performs an inverse transformation on the multiplication result, wherein the operation unit decomposes the inverse transformation of the multiplication result into a summation operation, and completes the inverse transformation of the multiplication result according to the summation operation to obtain the operation result.
[0110] In some embodiments, the storage unit receives and stores the weight transformation result;
[0111] The operation unit responds to the second instruction and extracts the weight transformation result from the storage unit.
[0112] In some embodiments, the storage unit stores weight data;
[0113] The operation unit extracts the weight data from the storage unit and performs a forward transformation on the weight data, wherein the operation unit decomposes the forward transformation of the weight data into a summation operation, and completes the forward transformation of the weight data according to the summation operation to obtain a weight transformation result.
[0114] In some embodiments, the operation unit includes: a first operation unit and a second operation unit;
[0115] The first operation unit responds to the first instruction, extracts feature data from the storage unit in response to the first instruction, and performs a positive transformation on the feature data, wherein the first operation unit decomposes the positive transformation of the feature data into a summation operation, and completes the positive transformation of the feature data according to the summation operation to obtain a feature transformation result;
[0116] The second operation unit obtains the weight transformation result in response to the second instruction, performs bitwise multiplication on the weight transformation result and the feature transformation result to obtain a multiplication result; and performs an inverse transformation on the multiplication result, wherein the second operation unit decomposes the inverse transformation of the multiplication result into a summation operation, and completes the inverse transformation of the multiplication result according to the summation operation to obtain an operation result.
[0117] In some embodiments, the second operation unit includes: a multiplication unit and an inverse transformation unit;
[0118] The multiplication unit responds to the second instruction, obtains a weight transformation result after the forward transformation, performs a bitwise multiplication on the weight transformation result and the feature transformation result, and obtains a multiplication result;
[0119] The inverse transformation unit performs an inverse transformation on the multiplication operation result, wherein the inverse transformation unit decomposes the inverse transformation of the multiplication operation result into a summation operation, and completes the inverse transformation of the multiplication operation result according to the summation operation to obtain an operation result.
[0120] In some embodiments, the operation unit includes: an addition operation unit and a multiplication operation unit;
[0121] The addition operation unit responds to the first instruction, obtains the feature data from the storage unit, and performs a positive transformation on the feature data, wherein the addition operation unit decomposes the positive transformation of the feature data into a summation operation, and completes the positive transformation of the feature data according to the summation operation to obtain a feature transformation result;
[0122] The multiplication operation unit obtains a weight transformation result in response to the second instruction, and performs bitwise multiplication on the weight transformation result and the feature transformation result to obtain a multiplication operation result;
[0123] The addition operation unit is also used to respond to the second instruction and perform an inverse transformation on the multiplication operation result, wherein the addition operation unit decomposes the inverse transformation of the multiplication operation result into a summation operation, and completes the inverse transformation of the multiplication operation result according to the summation operation to obtain the operation result.
[0124] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present disclosure is not limited by the order of the actions described, because according to the present disclosure, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present disclosure.
[0125] It should be further noted that, although the various steps in the flowchart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0126] It should be understood that the above-mentioned device embodiments are only illustrative, and the device of the present disclosure can also be implemented in other ways. For example, the division of units / modules described in the above-mentioned embodiments is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units, modules or components can be combined, or can be integrated into another system, or some features can be ignored or not executed.
[0127] In addition, unless otherwise specified, each functional unit / module in each embodiment of the present disclosure may be integrated into one unit / module, or each unit / module may exist physically separately, or two or more units / modules may be integrated together. The above-mentioned integrated unit / module may be implemented in the form of hardware or in the form of a software program module.
[0128] If the integrated unit / module is implemented in the form of hardware, the hardware may be a digital circuit, an analog circuit, etc. The physical implementation of the hardware structure includes but is not limited to transistors, memristors, etc. Unless otherwise specified, the artificial intelligence processor may be any appropriate hardware processor, such as a CPU, a GPU, an FPGA, a DSP, an ASIC, etc. Unless otherwise specified, the storage unit may be any appropriate magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory RRAM (Resist ive Random Access Memory), a dynamic random access memory DRAM (Dynamic Random Access Memory), a static random access memory SRAM (Static Random-Access Memory), an enhanced dynamic random access memory EDRAM (Enhanced Dynamic Random Access Memory), a high-bandwidth memory HBM (High-Bandwidth Memory), a hybrid memory cube HMC (Hybrid Memory Cube), etc.
[0129] If the integrated unit / module is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present disclosure is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a memory, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.
[0130] In a possible implementation, an artificial intelligence chip is also disclosed, which includes the above-mentioned computing device.
[0131] In a possible implementation, a board is also disclosed, which includes a storage device, an interface device, a control device and the above-mentioned artificial intelligence chip; wherein the artificial intelligence chip is connected to the storage device, the control device and the interface device respectively; the storage device is used to store data; the interface device is used to realize data transmission between the artificial intelligence chip and an external device; the control device is used to monitor the status of the artificial intelligence chip.
[0132] Figure 6 A structural block diagram of a board according to an embodiment of the present disclosure is shown. Figure 6 In addition to the chip 389, the board may also include other supporting components, including but not limited to: a storage device 390, an interface device 391 and a control device 392;
[0133] The storage device 390 is connected to the artificial intelligence chip via a bus for storing data. The storage device may include multiple groups of storage units 393. Each group of storage units is connected to the artificial intelligence chip via a bus. It is understood that each group of storage units may be DDR SDRAM (English: Double Data Rate SDRAM, double rate synchronous dynamic random access memory).
[0134] DDR can double the speed of SDRAM without increasing the clock frequency. DDR allows data to be read out on the rising and falling edges of the clock pulse. The speed of DDR is twice that of standard SDRAM. In one embodiment, the storage device may include 4 groups of storage units. Each group of storage units may include multiple DDR4 particles (chips). In one embodiment, the artificial intelligence chip may include 4 72-bit DDR4 controllers, 64 bits of the above 72-bit DDR4 controllers are used to transmit data, and 8 bits are used for ECC verification. It can be understood that when DDR4-3200 particles are used in each group of storage units, the theoretical bandwidth of data transmission can reach 25600MB / s.
[0135] In one embodiment, each group of the storage units includes a plurality of double rate synchronous dynamic random access memories arranged in parallel. DDR can transmit data twice in one clock cycle. A controller for controlling DDR is arranged in the chip to control the data transmission and data storage of each of the storage units.
[0136] The interface device is electrically connected to the artificial intelligence chip. The interface device is used to realize data transmission between the artificial intelligence chip and an external device (such as a server or a computer). For example, in one embodiment, the interface device may be a standard PCIE interface. For example, the data to be processed is transmitted to the chip by the server through a standard PCIE interface to realize data transfer. Preferably, when the PCIE 3.0X 16 interface is used for transmission, the theoretical bandwidth can reach 16000MB / s. In another embodiment, the interface device may also be other interfaces. The present disclosure does not limit the specific forms of expression of the above-mentioned other interfaces, and the interface unit can realize the switching function. In addition, the calculation results of the artificial intelligence chip are still transmitted back to the external device (such as a server) by the interface device.
[0137] The control device is electrically connected to the artificial intelligence chip. The control device is used to monitor the state of the artificial intelligence chip. Specifically, the artificial intelligence chip and the control device can be electrically connected through an SPI interface. The control device may include a single-chip microcomputer (Micro Controller Unit, MCU). For example, the artificial intelligence chip may include multiple processing chips, multiple processing cores or multiple processing circuits, which can drive multiple loads. Therefore, the artificial intelligence chip can be in different working states such as multi-load and light load. The control device can realize the regulation of the working states of multiple processing chips, multiple processing and / or multiple processing circuits in the artificial intelligence chip.
[0138] In a possible implementation, an electronic device is disclosed, which includes the above-mentioned artificial intelligence chip. The electronic device includes a data processing device, a robot, a computer, a printer, a scanner, a tablet computer, a smart terminal, a mobile phone, a driving recorder, a navigator, a sensor, a camera, a server, a cloud server, a camera, a video camera, a projector, a watch, a headset, a mobile storage, a wearable device, a vehicle, a household appliance, and / or a medical device.
[0139] The transportation means include airplanes, ships and / or vehicles; the household appliances include televisions, air conditioners, microwave ovens, refrigerators, rice cookers, humidifiers, washing machines, electric lights, gas stoves, and range hoods; the medical equipment includes magnetic resonance imaging, ultrasound machines and / or electrocardiographs.
[0140] In the above embodiments, the description of each embodiment has its own emphasis. For the part not described in detail in a certain embodiment, please refer to the relevant description of other embodiments. The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0141] The foregoing content can be better understood in accordance with the following terms:
[0142] A1. A computing method is applied to a computing device, wherein the computing device comprises: a control unit, a storage unit, and a computing unit; wherein:
[0143] The control unit sends a control instruction, wherein the control instruction is used to instruct the operation unit to perform a winograd convolution operation,
[0144] The storage unit stores data for winograd convolution operation;
[0145] The operation unit responds to the control instruction and extracts data from the storage unit to perform a winograd convolution operation, wherein the operation unit decomposes the transformation operation of the data in the winograd convolution operation into a summation operation, and completes the winograd transformation of the data according to the summation operation.
[0146] A2. According to the method described in clause A1, the computing unit decomposes the data into multiple sub-tensors; performs transformation operations on the multiple sub-tensors and sums them up, and obtains the winograd transformation result of the data according to the result of the summation operation.
[0147] A3. According to the calculation method described in clause A2,
[0148] The operation unit parses the data to obtain multiple sub-tensors, wherein the data is the sum of the multiple sub-tensors, the number of the multiple sub-tensors is the same as the number of non-0 elements in the data, each of the sub-tensors has a single non-0 element, and the non-0 elements in the sub-tensors are the same as the non-0 elements in the corresponding positions in the data.
[0149] A4. According to the calculation method described in clause A2,
[0150] The operation unit obtains the winograd transformation result of the meta-sub-tensor corresponding to each sub-tensor, wherein the meta-sub-tensor is a tensor in which the non-0 elements of the sub-tensor are set to 1; the non-0 element values in the sub-tensor are multiplied by the winograd transformation result of the corresponding meta-sub-tensor as coefficients to obtain the winograd transformation result of the sub-tensor; and the winograd transformation results of multiple sub-tensors are added to obtain the winograd transformation result of the data.
[0151] A5. According to the operation method described in clause A4, for each of the sub-tensors, the operation unit multiplies the meta-sub-tensor corresponding to the sub-tensor by a left multiplication matrix on the left and by a right multiplication matrix on the right to obtain the winograd transformation result of the meta-sub-tensor, wherein the left multiplication matrix and the right multiplication matrix are both determined by the scale of the sub-tensor and the winograd transformation type, wherein the winograd transformation type includes a winograd transformation type of a forward transformation and a winograd transformation type of an inverse transformation.
[0152] A6. According to any of the calculation methods described in clauses A1 to A5,
[0153] The data includes at least one of feature data and weight data;
[0154] The winograd transformation includes a forward transformation and / or an inverse transformation.
[0155] A7. The operation method according to clause A6, wherein the control instruction includes a first instruction and a second instruction, wherein the first instruction includes a forward transformation instruction, and the second instruction includes a bitwise multiplication instruction and an inverse transformation instruction;
[0156] The operation unit responds to the first instruction, extracts the feature data from the storage unit, and performs a winograd convolution operation on the feature data, wherein the operation unit decomposes the transformation operation on the feature data in the winograd convolution operation into a summation operation, and completes a positive transformation of the feature data according to the summation operation to obtain a feature transformation result;
[0157] The operation unit also responds to the second instruction to obtain the weight transformation result after the forward transformation, performs bitwise multiplication on the weight transformation result and the feature transformation result to obtain the multiplication result; and performs an inverse transformation on the multiplication result, wherein the operation unit decomposes the inverse transformation of the multiplication result into a summation operation, and completes the inverse transformation of the multiplication result according to the summation operation to obtain the operation result.
[0158] A8. According to the calculation method described in clause A7,
[0159] The storage unit receives and stores the weight transformation result;
[0160] The operation unit responds to the second instruction and extracts the weight transformation result from the storage unit.
[0161] A9. According to the calculation method described in clause A7,
[0162] The storage unit stores weight data;
[0163] The operation unit extracts the weight data from the storage unit and performs a forward transformation on the weight data, wherein the operation unit decomposes the forward transformation of the weight data into a summation operation, and completes the forward transformation of the weight data according to the summation operation to obtain a weight transformation result.
[0164] A10. According to the operation method described in clause A7, the operation unit includes: a first operation unit and a second operation unit;
[0165] The first operation unit responds to the first instruction, extracts feature data from the storage unit in response to the first instruction, and performs a positive transformation on the feature data, wherein the first operation unit decomposes the positive transformation of the feature data into a summation operation, and completes the positive transformation of the feature data according to the summation operation to obtain a feature transformation result;
[0166] The second operation unit obtains the weight transformation result in response to the second instruction, performs bitwise multiplication on the weight transformation result and the feature transformation result to obtain a multiplication result; and performs an inverse transformation on the multiplication result, wherein the second operation unit decomposes the inverse transformation of the multiplication result into a summation operation, and completes the inverse transformation of the multiplication result according to the summation operation to obtain an operation result.
[0167] A11. According to the operation method described in clause A10, the second operation unit includes: a multiplication unit and an inverse transformation unit;
[0168] The multiplication unit responds to the second instruction, obtains a weight transformation result after the forward transformation, performs a bitwise multiplication on the weight transformation result and the feature transformation result, and obtains a multiplication result;
[0169] The inverse transformation unit performs an inverse transformation on the multiplication operation result, wherein the inverse transformation unit decomposes the inverse transformation of the multiplication operation result into a summation operation, and completes the inverse transformation of the multiplication operation result according to the summation operation to obtain an operation result.
[0170] A12. According to the operation method described in clause A7, the operation unit includes: an addition operation unit and a multiplication operation unit;
[0171] The addition operation unit responds to the first instruction, obtains the feature data from the storage unit, and performs a positive transformation on the feature data, wherein the addition operation unit decomposes the positive transformation of the feature data into a summation operation, and completes the positive transformation of the feature data according to the summation operation to obtain a feature transformation result;
[0172] The multiplication operation unit obtains a weight transformation result in response to the second instruction, and performs bitwise multiplication on the weight transformation result and the feature transformation result to obtain a multiplication operation result;
[0173] The addition operation unit is also used to respond to the second instruction and perform an inverse transformation on the multiplication operation result, wherein the addition operation unit decomposes the inverse transformation of the multiplication operation result into a summation operation, and completes the inverse transformation of the multiplication operation result according to the summation operation to obtain the operation result.
[0174] The embodiments of the present disclosure are described in detail above. Specific examples are used herein to illustrate the principles and implementation methods of the present disclosure. The description of the above embodiments is only used to help understand the method and its core idea of the present disclosure. At the same time, changes or deformations made by those skilled in the art based on the ideas of the present disclosure, the specific implementation methods and the scope of application of the present disclosure, all belong to the scope of protection of the present disclosure. In summary, the content of this specification should not be understood as a limitation on the present disclosure.
Claims
1. A computing device for performing a winograd convolution operation, characterized in that: The device comprises: a control unit, a storage unit, and a computing unit; The control unit is used to send a control instruction, wherein the control instruction is used to instruct the operation unit to perform a winograd convolution operation; The storage unit is used to store data used for winograd convolution operation; The operation unit is used to respond to the control instruction, extract data from the storage unit to perform a winograd convolution operation, wherein the operation unit decomposes the transformation operation of the data in the winograd convolution operation into a summation operation, and completes the winograd transformation of the data according to the summation operation; The computing unit is specifically used to decompose the data into multiple sub-tensors; perform transformation operations on the multiple sub-tensors and sum them, and obtain a Winograd transformation result of the data according to the result of the summation operation; The operation unit is specifically used to parse the data to obtain multiple sub-tensors, wherein the data is the sum of the multiple sub-tensors, the number of the multiple sub-tensors is the same as the number of non-0 elements in the data, each of the sub-tensors has a single non-0 element, and the non-0 element in the sub-tensor is the same as the non-0 element in the corresponding position in the data.
2. The computing device according to claim 1, wherein: The operation unit is specifically used to obtain the winograd transformation result of the meta-sub-tensor corresponding to each sub-tensor, wherein the meta-sub-tensor is a tensor in which the non-0 elements of the sub-tensor are set to 1; the non-0 element values in the sub-tensor are used as coefficients to multiply the winograd transformation result of the corresponding meta-sub-tensor to obtain the winograd transformation result of the sub-tensor; and the winograd transformation results of multiple sub-tensors are added to obtain the winograd transformation result of the data.
3. The computing device according to claim 2, wherein: The operation unit is specifically used to multiply the left side of the elementary sub-tensor corresponding to the sub-tensor by the left multiplication matrix and the right side by the right multiplication matrix for each of the sub-tensors, so as to obtain the winograd transformation result of the elementary sub-tensor, wherein the left multiplication matrix and the right multiplication matrix are both determined by the scale of the sub-tensor and the winograd transformation type, wherein the winograd transformation type includes a winograd transformation type of a forward transformation and a winograd transformation type of an inverse transformation.
4. The computing device according to any one of claims 1 to 3, characterized in that: The data includes at least one of feature data and weight data; The winograd transformation includes a forward transformation and / or an inverse transformation.
5. The computing device according to claim 4, characterized in that: The control instruction includes a first instruction and a second instruction, wherein the first instruction includes a forward transformation instruction, and the second instruction includes a bitwise multiplication instruction and an inverse transformation instruction; The operation unit is used to respond to the first instruction, extract the feature data from the storage unit, and perform a positive transformation on the feature data, wherein the operation unit decomposes the positive transformation of the feature data into a summation operation, and completes the positive transformation of the feature data according to the summation operation to obtain a feature transformation result; The operation unit is also used to respond to the second instruction to obtain the weight transformation result after the forward transformation, perform bitwise multiplication on the weight transformation result and the feature transformation result to obtain the multiplication result; perform an inverse transformation on the multiplication result, wherein the operation unit decomposes the inverse transformation of the multiplication result into a summation operation, and completes the inverse transformation of the multiplication result according to the summation operation to obtain the operation result.
6. The computing device according to claim 5, characterized in that: The storage unit is specifically used to receive and store the weight transformation result; The operation unit is specifically used to respond to the second instruction and extract the weight transformation result from the storage unit.
7. The computing device according to claim 5, characterized in that: The storage unit is specifically used to store weight data; The operation unit is specifically used to extract the weight data from the storage unit and perform a positive transformation on the weight data, wherein the operation unit decomposes the positive transformation of the weight data into a summation operation, and completes the positive transformation of the weight data according to the summation operation to obtain a weight transformation result.
8. The computing device according to claim 5, characterized in that: The computing unit comprises: a first operation unit, configured to respond to the first instruction, extract feature data from the storage unit, and perform a positive transformation on the feature data, wherein the first operation unit decomposes the positive transformation of the feature data into a summation operation, and completes the positive transformation of the feature data according to the summation operation to obtain a feature transformation result; The second operation unit is used to respond to the second instruction to obtain the weight transformation result, perform bitwise multiplication on the weight transformation result and the feature transformation result to obtain the multiplication result; and perform inverse transformation on the multiplication result, wherein the second operation unit decomposes the inverse transformation operation of the multiplication result in the inverse transformation into a summation operation, and completes the inverse transformation of the multiplication result according to the summation operation to obtain the operation result.
9. The computing device according to claim 8, characterized in that: The second computing unit comprises: a multiplication unit, configured to respond to the second instruction, obtain a weight transformation result, perform bitwise multiplication on the weight transformation result and the feature transformation result, and obtain a multiplication result; An inverse transformation unit is used to perform an inverse transformation on the multiplication result, wherein the inverse transformation unit decomposes the transformation operation on the multiplication result in the inverse transformation into a summation operation, and completes the inverse transformation of the multiplication result according to the summation operation to obtain the operation result.
10. The computing device according to claim 5, characterized in that: The computing unit comprises: an adding unit, configured to respond to the first instruction, obtain feature data from the storage unit, and perform a positive transformation on the feature data, wherein the adding unit decomposes the positive transformation of the feature data into a summation operation, and completes the positive transformation of the feature data according to the summation operation to obtain a feature transformation result; a multiplication unit, configured to obtain a weight transformation result in response to the second instruction, and perform bitwise multiplication on the weight transformation result and the feature transformation result to obtain a multiplication result; The addition operation unit is also used to respond to the second instruction and perform an inverse transformation on the multiplication operation result, wherein the addition operation unit decomposes the inverse transformation of the multiplication operation result into a summation operation, and completes the inverse transformation of the multiplication operation result according to the summation operation to obtain the operation result.
11. An artificial intelligence chip, characterized in that: The chip includes a computing device as described in any one of claims 1-10.
12. An electronic device, characterized in that: The electronic device comprises the artificial intelligence chip as claimed in claim 11.
13. A board, characterized in that: The board includes: a storage device, an interface device and a control device and the artificial intelligence chip according to claim 11; Wherein, the artificial intelligence chip is connected to the storage device, the control device and the interface device respectively; The storage device is used to store data; The interface device is used to realize data transmission between the artificial intelligence chip and external equipment; The control device is used to monitor the status of the artificial intelligence chip.
14. The board according to claim 13, characterized in that: The storage device comprises: a plurality of groups of storage units, each group of the storage units is connected to the artificial intelligence chip via a bus, and the storage units are: DDR SDRAM; The chip includes: a DDR controller for controlling data transmission and data storage of each storage unit; The interface device is: a standard PCIE interface.
15. A computing method, characterized in that: Applied to a computing device, the computing device comprises: a control unit, a storage unit, and a computing unit; wherein, The control unit sends a control instruction, wherein the control instruction is used to instruct the operation unit to perform a winograd convolution operation, The storage unit stores data for winograd convolution operation; The operation unit responds to the control instruction to extract data from the storage unit to perform a winograd convolution operation, wherein the operation unit decomposes a transformation operation on the data in the winograd convolution operation into a summation operation, and completes the winograd transformation of the data according to the summation operation; The computing unit decomposes the data into a plurality of sub-tensors; performs transformation operations on the plurality of sub-tensors and sums them, and obtains a Winograd transformation result of the data according to a result of the summation operation; The operation unit parses the data to obtain multiple sub-tensors, wherein the data is the sum of the multiple sub-tensors, the number of the multiple sub-tensors is the same as the number of non-0 elements in the data, each of the sub-tensors has a single non-0 element, and the non-0 elements in the sub-tensors are the same as the non-0 elements in the corresponding positions in the data.
16. The calculation method according to claim 15, characterized in that: The operation unit obtains the winograd transformation result of the meta-sub-tensor corresponding to each sub-tensor, wherein the meta-sub-tensor is a tensor in which the non-0 elements of the sub-tensor are set to 1; the non-0 element values in the sub-tensor are multiplied by the winograd transformation result of the corresponding meta-sub-tensor as coefficients to obtain the winograd transformation result of the sub-tensor; and the winograd transformation results of multiple sub-tensors are added to obtain the winograd transformation result of the data.
17. The calculation method according to claim 16, characterized in that: For each of the sub-tensors, the operation unit multiplies the left side of the meta-sub-tensor corresponding to the sub-tensor by a left multiplication matrix and the right side by a right multiplication matrix to obtain a winograd transformation result of the meta-sub-tensor, wherein the left multiplication matrix and the right multiplication matrix are both determined by the scale of the sub-tensor and the winograd transformation type, wherein the winograd transformation type includes a winograd transformation type of a forward transformation and a winograd transformation type of an inverse transformation.
18. The calculation method according to any one of claims 15 to 17, characterized in that: The data includes at least one of feature data and weight data; The winograd transformation includes a forward transformation and / or an inverse transformation.
19. The calculation method according to claim 18, characterized in that: The control instruction includes a first instruction and a second instruction, wherein the first instruction includes a forward transformation instruction, and the second instruction includes a bitwise multiplication instruction and an inverse transformation instruction; The operation unit responds to the first instruction, extracts the feature data from the storage unit, and performs a winograd convolution operation on the feature data, wherein the operation unit decomposes the transformation operation on the feature data in the winograd convolution operation into a summation operation, and completes a positive transformation of the feature data according to the summation operation to obtain a feature transformation result; The operation unit also responds to the second instruction to obtain the weight transformation result after the forward transformation, performs bitwise multiplication on the weight transformation result and the feature transformation result to obtain the multiplication result; and performs an inverse transformation on the multiplication result, wherein the operation unit decomposes the inverse transformation of the multiplication result into a summation operation, and completes the inverse transformation of the multiplication result according to the summation operation to obtain the operation result.
20. The calculation method according to claim 19, characterized in that: The storage unit receives and stores the weight transformation result; The operation unit responds to the second instruction and extracts the weight transformation result from the storage unit.
21. The calculation method according to claim 19, characterized in that: The storage unit stores weight data; The operation unit extracts the weight data from the storage unit and performs a forward transformation on the weight data, wherein the operation unit decomposes the forward transformation of the weight data into a summation operation, and completes the forward transformation of the weight data according to the summation operation to obtain a weight transformation result.
22. The operation method according to claim 19, characterized in that: The operation unit comprises: a first operation unit and a second operation unit; The first operation unit responds to the first instruction, extracts feature data from the storage unit in response to the first instruction, and performs a positive transformation on the feature data, wherein the first operation unit decomposes the positive transformation of the feature data into a summation operation, and completes the positive transformation of the feature data according to the summation operation to obtain a feature transformation result; The second operation unit obtains the weight transformation result in response to the second instruction, performs bitwise multiplication on the weight transformation result and the feature transformation result to obtain a multiplication result; and performs an inverse transformation on the multiplication result, wherein the second operation unit decomposes the inverse transformation of the multiplication result into a summation operation, and completes the inverse transformation of the multiplication result according to the summation operation to obtain an operation result.
23. The calculation method according to claim 22, characterized in that: The second operation unit includes: a multiplication unit and an inverse transformation unit; The multiplication unit responds to the second instruction, obtains a weight transformation result after the forward transformation, performs a bitwise multiplication on the weight transformation result and the feature transformation result, and obtains a multiplication result; The inverse transformation unit performs an inverse transformation on the multiplication operation result, wherein the inverse transformation unit decomposes the inverse transformation of the multiplication operation result into a summation operation, and completes the inverse transformation of the multiplication operation result according to the summation operation to obtain an operation result.
24. The operation method according to claim 19, characterized in that: The operation unit includes: an addition operation unit and a multiplication operation unit; The addition operation unit responds to the first instruction, obtains the feature data from the storage unit, and performs a positive transformation on the feature data, wherein the addition operation unit decomposes the positive transformation of the feature data into a summation operation, and completes the positive transformation of the feature data according to the summation operation to obtain a feature transformation result; The multiplication operation unit obtains a weight transformation result in response to the second instruction, and performs bitwise multiplication on the weight transformation result and the feature transformation result to obtain a multiplication operation result; The addition operation unit is also used to respond to the second instruction and perform an inverse transformation on the multiplication operation result, wherein the addition operation unit decomposes the inverse transformation of the multiplication operation result into a summation operation, and completes the inverse transformation of the multiplication operation result according to the summation operation to obtain the operation result.
