A computing device and a computing method

By designing a low-power computing device in the deep neural network, and using threshold judgment conditions and data sparsity to control the opening and closing of the computing unit, the problem of high energy consumption caused by the large amount of calculations in the deep neural network is solved, and flexibility and efficiency are achieved. improvement.

CN113449855BActive Publication Date: 2024-09-17SHANGHAI CAMBRICON INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110597369.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2017-06-13
Publication Date
2024-09-17
Estimated Expiration
2037-06-13

AI Technical Summary

Technical Problem

The huge amount of calculations of deep neural networks results in high energy consumption of accelerators, which limits their faster development and wider application. The existing accelerator architecture is not very flexible, making it difficult to further improve the computing speed and reduce the amount of calculations.

Method used

Design a low-power computing device. Through the combination of the computing module and the control module, the threshold judgment condition or the function mapping judgment condition is used to control the opening and closing of the multiplier and the adder, and data processing is performed according to the sparsity of the data. Selectivity Configure computing components to reduce energy consumption.

Benefits of technology

It is achieved that the power consumption of the accelerator is significantly reduced without affecting the operation speed, and the flexibility and efficiency of operation are improved. By adjusting the judgment conditions to control the ratio of the multiplier and the adder, the purpose of reducing energy consumption is achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113449855B
    Figure CN113449855B
Patent Text Reader

Abstract

The present disclosure provides a computing device, including: a computing module, including one or more computing units; and a control module, including a computing control unit, for controlling the shutdown of the computing unit through a judgment condition. The present disclosure also provides a computing method. The low-power computing device and method disclosed in the present disclosure have high flexibility and can be combined with software enhancement methods, thereby further improving the computing speed, reducing the amount of calculation, and reducing the computing power consumption of the accelerator.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to a computing device and method. Background Art

[0002] Deep neural networks are the foundation of many current artificial intelligence applications. They have achieved breakthroughs in speech recognition, image processing, data analysis, advertising recommendation systems, autonomous vehicles, and many other areas, enabling their application in all aspects of life. However, the enormous computational complexity of deep neural networks has hindered their rapid development and widespread application. When considering the design of accelerators to accelerate the computation of deep neural networks, the huge computational complexity inevitably leads to significant energy consumption, which also restricts the further widespread application of accelerators.

[0003] In terms of hardware, the existing commonly used accelerator architecture mainly analyzes the most time-consuming operation part in its operation and then conducts targeted acceleration design. Taking convolutional neural network as an example, Figure 1 As shown in the figure, the existing common acceleration structure for inner product operations is often a "multiply-and-add" structure, where a set of multipliers is used to obtain a set of product values ​​in a single clock cycle, and then the products are accumulated in parallel to obtain the final result. However, this structure is not very flexible and cannot further improve the operation speed and reduce the computational complexity. Summary of the Invention

[0004] (1) Technical issues to be resolved

[0005] To address or at least partially alleviate the aforementioned technical issues, the present disclosure provides a low-power computing device and method. The disclosed low-power computing device and method offer high flexibility and can be combined with software enhancements to further increase computing speed, reduce computational complexity, and lower the computing power consumption of the accelerator.

[0006] (2) Technical solution

[0007] According to one aspect of the present disclosure, there is provided a computing device, comprising:

[0008] A computing module, comprising one or more computing units; and

[0009] The control module includes an operation control unit for controlling the shutdown of the operation unit of the operation module according to a judgment condition.

[0010] In some embodiments, each of the arithmetic units includes one or more arithmetic components, which are adders, multipliers, selectors, or temporary buffers.

[0011] In some embodiments, the operation module includes n multipliers at a first stage and an n-input adder tree at a second stage, where n is a positive integer.

[0012] In some embodiments, the judgment condition includes a threshold judgment condition or a function mapping judgment condition.

[0013] In some embodiments, the judgment condition is a threshold judgment condition, including: less than a given threshold, greater than a given threshold, within a given value range, or outside a given value range.

[0014] In some embodiments, the judgment condition is a function mapping judgment condition, that is, judging whether a given condition is met after function transformation.

[0015] In some embodiments, the n multipliers of the first stage are respectively connected to an operation control unit, and the operation control unit controls the shutdown of the multipliers according to the judgment condition.

