A floating point precision detection method and device

The floating-point calculation accuracy detection method of superimposed disturbances simplifies the floating-point accuracy detection process, solves the problems of low efficiency and complexity in the existing technology, and achieves efficient error detection and accuracy comparison, which is suitable for floating-point calculations. Error analysis.

CN112236749BActive Publication Date: 2024-08-27HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201880094332.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-09-21
Publication Date
2024-08-27
Estimated Expiration
2038-09-21

AI Technical Summary

Technical Problem

Existing floating point precision detection methods are inefficient and complex to implement, making it difficult to effectively detect the error between low precision and high precision, especially the accumulation of rounding errors in floating point calculations.

Method used

The floating-point calculation accuracy detection method based on superposition disturbance is adopted. By determining the disturbance results of the measured object, the first reference object and the second reference object, the acceptable disturbance error range is calculated, and the measured results are compared item by item to see whether they are within this range. Within, statistical methods such as root mean square error are used to simplify the detection process.

Benefits of technology

It effectively simplifies the accuracy detection process, improves detection efficiency, reduces cost investment, is suitable for uneven error scenarios, avoids the limitations of existing methods, and achieves more accurate accuracy comparison and error troubleshooting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112236749B
    Figure CN112236749B
Patent Text Reader

Abstract

The present application discloses a floating-point precision detection method and device, which relates to the field of chip technology and can solve the problems of low efficiency and complex implementation of existing floating-point precision detection methods. The method is as follows: taking the first floating-point number to be detected as the object to be measured, and determining the first reference object and the second reference object of the object to be measured, the second reference object is obtained after superimposing disturbance on the object to be measured; the object to be measured, the first reference object and the second reference object are respectively input into the operator for calculation, and the measured result of the object to be measured, the reference result of the first reference object and the disturbance result of the second reference object are obtained; according to the measured result, the reference result and the disturbance result, the acceptable disturbance error range is determined, and it is determined whether the measured result is within the acceptable disturbance error range. The embodiment of the present application is used for precision comparison detection of low-precision and high-precision, or objects with the same precision.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of chip technology, and in particular to a floating point precision detection method and device. Background Art

[0002] The Institute of Electrical and Electronics Engineers (IEEE) established the IEEE Floating-Point Arithmetic Standard (IEEE 754), which defines the format for representing floating-point numbers (including negative zero -0) and abnormal values, some special values ​​(infinity (Inf)y and non-numeric values ​​(NaN)), and "floating-point operators" for these values; it also specifies the rules for value intake and exceptions and how to handle them.

[0003] Binary floating point numbers are stored in sign-magnitude notation. Figure 1 Identifies the three fields of IEEE 754 floating-point numbers. The most significant bit is designated as the sign bit; the "exponent part", that is, the next most significant e bits, stores the exponent part; the last remaining f bits of less significant bits store the fractional part of the "significand" (the integer part defaults to 0 in the unreduced form, and defaults to 1 in all other cases). The actual value of a floating-point number is equal to the sign bit multiplied by the exponent bias and then multiplied by the fraction. For single-precision floating-point numbers, the bit width of the exponent bias is 8 bits, and the bit width of the fraction is 23 bits, for a total of 32 bits; for half-precision floating-point numbers, the bit width of the exponent bias is 5 bits, and the bit width of the fraction is 10 bits, for a total of 16 bits.

[0004] At present, floating-point calculations are widely used in machine vision, speech recognition, natural language processing and other fields. The industry usually uses high-performance graphics processing units (GPUs) to improve computing efficiency and achieve significant acceleration effects, but GPUs also have the disadvantage of high power consumption. With the deepening of application research, low-precision floating-point calculations have gradually become an effective measure to reduce costs, power consumption and improve performance. However, low-precision calculations still face a basic dilemma: when a finite number of floating-point numbers is used to represent real numbers (theoretically, there are infinite numbers of floating-point numbers), rounding errors will occur. Rounding errors are a form of quantization error. If rounding errors occur in one or several steps in a series of operations, in some cases, the errors will accumulate greatly as the number of operations increases, and ultimately a meaningless calculation result will be obtained. Therefore, in order to better select the calculation accuracy, the comparison detection of low-precision and high-precision reference objects with the same precision is a necessary accuracy detection method. Existing technologies can use relative error detection, bit absolute error detection, mean absolute error detection, root mean square error detection and error propagation formula to detect calculation accuracy. Relative error detection and bit absolute error detection methods are limited to subjective assumptions of a uniform error rate, which further leads to differences in the range of uniform error values ​​and the error performance of floating-point calculation results; mean absolute error detection and root mean square error detection are used to detect a set of data features, and the detection granularity is large, which is not convenient for locating bad points; and the error propagation formula is based on the error propagation law, and each operator is implemented differently. The error propagation derivation and calculation are complex, and it is generally difficult to directly use the law for complex operators, and the engineering cost is high. Therefore, the existing floating-point precision detection methods are inefficient and complex to implement. Summary of the invention

[0005] The embodiments of the present application provide a floating-point precision detection method and device, which can solve the problems of low efficiency and complex implementation of existing floating-point precision detection methods.

[0006] In the first aspect, a floating-point accuracy detection method is provided, including: taking a first floating-point number to be detected as a measured object, and determining a first reference object and a second reference object of the measured object, wherein the second reference object is obtained after superimposing disturbance on the measured object; inputting the measured object, the first reference object, and the second reference object into an operator for calculation respectively, obtaining the measured result of the measured object, the reference result of the first reference object, and the disturbance result of the second reference object; determining an acceptable disturbance error range according to the measured result, the reference result, and the disturbance result, and determining whether the measured result is within the acceptable disturbance error range. This floating-point calculation accuracy detection method based on superimposed disturbance effectively simplifies the process and can be implemented efficiently in an engineering manner. By effectively simplifying the implementation complexity of the accuracy comparison detection process, avoiding the limitations of the existing accuracy detection comparison method, effectively fitting the actual application scenario of uneven errors, meeting the requirements and goals of accuracy comparison detection, and greatly improving the implementation efficiency and reducing cost investment.

[0007] In one possible design, an acceptable disturbance error range is determined based on the measured result, the reference result and the disturbance result, and determining whether the measured result is within the acceptable disturbance error range includes: obtaining a first difference and a second difference, the first difference being the difference between the second output result and the reference result, the second difference being the difference between the third output result and the reference result, the acceptable disturbance error range is that the absolute value of the difference between the first output result and the reference result is less than the maximum value within the range of the first difference and the second difference, and the first root mean square error is less than the maximum value of the second root mean square error and the third root mean square error; if the absolute value of the difference between the first output result and the reference result is less than the maximum value within the range of the first difference and the second difference, and the first root mean square error is less than the maximum value of the second root mean square error and the third root mean square error, then it is determined that the measured result is within the acceptable disturbance error range. This method uses superimposed perturbed input data, after calculation with the reference object, to form a perturbation result range together with the unperturbed result calculation, and then detects whether each data item of the measured operator result is within the perturbation result range. At the same time, it detects whether the first root mean square error corresponding to each data item is less than the perturbation result, that is, the maximum value of the root mean square error of each group of results composed of the second root mean square error and the third root mean square error, which is conducive to accurate comparison and troubleshooting item by item.

