Arithmetic processing device

The arithmetic processing device enhances neural network inference accuracy by dynamically adjusting quantization parameters to maintain precision and reduce processing time, addressing the challenges of sudden input changes.

JP2024126731AActive Publication Date: 2024-09-20DENSO CORP
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
JP2023035307
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-03-08
Publication Date
2024-09-20
Estimated Expiration
2043-03-08

AI Technical Summary

Technical Problem

Existing methods for dynamically quantizing neural network models face challenges in maintaining inference accuracy while avoiding increased processing time due to sudden changes in input data.

Method used

An arithmetic processing device that includes an inference processing unit, a determination processing unit, and a change processing unit to dynamically adjust quantization parameters based on output accuracy, ensuring sufficient precision and reducing processing time.

Benefits of technology

Improves inference accuracy by dynamically adjusting quantization parameters, thereby reducing processing time and load without compromising precision.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2024126731000001
    Figure 2024126731000001
Patent Text Reader

Abstract

To provide an arithmetic processing device.SOLUTION: An arithmetic processing device for making an inference using a model executing a neural network comprises: an inference processing unit (11) that inputs accepted input data into the model to perform inference processing; a determination processing unit (12) that determines whether precision of the inferred output value satisfies prescribed conditions; and a change processing unit (13) that changes the precision of arithmetic processing when the determination processing unit determines that the prescribed conditions are satisfied.SELECTED DRAWING: Figure 1
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to a processor. [Background technology]

[0002] When a model that executes a neural network is embedded in a device and executed, it is required to make the model smaller. This process of making the model smaller is known as quantization.

[0003] In a model that is quantized using input values ​​estimated in advance, the accuracy of inference may decrease when inferring from a neural network using actual data as input due to overflow or a deterioration in the S / N ratio.

[0004] One approach is to prepare several sets of expected input values ​​and create multiple quantized models in advance. However, there is no guarantee that the inference results will be appropriate for the actual input data.

[0005] Another method is to perform dynamic quantization in response to actual input data (see Patent Document 1 below). [Prior art documents] [Patent documents]

[0006] [Patent Document 1] JP 2022-117866 A Summary of the Invention [Problem to be solved by the invention]

[0007] Methods that dynamically quantize in response to input data require processing time, making it difficult to process in response to sudden changes in the input. [Means for solving the problem]

[0008] In view of the above problems, the present inventors have invented a processing device that can improve the accuracy of inference while suppressing an increase in processing time when dynamic quantization is performed in response to input data.

[0009] The present invention employs the following technical means to solve the above problems. The reference characters in the claims and in this section are merely examples showing the corresponding relationship with the specific means described in the embodiments below as one aspect, and do not limit the technical scope of the present invention.

[0010] The arithmetic processing device of the present invention is a arithmetic processing device (1) that performs inference using a model that executes a neural network, and the arithmetic processing device has an inference processing unit (11) that inputs received data into the model and executes inference processing, a judgment processing unit (12) that judges whether the accuracy of the inferred output value satisfies a predetermined condition, and a change processing unit (13) that changes the accuracy of the arithmetic processing when the judgment processing unit judges that the predetermined condition is satisfied.

[0011] By configuring as described above, even when dynamic quantization is performed, if the accuracy of the output value is insufficient, the accuracy of the calculation processing can be changed, thereby improving the accuracy of inference while suppressing an increase in processing time.

[0012] In one embodiment, the arithmetic processing device, when an abnormality is detected in the inference processing in the inference processing unit, the determination processing unit determines that the predetermined condition is satisfied.

[0013] In one embodiment, the processing device is configured such that, when an overflow or an error is detected in the inference processing in the inference processing unit, the determination processing unit determines that the predetermined condition is satisfied.

[0014] In one embodiment of the processing device, the judgment processing unit determines that the specified condition is satisfied when it determines that the output value is abnormal by comparing it with the dynamic range or variance of a predetermined number of past output values.