[0016] In some embodiments, the operation control unit judges the data to be operated according to the judgment condition, and when it judges that the absolute value of the input data input to a multiplier is less than a given threshold, the multiplier is turned off.

[0017] In some embodiments, the addition tree includes k-level adders, the number of adders in the first level is n / 2, the number of adders in the last level, i.e., the k-th level, is 1, wherein 2 k =n; the n / 2 adders of the first stage of the adder tree are connected to the n multipliers to receive data signals and control signals sent by the multipliers; the adders of the second to kth stages of the adder tree are respectively connected to the adders of the previous stage and receive data signals and control signals sent by the previous adders.

[0018] In some embodiments, if the multiplier receives a shutdown signal sent by the operation control unit, a control signal 0 is input into the first-level adder of the addition tree, otherwise the multiplication result is sent to the first-level adder of the addition tree, and a control signal 1 is input; if the adder receives two control signals both of which are 1, the input values ​​are accumulated, and the accumulated sum is sent to the next-level adder, and a control signal 1 is sent to the next-level adder; if the adder receives one control signal of 1 and one of which is 0, the input data at the end of 1 is directly passed to the next level, and a control signal 1 is input to the next level; if the adder receives two control signals both of which are 0, the adder is turned off, and a control signal 0 is input to the next-level adder, and so on, until the addition tree accumulates and obtains the final result.

[0019] In some embodiments, the n multipliers of the first stage and the n-input adder tree of the second stage are respectively connected to an operation control unit, which judges the data to be operated according to the judgment condition; when it judges that the absolute value of the input data input to a multiplier or adder is less than a given threshold, the multiplier or adder is turned off.

[0020] In some embodiments, the computing device further includes: a data processing module for expanding or compressing data; correspondingly, the control module includes a data control unit for controlling the data processing module to expand or compress data.

[0021] In some embodiments, the data processing module expands and compresses the data. If the synaptic value is a sparse pattern, that is, a sparse network expressed using sparse coding, the neuron data is compressed according to the sparsity of the synaptic value, and the neuron data that does not need to be calculated is compressed and filtered out; or, if the neuron data is a sparse pattern, the synapses are compressed accordingly according to the sparsity of the neuron data, and the synaptic data that does not need to be calculated is compressed and filtered out; or, given a compression judgment condition, the synapse and / or neuron data is compressed according to the compression judgment condition.

[0022] In some embodiments, the compression judgment condition includes a threshold judgment condition or a function mapping judgment condition.

[0023] In some embodiments, the threshold judgment conditions include: less than a given threshold, greater than a given threshold, within a given value range, or outside a given value range.

[0024] In some embodiments, the n multipliers of the first stage are respectively connected to the data processing module to receive the neuron data and synapse data output by the data processing module.

[0025] In some embodiments, the operation module includes m operation units, each operation unit includes a multiplier, an adder, and a temporary buffer;

[0026] The control module includes m operation control units, each operation control unit is connected to the multiplier and adder of an operation unit respectively, and controls the closing of the multiplier and adder according to the judgment condition, and m is a positive integer.

[0027] In some embodiments, the multiplier of each operation unit has three input terminals and one output terminal, wherein two input terminals are used to receive neuron data and synapse data respectively, another input terminal is used to input a control signal, and the output terminal is used to output a multiplication result;

[0028] The adder has three input terminals and one output terminal, wherein two input terminals are used to receive the multiplication result and the data inputted by the temporary buffer respectively, the other input terminal is used to input the control signal, and the output terminal is used to output the addition result, which is stored back in the temporary buffer to be used as the input data of the next layer of addition operation.

[0029] In some embodiments, synaptic data is sent to each operation unit via broadcasting. If the neuron data input into the operation unit is less than a threshold value, the control signal controls the closing of the multiplier and adder of the operation unit, and the partial sum stored in the temporary buffer remains unchanged; otherwise, the operation unit uses the multiplier to multiply the two input data, and accumulates them with the data in the temporary buffer, and then stores them back in the temporary buffer after accumulation.

[0030] In some embodiments, the computing device further includes a data processing module and a storage module, one of the input ends of the multiplier is connected to the data processing module for receiving compressed synaptic data; one of the input ends is connected to the storage module for receiving neuron data.