[0008] In a possible design, if the first floating-point number includes at least one floating-point number, each of the at least one floating-point number is respectively used as a measured object; an acceptable disturbance error range is determined according to the measured result, the reference result and the disturbance result, and determining whether the measured result is within the acceptable disturbance error range includes: for at least one floating-point number, obtaining the first difference and the second difference corresponding to each floating-point number point by point; the first difference is the difference between the second output result and the reference result, the second difference is the difference between the third output result and the reference result, the acceptable disturbance error range is that the absolute value of the difference between the first output result and the reference result is less than the maximum value within the range of the first difference and the second difference, and the first root mean square error is less than the second root mean square error. The maximum value of the difference and the third root mean square error; compare the absolute value of the difference between the first output result of each floating point number and the reference result point by point to see whether it is less than the maximum value within the range of the first difference and the second difference, and for a group of second root mean square errors and third root mean square errors corresponding to each floating point number, compare the first root mean square error corresponding to each floating point number group by group to see whether it is less than the maximum value of a corresponding group of second root mean square errors and third root mean square errors; if the absolute value of the difference between the first output result corresponding to any floating point number and the reference result is less than the maximum value within the range of the first difference and the second difference, and the first root mean square error is less than the maximum value of the second root mean square error and the third root mean square error, then determine that the measured result of any floating point number is within the acceptable disturbance error range. In this way, by using error methods such as point-by-point direct comparison and group-by-group root mean square error calculation, it is possible to detect whether the calculation result of the measured object is within the acceptable disturbance range, and the process is effectively simplified.

[0009] In a second aspect, a detection device is provided, including: a data production and distribution module, used to use a first floating-point number to be detected as a detected object, and determine a first reference object and a second reference object of the detected object, the second reference object being obtained after superimposing a disturbance on the detected object; a data collection and preprocessing module, used to input the detected object, the first reference object, and the second reference object into operators for calculation respectively, to obtain a detected result of the detected object, a reference result of the first reference object, and a disturbance result of the second reference object; a determination module, used to determine an acceptable disturbance error range according to the detected result, the reference result, and the disturbance result, to determine whether the detected result is within the acceptable disturbance error range.

[0010] In one possible design, the determination module is used to: obtain a first difference and a second difference, the first difference is the difference between the second output result and the reference result, the second difference is the difference between the third output result and the reference result, and the acceptable disturbance error range is that the absolute value of the difference between the first output result and the reference result is less than the maximum value within the range of the first difference and the second difference, and the first root mean square error is less than the maximum value of the second root mean square error and the third root mean square error; if the absolute value of the difference between the first output result and the reference result is less than the maximum value within the range of the first difference and the second difference, and the first root mean square error is less than the maximum value of the second root mean square error and the third root mean square error, then it is determined that the measured result is within the acceptable disturbance error range.

[0011] In a possible design, if the first floating-point number includes at least one floating-point number, each floating-point number in the at least one floating-point number is respectively used as a measured object; the determination module is used to: for at least one floating-point number, obtain the first difference and the second difference corresponding to each floating-point number point by point, the first difference is the difference between the second output result and the reference result, the second difference is the difference between the third output result and the reference result, the acceptable disturbance error range is that the absolute value of the difference between the first output result and the reference result is less than the maximum value within the range of the first difference and the second difference, and the first root mean square error is less than the maximum value of the second root mean square error and the third root mean square error; compare each floating-point number point by point Whether the absolute value of the difference between the first output result and the reference result is less than the maximum value within the range of the first difference and the second difference, and for a group of second root mean square errors and third root mean square errors corresponding to each floating-point number, compare group by group whether the first root mean square error corresponding to each floating-point number is less than the maximum value of a corresponding group of second root mean square errors and third root mean square errors; if the absolute value of the difference between the first output result corresponding to any floating-point number and the reference result is less than the maximum value within the range of the first difference and the second difference, and the first root mean square error is less than the maximum value of the second root mean square error and the third root mean square error, then determine that the measured result of any floating-point number is within an acceptable disturbance error range.

[0012] According to a third aspect, a detection device is provided, comprising a processor and a memory, the memory being used to store data and programs, and the processor being used to: take a first floating-point number to be detected as a detected object, and determine a first reference object and a second reference object of the detected object, the second reference object being obtained by superimposing a disturbance on the detected object; inputting the detected object, the first reference object, and the second reference object into operators for calculation respectively, to obtain a detected result of the detected object, a reference result of the first reference object, and a disturbance result of the second reference object; determining an acceptable disturbance error range according to the detected result, the reference result, and the disturbance result, to determine whether the detected result is within the acceptable disturbance error range.

[0013] In the above-mentioned first to third aspects, in a possible design, the accuracy of the measured object is lower than the accuracy of the first reference object or the second reference object, or the accuracy of the measured object is the same as the accuracy of the first reference object and the second reference object; if the accuracy of the measured object is lower than the accuracy of the first reference object or the second reference object, the first reference object is obtained by performing precision conversion on the first floating-point number, and the second reference object is obtained by performing precision conversion on the first floating-point number and superimposing disturbance.

[0014] In the above-mentioned first to third aspects, in a possible design, the disturbance is a minimum of 1 bit, and the parameters of the second reference object include an upper limit of the disturbance and a lower limit of the disturbance obtained by superimposing the disturbance; the measured result includes a first output result and a first root mean square error, the first output result is calculated by inputting the measured object into the operator, and the first root mean square error is the root mean square error between the reference result and the first output result; the disturbance result includes a second output result, a third output result, a second root mean square error and a third root mean square error, the second output result is calculated by inputting the upper limit of the disturbance into the operator, the third output result is calculated by inputting the lower limit of the disturbance into the operator, the second root mean square error is the root mean square error between the second output result and the reference result, and the third root mean square error is the root mean square error between the third output result and the reference result.

[0015] In one possible design, the processor is used to: obtain a first difference and a second difference, the first difference is the difference between the second output result and the reference result, the second difference is the difference between the third output result and the reference result, and the acceptable disturbance error range is that the absolute value of the difference between the first output result and the reference result is less than the maximum value within the range of the first difference and the second difference, and the first root mean square error is less than the maximum value of the second root mean square error and the third root mean square error; if the absolute value of the difference between the first output result and the reference result is less than the maximum value within the range of the first difference and the second difference, and the first root mean square error is less than the maximum value of the second root mean square error and the third root mean square error, it is determined that the measured result is within the acceptable disturbance error range.