[0015] When the predetermined condition is satisfied in the judgment processing section, there are cases where the accuracy of the output value in the inference processing is not sufficient. In such cases, it is advisable to carry out the processing of each of the above-mentioned inventions.

[0016] In one embodiment, the change processing unit changes the accuracy of the calculation process by changing a quantization parameter.

[0017] In one embodiment of the processing device, the inference processing unit performs inference processing using layers of multiple calculation accuracy, and the change processing unit uses an output value of a layer with a higher calculation accuracy than the output value of a layer with a calculation accuracy that the judgment processing unit has determined to satisfy the specified condition.

[0018] When the calculation precision is to be changed, it is advisable to carry out the processing of each of the above-mentioned inventions.

[0019] In one embodiment of the processing device, when the inference processing unit determines in the judgment processing unit that the accuracy of the inferred output value does not satisfy a specified condition, the inference processing unit stops inference processing of layers with other calculation accuracy.

[0020] In a layer with high calculation accuracy, the processing takes time. Therefore, when it is determined that the accuracy of the output value does not satisfy a predetermined condition, that is, the accuracy of the output value is sufficient, the processing time can be shortened and the processing load can be reduced by stopping the processing of other calculation accuracy.

[0021] The control method of the arithmetic processing device of the present invention can be performed as follows: That is, in the control method for a arithmetic processing device that performs inference using a model that executes a neural network, the arithmetic processing device inputs received data to the model to execute an inference process, determines whether the accuracy of the inferred output value satisfies a predetermined condition, and changes the accuracy of the arithmetic process when it is determined in the determination that the predetermined condition is satisfied. Effect of the Invention

[0022] By using the arithmetic processing device of the present invention, when dynamic quantization is performed in response to input data, it is possible to improve the accuracy of inference while suppressing an increase in inference time. [Brief description of the drawings]

[0023] [Figure 1] FIG. 1 is a block diagram illustrating an example of a configuration of a processor according to the present invention. [Diagram 2] 4 is a flowchart showing an example of the overall processing process of the processor of the present invention. [Diagram 3] FIG. 2 is a diagram illustrating the process of the processor of the first embodiment. [Figure 4] FIG. 11 is a diagram illustrating the process of the arithmetic processing device of the second embodiment. [Diagram 5] FIG. 11 is a diagram illustrating the process of the arithmetic processing device of the third embodiment. [Figure 6] FIG. 11 is a diagram illustrating the process of the arithmetic processing device of the fourth embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0024] An example of the configuration of each function of a processing device 1 of the present invention is shown typically in the block diagram of Figure 1. The processing device 1 of the present invention is a processing device that performs inference using a model that executes a neural network (hereinafter simply referred to as "model"), and has an input reception processing unit 10, an inference processing unit 11, a judgment processing unit 12, a change processing unit 13, and an output processing unit 14.

[0025] The input reception processing unit 10 receives input of data to be input into the model.

[0026] The inference processing unit 11 inputs the data received by the input reception processing unit 10 into the model and executes inference processing. The inference processing using the model can use known inference processing of a neural network.

[0027] The judgment processing unit 12 judges whether the accuracy of the output value inferred in the inference processing in the inference processing unit 11 satisfies a predetermined condition, that is, judges that the accuracy of the output value is not sufficient.

[0028] For example, when a predetermined abnormality such as an overflow or an error is detected in the inference process of the arithmetic processing device 1, it is determined that the accuracy of the output value is not sufficient.

[0029] In addition, if the accuracy of the output value inferred by the inference processing in the inference processing unit 11 is biased when compared with the dynamic range, variance, etc. based on the past N output values, it is determined that the accuracy of the output value is not sufficient.

[0030] When the determination processing unit 12 determines that the precision of the output value in the inference processing unit 11 satisfies a predetermined condition, i.e., that the precision of the output value is not sufficient, the change processing unit 13 changes the precision of the calculation process, such as changing the quantization parameter or the calculation precision, and causes the inference processing unit 11 to execute the inference processing again. In this case, instead of causing the inference processing unit 11 to execute the inference processing again, the inference processing may be executed using the changed quantization parameter and calculation precision from the next input data.