[0031] In some embodiments, the operation module includes p operation units, each operation unit includes a multiplier, an adder, and a selector;

[0032] The control module includes p operation control units, each operation control unit is connected to the multiplier and adder of an operation unit respectively, and controls the closing of the multiplier and adder according to the judgment condition, and p is a positive integer.

[0033] In some embodiments, the multiplier of each operation unit has three input terminals and one output terminal, wherein two input terminals are used to receive neuron data and synapse data respectively, another input terminal is used to input a control signal, and the output terminal is used to output a multiplication result;

[0034] The adder of the first arithmetic unit has three input terminals and one output terminal, wherein two input terminals are used to receive the multiplication result and the data input by the selector of the arithmetic unit of the same level respectively, the other input terminal is used to input the control signal, and the output terminal is used to output the addition result. The addition result is sent to the next arithmetic unit through the selector to be used as the input data of the next level addition operation;

[0035] The adders of the 2nd to pth operation units have three input terminals and one output terminal, two of which are used to receive the multiplication results and the data input by the selector of the previous level operation unit respectively, the other input terminal is used to input the control signal, and the output terminal is used to output the addition result. The addition result is sent to the next operation unit through the selector to be used as input data for the next level addition operation.

[0036] In some embodiments, the computing device further comprises:

[0037] The storage module is connected to the control module and is used to control the storage module to store or read the required data; the storage module is also connected to the operation module and is used to input the data to be calculated into the operation module and receive and store the data calculated by the operation module.

[0038] In some embodiments, the control module includes a storage control unit, which is used to control the storage module to store or read required data.

[0039] According to another aspect of the present disclosure, a calculation method is provided, comprising:

[0040] Set judgment conditions;

[0041] The closing of the operation unit of the operation module is controlled according to the judgment condition.

[0042] In some embodiments, the judgment condition includes a threshold judgment condition or a function mapping judgment condition.

[0043] In some embodiments, the judgment condition is a threshold judgment condition, including: less than a given threshold, greater than a given threshold, within a given value range, or outside a given value range.

[0044] In some embodiments, the judgment condition is a function mapping judgment condition, that is, judging whether a given condition is met after function transformation.

[0045] In some embodiments, according to the judgment condition, if the absolute value of input data input to a multiplier is less than a given threshold, the multiplier is turned off.

[0046] In some embodiments, the multiplier receives a shutdown signal and inputs a control signal 0 to the first-stage adder of the adder tree, otherwise the multiplication result is sent to the first-stage adder of the adder tree and inputs a control signal 1;

[0047] The first-level adder receives the control signal sent by the multiplier, and the second to k-level adders respectively receive the control signal sent by the previous adder until the addition tree accumulates and obtains the final result;

[0048] If the adder receives two control signals that are both 1, the input values ​​are accumulated and the accumulated sum is sent to the next adder, and the control signal 1 is sent to the next level; if the adder receives one control signal that is 1 and the other is 0, the input data of the end that is 1 is directly passed to the next level, and the control signal 1 is input to the next level; if the first-level adder receives two control signals that are both 0, the adder is turned off, and the control signal 0 is input to the next-level adder.

[0049] In some embodiments, the judgment condition is a threshold judgment condition. The operation control unit sets the threshold and compares the absolute value of the data input to the multiplier / adder with the threshold. If the absolute value is less than the threshold, the multiplier / adder is controlled to be turned off.

[0050] In some embodiments, if the multiplier of an operation unit is not turned off, a multiplication operation is performed on the input neuron data and synapse data and a multiplication result is output; otherwise, the adder of the operation unit is turned off at the same time, and the partial sum stored in the temporary cache remains unchanged;

[0051] If the adder of the operation unit is not closed, it receives the multiplication result and the data input from the temporary buffer, performs the addition operation and outputs the addition operation result, and the addition operation result is stored back to the temporary buffer to be used as the input data of the next layer of addition operation until the operation is completed; otherwise, the partial sum stored in the temporary buffer remains unchanged.

[0052] In some embodiments, if the multiplier of an operation unit is not closed, a multiplication operation is performed on the input neuron data and synapse data and the multiplication result is output; otherwise, the adder of the operation unit is closed at the same time, and the selector selects to directly transmit the data of the previous level to the selector of the next level;