[0016] In a possible design, if the first floating-point number includes at least one floating-point number, each floating-point number in the at least one floating-point number is used as a measured object; the processor is used to: for at least one floating-point number, obtain the first difference and the second difference corresponding to each floating-point number point by point; the first difference is the difference between the second output result and the reference result, the second difference is the difference between the third output result and the reference result, the acceptable disturbance error range is that the absolute value of the difference between the first output result and the reference result is less than the maximum value within the range of the first difference and the second difference, and the first root mean square error is less than the maximum value of the second root mean square error and the third root mean square error; compare each floating-point number point by point Whether the absolute value of the difference between the first output result and the reference result is less than the maximum value within the range of the first difference and the second difference, and for a group of second root mean square errors and third root mean square errors corresponding to each floating-point number, compare group by group whether the first root mean square error corresponding to each floating-point number is less than the maximum value of a corresponding group of second root mean square errors and third root mean square errors; if the absolute value of the difference between the first output result corresponding to any floating-point number and the reference result is less than the maximum value within the range of the first difference and the second difference, and the first root mean square error is less than the maximum value of the second root mean square error and the third root mean square error, then it is determined that the measured result of any floating-point number is within an acceptable disturbance error range.

[0017] In a fourth aspect, a detection device is provided, comprising an analysis engine module, a network device module, a data storage module, a reference object execution module and a measured object execution module; the analysis engine module is used to support data processing detection; the network device module can be used to connect various modules and subsystems; the data storage module is used to support the storage and backup of various types of data; the reference object execution module is used to calculate a group of reference objects, and the measured object execution module is used to calculate a group of measured objects; wherein the analysis engine module comprises: a joint detection submodule, used to obtain the detection result of the measured object through one or a group of detection methods; a data feature analysis submodule, used to analyze the input data, output data, intermediate data and detection results of the detection device to obtain data feature analysis results, and perform accuracy selection on the measured object according to the data feature analysis results.

[0018] In one possible design, the joint detection module includes the definition and implementation of various detection methods, one or a group of detection methods specified for different objects to be tested, and the threshold setting of each detection method can be adapted and adjusted according to different objects to be tested; the data feature analysis results include the interval distribution, dimension, model and rules of combined input scenarios, output data deviation characteristics, discrete characteristics, and positive and negative sample detection result characteristics of input data and output data.

[0019] According to a fifth aspect, a communication device is provided, comprising a memory, wherein the memory stores computer instructions, and when the computer instructions are executed, the communication device executes the method according to the first aspect.

[0020] In a sixth aspect, a computer storage medium stores computer instructions, and when the computer instructions are executed by a computer, the computer executes the method of the first aspect.

[0021] In a seventh aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the method of the first aspect.

[0022] Therefore, the precision detection process is effectively simplified through the floating-point calculation precision detection method and device based on superposition disturbance, which can be implemented efficiently in an engineering manner. By effectively simplifying the implementation complexity of the precision comparison detection process, avoiding the limitations of the existing precision detection comparison method, and effectively fitting the actual application scenario of uneven errors, the requirements and goals of precision comparison detection can be met, while improving the implementation efficiency and reducing cost investment. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 is a schematic diagram of three fields of an IEEE 754 floating point number;

[0024] Figure 2 A schematic diagram of the structure of a detection device provided in an embodiment of the present application;

[0025] Figure 3 A flowchart of a floating point precision detection method provided in an embodiment of the present application;

[0026] Figure 4 A schematic diagram of comparing a low-precision FP16 operator operation with a high-precision FP32 operator operation of a reference object provided in an embodiment of the present application;

[0027] Figure 5 A flowchart of a floating point precision detection method provided in an embodiment of the present application;

[0028] Figure 6 A schematic diagram of some results of comparing the error of the object under test with the disturbance error range point by point and bit by bit in an actual verification provided by an embodiment of the present application;

[0029] Figure 7 A schematic diagram of a workflow of an analysis engine module provided in an embodiment of the present application;

[0030] Figure 8 A schematic diagram of the structure of a detection device provided in an embodiment of the present application;

[0031] Fig. 9 A schematic diagram of the structure of a detection device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0032] For ease of understanding, some examples of concepts related to this application are provided for reference, as shown below:

[0033] Floating-point number: A numerical representation of an approximate value of a real number, represented by a significant digit (i.e., the mantissa) plus a power, usually multiplied by an integer power of a base. The value represented in this representation is called a floating-point number.

[0034] Floating-point computation: Calculations using floating-point numbers. This type of calculation is usually accompanied by approximation or rounding because the number cannot be accurately represented.

[0035] Round-off error: The difference between the approximate value obtained by floating-point arithmetic and the exact value.

[0036] Perturbation: also known as noise, is a process of adding noise to the lower bits of the input and calculating the range of perturbation results.

[0037] Exponent bias: The encoding value of the exponent field in the floating point representation is the actual value of the exponent plus a fixed value. The IEEE 754 standard stipulates that this fixed value is 2. e-1 -1, where e is the length of the bits used to store the exponent.

[0038] Operator: A mapping from one vector space (or module) to another vector space (or module). Various operators can have important properties including linearity, continuity, and boundedness. In this article, it refers to a collection of floating-point calculations.

[0039] Bit: Data with a length of w bits is encoded from the low end to the high end of the memory address, from 0 to w-1. The bit at the low end of the memory address is usually written on the far right, called the least significant bit, which represents the smallest bit and has the smallest impact on the overall value when changed.

[0040] Root Mean Square Error (RMSE): The square root of the ratio of the square of the deviation between the observed value and the true value and the number of observations n.

[0041] Mean Absolute Error (MAE): The average of the absolute values ​​of the deviations of all individual observations from the arithmetic mean.

[0042] The network architecture and business scenarios described in this application are intended to more clearly illustrate the technical solutions of this application and do not constitute a limitation on the technical solutions provided by this application. A person of ordinary skill in the art will appreciate that with the evolution of the network architecture and the emergence of new business scenarios, the technical solutions provided by this application are also applicable to similar technical problems.

[0043] The present application can be applied to floating-point computing scenarios in the fields of machine vision, speech recognition, natural language processing, etc., such as the comparative detection of low-precision floating-point numbers and high-precision floating-point numbers, or floating-point numbers of the same precision.

[0044] The present application can be applied to hardware such as chips, and the chip can be a graphics processor GPU, etc. The GPU can be set in personal computers, workstations, game consoles and some mobile devices (such as tablets, smart phones, etc.).

[0045] The floating point accuracy detection method provided in this application can be applied to Figure 2 The detection device shown in the figure includes an analysis engine module 21, a network device module 22, a data storage module 23, a reference object execution module 24 and a measured object execution module 25. The analysis engine module 21 is used to support data processing detection and has data mining capabilities; the data storage module 23 is used to support the storage and backup of various types of data, including reference objects and measured objects that can be floating point numbers in the embodiments of the present application; the network device module 22 can be used to connect various modules and subsystems.