[0031] The output processing unit 14 outputs the output value of the inference processing in the inference processing unit 11. EXAMPLES

[0032] Next, an example of processing when performing inference using a model by the arithmetic processing device 1 of the present invention will be described with reference to the flowchart of Fig. 2. In this embodiment, when the determination processing unit 12 detects a predetermined abnormality such as an overflow or an error in the processing of the arithmetic processing device 1, it is determined that the accuracy of the output value is not sufficient, and the quantization parameter is changed as the accuracy change processing in the change processing unit 13. The processing in this case is shown diagrammatically in Fig. 3.

[0033] The input reception processing unit 10 of the arithmetic processing device 1 receives input of data to be input to the model from outside the arithmetic processing device 1 using a predetermined method (S100).

[0034] Then, the inference processing unit 11 executes inference processing using the model based on the data received as input in S100 (S110).

[0035] The judgment processing unit 12 judges whether an abnormality such as an overflow or an error can be detected in the inference processing in the inference processing unit 11 (S120), and if no abnormality is detected (S130), the output processing unit 14 outputs the output value in the inference processing unit 11 as is (S160).

[0036] On the other hand, if the judgment processing unit 12 detects an abnormality such as an overflow or an error in the inference processing in the inference processing unit 11 (S130), the change processing unit 13 changes the quantization parameter by a known method (S140) and executes the inference processing in the inference processing unit 11 again (S150). Then, the output processing unit 14 outputs the output value of the inference processing in the inference processing unit 11 (S160). Note that if the judgment processing unit 12 detects an overflow or an error again in the re-execution of the inference processing in the inference processing unit 11, the quantization parameter may be further changed. EXAMPLES

[0037] In this embodiment, the past N-1 output values ​​from the inference processing unit 11 are recorded, and the dynamic range and variance based on the N-1 output values ​​are calculated in advance. A case will be described in which it is determined that the accuracy is insufficient when the Nth output value from the inference processing unit 11 and the predetermined conditions for the dynamic range and variance are not satisfied. The process in this case is shown in FIG.

[0038] The input reception processing unit 10 of the arithmetic processing device 1 receives input of data to be input to the model from outside the arithmetic processing device 1 using a predetermined method (S100).

[0039] Then, the inference processing unit 11 executes an inference process using the model based on the data (N-th input data) received in S100 (S110).

[0040] The determination processing unit 12 compares the dynamic range and variance based on the N-1 output values ​​with the Nth input data, and determines whether the accuracy is sufficient, for example, if there is a bias (S120).

[0041] When the judgment processing unit 12 judges that the accuracy is sufficient (S130), the output value of the inference processing in the inference processing unit 11 is output by the output processing unit 14 (S160). In addition, the output value is stored in a predetermined storage device, and the dynamic range and variance are newly calculated.

[0042] On the other hand, if the determination processing unit 12 determines that the accuracy is not sufficient (S130), the change processing unit 13 changes the quantization parameter by a known method (S140) and executes the inference processing in the inference processing unit 11 again (S150). Then, the output processing unit 14 outputs the output value of the inference processing in the inference processing unit 11 (S160). Note that, if the determination processing unit 12 determines that a predetermined condition is satisfied in the re-inference processing in the inference processing unit 11, the quantization parameter may be further changed. EXAMPLES

[0043] In this embodiment, a case will be described in which, when the determination processing unit 12 detects a predetermined abnormality such as an overflow or an error in the processing of the calculation processing device 1, it is determined that the accuracy of the output value satisfies a predetermined condition, and the calculation accuracy is changed as the accuracy change processing in the change processing unit 13. The processing in this case is shown in FIG.