[0053] If the adder of the arithmetic unit is not closed, it receives the multiplication result and the input data of this stage or the data output by the selector of the previous stage, performs the addition operation and outputs the addition result, which is sent to the next arithmetic unit through the selector;

[0054] Otherwise, when the adder and multiplier are turned off, the selector selects the input data of the current stage or the data output by the selector of the previous stage as the result output of the operation unit.

[0055] In some embodiments, the method further includes: expanding or compressing the data to be operated.

[0056] In some embodiments, the data processing module expands and compresses the data. If the synaptic value is in a sparse mode, the neuron data is compressed according to the sparsity of the synaptic value, and the neuron data that does not need to be calculated is compressed and filtered out; or, if the neuron data is in a sparse mode, the synapses are compressed accordingly according to the sparsity of the neuron data, and the synaptic data that does not need to be calculated is compressed and filtered out; or, given a compression judgment condition, the synapse and / or neuron data is compressed according to the compression judgment condition.

[0057] (3) Beneficial effects

[0058] It can be seen from the above technical solutions that the low-power computing device and method disclosed herein have at least one of the following beneficial effects:

[0059] (1) Differentiate the data and reasonably choose whether to configure the corresponding components of the computing device according to the difference of the data. For example, you can choose whether to configure the data processing part according to whether the data storage method is sparse representation. For example, you can choose the number of configured operation groups according to the needs, and choose the number of multipliers and adders to be configured in each operation group, which has high flexibility.

[0060] (2) When the data to be calculated meets the given judgment conditions, the corresponding multipliers and adders are turned off, thereby reducing the power consumption of the accelerator without affecting the calculation speed of the accelerator.

[0061] (3) By adjusting the judgment conditions, the ratio of closing adders and multipliers is controlled, thereby achieving the purpose of controlling the amount of energy consumption reduction. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Figure 1 It is a schematic diagram of the functional modules of a conventional computing device.

[0063] Figure 2 Schematic diagram of the functional modules of the low-power computing device according to the present invention.

[0064] Figure 3 2 is a schematic diagram of another functional module of the low-power computing device according to the present disclosure.

[0065] Figure 4 This is a schematic diagram of the structure of a low-power computing device proposed in Example 1 of the present disclosure.

[0066] Figure 5 This is a schematic diagram of the structure of a low-power computing device proposed in Example 2 of the present disclosure.

[0067] Figure 6 This is a schematic diagram of the structure of a low-power computing device proposed in Example 3 of the present disclosure. DETAILED DESCRIPTION

[0068] In order to make the objectives, technical solutions and advantages of the present disclosure more clearly understood, the present disclosure is further described in detail below in conjunction with specific embodiments and with reference to the accompanying drawings.

[0069] It should be noted that in the drawings or descriptions of the specification, similar or identical parts use the same figure numbers. The implementation methods not shown or described in the drawings are forms known to those of ordinary skill in the art. In addition, although this document may provide demonstrations of parameters containing specific values, it should be understood that the parameters do not need to be exactly equal to the corresponding values, but can be approximated to the corresponding values ​​within an acceptable error tolerance or design constraint. In addition, the directional terms mentioned in the following embodiments, such as "up", "down", "front", "back", "left", "right", etc., are only reference to the directions of the drawings. Therefore, the directional terms used are used to illustrate and are not used to limit the present disclosure.

[0070] The present disclosure provides a low-power neural network computing device. Figure 2 Schematic diagram of the functional modules of the low-power computing device according to the present disclosure. Figure 2 As shown, the low-power neural network operation device mainly includes: a control module, a storage module and an operation module; wherein, the control module is connected to the storage module, and is used to control the storage module to store or read the required data; the storage module is connected to the operation module, and is used to input the data to be operated into the operation module, and at the same time receive and store the data after the operation of the operation module; the control module is also connected to the operation module, and is used to control the working mode of the operation module according to the type of operation to be operated and the operation data.

[0071] Specifically, the control module includes a storage control unit and an operation control unit. The storage control unit is used to control the storage module to store or read required data; the operation control unit controls whether each component in the operator operates and how it operates based on the type of operation to be performed and the operation data. The control module can be split into individual operation groups to control them, or it can be controlled as a whole or individually from outside.