[0046] The services included in the analysis engine module 21 will vary according to the functions and implementations of each data intelligent analysis system. Generally speaking, it may include the following basic sub-modules: data production and distribution sub-module 211, data collection and preprocessing sub-module 212, joint detection sub-module 213, data feature analysis sub-module 214, and test strategy generation sub-module 215. In the floating-point precision comparison detection device, the analysis engine module 21 can distribute execution tasks and data to the object execution module 25 and the reference object execution module 24 through the data production and distribution sub-module 211. After execution, the data collection and preprocessing sub-module 212 obtains the calculated data, and then the joint detection sub-module 213, the data feature analysis sub-module 214, and the test strategy generation sub-module 215 respectively generate targeted precision comparison detection results, analysis results, and test execution strategies through data analysis and detection combined with models and rules. The specific functions of each sub-module are described as follows:

[0047] The data production and distribution submodule 211 obtains the input data, parameters, deployment, selection and other calculation data and control data required by the tested object and the reference object by processing the test strategy (the test strategy here can be a model and rules preset manually at the beginning, or it can be a test strategy generated by the data feature analysis submodule 214 after data analysis), and distributes the input data and execution tasks to the tested object and the reference object according to the strategy requirements.

[0048] The data collection and preprocessing submodule 212 is used to collect the output and intermediate processing data of the measured object and the reference object, and preprocess the data from different implementation objects according to different rules, such as format conversion, data cleaning, etc.

[0049] The joint detection submodule 213 may include various detection method definitions and implementations, one or a group of detection methods and their rules specified by different operators. The detection method may be various error detection methods such as relative error, bit absolute error, perturbation error, mean absolute error, root mean square error, and various detection methods such as positive and negative sample detection methods. The parameter settings such as the threshold of each detection method may be adjusted according to different operators. The joint detection module also defines the calculation output rules for the results of different operators.

[0050] The data feature analysis submodule 214 can summarize and analyze various types of data such as input, output, intermediate generated data, and calculation data of the detection model. The output data feature analysis results can include input and output value interval distribution, dimension, model and rules of combined input scenarios, output data deviation characteristics, discrete characteristics, positive and negative sample detection result characteristics, etc. After comprehensive analysis and output data feature analysis results, it is used to characterize the error sensitivity characteristics of the operator for further accuracy tuning or calculation accuracy selection.

[0051] The test strategy generation submodule 215 generates a test recommendation strategy based on the existing data feature analysis results, using a stratified sampling algorithm or other sampling algorithms, or a combination of commonly used test methods. The recommended strategy (some initialization test strategies and rules can be manually preset at the beginning) may include input scenarios, input data structure features, input disturbance ranges, specify one or more reference objects and other combination conditions. The data generation and distribution links will execute these test strategies to carry out multiple rounds of testing, and the scale and threshold parameters such as rounds, number of use cases, and number of combined scenarios can be set.

[0052] The tested object execution module 25 may include but is not limited to low-precision, mixed-precision or same-precision floating-point calculations, and may be in the form of systems, modules, operators or instructions, etc. In this device, one or a group of multiple tested objects may be tested simultaneously.

[0053] The reference object execution module 24 may include but is not limited to high-precision, same-precision floating-point calculations for reference, and may be in the form of systems, modules, operators or instructions. In this device, one or a group of multiple reference objects may be tested simultaneously to meet the selection and comparison of different reference objects.

[0054] The data storage module 23 can support the storage and backup of various types of data.

[0055] The network device module 22 can support the connection and communication of various modules and subsystems, including but not limited to the connection of various network devices.

[0056] The networking of the detection device may include but is not limited to a single network element, a cluster, a distributed system, and the like.

[0057] In this way, the joint detection model designed in this application can flexibly adapt to different objects to be tested, flexibly adapt various detection methods and thresholds for different operators, adjust parameters, and output rich conclusions of joint detection results, which can effectively reduce misjudgment and help further precision tuning and analytical decision-making.

[0058] The present application also provides a floating-point calculation accuracy comparison detection method based on superimposed disturbance, the core idea of ​​which can be: the error introduced by the specified precision floating-point calculation is not greater than the error generated by the superimposed disturbance. That is, the disturbance is superimposed on the input floating-point number of the reference object, and the disturbance error range is obtained by calculating the disturbance input and the original reference object input. The error statistics methods such as point-by-point direct comparison, group-by-group root mean square error RMSE, mean absolute error MAE, etc. are used to detect whether the calculation result of the measured object is within the acceptable disturbance error range.

[0059] This application also provides a joint decision model and data feature analysis model, which defines various precision detection methods and implementations, and can preset and dynamically adjust the detection methods and parameters corresponding to each operator. Through comparative detection and computational analysis, the joint detection results and data feature analysis results are output to improve detection accuracy and efficiency and reduce misjudgment.

[0060] With respect to the above detection method, the method is further described below.

[0061] The present application provides a floating point precision detection method, which effectively avoids the shortcomings of the prior art, is simple to implement, and is efficient in operation. Figure 3 As shown, the method can be divided into two parts as a whole:

[0062] A. Constructing input based on superposition perturbations

[0063] In view of the current situation that computational error propagation is complex and difficult to engineer in actual operator accuracy detection, we focus on simplifying the error construction and propagation process: that is, by constructing the perturbation error input and judging whether the test result is within the error range of the result generated by the perturbation input.

[0064] Taking the comparison between low-precision FP16 operator operation and high-precision FP32 operator operation of the reference object as an example, the accuracy comparison detection process is shown in Figure 4 The core idea is that the error introduced by FP16 floating-point calculation should not be greater than the error caused by the superimposed minimum 1-bit (or k*1-bit or other values ​​within an acceptable precision range) disturbance.

[0065] B. Generate an allowable non-uniform error range

[0066] The input data with superimposed disturbance is calculated by the reference object and then together with the unperturbed result calculation to form the disturbance result range. Then the measured operator result is checked point by point to see if it is within the disturbance result range, and at the same time, the root mean square error is checked to see if it is less than the maximum value of the root mean square error of the disturbance result.

[0067] The non-uniform error is more consistent with the actual expression of each floating-point input after the truncation error propagation in the output result. It is conducive to accurate comparison and troubleshooting of each item. This method can be used for precision comparison and detection of low-precision, mixed-precision or same-precision objects and reference objects.

[0068] In combination with the above method overview, the present application provides a floating point precision detection method, such as Figure 5 As shown, including:

[0069] 501. The device uses a first floating-point number to be detected as a measured object, and determines a first reference object and a second reference object of the measured object, where the second reference object is obtained by superimposing a disturbance on the measured object.

[0070] If the first floating-point number includes at least one floating-point number, each floating-point number in the at least one floating-point number is a measured object. For example, the first floating-point number can be a multi-dimensional array sequence, each floating-point number in the array sequence is a measured object, and each measured object corresponds to a first reference object and a second reference object.