[0044] The input reception processing unit 10 of the arithmetic processing device 1 receives input of data to be input to the model from outside the arithmetic processing device 1 using a predetermined method (S100).

[0045] Then, the inference processing unit 11 executes inference processing using the model based on the data received in S100 (S110). At this time, the inference processing is executed in layers with multiple calculation precisions. For example, the same input data is input to layers with multiple calculation precisions such as 8 bits, 16 bits, and 24 bits, and the inference processing is executed in parallel.

[0046] Then, in the order in which the output results of the inference processing by each layer are obtained, the judgment processing unit 12 executes judgment processing one by one to judge whether an abnormality such as an overflow or an error can be detected (S120), and if no abnormality is detected (S130), the output value of the inference processing unit 11 is output as is by the output processing unit 14 (S160). At this time, inference processing of other calculation precisions may be terminated midway.

[0047] On the other hand, if the judgment processing unit 12 detects an abnormality such as an overflow or an error (S130), the change processing unit 13 does not use the output value of the inference processing with the calculation accuracy in which the abnormality was detected, and the output processing unit 14 outputs the output value of the inference processing unit 11 with a higher calculation accuracy (S160).

[0048] For example, when inference processing is performed using layers with multiple calculation precisions such as 8 bits, 16 bits, and 24 bits, the layer with the lower calculation precision finishes the inference processing first, so when the 8-bit inference processing is completed, the determination processing unit 12 determines whether an abnormality such as an overflow or an error has been detected. If no abnormality is detected, the output processing unit 14 outputs the output value of the inference processing with 8-bit calculation precision. Then, even if the inference processing with the 16-bit, 24-bit, or other calculation precision has not been completed, the calculation processing is completed.

[0049] On the other hand, if the judgment processing unit 12 determines that an abnormality such as an overflow or error has been detected in the 8-bit inference processing, the output value of the 8-bit inference processing is not used, and the output value that was output earlier among the output values ​​of the 16-bit or 24-bit inference processing, and in which no abnormality was detected by the judgment processing unit 12, is output from the output processing unit 14. EXAMPLES

[0050] In this embodiment, the past N-1 output values ​​from the inference processing unit 11 are recorded, and the dynamic range and variance based on the N-1 output values ​​are calculated in advance. If the Nth output value from the inference processing unit 11 does not satisfy the predetermined conditions of the dynamic range and variance, it is determined that the accuracy is insufficient, and the calculation accuracy is changed as the accuracy change process in the change processing unit 13. The process in this case is shown in FIG. 6.

[0051] The input reception processing unit 10 of the arithmetic processing device 1 receives input of data to be input to the model from outside the arithmetic processing device 1 using a predetermined method (S100).

[0052] Then, the inference processing unit 11 executes inference processing using the model based on the data (Nth input data) received in S100 (S110). At this time, the inference processing is executed in layers with multiple calculation precisions. For example, the same input data is input to layers with multiple calculation precisions such as 8 bits, 16 bits, and 24 bits, and the inference processing is executed in parallel.

[0053] Then, in the order in which the output results of the inference processing by each layer are obtained, the judgment processing unit 12 executes judgment processing sequentially, and compares the dynamic range and variance based on the output values ​​of N-1 times with the Nth input data to judge whether the accuracy is sufficient in cases where bias has occurred (S120).

[0054] When the judgment processing unit 12 judges that the accuracy is sufficient (S130), the output processing unit 14 outputs the output value of the inference processing in the inference processing unit 11 with the calculation accuracy at which the calculation processing was completed the earliest (usually the calculation processing with the lowest calculation accuracy) (S160). The output value is stored in a predetermined storage device, and the dynamic range and variance are newly calculated. At this time, the inference processing with the other calculation accuracy may be terminated midway.

[0055] On the other hand, if the judgment processing unit 12 judges that the accuracy is insufficient (S130), the change processing unit 13 does not use the output value of the inference processing with that calculation accuracy, and the output processing unit 14 outputs the output value of the inference processing unit 11 with a higher calculation accuracy (S160).