[0072] Further, such as Figure 3 As shown, the low-power neural network operation device may also include a data processing module for expanding and compressing data; accordingly, the control module includes a data control module for controlling whether to expand or compress the data, and the data processing module and the data control unit may exist at the same time or not.

[0073] The data processing module expands and compresses the data. Specifically, when the synaptic value is in a sparse mode, that is, a sparse representation is used, the neuron data is compressed according to the sparsity of the synaptic value, and the neuron data that does not need to be calculated is filtered out; or, when the neuron data is in a sparse mode, the synapses are compressed accordingly according to the sparsity of the neuron data, and the synaptic data that does not need to be calculated is filtered out; or, given a compression judgment condition, the synapse and / or neuron data is compressed according to the compression judgment condition, and the data that meets the compression judgment condition is filtered out.

[0074] The compression judgment condition includes a threshold judgment condition or a function mapping judgment condition, wherein the threshold judgment condition includes: less than a given threshold, greater than a given threshold, within a given value range, or outside a given value range.

[0075] The storage module includes a data storage unit and a temporary cache unit. One or more data storage units can be set according to needs, that is, the data to be calculated can be stored in the same area or stored separately; the intermediate result values ​​can be stored in the same area or stored separately.

[0076] The operation module can have various structures, which may include one or more operation units, each of which includes one or more multipliers and one or more adders. The operation units transmit the data to be operated or the intermediate result values ​​in a certain direction.

[0077] The main operation process of the low-power neural network operation device disclosed in the present invention is as follows: the storage control module sends a read control signal to the storage part to select and read the data to be operated. If the data read is a compressed mode and expanded data, the data control unit controls the data processing module to expand the compressed data or compress the corresponding data to be operated. Then, the operation control unit prepares to send an operation signal to be operated and judges the value of the data to be operated. If its absolute value is less than a given threshold, a shutdown signal is sent to the corresponding operation component. Otherwise, an operation signal to be operated is sent to the corresponding operation component. When the operation is completed, if the data needs to be compressed or expanded, the data control part receives the data and controls the data processing part to perform compression or expansion operations on the data, that is, compresses and filters out data that does not need to be operated or expands the sparsely represented data into a non-sparse representation. Then, the result is stored in the storage part according to the storage control part. If data processing is not required, the result can be directly stored in the storage part through the storage control part.

[0078] The structure of the computing device disclosed herein is described in detail below in conjunction with specific embodiments. Those skilled in the art will appreciate that the structure of the computing device disclosed herein is not limited to the following examples.

[0079] Example 1

[0080] Please refer to the attached Figure 4 As shown, in this embodiment 1, the operation unit of the operation module includes n (n is a positive integer) multipliers and an n-input adder tree. The operation control unit controls the operation module as a whole and can send control signals to each multiplier. In addition to receiving data signals, each adder and multiplier can also receive control signals. In other words, in addition to receiving data to be operated, it can also receive control signals and send control signals to the next level.

[0081] The specific operation process of the low-power neural network operation device using the operation module of this embodiment 1 is as follows: First, the storage control unit controls the storage module to read out the neuron data and synapse data. If the synapse data is stored in a sparse coding manner, it is necessary to transmit the neuron data and the synapse index value together to the data processing module, and compress the neuron data accordingly according to the index value, that is, only the neuron data that will be operated with the synapse data sent to the operation unit is filtered out. The data processing module then transmits the processed neuron data and synapse data together to each operation unit. Each multiplier receives a neuron data and corresponding synapse data. The result of the multiplier is then sent to the adder of the next level for accumulation, and the accumulated sum is continued to be sent to the adder of the next level for accumulation until the final result is completed.