[0071] The precision of the measured object is lower than that of the first reference object or the second reference object, or the precision of the measured object is the same as that of the first reference object and the second reference object. For example, when the measured object is low-precision FP16, the first reference object and the second reference object are both high-precision FP32; or when the measured object is low-precision FP16, the first reference object and the second reference object are both FP16 with the same precision.

[0072] If the accuracy of the measured object is lower than that of the first reference object or the second reference object, the first reference object is obtained by performing precision conversion on the first floating point number, and the second reference object is obtained by performing precision conversion on the first floating point number and superimposing disturbance.

[0073] The disturbance is at least 1 bit, and the parameters of the second reference object include an upper disturbance limit and a lower disturbance limit obtained by superimposing the disturbance.

[0074] Continuing with the above-mentioned comparative detection process example of the low-precision FP16 operator operation as the object to be tested and the high-precision FP32 operator operation as the first reference object, the calculation steps of this method are explained as follows:

[0075] 1) Construct input and add disturbance

[0076] Construct input in FP16 format fp16 , the input fp16 is the first floating point number to be detected, that is, as the object to be tested, Figure 4 In the example, the input is marked as FP16 and read as UINT16, which is an unsigned integer input. UINT16 On the one hand, the input fp16 Convert to FP32 format and record it as input fp32 , input fp32 As the first reference object, Figure 4 Then, according to the specified perturbation size, the acceptable perturbation is assumed to be 1 bit, so the process of obtaining the perturbation size can be: input adjacent =input UINT16 +1, read input in FP16 format adjacent , denoted as input adjacentfp32 , and then calculate the disturbance error delta: delta = abs(input adjacentfp32 -input fp32 ).

[0077] 2) Generate disturbance input, that is, generate the second reference object, including the upper limit input of disturbance noiseHi and the disturbance lower limit input noiseLo , disturbance upper limit input noiseHi and the disturbance lower limit input noiseLo ,exist Figure 4 It is marked as FP32(1) in the figure, which means that FP32(1) actually includes two values ​​for each floating point number.

[0078] input noiseHi =input fp32 +delta

[0079] input noiseLo =input fp32 -delta

[0080] The step 501 can be used by the above-mentioned data production and distribution submodule 211 to obtain the data, parameters, deployment, selection and other calculation data and control data required by the object under test, the first reference object and the second reference object, and distribute input data and execution tasks to the reference object execution module 24 and the object under test execution module 25 respectively.

[0081] 502. The device inputs the measured object, the first reference object, and the second reference object into operators for calculation respectively, to obtain a measured result of the measured object, a reference result of the first reference object, and a disturbance result of the second reference object.

[0082] Continue with Figure 4 Take the following as an example to illustrate: fp16 , first reference object input fp32 And the second reference object (input noiseHi 、input noiseLo ) respectively input operators for calculation and obtain the corresponding output results.