[0056] For example, when inference processing is performed using layers with multiple calculation precisions such as 8 bits, 16 bits, and 24 bits, the inference processing with the lower calculation precision is completed first, so when the 8-bit inference processing is completed first, the determination processing unit 12 compares the dynamic range and variance based on the N-1 output values ​​with the Nth input data to determine whether the precision is sufficient in the case of bias, etc. Then, if it is determined that the precision is sufficient, the output processing unit 14 outputs the output value of the inference processing with 8-bit calculation precision. Then, even if the inference processing with 16-bit, 24-bit, etc. calculation precision has not been completed, the calculation processing is completed.

[0057] On the other hand, if the judgment processing unit 12 judges that the accuracy of the 8-bit inference processing is insufficient, the output value of the 8-bit inference processing is not used, and the output value of the 16-bit or 24-bit inference processing that was output earlier and for which no abnormality was detected by the judgment processing unit 12 is output from the output processing unit 14. EXAMPLES

[0058] The processing may be executed by combining the above-described first to fourth embodiments.

[0059] The arithmetic processing device 1 of the present invention is not limited to the scope described in this specification, and can be arbitrarily modified within the scope of the technical concept. The order of each process can also be arbitrarily modified within the scope of the technical concept. [Industrial Applicability]

[0060] By using the arithmetic processing device 1 of the present invention, when quantization is performed dynamically in response to input data, it is possible to improve the accuracy of inference while suppressing an increase in inference time. [Explanation of symbols]

[0061] 1: arithmetic processing device, 10: input reception processing unit, 11: inference processing unit, 12: judgment processing unit, 13: change processing section, 14: output processing section

Claims

1. A processing device (1) for performing inference using a model implementing a neural network, comprising: The arithmetic processing device includes: an inference processing unit (11) that inputs the received input data into the model and executes inference processing; A determination processing unit (12) that determines whether the accuracy of the inferred output value satisfies a predetermined condition; a change processing unit (13) that changes the accuracy of the calculation processing when it is determined in the determination processing unit that a predetermined condition is satisfied; A processing device having:

2. The determination processing unit: When an abnormality is detected in the inference processing in the inference processing unit, it is determined that the predetermined condition is satisfied. The processor according to claim 1 .

3. The determination processing unit: When an overflow or an error is detected in the inference processing in the inference processing unit, it is determined that the predetermined condition is satisfied. The processor according to claim 2 .

4. The determination processing unit: if it is determined that the output value is abnormal by comparing it with the dynamic range or variance of a predetermined number of past output values, it is determined that the predetermined condition is satisfied; The processor according to claim 1 .

5. The change processing unit: changing the quantization parameter to change the accuracy of the calculation process; The processor according to claim 1 .

6. The inference processing unit: Inference processing is performed using multiple layers of computational precision. The change processing unit: using an output value of a layer with a higher calculation accuracy than an output value of a layer with a calculation accuracy determined by the determination processing unit to satisfy the predetermined condition; The processor according to claim 1 .

7. The inference processing unit: When the determination processing unit determines that the accuracy of the inferred output value does not satisfy a predetermined condition, the inference processing of the layers having other calculation accuracy is stopped. The processor according to claim 6.

8. A control method for a processor that performs inference using a model that executes a neural network, comprising: The arithmetic processing device includes: The received input data is input to the model to execute an inference process; determining whether the accuracy of the inferred output value satisfies a predetermined condition; changing the accuracy of the calculation process when it is determined that the predetermined condition is satisfied in the determination; A method for controlling a processor.

Citation Information

Patent Citations

  • Method and device for quantizing parameter of neural network

    JP2020064635A

  • Information processing program, method for processing information, and information processor

    JP2023003333A

  • Adaptive quantization for execution of machine learning models

    US20210279635A1

  • Neural network generation apparatus, neural network computing apparatus, edge device, neural network control method, and software generation program

    JP2022117866A