Quantization program, quantization method, and quantization device
The quantization program optimizes neural network layers by calculating differences and updating confidence radii efficiently, addressing the inefficiencies of conventional methods to reduce execution and training times.
Patent Information
- Application Number
- JP2020200353
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2020-12-02
- Publication Date
- 2024-09-26
- Estimated Expiration
- 2040-12-02
AI Technical Summary
Conventional quantization methods require a large number of iterations to converge bit widths, leading to increased execution time and training time for neural networks, as they often repeat determinations on overlapping bit width combinations.
A quantization program that calculates a difference between a quantization error and a confidence radius threshold, sets a bit width one step narrower than tentatively calculated, and updates the confidence radius using the smallest scaling coefficient to efficiently optimize all layers in a short time.
All layers can be optimized efficiently within a limited period, reducing calculation time and cost, and improving the degree of quantization, thereby shortening the training time of neural networks.
Smart Images

Figure 0007556276000007 
Figure 0007556276000009 
Figure 0007556276000010
Abstract
Description
[Technical field]
[0001] The present invention relates to a quantization program, a quantization method, and a quantization device. [Background technology]
[0002] Quantization is known as a method to reduce the execution time of neural networks (NNs), which tend to become increasingly complex.
[0003] Quantization reduces calculation and communication times by converting the weight data type used in neural networks (e.g., FP32) into a smaller data type (INT8). Furthermore, as a conventional quantization method, an optimization algorithm is known that automatically sets a data type for each layer that does not degrade the recognition rate.
[0004] In such a conventional optimization algorithm, the quantization error of the quantization target vector is compared with a threshold determined by the algorithm using the trust region method, and the bit width is provisionally calculated according to the comparison result. In the trust region method, the threshold is scaled to be less than the trust radius to prevent errors in bit width determination due to approximation errors. Then, multiple iterations of training are performed with the provisionally calculated bit width settings, and the evaluation function is calculated.
[0005] Furthermore, the bit width and the trust radius are updated depending on whether or not the constraint that the loss function calculated using the provisionally calculated bit width is equal to or smaller than the loss function calculated under ideal conditions (ideal loss function) is satisfied.
[0006] That is, if the calculated loss function is equal to or smaller than the ideal loss function, the bit width is updated using the provisionally calculated bit width value, and the current trust radius is multiplied by the constant a to increase the trust radius. Note that the constant a here is a value greater than 1 (a > 1). On the other hand, if the calculated loss function is greater than the ideal loss function, the bit width value is maintained, the provisionally calculated bit width value is discarded, and the current trust radius is multiplied by the constant a to decrease the trust radius. Note that the constant a here is a value less than 1 (a < 1). In the quantization algorithm, these processes are repeatedly performed a predefined number of times for all layers to be quantized. [Prior art documents] [Patent documents]
[0007] [Patent Document 1] International Publication No. 2020 / 049681 [Patent Document 2] JP 2020-9048 A Summary of the Invention [Problem to be solved by the invention]
[0008] In such conventional quantization methods, the bit width can be reliably converged by increasing the number of iterations. However, increasing the number of iterations increases the execution time. On the other hand, if the period available for optimization is limited, the bit width may not be sufficiently quantized within that period. As a result of insufficient quantization, the training time of the neural network also increases. In one aspect, the present invention has an object to enable optimization of all layers in a short period of time. [Means for solving the problem]
[0009] For this reason, this quantization program causes a processor of an information processing device that quantizes the data to be quantized to execute a process of calculating the difference between the quantization error of a bit width one step narrower than the provisionally calculated bit width and a confidence radius threshold for all layers constituting a neural network, calculating scaling coefficients for all the layers based on the difference, and updating the confidence radius using the smallest value of all the scaling coefficients. Effect of the Invention
[0010] According to one embodiment, all layers can be optimized in a short time. [Brief description of the drawings]
[0011] [Figure 1] FIG. 1 is a diagram illustrating a hardware configuration of an information processing apparatus according to an embodiment; [Diagram 2] FIG. 1 is a diagram illustrating an example of a functional configuration of a computer system according to an embodiment. [Diagram 3] FIG. 1 is a diagram illustrating an overview of a neural network. [Figure 4] 1 is a diagram illustrating an example of a vector to be quantized in an information processing device as an example of an embodiment; [Diagram 5] 1 is a diagram illustrating a difference calculated by a difference calculation unit of an information processing device as an example of an embodiment; [Figure 6] 1 is a diagram illustrating a difference calculated by a difference calculation unit of an information processing device as an example of an embodiment; [Figure 7] 1 is a diagram illustrating a relationship between a quantization error and a threshold value in an information processing device as an example of an embodiment. [Figure 8] 1 is a diagram illustrating a relationship between a quantization error and a threshold value in an information processing device as an example of an embodiment. [Figure 9] 1 is a flowchart illustrating a quantization process in an information processing device as an example of an embodiment. [Figure 10]1 is a flowchart illustrating a quantization process in an information processing device as an example of an embodiment. [Figure 11] 1 is a diagram illustrating a result of quantization performed by an information processing device as an example of an embodiment; [Figure 12] 1 is a diagram illustrating a result of quantization performed by an information processing device as an example of an embodiment; DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0012] Hereinafter, the embodiments of the present quantization program, quantization method, and quantization device will be described with reference to the drawings. However, the embodiments shown below are merely examples, and are not intended to exclude the application of various modified examples and techniques not explicitly stated in the embodiments. In other words, the present embodiment can be implemented with various modifications within the scope of the gist of the embodiment. Furthermore, each figure does not intend to include only the components shown in the figure, but can include other functions, etc.
[0013] (A) Configuration FIG. 1 is a diagram illustrating a hardware configuration of an information processing device 1 as an example of an embodiment.
[0014] The information processing device 1 is a computer that realizes a quantized neural network. As shown in Fig. 1, the information processing device 1 includes a CPU (Central Processing Unit) 10, a memory 11, and an accelerator 12. The CPU 10, the memory 11, and the accelerator 12 are connected to each other so as to be able to communicate with each other via a communication bus 13. The communication bus 13 performs data communication within the information processing device 1.
[0015] The memory 11 is a storage memory including a ROM (Read Only Memory) and a RAM (Random Access Memory). A software program related to the quantization process and data for this program are written in the ROM of the memory 11. The software program on the memory 11 is appropriately read and executed by the CPU 10. The RAM of the memory 11 is used as a primary storage memory or a working memory. The RAM of the memory 11 also stores parameters used for quantization such as weights, various thresholds, and the like. The accelerator 12 executes arithmetic operations necessary for neural network calculations, such as matrix operations.
[0016] The CPU 10 is a processing device (processor) that performs various controls and calculations, and controls the entire information processing device 1 based on an implemented program. The CPU 10 executes a deep learning processing program (not shown) stored in the memory 11 or the like, thereby realizing the function of a deep learning processing unit 100 (FIG. 2) described later.
[0017] The deep learning processing program may be configured to include a quantization program. The CPU 10 executes a quantization program (not shown) stored in the memory 11 or the like to realize a function as a quantization processing unit 101 (FIG. 2) described later.
[0018] The CPU 10 of the information processing device 1 executes the deep learning processing program (quantization program) to function as a deep learning processing unit 100 (quantization processing unit 101).
[0019] The program (quantization program) for realizing the function of the deep learning processing unit 100 (quantization processing unit 101) is provided in a form recorded on a computer-readable recording medium, such as a flexible disk, CD (CD-ROM, CD-R, CD-RW, etc.), DVD (DVD-ROM, DVD-RAM, DVD-R, DVD+R, DVD-RW, DVD+RW, HD DVD, etc.), Blu-ray disk, magnetic disk, optical disk, magneto-optical disk, etc. Then, the computer (information processing device 1) reads the program from the recording medium, transfers it to an internal storage device or an external storage device, stores it, and uses it. In addition, the program may be recorded in a storage device (recording medium), such as a magnetic disk, optical disk, magneto-optical disk, etc., and provided to the computer from the storage device via a communication path.
[0020] When the function of the deep learning processing unit 100 (quantization processing unit 101) is realized, a program stored in an internal storage device (RAM or ROM of memory 11 in this embodiment) is executed by a microprocessor of a computer (CPU 10 in this embodiment). At this time, the computer may read and execute a program recorded on a recording medium.
[0021] FIG. 2 is a diagram illustrating a functional configuration of an information processing device 1 as an example of an embodiment.
[0022] 2, the information processing device 1 has a function as a deep learning processing unit 100. The deep learning processing unit 100 performs deep learning in a neural network.
[0023] The neural network may be a hardware circuit, or may be a virtual network using software that connects layers virtually constructed on a computer program by the CPU 10 or the like.
[0024] An overview of a neural network is shown in Figure 3. The neural network shown in Figure 3 is a deep neural network that includes multiple hidden layers between the input layer and the output layer. For example, the hidden layers are convolutional layers, pooling layers, fully connected layers, etc. The circles shown in each layer indicate nodes that perform a given calculation.
[0025] A neural network inputs input data such as images and sounds into an input layer, and sequentially executes predetermined calculations in a hidden layer composed of a convolution layer, a pooling layer, and the like, thereby executing forward processing (forward propagation processing) to sequentially transmit information obtained by the calculation from the input side to the output side. After the forward processing is executed, a backward processing (backpropagation processing) is executed to determine parameters to be used in the forward processing in order to reduce the value of an error function obtained from the output data output from the output layer and the correct answer data. Then, an update processing is executed to update variables such as weights based on the results of the backpropagation processing. For example, a gradient descent method is used as an algorithm to determine the update width of the weights used in the calculation of the backpropagation processing.
[0026] The deep learning processing unit 100 includes a quantization processing unit 101. The quantization processing unit 101 quantizes variables used in the neural network. In the present information processing device 1, the quantization processing unit 101 realizes quantization by narrowing the bit width of the weight vector in each layer. In addition, the present information processing device 1 uses a trust region method.
[0027] As shown in FIG. 2, the quantization processing unit 101 includes functions as a quantization error calculation unit 106, a threshold generation unit 107, a bit width setting unit 102, a difference calculation unit 103, a scaling coefficient calculation unit 104, and a confidence radius update unit 105.
[0028] The quantization error calculation unit 106 calculates the quantization error of the vector used in the calculation of the neural network. Note that the calculation of the quantization error can be realized by various known methods, and the description thereof will be omitted. FIG. 4 is a diagram illustrating vectors to be quantized in the information processing device 1 as one example of the embodiment. In the present information processing device 1, an example is shown in which the weight vector W1 of layer 1 and the weight vector W2 of layer 2 shown in FIG. 4 are to be quantized.
[0029] The threshold generating unit 107 generates a trust radius threshold based on the set trust radius and bit width. Hereinafter, the trust radius threshold may be simply referred to as a threshold. For example, the threshold generating unit 107 calculates the loss and gradient with the set bit width, and calculates the trust radius threshold based on the following derivation formula (1).
[0030]
number
[0031] In the above formula (1), Δw is the quantization error. L(w+Δw) is the loss function of the base quantized model (e.g., INT16). L(w) is the loss function of the base model (e.g., INT32). L ideal is, for example, the loss function (ideal loss function) calculated without quantization using FP32. margin is the ideal loss function L(w+Δw) of the quantized model loss function L(w+Δw) set by the designer. ideal This is the margin amount of the loss function from
[0032] The loss function L(w+Δw) when quantized is expanded by Taylor. Also, even after quantization, the loss function remains at the ideal value L ideal (FP32 loss function) with margin L margin There is a constraint that the sum of By rearranging the above formula (1) with respect to the quantization error, an upper limit (threshold) of the quantization error that satisfies the constraint conditions is derived.
[0033] The threshold generation unit 107 calculates the L2 norm (|| Q thSet (scale) the threshold so that ||2) is equal to or smaller than the trust radius. In the following, the threshold is denoted by Q th It may be expressed as: The bit width setting unit 102 sets the bit width of the weight vector in each layer. The bit width setting unit 102 calculates a loss function (ideal loss function) L ideal Calculate.
[0034] The bit width setting unit 102 performs a provisional calculation of the bit width. The bit width setting unit 102 provisionally calculates the minimum bit width among a plurality of bit width candidates that makes the quantization error equal to or smaller than the calculated threshold value. In the present information processing device 1, three types (three stages) of bit widths [8, 16, 32] are used as bit width candidates.
[0035] Then, the bit width setting unit 102 checks whether the provisionally calculated bit width satisfies the constraint condition. The bit width setting unit 102 checks whether the provisionally calculated bit width satisfies the constraint condition. tmp ) is the ideal loss function (L ideal ) or less.
[0036] Loss function (L tmp ) is the ideal loss function (L ideal ), that is, if the constraint condition is satisfied, the bit width setting unit 102 sets the provisionally calculated bit width as the bit width. Also, if the constraint condition is satisfied, the bit width setting unit 102 increases the trust radius by multiplying the current trust radius by a constant (a value greater than 1).
[0037] On the other hand, the loss function (L tmp ) is the ideal loss function (L ideal ), i.e., if the constraint is not satisfied, the bit width value is maintained, the provisionally calculated bit width value is discarded, and the current trust radius is decreased by multiplying it by a constant (a value smaller than 1).
[0038] The difference calculation unit 103 calculates the quantization error and the confidence radius threshold (Q th ) and the difference (Q diff ) is measured.
[0039] 5 and 6 are diagrams illustrating the difference (Q diff 5 is a diagram illustrating the quantization error of a weight vector W1 of layer 1, and FIG. 6 is a diagram illustrating the quantization error of a weight vector W2 of layer 2.
[0040] In the example shown in FIG. 5, the provisionally calculated bit width is assumed to be 16 bits. Also, the threshold value of layer 1 is expressed as code Q th,1 and the difference of layer 1 is denoted by Q diff,1 In addition, the threshold and difference in each layer are generalized, and the threshold of layer k is represented by Q th,k and the difference of layer k is denoted by Q diff,k It may also be expressed as:
[0041] The difference calculation unit 103 calculates the quantization error (see symbol P1) of a bit width 8 (8 bits) which is one step narrower than the provisionally calculated bit width 16 (16 bits) and a threshold value 1 (Q th,1 ) and the difference Q diff,1 (See symbol P2) is measured (calculated).
[0042] In the example shown in FIG. 6, the provisionally calculated bit width is assumed to be 32 bits. Also, the threshold value of layer 2 is represented by the code Q th,2 and the difference in layer 2 is denoted by Q diff,2 It is expressed as:
[0043] The difference calculation unit 103 calculates the quantization error (see symbol P3) of a bit width 16 (16 bits) which is one step narrower than the provisionally calculated bit width 32 (32 bits) and the threshold value 2 (Q th,2 ) and the difference Q diff,2 (See symbol P4) is measured (calculated).
[0044] The scaling coefficient calculation unit 104 calculates a scaling coefficient (Q scale ) is calculated. Scaling factor (Q scale ) is the difference (Q diff ) is a coefficient value used for multiplication by the trust radius update unit 105 described later.
[0045] The scaling coefficient calculation unit 104 calculates the difference (Q diff ), and threshold (Q th ) to obtain the scaling factor Q scale Calculate The scaling coefficient calculation unit 104 calculates a scaling coefficient (Q scale ) is calculated. Q scale, k = 1 + Q diff,k / Q th,k (2)
[0046] In the above formula (2), the scaling coefficient is generalized, and k represents the layer number. Formula (2) shows the scaling coefficient for which the next confidence radius, i.e., the upper limit of the threshold, coincides with the quantization error of a bit width one step narrower than the bit width provisionally calculated this time. From the above formula (2), the scaling coefficient of layer 1 is expressed by the following formula (3). Q scale,1 = 1 + Q diff,1 / Q th,1 (3) Furthermore, from the above formula (2), the scaling coefficient of layer 2 is expressed by the following formula (4). Q scale,2 = 1 + Q diff,2 / Q th,2 (4) The difference between the quantization error of the bit width one bit narrower than the provisionally calculated bit width and the threshold (Q diff ) is not included, there is no scaling factor.
[0047] Furthermore, the scaling coefficient calculation unit 104 determines the smallest value of all the scaling coefficients calculated for each layer as the minimum scaling coefficient (Q scale,min ) as the
[0048] If the scaling coefficient makes the next threshold too large, a combination of bit widths that makes it difficult to satisfy the constraint condition, such as "bit width = 8 bits in all layers," may be calculated. Therefore, in the information processing device 1, the smallest scaling coefficient is selected to gradually change the bit width. Minimum Scaling Factor (Q scale,min ) is expressed by the following equation (5). Q scale,min = min(Q scale,1 ,Q scale,2 ) ···(5) The trust radius update unit 105 updates the trust radius. The trust radius update unit 105 updates the trust radius using the following equation (6). Next trust radius = current trust radius × max(constant a, Q scale,min ) · · · (6)
[0049] Here, the constant a is a predetermined constant (constant for updating the trust radius) used to increase or decrease the trust radius in the conventional method. The trust radius update unit 105 calculates the trust radius update constant a (hereinafter, sometimes simply referred to as constant a) and a scaling coefficient (Q scale,min ) and update the trust radius using the larger value.
[0050] Q scale,min The difference (Q diff ), so Q scale,minIf you choose a different bit width next time, a different bit width will be calculated. Therefore, if "constant a > Q scale,min ", even if the constant a is selected, a different bit width will be calculated next time.
[0051] 7 and 8 are diagrams illustrating the relationship between the quantization error and the threshold value in the information processing device 1 as one example of the embodiment. Fig. 7 is a diagram illustrating the quantization error of the weight vector W1 of the layer 1, and Fig. 8 is a diagram illustrating the quantization error of the weight vector W2 of the layer 2.
[0052] 7 and 8, the upper side shows the state before the trust radius is updated, and the lower side shows the state after the trust radius is updated. In the examples shown in these FIGS. 7 and 8, Q scale,min Q scale,2 This shows the case where the confidence radius is Q scale,2 Here is an updated example using
[0053] In layer 1 shown in Fig. 7, the provisionally calculated bit width was 16 bits, but the trust radius was Q scale,2 In this example, even after updating using the threshold Q, the next bit width selected remains 16 bits. th,k If it is greater than , no bit width update is performed.
[0054] On the other hand, in layer 2 shown in Fig. 8, the provisionally calculated bit width was 32 bits, but the trust radius was Q scale,2 After updating using, the next trust radius = upper limit of the threshold is equal to the quantization error by the vector. This means that the next bit width selected is 16 bits, indicating that a different bit width has been selected from the previous one.
[0055] (B) Operation The quantization process in the information processing device 1 as one example of the embodiment configured as described above will be described with reference to the flowcharts (steps S1 to S17) shown in Figures 9 and 10. Figure 9 shows steps S1 to S6, and Figure 10 shows steps S7 to S17.
[0056] 9, the quantization processing unit 101 executes an initialization process. For example, the quantization processing unit 101 sets an initial value of a bit width and calculates an ideal loss function (target value).
[0057] In step S2 of FIG. 9, the threshold generation unit 107 calculates the threshold Q th The threshold generator 107 calculates a threshold value with the set bit width. At this time, the threshold generator 107 calculates a threshold value Q th Set a threshold so that the L2 norm of is less than or equal to the trust radius.
[0058] In step S3 of FIG. 9, the threshold generation unit 107 calculates a threshold Q th Check whether the L2 norm of is less than the confidence radius and set the threshold Q th If the L2 norm of is equal to or smaller than the trust radius (see the YES route of step S3), the process proceeds to step S5 in FIG. On the other hand, the threshold Q th If the L2 norm of is greater than the trust radius (see NO route of step S3), the process proceeds to step S4. In step S4 of FIG. 9, the threshold generation unit 107 sets a threshold Q th The threshold is scaled so that the L2 norm of becomes the trust radius. Then, the process proceeds to step S5.
[0059] In step S5, the bit width setting unit 102 provisionally calculates a bit width. The bit width setting unit 102 provisionally calculates the smallest bit width among a plurality of bit width candidates that results in a quantization error equal to or smaller than the calculated threshold value.
[0060] In step S6 of FIG. 9, the bit width setting unit 102 checks whether the provisionally calculated bit width satisfies the constraint condition. The bit width setting unit 102 checks whether the provisionally calculated bit width satisfies the constraint condition. tmp ) is the ideal loss function (L ideal ) or less (step S7 in FIG. 10).
[0061] Loss function (Ltmp ) is the ideal loss function (L ideal ), that is, if the constraint condition is satisfied (see the YES route in step S7), the bit width setting unit 102 sets the provisionally calculated bit width as the bit width (step S8 in FIG. 10). Setting the bit width can be said to be determining the bit width.
[0062] In step S9 of FIG. 10, the difference calculation unit 103 calculates the quantization error and the threshold (Q th ) and the difference (Q diff ) is measured.
[0063] In step S10 of FIG. 10, the scaling coefficient calculation unit 104 calculates a scaling coefficient (Q scale ) is calculated.
[0064] In step S11 of FIG. 10, the scaling coefficient calculation unit 104 calculates the smallest scaling coefficient (Q scale,min ) and output it.
[0065] 10, the trust radius update unit 105 updates (increases) the trust radius by using the minimum scaling coefficient (5) described above. Then, the process proceeds to step S15.
[0066] On the other hand, as a result of the check in step S7, the loss function (L tmp ) is the ideal loss function (L ideal ), that is, if the constraint is not satisfied (see the NO route from step S7), the process proceeds to step S13 in FIG. In step S13, the bit width setting unit 102 maintains the value of the bit width and discards the provisionally calculated value of the bit width. In step S14 of FIG. 10, the bit width setting unit 102 multiplies the current trust radius by a constant a (a is a value less than 1) to decrease the trust radius.
[0067] The quantization processing unit 101 repeats the process of steps S2 to S14 (bit width determination process) until a convergence condition is satisfied (step S15 in FIG. 10). That is, the quantization processing unit 101 counts the number of times the process of steps S2 to S14 is executed (the number of determinations), and checks whether the number of determinations has reached a predetermined number (step S16 in FIG. 10).
[0068] As a result of the check, if the number of determinations has not reached the specified number (see NO route from step S16), the process returns to step S2 in FIG. 9. On the other hand, if the number of determinations has reached the specified number (see YES route from step S16), the quantization processing unit 101 outputs the determined bit width in step S17 in FIG. 10. The quantization processing unit 101 may store the determined bit width for each layer in a predetermined storage area such as the memory 12 or a storage device (not shown). The quantization processing unit 101 performs quantization with the bit width determined for each layer. Then, the process ends.
[0069] (C) Effects In this way, according to the information processing device 1 as an example of the embodiment, the difference calculation unit 103 calculates the quantization error and the threshold (Q th ) and the difference (Q diff ) is measured.
[0070] In addition, the scaling coefficient calculation unit 104 calculates a scaling coefficient (Q scale ) is calculated, and the smallest value of all the scaling coefficients calculated for each layer is called the minimum scaling coefficient (Q scale,min ) as the
[0071] Then, the trust radius update unit 105 calculates the constant a and the scaling coefficient (Q scale,min ) is used to update the confidence radius. As a result, in the bit width determination process, for the combination of bit widths of each layer after the confidence radius is updated, the upper limit of the confidence radius (=threshold) after the update matches the quantization error calculation by vector, and a bit width different from the previous one is selected.
[0072] As a result, the determination as to whether the provisionally calculated bit width satisfies the constraint condition is always performed with a different combination of bit widths each time, i.e., the determination as to whether the constraint condition is satisfied is never performed repeatedly with the same combination of bit widths.
[0073] Therefore, the bit width determination can be performed efficiently without performing a determination for a combination of overlapping bit widths, that is, all layers can be optimized in a short period of time.
[0074] The bit width can be sufficiently quantized within a limited optimization period. In addition, the number of times the algorithm is applied until the bit width is optimized is reduced, thereby reducing the calculation time and calculation cost. In addition, the degree of quantization is increased compared to conventional methods, and as a result, the training time of the neural network can be shortened.
[0075] In the conventional quantization method, the reason why many iterations are required for the bit width to converge is that the constraint condition may be determined again for a combination of bit widths that has already been determined once. By determining the constraint condition again for a combination of bit widths that has already been determined once, duplicated work is performed, which increases the time required for the quantization process.
[0076] In contrast to this, in the present information processing device 1, a determination is not made for a combination of overlapping bit widths, and the bit width determination can be performed efficiently. 11 and 12 are diagrams illustrating the results of quantization performed by the information processing device 1 as one example of an embodiment.
[0077] In Fig. 11, the horizontal axis indicates epochs, and the vertical axis indicates validation accuracy. As shown in Fig. 11, the quantization by the information processing device 1 shows that even if the bit width of all layers is set to 8 bits (when all are trained with QINT8), the bit width adjustment (quantization) is performed, which allows training without deterioration of the recognition rate (validation accuracy).
[0078] In Fig. 12, the horizontal axis indicates the number of determinations, and the vertical axis indicates the determined bit width. As shown in Fig. 12, the bit width of all layers was set (determined) to 8 bits during the optimization period (number of applications = 10 times) by quantization by the information processing device 1.
[0079] (D) Other The disclosed technology is not limited to the above-described embodiment, and can be modified in various ways without departing from the spirit of the present embodiment. Each configuration and each process of the present embodiment can be selected as needed, or can be combined as appropriate.
[0080] For example, in the above embodiment, the quantization is realized by narrowing the bit width of the weight vector in each layer, but the present invention is not limited to this. For example, the quantization may be applied to activation, weight gradient, activation gradient, etc., and may be implemented with various modifications. Furthermore, the above disclosure enables a person skilled in the art to implement and manufacture the present embodiment.
[0081] (E) Notes Regarding the above embodiment, the following supplementary notes are further disclosed. (Appendix 1) A processor of an information processing device that quantizes quantization target data, For all layers that make up the neural network, Calculate the difference between the quantization error of a bit width one step narrower than the provisionally calculated bit width and the confidence radius threshold value; calculating scaling factors for all of the layers based on the differences; Update the trust radius using the smallest value of all the scaling factors. A quantization program for executing a process.
[0082] (Appendix 2) The confidence radius is updated by multiplying the confidence radius by the smallest value of the scaling coefficients. 2. The quantization program according to claim 1, wherein the quantization program causes the processor to execute a process.
[0083] (Appendix 3) The trust radius is updated by multiplying the trust radius by the larger of the smallest value of the scaling coefficients and a trust radius update constant. 3. The quantization program according to claim 2, wherein the quantization program causes the processor to execute a process.
[0084] (Appendix 4) When the information processing device quantizes the quantization target data, For all layers that make up the neural network, A process of calculating a difference between a quantization error of a bit width one step narrower than the provisionally calculated bit width and a confidence radius threshold value; calculating scaling factors for all of the layers based on the differences; updating the confidence radius using the smallest value of all the scaling coefficients; A quantization method comprising:
[0085] (Appendix 5) The process of updating the trust radius is performed by multiplying the trust radius by the smallest value of the scaling coefficients. 5. The quantization method according to claim 4.
[0086] (Appendix 6) The process of updating the trust radius is performed by multiplying the trust radius by the larger of the smallest value of the scaling coefficients and a trust radius update constant. 6. The quantization method according to claim 5,
[0087] (Appendix 7) An information processing device having a processor that executes a process of quantizing quantization target data, The processor, For all layers that make up the neural network, Calculate the difference between the quantization error of a bit width one step narrower than the provisionally calculated bit width and the confidence radius threshold value; calculating scaling factors for all of the layers based on the differences; Update the trust radius using the smallest value of all the scaling factors. Quantization device
[0088] (Appendix 8) The confidence radius is updated by multiplying the confidence radius by the smallest value of the scaling coefficients. 8. The quantization device according to claim 7.
[0089] (Appendix 9) The trust radius is updated by multiplying the trust radius by the larger of the smallest value of the scaling coefficients and a trust radius update constant. 9. The quantization device according to claim 8. [Explanation of symbols]
[0090] 1. Information processing device 10 CPU 11. Memory 12 Accelerators 13 Communication Bus 100 Deep learning processing unit 101 Quantization processing unit 102 Bit width setting section 103 Difference calculation part 104 Scaling coefficient calculation unit 105 Trust radius update unit 106 Quantization error calculation section 107 Threshold Generation Unit
Claims
1. A processor of an information processing device that quantizes quantization target data, For all layers that make up the neural network, Calculate the difference between the quantization error of a bit width one step narrower than the provisionally calculated bit width and the confidence radius threshold value; calculating scaling factors for all of the layers based on the differences; Update the trust radius using the smallest value of all the scaling factors. A quantization program for executing a process.
2. The confidence radius is updated by multiplying the confidence radius by the smallest value of the scaling coefficients.
2. The quantization program according to claim 1, wherein the program causes the processor to execute a process.
3. The trust radius is updated by multiplying the trust radius by the larger of the smallest value of the scaling coefficients and a trust radius update constant.
3. The quantization program according to claim 2, wherein the program causes the processor to execute a process.
4. When the information processing device quantizes the quantization target data, For all layers that make up the neural network, A process of calculating a difference between a quantization error of a bit width one step narrower than the provisionally calculated bit width and a confidence radius threshold value; calculating scaling factors for all of the layers based on the differences; updating the confidence radius using the smallest value of all the scaling coefficients; A quantization method comprising:
5. An information processing device having a processor that executes a process of quantizing quantization target data, The processor, For all layers that make up the neural network, Calculate the difference between the quantization error of a bit width one step narrower than the provisionally calculated bit width and the confidence radius threshold value; calculating scaling factors for all of the layers based on the differences; Update the trust radius using the smallest value of all the scaling factors. Quantization device
Citation Information
Patent Citations
Numerical Differentiation Method for Digital Sensor Signals
JP1994508709A
Neural network learning device and learning method
JP2020009048A
Information processing device, method, and program
WO2020049681A1