[0083] The reference result is the first reference object input fp32 The result obtained by inputting the operator (in Figure 4 In order to facilitate subsequent detection and comparison, the reference result can be converted into a 16-bit unsigned integer UINT16 to output GTUUINT16 Indicates that in Figure 4 It is identified by UINT16(2);

[0084] The measured results include the first output result and the first root mean square error RMSE test , the first output result is Figure 4 The first output is the input fp16 The input operator calculates the result. In order to facilitate subsequent detection and comparison, the first output result can be converted into a 16-bit unsigned integer UINT16 (in Figure 4 It is marked as UINT16(1) in the output UINT16 RMSE test The root mean square error between the reference results FP32(2) and FP32(4), FP32(4) is obtained by precision conversion of FP16(1);

[0085] The disturbance results include the second output result, the third output result (in Figure 4 The second output result and the third output result are both marked as FP32(3)), the second root mean square error RMSE noiseHi And the third root mean square error RMSE noiseLo ,exist Figure 4 In the calculation, the second output result is obtained by inputting the upper limit of the disturbance into the operator, and the third output result is obtained by inputting the lower limit of the disturbance into the operator. In order to facilitate subsequent detection and comparison, the second and third output results can be converted into UINT16. The second output result is recorded as output after conversion. noiseHiUINT16 , the third output result is converted and recorded as output noiseLoUINT16 (output noiseHiUINT16 and output noiseLoUINT16 exist Figure 4 The second RMS error is the RMS error between the second output result and the reference result FP32(2), and the third RMS error is the RMS error between the third output result and the reference result FP32(2).

[0086] Step 502 can be used by the data collection and preprocessing submodule 212 to collect the outputs of the measured object, the first reference object, and the second reference object, process intermediate data, and preprocess data from different implementation objects according to different rules, such as format conversion and data cleaning.

[0087] 503. The device determines an acceptable disturbance error range according to the measured result, the reference result and the disturbance result, and determines whether the measured result is within the acceptable disturbance error range.

[0088] In one possible design, a first difference and a second difference are obtained, the first difference is the difference between a reference result and a first output result, the second difference is the difference between a third output result and a reference result, and an acceptable disturbance error range is less than a maximum value within the range of the first difference and the second difference, and less than a maximum value of the second root mean square error and a third root mean square error; if the absolute value of the difference between the first output result and the reference result is less than the maximum value within the range of the first difference and the second difference, and the first root mean square error is less than the maximum value of the second root mean square error and the third root mean square error, it is determined that the measured result is within an acceptable disturbance error range.

[0089] Continue with Figure 4 Take the example to illustrate that the first difference is the second output result output noiseHiUINT16 With reference to the output GTUUINT16 The second difference is the third output result output noiseLoUINT16 With reference to the output GTUUINT16The acceptable disturbance error range is abs(output UINT16 -output GTUUINT16 ) <max((output noiseHiUINT16 -output GTUUINT16 ), (output noiseLoUINT16 -output GTUUINT16 )), and RMSE test <max(RMSE noiseHi , RMSE noiseLo ); if abs(output UINT16 -output GTUUINT16 ) <max((output noiseHiUINT16 -output GTUUINT16 ), (output noiseLoUINT16 -output GTUUINT16 )), and RMSE test <max(RMSE noiseHi , RMSE noiseLo ), then it is determined that the detection result is within the acceptable disturbance error range.

[0090] It should be noted that if the first floating-point number includes at least one floating-point number, and each floating-point number in the at least one floating-point number is used as a measured object, then for each floating-point number in the first floating-point number, it is necessary to compare the abs(output UINT16 -output GTUUINT16 ) is less than max((output noiseHiUINT16 -output GTUUINT16 ), (output noiseLoUINT16 -output GTUUINT16 )), and multiple groups (RMSE) calculated after adding disturbance to each floating point number noiseHi , RMSE noiseLo ), it is necessary to compare the RMSE corresponding to the floating point number group by group test Is it less than max(RMSE noiseHi , RMSE noiseLo ), if any floating point number corresponds to abs(output UINT16 -output GTUUINT16 ) <max((output noiseHiUINT16 -output GTUUINT16 ), (output noiseLoUINT16 -output GTUUINT16 )), and RMSE test <max(RMSE noiseHi , RMSE noiseLo), determine that the measured result of any floating-point number is within the acceptable disturbance error range.

[0091] Step 503 may be performed by the joint detection submodule 213 .

[0092] The present application is not limited to realizing floating point number accuracy detection through error detection methods such as disturbance error or root mean square error, but may also be other detection methods, which are not limited in the present application.

[0093] Figure 6 This is a partial illustration of the results of comparing the error of the object under test with the disturbance error range bit by bit in step 503 in actual verification. Figure 6 If the errors of each point of the measured object are within the range formed by the upper and lower limits of the disturbance error, the result of the point-by-point comparison is considered to be within the acceptable range of the disturbance error.

[0094] Therefore, the floating-point calculation accuracy detection method based on superposition disturbance designed by this application effectively simplifies the process and can be implemented efficiently in an engineering manner. By effectively simplifying the implementation complexity of the accuracy comparison detection process, avoiding the limitations of existing accuracy detection comparison methods, and effectively fitting the actual application scenarios of uneven errors. While meeting the requirements and goals of accuracy comparison detection, it can improve implementation efficiency and reduce cost investment.

[0095] Figure 2 In the detection device provided, the analysis engine module 21 is the central nervous system of the entire device. It controls how to process the test strategy, how to distribute and input data to the object, how to perform the comparison test, and how to process the data results. The workflow of the analysis engine module 21 can be as follows: Figure 7 As shown, including:

[0096] 701. Preset test strategy.

[0097] The test strategy may be a model and rules preset manually at the initial stage, or may be a test strategy collected from the test strategy generation submodule 215 and generated through data analysis.

[0098] 702. Data generation and distribution, and then executing steps 703 and 704 in parallel.

[0099] The steps 701 and 702 may be performed by the data production and distribution submodule 211. For each type of data, there will be a set of targeted models and rules that can convert the input test strategy into the relevant information required by the tested object and the reference object, such as input data, parameters, tested objects, reference object deployment and selection models and rules.

[0100] 703 . The object under test executes, and then executes step 705 .

[0101] This step can be performed by the measured object execution module 25, and can be specifically used to make the measured object execute and output intermediate and result data according to the obtained data and rules. For example, the measured object execution module 25 can be used to calculate and obtain the measured result according to the input measured object and operator.

[0102] 704. Execute with reference to the object.

[0103] This step can be performed by the reference object execution module 24, and can be specifically used to enable the reference object to execute and output intermediate and result data based on the obtained data and rules. Figure 5 In the provided method, the reference object execution module 24 can be used to calculate according to the input first reference object, second reference object and operator to obtain the reference result of the first reference object and the disturbance result of the second reference object.

[0104] 705. Data collection and preprocessing.

[0105] This step can be performed by the data collection and preprocessing submodule 212, which is used to collect output and intermediate processing data from the measured object and the reference object, and preprocess the data from different implementation objects according to different rules, such as format conversion and data cleaning.

[0106] Combination Figure 5 The method provided, the data collection preprocessing submodule 212 can be used to collect the measured results, reference results and disturbance results calculated in step 502, and convert the measured results, reference results and disturbance results into formats, for example, converting FP16 into FP32, converting FP32 into UINT16, etc.

[0107] 706. Perform joint detection on the preprocessed data using at least one detection method, and output a detection result.

[0108] This step can be performed by the joint detection submodule 213, which is used to obtain the collected data to be detected, perform detection according to the detection method and parameters corresponding to the operator being tested, calculate the output method and other rules, and output the detection result of the joint detection method.

[0109] For example, one detection method is to compare the relative error between the measured object and the reference object with the corresponding first threshold range, and another detection method is to compare the bit absolute error between the measured object and the reference object with the corresponding second threshold range. Then, if the relative error corresponding to any object among the measured objects is within the preset first threshold range, and the bit absolute error corresponding to any object is also within the preset second threshold range, then it is determined that the precision error of any object is within an acceptable range. If the relative error corresponding to any object is not within the preset first threshold range, and / or the bit absolute error corresponding to any object is not within the preset second threshold range, then it is determined that the precision error of any object is not within the acceptable range.

[0110] 707. Conduct data feature analysis.

[0111] This step can be performed by the data feature analysis submodule 214, which is used to combine the data and the model rules for calculation, and generate data feature analysis results and test recommendation strategies. Then, the test strategy can be preset according to the output test recommendation strategy.

[0112] The above methods and features can be provided and supported in the developer's related integrated development environment (IDE) tools to assist in better selection of calculation accuracy.

[0113] The joint detection model provided in this application can be flexibly adapted to different objects under test, and the conclusions are rich and effective in reducing misjudgments. It is flexible to adapt various detection methods and thresholds and parameter adjustments for different operators. The output joint detection results are rich in conclusions, effectively reducing misjudgments, and contributing to further precision tuning and analytical decision-making. The data feature analysis model can carry out a comprehensive and effective analysis of data features. By analyzing and mining the error-sensitive data features under potential conditions, and outputting further testing strategies, it assists in troubleshooting subjective errors, defines error-sensitive features, reduces the input of manual test analysis and design, and improves the efficiency of analysis and verification.

[0114] Through the description of steps 701 to 707, the detection device has a clear and simple process, a high degree of automation, and significantly reduced manual intervention. It can carry out multiple rounds of large-scale effective detection, which helps to improve the efficiency of precision detection and analysis, and assists in selecting better calculation accuracy. Initially, some initialization test strategies, model definitions, and operation rules can be manually preset, and the data is produced and distributed to the object under test and the reference object for operation and execution. The data collection preprocessing is summarized, and the detection conclusion is output by the joint detection model calculation. The data feature analysis module then conducts a comprehensive analysis, and outputs the data feature analysis conclusion and the next test recommendation strategy. The test recommendation strategy can be input into the device front-end data production and distribution module for cyclic testing, and the scale and threshold parameters such as the number of cycles, the number of use cases, and the number of combined scenarios can be set. After multiple rounds of automated large-scale testing, the accuracy calculation status of the expression interval of the object under test can be fully verified, reducing manual input, which helps to improve the efficiency of precision detection and analysis.

[0115] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of the detection device. It is understandable that, in order to realize the above functions, the detection device includes a hardware structure and / or software module corresponding to each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.

[0116] The embodiment of the present application can divide the functional modules of the detection device according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0117] In the case of dividing each functional module into corresponding functional modules, Figure 8 A possible structural diagram of the detection device involved in the above embodiment is shown, and the detection device 80 includes: a data production and distribution module 801, a data collection and preprocessing module 802 and a determination module 803. The data production and distribution module 801 is used to support the detection device to execute Figure 5 In process 501, the data collection preprocessing module 802 is used to support the detection device to perform Figure 5Process 502 in; Determine module 803 is used to support the detection device to perform Figure 5 Process 503 in the above method embodiment. All relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, which will not be repeated here.

[0118] Wherein, data production distribution module 801, data collection preprocessing module 802 and determination module 803 can be integrated in a processor or controller, for example, it can be a central processing unit (CPU), a general processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It can implement or execute various exemplary logic boxes, modules and circuits described in conjunction with the disclosure of the present application. The processor can also be a combination that realizes a computing function, for example, comprising a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like. The detection device can also include a storage module 804 for storing data and programs, etc., and the storage module 804 can be a memory.

[0119] When the data production and distribution module 801, the data collection and preprocessing module 802, and the determination module 803 can be integrated in the processor, and the storage module 804 is a memory, the detection device involved in the embodiment of the present application can be Fig. 9 The testing equipment shown.

[0120] See also Fig. 9 As shown, the detection device 90 includes: a processor 901, a memory 902 and a bus 903. The processor 901 and the memory 902 are connected to each other via the bus 903; the bus 903 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig. 9 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0121] Those skilled in the art should be aware that in one or more of the above examples, the functions described in this application can be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any media that facilitates the transmission of a computer program from one place to another. The storage medium can be any available medium that a general or special-purpose computer can access.