[0082] For the first-stage multiplier operation, the data to be operated on is simultaneously input into the first-stage multiplier and the operation control unit. The operation control unit performs a threshold judgment on the data to be operated on. If it determines that the absolute value of the input neuron data to a multiplier is less than a given threshold, the multiplier is turned off. Upon receiving the shutdown signal, the multiplier inputs a control signal of 0 to the adder and turns off. Otherwise, the multiplication result is passed to the adder and a control signal of 1 is input. If the adder receives both control signals of 1, it accumulates the input values, passes the accumulated sum to the next stage, and transmits a control signal of 1 to the next stage. If the adder receives one control signal of 1 and one control signal of 0, the input data on the end with the 1 value is directly passed to the next stage and a control signal of 1 is input to the next stage. If the adder receives both control signals of 0, the adder is turned off and a control signal of 0 is input to the adder at the next stage. This process continues in this manner until the adder tree accumulates the final result, which the storage control unit controls and writes to the storage module. This result clearly enables, without sacrificing the speed of parallel computing, the operation of multipliers or adders whose inputs are less than a given threshold to be turned on or off, thereby further reducing power consumption during the operation. In addition to the absolute value of the value to be judged being less than the given threshold, the judgment conditions for turning off the multiplier can also include the value to be judged being greater than the given threshold; the value to be judged being within a given value range, that is, between two thresholds, one large and one small; the value to be judged being outside the given value range, that is, greater than the large threshold or less than the small threshold; or the value to be judged meeting certain conditions after function mapping, such as the mapped value being equal to the given threshold, greater than / less than the given threshold, or within a given value range.

[0083] Example 2

[0084] Please refer to the attached Figure 5 As shown, in this embodiment 2, the operation module includes n (n is a positive integer) operation units, each of which includes a multiplier, an adder, and a temporary buffer. Each operation control unit is also split into each operation group. Synaptic data is transmitted to each operation unit via broadcast, and neurons are directly fed in from the storage unit.

[0085] The specific operation process of the low-power neural network operation device using the operation module of this embodiment 2 is as follows: First, the temporary buffer in each operation unit is initialized to 0. The storage control unit controls the storage module to read the neuron data. If the synaptic data is stored in a sparsely coded manner, the synaptic index value and the neuron data are transmitted to the data processing module. The neuron data is compressed accordingly based on the index value, thereby selecting the neuron data to be operated on by the operation unit with the incoming synaptic data value. Then, both the neuron data and the synaptic data are transmitted to each operation unit. Simultaneously, the storage control unit controls the storage module to read the synaptic data, and the storage module broadcasts the first synaptic data to all operation units. When an operation unit receives the neuron data, the operation control unit determines whether it is less than a given threshold. If so, the multiplier and adder of the operation unit are disabled, and the partial sum stored in the temporary buffer remains unchanged. Otherwise, the operation unit uses the multiplier to multiply the two input data and accumulates them with the data in the temporary buffer, and the accumulated sum is stored back in the temporary buffer. Then, the second synaptic data is broadcast, and the above operation is repeated until all synaptic data broadcasts are complete. The storage control unit then saves the n calculation results to the storage module. The next round of calculations is then performed until all calculations are complete. When synaptic data is dense, it is possible to skip the data processing module after reading the neuron data from the storage module and directly transmit the data to the calculation module. This device has the advantage of fully leveraging the characteristics of neural networks, namely the reusability of synapses, and reducing the need for repeated reading of synaptic data. Furthermore, when the absolute value of the neuron data is less than a given threshold, the corresponding multiplier and adder are disabled, preventing calculations from occurring, thereby reducing power consumption. In addition to the absolute value of the value to be determined being less than a given threshold, the conditions for disabling the multiplier and adder can also include: the value to be determined being greater than a given threshold; the value to be determined being within a given value range, i.e., between two thresholds (a large and a small); the value to be determined being outside the given value range, i.e., greater than a large threshold or less than a small threshold; or the value to be determined meeting certain conditions after function mapping, such as the mapped value being equal to a given threshold, greater than or less than a given threshold, or within a given value range.

[0086] Example 3

[0087] Please refer to the attached Figure 6 As shown, in this embodiment 3, the operation module includes n operation units. Each operation unit includes a multiplier, an adder, and a selector. The operation control unit controls each operation unit separately, and partial sums are transmitted between the operation units.

