ARITHMETIC UNIT FOR APPROXIMATE CALCULATIONS IN NEURAL NETWORKS

20230072032 ยท 2023-03-09

    Inventors

    Cpc classification

    International classification

    Abstract

    An arithmetic unit for calculating an approximate value for a product or a sum of two inputted numbers. The arithmetic unit includes arithmetic modules, at least one of the arithmetic modules being provided to calculate individual products or individual sums of digits of the inputted numbers, and the arithmetic modules being connected in an adder that is designed to calculate digits of the product or of the sum from the individual products or from the individual sums. An arithmetic module that is required for the calculation of at least one individual product or individual sum, and/or is required for the propagation of this individual product or this individual sum onto the product or the sum, being absent in the arithmetic unit or being connected there in such a way that it is capable of being selectively deactivated, completely or partially, for the running time of the arithmetic unit.

    Claims

    1-14. (canceled)

    15. An arithmetic unit for calculating an approximate value for a product or a sum of two inputted numbers, comprising: a plurality of arithmetic modules, at least one of the arithmetic modules being provided to calculate individual products or individual sums of digits of the inputted numbers, the plurality of arithmetic modules being connected in an adder that is configured to calculate digits of the product or of the sum, from the individual products or from the individual sums, at least one arithmetic module that is required for the calculation of at least one individual product or individual sum, and/or is required for the propagation of the individual product or the individual sum onto the product or the sum, being absent in the arithmetic unit or being connected there in such a way that it is capable of being selectively deactivated, completely or partially, for a running time of the arithmetic unit.

    16. The arithmetic unit as recited in claim 15, wherein at least one arithmetic module of the arithmetic modules that is provided to calculate at least one individual product of two binary digits including a logical AND gate, and/or logical XOR gate, and/or a multiplexer.

    17. The arithmetic unit as recited in claim 16, wherein the adder includes a plurality of full adders as arithmetic modules.

    18. The arithmetic unit as recited in claim 15, wherein at least one arithmetic module of the arithmetic modules and/or its spatial situation inside the arithmetic unit, is thermally configured for a lower work cycle than is the case for at least one other of the arithmetic modules.

    19. The arithmetic unit as recited in claim 18, wherein at least one arithmetic module of the arithmetic models, or its situation in the arithmetic unit, is configured for a lower work cycle by scaling down its constructive size and/or by reducing a distance between the at least one arithmetic module and other components of the arithmetic unit.

    20. A control device for a vehicle, comprising: a first interface capable of being connected to at least one sensor borne by the vehicle; a second interface capable of being connected to at least one actuator of the vehicle; an artificial neural network (ANN) that is involved in processing of measurement data of the sensor to form control signals for the actuator, at least one arithmetic unit being provided for calculation of a sum of inputs of at least one neuron in the ANN, the inputs being weighted with weights of the neuron, the arithmetic unit including: a plurality of arithmetic modules, at least one of the arithmetic modules being provided to calculate individual products or individual sums of digits of the inputted numbers, the plurality of arithmetic modules being connected in an adder that is configured to calculate digits of the product or of the sum, from the individual products or from the individual sums, at least one arithmetic module that is required for the calculation of at least one individual product or individual sum, and/or is required for the propagation of this individual product or this individual sum onto the product or the sum, being absent in the arithmetic unit or being connected there in such a way that it is capable of being selectively deactivated, completely or partially, for a running time of the arithmetic unit.

    21. A method for producing and/or configuring an arithmetic unit for calculation of a sum of inputs of at least one neuron in an artificial neural network (ANN), the inputs being weighted with weights of the neuron, the arithmetic unit including: a plurality of arithmetic modules, at least one of the arithmetic modules being provided to calculate individual sums of digits of the inputted numbers, the plurality of arithmetic modules being connected in an adder that is configured to calculate digits of the sum, from the individual sums, at least one arithmetic module that is required for the calculation of at least one individual sum, and/or is required for the propagation of the individual sum onto the sum, being absent in the arithmetic unit or being connected there in such a way that it is capable of being selectively deactivated, completely or partially, for a running time of the arithmetic unit, wherein the method comprises the following steps: providing a candidate configuration of the arithmetic unit that determines which arithmetic modules are absent or are completely deactivated or partially deactivated; training the ANN bases on training data, the arithmetic unit, or a simulational representation of the arithmetic unit, behaving in a manner corresponding to the candidate configuration; ascertaining success of the training based on test data or validation data; optimizing parameters that characterize the candidate configuration with respect to at least one specified optimization goal, with a boundary condition that the success of the training fulfills a further specified condition.

    22. The method as recited in claim 21, wherein the specified optimization goal includes: a minimal number of arithmetic modules present or activated in the arithmetic unit, and/or a minimal energy consumption of the arithmetic unit, and/or a minimal space requirement of the arithmetic unit on at least one semiconductor substrate.

    23. A method for operating an artificial neural network (ANN) that is implemented with at least one arithmetic unit including: a plurality of arithmetic modules, at least one of the arithmetic modules being provided to calculate individual products or individual sums of digits of the inputted numbers, the plurality of arithmetic modules being connected in an adder that is configured to calculate digits of the product or of the sum, from the individual products or from the individual sums, at least one arithmetic module that is required for the calculation of at least one individual product or individual sum, and/or is required for the propagation of the individual product or the individual sum onto the product or the sum, being absent in the arithmetic unit or being connected there in such a way that it is capable of being selectively deactivated, completely or partially, for a running time of the arithmetic unit, wherein the method comprises the following steps: based on specific input data that are provided for processing by the ANN, ascertaining a configuration of the arithmetic unit that determines which of the arithmetic modules of the arithmetic unit are to be deactivated for the running time; completely or partially deactivating selected arithmetic modules of the arithmetic unit corresponding to the ascertained configuration; supplying the input data to the ANN for the processing with the selected arithmetic modules completely or partially deactivated.

    24. The method as recited in claim 23, wherein a measure of the resilience of the ANN to changes in the input data are ascertained based on the input data, and the configuration of the arithmetic unit is ascertained based on the measure of the resilience.

    25. The method as recited in claim 23, wherein the configuration of the arithmetic unit is retrieved based on the input data from a further artificial neural network.

    26. A non-transitory machine-readable data carrier on which is stored a computer program for operating an artificial neural network (ANN) that is implemented with at least one arithmetic unit including: a plurality of arithmetic modules, at least one of the arithmetic modules being provided to calculate individual products or individual sums of digits of the inputted numbers, the plurality of arithmetic modules being connected in an adder that is configured to calculate digits of the product or of the sum, from the individual products or from the individual sums, at least one arithmetic module that is required for the calculation of at least one individual product or individual sum, and/or is required for the propagation of the individual product or the individual sum onto the product or the sum, being absent in the arithmetic unit or being connected there in such a way that it is capable of being selectively deactivated, completely or partially, for a running time of the arithmetic unit, wherein the computer program, when executed by one or more computers, causing the one of more computers to perform the following steps: based on specific input data that are provided for processing by the ANN, ascertaining a configuration of the arithmetic unit that determines which of the arithmetic modules of the arithmetic unit are to be deactivated for the running time; completely or partially deactivating selected arithmetic modules of the arithmetic unit corresponding to the ascertained configuration; supplying the input data to the ANN for the processing with the selected arithmetic modules completely or partially deactivated.

    27. A computer configured to operate an artificial neural network (ANN) that is implemented with at least one arithmetic unit including: a plurality of arithmetic modules, at least one of the arithmetic modules being provided to calculate individual products or individual sums of digits of the inputted numbers, the plurality of arithmetic modules being connected in an adder that is configured to calculate digits of the product or of the sum, from the individual products or from the individual sums, at least one arithmetic module that is required for the calculation of at least one individual product or individual sum, and/or is required for the propagation of the individual product or the individual sum onto the product or the sum, being absent in the arithmetic unit or being connected there in such a way that it is capable of being selectively deactivated, completely or partially, for a running time of the arithmetic unit, the computer configured to: based on specific input data that are provided for processing by the ANN, ascertain a configuration of the arithmetic unit that determines which of the arithmetic modules of the arithmetic unit are to be deactivated for the running time; completely or partially deactivate selected arithmetic modules of the arithmetic unit corresponding to the ascertained configuration; supply the input data to the ANN for the processing with the selected arithmetic modules completely or partially deactivated.

    Description

    BRIEF DESCRIPTION OF THE DRAWINGS

    [0042] FIG. 1 shows an exemplary embodiment of arithmetic unit 1, according to the present invention.

    [0043] FIG. 2 shows an illustration of a multiplication carried out with arithmetic unit 1, according to the present invention.

    [0044] FIG. 3 shows a further exemplary embodiment of arithmetic unit 1, according to the present invention.

    [0045] FIG. 4 shows control device 10 for a vehicle 50 having arithmetic unit 1, according to the present invention.

    [0046] FIG. 5 shows an exemplary embodiment of method 100 for producing and/or configuring an arithmetic unit 1, according to the present invention.

    [0047] FIG. 6 shows an exemplary embodiment of method 200 for operating an ANN 13, according to the present invention.

    DETAILED DESCRIPTION OF EXAMPLE EMBODIMENTS

    [0048] FIG. 1 shows a schematic exemplary embodiment of arithmetic unit 1 that is designed to multiply a signed 8-bit number 2a by a signed 4-bit number 2b. Number 2a includes a lowest-valued digit a0, higher-valued digits a1 through a6, and the sign a7. Number 2b includes a lowest-valued digit b0, higher-valued digits b1 and b2, and the sign b3. Arithmetic unit 1 includes a multiplicity of arithmetic modules 4. These arithmetic modules 4 are subdivided into arithmetic modules 4a, which calculate the individual products of digits of numbers 2a, 2b, and arithmetic modules 4b, which calculate, from these individual products, digits 3a-3k of product 3 of numbers 2a and 2b.

    [0049] Arithmetic modules 4a are in turn subdivided into AND gate 4a1, as well as an XOR gate 4a2, which by calculation produces sign 3k of product 3 from sign a7 of number 2a and sign b3 of number 2b.

    [0050] Arithmetic modules 4b include half-adders HA and full adders FA, which are each made up of two half-adders HA.

    [0051] The example shown in FIG. 1 is based on the determination, obtained from any source, that the three lowest-valued digits 3a-3c of the product 3 of numbers 2a and 2b are not important for the further processing of this product 3. Therefore, arithmetic modules 4a, 4b within marking 4* are deactivated, or are omitted from the outset in arithmetic unit 1. The individual products a0b0, a0b1, a1b0, a0b2, a1b1, and a2b0 are then not even calculated and are not further processed. Digits 3a-3c of product 3 are correspondingly set to zero. A half-adder HA, responsible for the calculation of 3d, which otherwise would have received a carryover from the calculation of digit 3c of product 3, can also be omitted.

    [0052] In addition, arithmetic modules 4a, 4b inside markings 4** and/or 4*** can also be deactivated for the running time, as a function of the data. Deactivated arithmetic modules 4a, 4b in principle supply only 0 at all outputs. The deactivation saves additional latency time and energy in the running time, at the price that the accuracy of product 3 is worsened compared to the precise value.

    [0053] The calculation carried out with arithmetic unit 1 shown in FIG. 1 is illustrated in more detail in FIG. 2. The individual products of digits a0-a6 of number 2a and digits b0-b2 of number 2b are organized in a manner analogous to written multiplication, in such a way that they can be added to yield the digits 3a-3j of product 3. Sign 3k of product 3 is formed from sign a7 of number 2a and sign b3 of number 2b.

    [0054] FIG. 3 shows an alternative specific embodiment of arithmetic unit 1. Differing from FIG. 1, instead of AND gate 4a1 there is a multiplexer 4a3 to which digits a0-a6 of number 2a and digits b0-b2 of number 2b are supplied. A register 4a4 controls which arithmetic modules 4b in adder 5 receive the provision in each case of individual products from multiplexer 4a3.

    [0055] FIG. 4 shows the incorporation of an ANN 13 that uses arithmetic unit 1 in a control device 10 for a vehicle 50.

    [0056] Interface 11 of control device 10 is connected to sensor 51 of vehicle 50, and receives measurement data 51a that the sensor has recorded through observation of the region of acquisition 50a. Measurement data 51a are processed by ANN 13 using the compact and energy-saving arithmetic unit 1 to form a control signal 52a for an actuator 52 of vehicle 50. Control signal 52a is outputted to actuator 52 of vehicle 50 via interface 12 of control device 50, and causes this actuator 52 to intervene in the driving dynamics of vehicle 50.

    [0057] FIG. 5 shows an exemplary embodiment of method 100 for producing and/or configuring an arithmetic unit 1 as described above. In step 110, a candidate configuration 1a of arithmetic unit 1 is provided that determines which arithmetic modules 4, 4a, 4b are absent or are completely or partially deactivated. In step 120, ANN 13 is trained on the basis of training data. Here, arithmetic unit 1, which calculates weighted sums of inputs of at least one neuron in ANN 13, or a simulational representation of this arithmetic unit 1, behaves in a manner corresponding to candidate configuration 1a. The success of training 120 is ascertained in step 130 on the basis of test data, or validation data. Parameters 1a*, which characterize candidate configuration 1a, are thereupon optimized with respect to a specified optimization goal (such as saving space, hardware, or energy), under the boundary condition that the success of the training fulfills a further specified condition. On the basis of the finally trained parameters 1a*, configuration 1a for the arithmetic unit 1 to be used in the specific application can be defined.

    [0058] FIG. 6 shows an exemplary embodiment of method 200 for operating the ANN 13. In step 210, a configuration 1a of arithmetic unit 1 is ascertained on the basis of specific input data 13a that are provided for processing by the ANN 13. This configuration 1a indicates which arithmetic modules 4, 4a, 4b of arithmetic unit 1 are to be deactivated for the running time, and when.

    [0059] Corresponding to this configuration 1a, in step 220 arithmetic modules 4, 4a, 4b of arithmetic unit 1 that is used by ANN 13 are completely or partially deactivated. In this state of arithmetic unit 1, input data 13a are supplied to ANN 13 in step 230 for the processing.

    [0060] Within box 210, two example possibilities are shown as to how configuration 1a can be ascertained as a function of the data.

    [0061] According to block 211, a measure of the resilience 13b of ANN 13 against modifications of input data 13a can be ascertained on the basis of input data 13a. According to block 212, configuration 1a can then be defined on the basis of this measure of resilience 13b.

    [0062] According to block 213, configuration 1a of arithmetic unit 1 can be retrieved from a further ANN 20 on the basis of input data 13a.