[0122] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A floating point precision detection method, characterized in that: include: Taking a first floating-point number to be detected as a measured object, and determining a first reference object and a second reference object of the measured object, wherein the second reference object is obtained by superimposing a disturbance on the measured object; Input the measured object, the first reference object and the second reference object into operators for calculation respectively, to obtain the measured result of the measured object, the reference result of the first reference object and the disturbance result of the second reference object; An acceptable disturbance error range is determined according to the measured result, the reference result and the disturbance result, and it is determined whether the measured result is within the acceptable disturbance error range.

2. The method according to claim 1, characterized in that The accuracy of the measured object is lower than the accuracy of the first reference object or the second reference object, or the accuracy of the measured object is the same as the accuracy of the first reference object and the second reference object; If the accuracy of the measured object is lower than that of the first reference object or the second reference object, the first reference object is obtained by performing precision conversion on the first floating-point number, and the second reference object is obtained by performing precision conversion on the first floating-point number and superimposing the disturbance.

3. The method according to claim 1 or 2, characterized in that: The disturbance is at least 1 bit, and the parameters of the second reference object include a disturbance upper limit and a disturbance lower limit obtained by superimposing the disturbance; The measured result includes a first output result and a first root mean square error, wherein the first output result is obtained by inputting the measured object into the operator for calculation, and the first root mean square error is a root mean square error between the reference result and the first output result; The disturbance result includes a second output result, a third output result, a second root mean square error and a third root mean square error. The second output result is obtained by inputting the upper limit of the disturbance into the operator, and the third output result is obtained by inputting the lower limit of the disturbance into the calculation. The second root mean square error is the root mean square error between the second output result and the reference result, and the third root mean square error is the root mean square error between the third output result and the reference result.

4. The method according to claim 3, characterized in that The step of determining an acceptable disturbance error range according to the measured result, the reference result, and the disturbance result, and determining whether the measured result is within the acceptable disturbance error range includes: Obtaining a first difference and a second difference, wherein the first difference is a difference between the second output result and the reference result, and the second difference is a difference between the third output result and the reference result, wherein the acceptable disturbance error range is that an absolute value of the difference between the first output result and the reference result is less than a maximum value within a range between the first difference and the second difference, and the first root mean square error is less than a maximum value between the second root mean square error and the third root mean square error; If the absolute value of the difference between the first output result and the reference result is smaller than the maximum value within the range of the first difference and the second difference, and the first root mean square error is smaller than the maximum value of the second root mean square error and the third root mean square error, then it is determined that the measured result is within the acceptable disturbance error range.

5. The method according to claim 3, characterized in that: If the first floating-point number includes at least one floating-point number, each floating-point number in the at least one floating-point number is used as a measured object; The step of determining an acceptable disturbance error range according to the measured result, the reference result, and the disturbance result, and determining whether the measured result is within the acceptable disturbance error range includes: For the at least one floating-point number, a first difference and a second difference corresponding to each floating-point number are obtained point by point; the first difference is a difference between the second output result and the reference result, the second difference is a difference between the third output result and the reference result, the acceptable disturbance error range is that the absolute value of the difference between the first output result and the reference result is less than the maximum value within the range of the first difference and the second difference, and the first root mean square error is less than the maximum value of the second root mean square error and the third root mean square error; Compare point by point whether the absolute value of the difference between the first output result and the reference result of each floating-point number is less than the maximum value within the range of the first difference and the second difference, and for a group of the second root mean square error and the third root mean square error corresponding to each floating-point number, compare group by group whether the first root mean square error corresponding to each floating-point number is less than the maximum value of a corresponding group of the second root mean square error and the third root mean square error; If the absolute value of the difference between the first output result corresponding to any floating-point number and the reference result is smaller than the maximum value within the range of the first difference and the second difference, and the first root mean square error is smaller than the maximum value of the second root mean square error and the third root mean square error, then it is determined that the measured result of any floating-point number is within the acceptable disturbance error range.

6. A detection device, characterized in that: include: A data production and distribution module, used to use a first floating-point number to be detected as a measured object, and determine a first reference object and a second reference object of the measured object, wherein the second reference object is obtained by superimposing a disturbance on the measured object; A data collection preprocessing module, used to input the measured object, the first reference object and the second reference object into operators for calculation respectively, to obtain the measured result of the measured object, the reference result of the first reference object and the disturbance result of the second reference object; A determination module is used to determine an acceptable disturbance error range according to the measured result, the reference result and the disturbance result, and to determine whether the measured result is within the acceptable disturbance error range.

7. The detection device according to claim 6, characterized in that: The accuracy of the measured object is lower than the accuracy of the first reference object or the second reference object, or the accuracy of the measured object is the same as the accuracy of the first reference object and the second reference object; If the accuracy of the measured object is lower than that of the first reference object or the second reference object, the first reference object is obtained by performing precision conversion on the first floating-point number, and the second reference object is obtained by performing precision conversion on the first floating-point number and superimposing the disturbance.

8. The detection device according to claim 6 or 7, characterized in that: The disturbance is at least 1 bit, and the parameters of the second reference object include a disturbance upper limit and a disturbance lower limit obtained by superimposing the disturbance; The measured result includes a first output result and a first root mean square error, wherein the first output result is obtained by inputting the measured object into the operator for calculation, and the first root mean square error is a root mean square error between the reference result and the first output result; The disturbance result includes a second output result, a third output result, a second root mean square error and a third root mean square error. The second output result is obtained by inputting the upper limit of the disturbance into the operator, and the third output result is obtained by inputting the lower limit of the disturbance into the calculation. The second root mean square error is the root mean square error between the second output result and the reference result, and the third root mean square error is the root mean square error between the third output result and the reference result.