[0088] The specific operation process of a low-power neural network operation device using the operation module of Example 3 is as follows: First, the storage control unit reads synaptic values ​​from the storage module and sends them to the data processing module. The data processing module compresses the synapses using a given compression threshold, selecting only synaptic values ​​with an absolute value not less than the given compression threshold and transmitting them to each operation unit, while maintaining the synaptic values ​​unchanged. Neuron values ​​are then read from the storage module and, after corresponding compression by the data processing module, only neuron values ​​with an absolute value not less than the given threshold are selected and transmitted to the operation control unit in each operation unit. The operation control unit receives the neuron data, takes its absolute value, and compares it with the given threshold. If the value is less than a given shutdown threshold, the multiplier and adder are shut down, and the selector selects to transmit the data from the previous level directly to the selector at the next level. Otherwise, the multiplier multiplies the neuron data and synapse data, then feeds the adder. The adder takes the product and the data from the previous level and accumulates it. The result is then fed into the selector, which selects the adder's output as the output of the current level and transmits it to the adder and selector at the next level. This process continues in this order until the final result is obtained. The storage control unit stores the final result in a memory module. This method maximizes the proportion of valid data in the algorithm by repeatedly screening synapses and neurons, further reducing the computational effort and increasing computational speed. It also leverages the shared nature of neural network synapses, avoiding the memory access power consumption caused by repeated synaptic reading. Furthermore, it shuts down unused multipliers and adders when the data to be calculated is less than a given threshold, further reducing power consumption.

[0089] Among them, the judgment conditions for closing the multiplier and adder include, in addition to the absolute value of the value to be judged being less than the given threshold, the value to be judged being greater than the given threshold; the value to be judged being within the given value range, that is, between two thresholds, one large and one small; or the value to be judged being outside the given value range, that is, greater than the large threshold or less than the small threshold; or the value to be judged meeting certain conditions after function mapping, such as the mapped value being equal to the given threshold, greater than / less than the given threshold, within the given value range, etc.

[0090] In addition, although compression is performed through a given threshold in the above-mentioned embodiment, the compression judgment condition of the present disclosure is not limited to the threshold judgment condition, but can also be a function mapping judgment condition, and the threshold judgment condition may include: less than a given threshold, greater than a given threshold, within a given value range or outside a given value range, etc.; and the judgment condition for closing the operation unit and the compression judgment condition in the present disclosure can use the same judgment condition (for example, both use threshold judgment, and the selection of the threshold size can also be the same or different), or different judgment conditions can be used (for example, one of them is threshold judgment and the other is mapping judgment), which does not affect the implementation of the present disclosure.

[0091] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present disclosure. It should be understood that the above are only specific embodiments of the present disclosure and are not intended to limit the present disclosure. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present disclosure should be included in the scope of protection of the present disclosure.

Claims

1. A computing device, the device being applied to a deep neural network, the device comprising: The computing module includes one or more computing units and a computing control unit. The operation control unit is used to control the shutdown of the operation unit of the operation module according to a judgment condition; the judgment condition includes a threshold judgment condition or a function mapping judgment condition; The computing device further includes a data processing module and a control module, wherein the data processing module is used to expand or compress the synaptic values ​​and neuron values ​​read from the storage module; The control module includes a data control unit for controlling the data processing module to expand or compress data; The data processing module expands or compresses the synaptic values ​​and neuron values ​​read from the storage module, including: if the synaptic value is a sparse mode, that is, a sparse network expressed by sparse coding, the neuron value is compressed according to the sparsity of the synaptic value, and the neuron value that does not need to be calculated is compressed and filtered out; or, if the neuron value is a sparse mode, the synaptic value is correspondingly compressed according to the sparsity of the neuron value, and the synaptic value that does not need to be calculated is compressed and filtered out; or, a compression judgment condition is given, and the synaptic value and / or neuron value is compressed according to the compression judgment condition; The operation module includes n multipliers at the first stage and an n-input addition tree at the second stage, where n is a positive integer; The n multipliers of the first stage are respectively connected to the data processing module to receive the neuron data and synapse data output by the data processing module.

2. The computing device according to claim 1, wherein: Each of the operation units includes one or more operation components, which are adders, multipliers, selectors or temporary buffers.

3. The computing device according to claim 1, wherein: The judgment condition is a threshold judgment condition, including: less than a given threshold, greater than a given threshold, within a given value range, or outside a given value range.