9. The detection device according to claim 8, characterized in that: The determination module is used for: Obtaining a first difference and a second difference, wherein the first difference is a difference between the second output result and the reference result, and the second difference is a difference between the third output result and the reference result, wherein the acceptable disturbance error range is that an absolute value of the difference between the first output result and the reference result is less than a maximum value within a range between the first difference and the second difference, and the first root mean square error is less than a maximum value between the second root mean square error and the third root mean square error; If the absolute value of the difference between the first output result and the reference result is smaller than the maximum value within the range of the first difference and the second difference, and the first root mean square error is smaller than the maximum value of the second root mean square error and the third root mean square error, then it is determined that the measured result is within the acceptable disturbance error range.

10. The detection device according to claim 8, characterized in that: If the first floating-point number includes at least one floating-point number, each floating-point number in the at least one floating-point number is used as a measured object; The determination module is used for: For the at least one floating-point number, obtain a first difference and a second difference corresponding to each floating-point number point by point, wherein the first difference is a difference between the second output result and the reference result, the second difference is a difference between the third output result and the reference result, and the acceptable disturbance error range is that an absolute value of the difference between the first output result and the reference result is less than a maximum value within a range between the first difference and the second difference, and the first root mean square error is less than a maximum value between the second root mean square error and the third root mean square error; Compare point by point whether the absolute value of the difference between the first output result and the reference result of each floating-point number is less than the maximum value within the range of the first difference and the second difference, and for a group of the second root mean square error and the third root mean square error corresponding to each floating-point number, compare group by group whether the first root mean square error corresponding to each floating-point number is less than the maximum value of a corresponding group of the second root mean square error and the third root mean square error; If the absolute value of the difference between the first output result corresponding to any floating-point number and the reference result is smaller than the maximum value within the range of the first difference and the second difference, and the first root mean square error is smaller than the maximum value of the second root mean square error and the third root mean square error, then it is determined that the measured result of any floating-point number is within the acceptable disturbance error range.

11. A detection device, characterized in that: The device comprises a processor and a memory, wherein the memory is used to store data and programs, and the processor is used to: Taking a first floating-point number to be detected as a measured object, and determining a first reference object and a second reference object of the measured object, wherein the second reference object is obtained by superimposing a disturbance on the measured object; Input the measured object, the first reference object and the second reference object into operators for calculation respectively, to obtain the measured result of the measured object, the reference result of the first reference object and the disturbance result of the second reference object; An acceptable disturbance error range is determined according to the measured result, the reference result and the disturbance result, and it is determined whether the measured result is within the acceptable disturbance error range.

12. The detection device according to claim 11, characterized in that: The accuracy of the measured object is lower than the accuracy of the first reference object or the second reference object, or the accuracy of the measured object is the same as the accuracy of the first reference object and the second reference object; If the accuracy of the measured object is lower than that of the first reference object or the second reference object, the first reference object is obtained by performing precision conversion on the first floating-point number, and the second reference object is obtained by performing precision conversion on the first floating-point number and superimposing the disturbance.

13. The detection device according to claim 11 or 12, characterized in that: The disturbance is at least 1 bit, and the parameters of the second reference object include a disturbance upper limit and a disturbance lower limit obtained by superimposing the disturbance; The measured result includes a first output result and a first root mean square error, wherein the first output result is obtained by inputting the measured object into the operator for calculation, and the first root mean square error is a root mean square error between the reference result and the first output result; The disturbance result includes a second output result, a third output result, a second root mean square error and a third root mean square error. The second output result is obtained by inputting the upper limit of the disturbance into the operator, and the third output result is obtained by inputting the lower limit of the disturbance into the calculation. The second root mean square error is the root mean square error between the second output result and the reference result, and the third root mean square error is the root mean square error between the third output result and the reference result.

14. The detection device according to claim 13, characterized in that: The processor is used to: obtain a first difference and a second difference, wherein the first difference is a difference between the second output result and the reference result, the second difference is a difference between the third output result and the reference result, the acceptable disturbance error range is that an absolute value of the difference between the first output result and the reference result is less than a maximum value within a range between the first difference and the second difference, and the first root mean square error is less than a maximum value between the second root mean square error and the third root mean square error; If the absolute value of the difference between the first output result and the reference result is smaller than the maximum value within the range of the first difference and the second difference, and the first root mean square error is smaller than the maximum value of the second root mean square error and the third root mean square error, then it is determined that the measured result is within the acceptable disturbance error range.

15. The detection device according to claim 13, characterized in that: If the first floating-point number includes at least one floating-point number, each floating-point number in the at least one floating-point number is used as a measured object; The processor is used to: For the at least one floating-point number, a first difference and a second difference corresponding to each floating-point number are obtained point by point; the first difference is a difference between the second output result and the reference result, the second difference is a difference between the third output result and the reference result, the acceptable disturbance error range is that the absolute value of the difference between the first output result and the reference result is less than the maximum value within the range of the first difference and the second difference, and the first root mean square error is less than the maximum value of the second root mean square error and the third root mean square error; Compare point by point whether the absolute value of the difference between the first output result and the reference result of each floating-point number is less than the maximum value within the range of the first difference and the second difference, and for a group of the second root mean square error and the third root mean square error corresponding to each floating-point number, compare group by group whether the first root mean square error corresponding to each floating-point number is less than the maximum value of a corresponding group of the second root mean square error and the third root mean square error; If the absolute value of the difference between the first output result corresponding to any floating-point number and the reference result is smaller than the maximum value within the range of the first difference and the second difference, and the first root mean square error is smaller than the maximum value of the second root mean square error and the third root mean square error, then it is determined that the measured result of any floating-point number is within the acceptable disturbance error range.

16. A detection device, characterized in that: It includes an analysis engine module, a network device module, a data storage module, a reference object execution module and a measured object execution module; the analysis engine module is used to support data processing detection; the network device module is used to connect various modules and subsystems; the data storage module is used to support various data storage and backup; the reference object execution module is used to calculate a group of reference objects, and the measured object execution module is used to calculate a group of measured objects; The analysis engine module comprises: A joint detection submodule is used to obtain the detection result of the detected object through one or a group of detection methods; The data feature analysis submodule is used to analyze the input data, output data, intermediate data and the detection result of the detection device to obtain the data feature analysis result, and perform accuracy selection on the object to be detected according to the data feature analysis result.

17. The detection device according to claim 16, characterized in that: The joint detection submodule includes the definition and implementation of various detection methods, one or a group of detection methods specified by different objects to be detected, and the threshold setting of each detection method can be adaptively adjusted according to different objects to be detected; The data feature analysis results include the interval distribution, dimension, model and rules of combined input scenarios of the input data and the output data, deviation characteristics, discrete characteristics of the output data, and positive and negative sample detection result characteristics.

18. A communication device, characterized in that: The device comprises a memory storing computer instructions, and when the computer instructions are executed, the communication device executes the method according to any one of claims 1 to 5.

19. A computer storage medium, characterized in that: The computer storage medium stores computer instructions, and when the computer instructions are executed by a computer, the computer is caused to execute the method according to any one of claims 1 to 5.