4. The computing device according to claim 1, wherein: The judgment condition is a function mapping judgment condition, that is, judging whether a given condition is satisfied after function transformation.

5. The computing device according to claim 2, wherein: The n multipliers of the first stage are respectively connected to an operation control unit, and the operation control unit controls the closing of the multipliers according to the judgment condition.

6. The computing device according to claim 5, wherein: The operation control unit judges the data to be operated according to the judgment condition, and when it judges that the absolute value of the input data input to a multiplier is less than a given threshold, the multiplier is turned off.

7. The computing device according to claim 5, wherein: The addition tree includes k-level adders, the number of adders in the first level is n / 2, and the number of adders in the last level, i.e., the k-th level, is 1, wherein 2 k =n; the n / 2 adders of the first level of the adder tree are connected to the n multipliers to receive data signals and control signals sent by the multipliers; the adders of the second to kth levels of the adder tree are respectively connected to the adders of the previous level to receive data signals and control signals sent by the adders of the previous level.

8. The computing device according to claim 5, wherein: If the multiplier receives a shutdown signal sent by the operation control unit, a control signal of 0 is input into the first-level adder of the addition tree, otherwise the multiplication result is sent to the first-level adder of the addition tree, and a control signal of 1 is input; if the adder receives two control signals that are both 1, the input values ​​are accumulated, and the accumulated sum is sent to the lower-level adder, and a control signal of 1 is sent to the lower level; if the adder receives one control signal of 1 and one control signal of 0, the input data of the end that is 1 is directly passed to the lower level, and a control signal of 1 is input to the lower level; if the adder receives two control signals that are both 0, the adder is turned off, and a control signal of 0 is input to the lower level adder, and so on, until the addition tree accumulates and obtains the final result.

9. The computing device according to claim 1, wherein: The n multipliers of the first stage and the n-input addition tree of the second stage are respectively connected to an operation control unit, which judges the data to be operated according to the judgment condition; when it is judged that the absolute value of the input data of a multiplier or adder is less than a given threshold, the multiplier or adder is turned off.

10. The computing device according to claim 1, wherein: The compression judgment condition includes a threshold judgment condition or a function mapping judgment condition.

11. The computing device according to claim 10, wherein: The threshold judgment conditions include: less than a given threshold, greater than a given threshold, within a given value range, or outside a given value range.

12. The computing device according to claim 1, wherein: The operation module includes m operation units, each of which includes a multiplier, an adder and a temporary buffer; The control module includes m operation control units, each of which is connected to a multiplier and an adder of an operation unit, and controls the closing of the multiplier and the adder according to the judgment condition, and m is a positive integer.

13. The computing device according to claim 1, wherein: The multiplier of each operation unit has three input terminals and one output terminal, wherein two input terminals are used to receive neuron data and synapse data respectively, another input terminal is used to input a control signal, and the output terminal is used to output a multiplication operation result; The adder has three input terminals and one output terminal, wherein two input terminals are respectively used to receive the multiplication result and the data inputted by the temporary buffer, the other input terminal is used to input the control signal, and the output terminal is used to output the addition result, which is stored back in the temporary buffer to be used as the input data of the next layer of addition operation.

14. The computing device according to claim 7, wherein: The synaptic data is sent to each operation unit through broadcasting. If the neuron data input to the operation unit is less than the threshold, the multiplier and adder of the operation unit are turned off by the control signal, and the partial sum stored in the temporary buffer remains unchanged. Otherwise, the operation unit uses a multiplier to multiply the two input data, and adds them with the data in the temporary buffer, and then stores them back to the temporary buffer after accumulation.

15. The computing device according to claim 1, wherein: The operation module includes p operation units, each of which includes a multiplier, an adder and a selector; The control module includes p operation control units, each of which is connected to a multiplier and an adder of an operation unit, and controls the closing of the multiplier and the adder according to the judgment condition, and p is a positive integer.

16. The computing device according to claim 1, wherein: The computing device further comprises: The storage module is connected to the control module and is used to control the storage module to store or read the required data; the storage module is also connected to the operation module and is used to input the data to be operated into the operation module and receive and store the data after the operation of the operation module.

17. The computing device according to claim 15, wherein: The control module includes a storage control unit, which is used to control the storage module to store or read required data.