CN115934346B - Operator automatic detection method and device, electronic equipment and medium - Google Patents
Operator automatic detection method and device, electronic equipment and medium Download PDFInfo
- Publication number
- CN115934346B CN115934346B CN202211689392.8A CN202211689392A CN115934346B CN 115934346 B CN115934346 B CN 115934346B CN 202211689392 A CN202211689392 A CN 202211689392A CN 115934346 B CN115934346 B CN 115934346B
- Authority
- CN
- China
- Prior art keywords
- operator
- detected
- computing
- calculation
- result
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Debugging And Monitoring (AREA)
Abstract
The application discloses an operator automatic detection method, an operator automatic detection device, electronic equipment and a medium. By applying the technical scheme of the application, the operator supporting capability of the operator to be detected under different computing devices can be automatically tested. And obtaining the calculation capability judgment of the operator under different scenes by comparing the calculation precision and calculation efficiency of the operator to be detected with the capability of the standard result. Therefore, the problem that the required operators cannot be applied to different hardware devices or different application functions in the related technology is avoided.
Description
Technical Field
The present application relates to data processing technologies, and in particular, to an operator automatic detection method, apparatus, electronic device, and medium.
Background
The operator is a calculation unit for constructing an artificial intelligence application algorithm, is encapsulated by related hardware, and can be called by the artificial intelligence application and obtain a return result.
In the related art, an operator interface defines an operator calling form and a function description, but different hardware devices have different supporting capacities on operators, and the difference is mainly reflected in calculation efficiency and calculation precision. This also results in the prior art that different application functions are running efficiently on the same hardware device. And the same application functions are good or bad running on different hardware devices. In this case, this is often caused by the fact that no operator units are provided with the appropriate algorithm capabilities for the hardware device or application function.
Therefore, how to detect the algorithm capability of each operator unit is to avoid the problem that proper operators cannot be matched for different hardware devices or different application functions. Which is a problem to be solved by the person skilled in the art.
Disclosure of Invention
The embodiment of the application provides an operator automatic detection method, an operator automatic detection device, electronic equipment and a medium. The method is used for solving the problem that the algorithm capability detection cannot be carried out on the operator units in the related technology.
According to an aspect of the embodiment of the present application, there is provided an operator automatic detection method, including:
acquiring an operator to be detected, and configuring a corresponding computing task for the operator to be detected, wherein the computing task comprises at least one computing rule and corresponding computing equipment;
starting a calculation task of the operator to be detected in the calculation equipment, and obtaining a calculation result to be detected corresponding to the operator to be detected;
determining the computing capacity corresponding to the operator to be detected based on the computing result to be detected and a standard computing result, wherein the standard computing result is a computing result obtained by the standard operator under the computing task;
and determining a detection result of the operator to be detected according to the corresponding computing capacity of the operator to be detected.
Optionally, in another embodiment of the above method according to the present application, after the configuring of the corresponding computing task for the operator to be detected, the method further includes:
acquiring a computing frame language characterized by the computing rule; obtaining an operator function for constructing the operator to be detected;
the first data format of the operator function is converted into a second data format that matches the computing framework language.
Optionally, in another embodiment of the foregoing method according to the present application, the starting, in the computing device, a computing task of the operator to be detected, and obtaining a computing result to be detected corresponding to the operator to be detected, includes:
acquiring the calculated circulation times represented by the calculation rule;
and respectively starting the operator to be detected in at least one computing device to execute the computing task under the computing cycle times to obtain a computing result to be detected of the operator to be detected in at least one computing device.
Optionally, in another embodiment of the above method according to the present application, the determining, based on the to-be-detected calculation result and the standard calculation result, the calculation capability corresponding to the to-be-detected operator includes:
acquiring a calculated value, a calculated time length and the number of calculation failures included in the calculation result to be detected;
determining the calculation accuracy and calculation efficiency of the operator to be detected based on the calculation value, the calculation time length and the comparison of the calculation failure times and the standard calculation result;
and taking the calculation accuracy and the calculation efficiency as the calculation capacity corresponding to the operator to be detected.
Optionally, in another embodiment of the above method according to the present application, before the determining, based on the to-be-detected calculation result and the standard calculation result, a calculation capability corresponding to the to-be-detected operator further includes:
obtaining a standard operator name lookup table, wherein the standard operator name lookup table comprises a plurality of standard calculation results obtained by executing a plurality of different calculation tasks by a standard operator under a plurality of different calculation devices;
searching the standard calculation result matched with the calculation task corresponding to the operator to be detected in the standard operator name lookup table.
Optionally, in another embodiment of the above method according to the present application, the determining, according to the computing capability corresponding to the operator to be detected, a detection result of the operator to be detected includes:
if the computing capacity corresponding to the operator to be detected is determined to be greater than a preset threshold, determining that the detection result of the operator to be detected is qualified, and storing the association relation between the operator to be detected and the detection result into a call log;
or alternatively, the first and second heat exchangers may be,
and if the computing capacity corresponding to the operator to be detected is smaller than or equal to the preset threshold, determining that the detection result of the operator to be detected is unqualified.
Optionally, in another embodiment of the above method according to the present application, the acquiring an operator to be detected includes:
calling a data processing function module, and constructing an initial operator by a preset method, wherein the preset method comprises data definition, data conversion and data loading;
and calling a data processing function module, and defining an operator function of the initial operator to obtain the operator to be detected.
According to still another aspect of the embodiment of the present application, an automatic operator detection apparatus is provided, which is characterized by comprising:
the configuration module is configured to acquire an operator to be detected and configure a corresponding calculation task for the operator to be detected, wherein the calculation task comprises at least one calculation rule and corresponding calculation equipment;
the starting module is configured to start a calculation task of the operator to be detected in the computing equipment and obtain a calculation result to be detected corresponding to the operator to be detected;
the determining module is configured to determine the computing capacity corresponding to the operator to be detected based on the computing result to be detected and a standard computing result, wherein the standard computing result is a computing result obtained by the standard operator under the computing task;
the generating module is configured to determine a detection result of the operator to be detected according to the corresponding computing capability of the operator to be detected.
According to still another aspect of an embodiment of the present application, there is provided an electronic apparatus including:
a memory for storing executable instructions; and
and the display is used for executing the executable instructions with the memory so as to finish the operation of the automatic detection method of any operator.
According to a further aspect of an embodiment of the present application, there is provided a computer-readable storage medium storing computer-readable instructions that, when executed, perform the operations of the automatic detection method of any one of the operators described above.
In the application, an operator to be detected is obtained, and a corresponding calculation task is configured for the operator to be detected, wherein the calculation task comprises at least one calculation rule and corresponding calculation equipment; starting a calculation task of an operator to be detected in the calculation equipment, and obtaining a calculation result to be detected corresponding to the operator to be detected; determining the computing capacity corresponding to the operator to be detected based on the computing result to be detected and the standard computing result, wherein the standard computing result is the computing result obtained by the standard operator under the computing task; and determining the detection result of the operator to be detected according to the corresponding calculation capability of the operator to be detected. By applying the technical scheme of the application, the operator supporting capability of the operator to be detected under different computing devices can be automatically tested. And obtaining the calculation capability judgment of the operator under different scenes by comparing the calculation precision and calculation efficiency of the operator to be detected with the capability of the standard result. Therefore, the problem that the required operators cannot be applied to different hardware devices or different application functions in the related technology is avoided.
The technical scheme of the application is further described in detail through the drawings and the embodiments.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description, serve to explain the principles of the application.
The application may be more clearly understood from the following detailed description taken in conjunction with the accompanying drawings, in which:
FIG. 1 is a schematic diagram of an operator automatic detection method according to an embodiment of the present application;
FIG. 2 is a flow chart of an operator automatic detection method according to an embodiment of the present application;
FIG. 3 is a schematic diagram of an electronic device according to an embodiment of the application;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 5 shows a schematic diagram of a storage medium according to an embodiment of the present application.
Detailed Description
Various exemplary embodiments of the present application will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present application unless it is specifically stated otherwise.
Meanwhile, it should be understood that the sizes of the respective parts shown in the drawings are not drawn in actual scale for convenience of description.
The following description of at least one exemplary embodiment is merely exemplary in nature and is in no way intended to limit the application, its application, or uses.
Techniques, methods, and apparatus known to one of ordinary skill in the relevant art may not be discussed in detail, but are intended to be part of the specification where appropriate.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further discussion thereof is necessary in subsequent figures.
In addition, the technical solutions of the embodiments of the present application may be combined with each other, but it is necessary to be based on the fact that those skilled in the art can implement the technical solutions, and when the technical solutions are contradictory or cannot be implemented, the combination of the technical solutions should be considered as not existing, and not falling within the scope of protection claimed by the present application.
It should be noted that, in the embodiments of the present application, all directional indicators (such as up, down, left, right, front, and rear … …) are merely used to explain the relative positional relationship, movement conditions, and the like between the components in a specific posture (as shown in the drawings), and if the specific posture is changed, the directional indicators are correspondingly changed accordingly.
An automatic detection method for performing an operator according to an exemplary embodiment of the present application is described below with reference to fig. 1 to 2. It should be noted that the following application scenarios are only shown for facilitating understanding of the spirit and principles of the present application, and embodiments of the present application are not limited in this respect. Rather, embodiments of the application may be applied to any scenario where applicable.
The application also provides an operator automatic detection method, an operator automatic detection device, electronic equipment and a medium.
Fig. 1 schematically shows a flow diagram of an operator automatic detection method according to an embodiment of the application. The method comprises the following steps:
s101, acquiring an operator to be detected, and configuring a corresponding computing task for the operator to be detected, wherein the computing task comprises at least one computing rule and corresponding computing equipment.
S102, starting a calculation task of an operator to be detected in the calculation equipment, and obtaining a calculation result to be detected corresponding to the operator to be detected.
S103, determining the computing capacity corresponding to the operator to be detected based on the computing result to be detected and the standard computing result, wherein the standard computing result is the computing result obtained by the standard operator under the computing task.
S104, determining the detection result of the operator to be detected according to the corresponding calculation capability of the operator to be detected.
In one mode, the operator is a computing unit for constructing an artificial intelligence application algorithm, is encapsulated by related hardware equipment, and can be called by the artificial intelligence application and obtain a return result. The operator interface defines the calling form and the function description of the operator, but different hardware devices have different supporting capacities on the operator, and the difference is mainly reflected in the calculation efficiency and the calculation precision. When an artificial intelligence application wishes to accelerate using a hardware device, it is first determined whether the hardware device supports the operator invoked in the application. However, this presents a problem in that it is generally difficult for business users to know which operators are supported by a piece of hardware equipment and which applications are operating well on that piece of hardware equipment.
Wherein, different hardware devices are carriers of artificial intelligence application operation. The special artificial intelligence hardware device can increase the calculation speed by several orders of magnitude higher than the CPU, thereby ensuring that the artificial intelligence application completes the calculation on time. In order to realize hardware device acceleration by applying common operators to artificial intelligence, special artificial intelligence hardware devices are specially designed and realized. Thus, the computing speed and the computing accuracy of operators are different for different artificial intelligence hardware devices.
The artificial intelligence framework is the underlying software for artificial intelligence applications. The artificial intelligence framework can be utilized to quickly form an independently operated artificial intelligence application. The artificial intelligence framework manages the CPU and the artificial intelligence hardware equipment, and can realize the CPU calculation and the cooperative calculation of the CPU and the artificial intelligence calculation by the interaction of the driving software and the hardware equipment.
Wherein the operators exist in the framework as a library of computations provided by the hardware device. The compiler of the framework decides which operators are allocated to run on the CPU and which operators are run on the artificial intelligence hardware device. However, the compiler does not know which are operators, and thus cannot analyze and output on which hardware device the operators are executing. For a mainstream interpreted language such as Python, the operation is performed while being interpreted, and specific execution details of the operator can only be obtained through execution.
In one approach, the operators are special operations for artificial intelligence applications, the hardware devices are carriers for operator execution, and the framework is code that compiles the applications into hardware device executables, thereby making efficient use of the operators. However, the compiler does not pay attention to the computational power and efficiency of the operators. The application cannot effectively confirm the support condition of the hardware device to the operator. This makes it difficult for an application to evaluate the computing power and compatibility of the hardware device from an operator perspective, and only the hardware device can be seen as a result of the computation. This tends to result in different artificial intelligence applications running faster and slower on the same hardware device; the same application runs on different hardware devices. In this case, the problem that the appropriate operators cannot be matched for different hardware devices or different application functions often results. And further seriously influences the accuracy of hardware equipment type selection and the development efficiency of the application.
In order to solve the problems, the application provides an operator automatic detection method, which aims to realize automatic detection of algorithm supporting capability of an operator to be detected under different computing devices. And the computing capability of the operator under different scenes is obtained by comparing the computing precision and computing efficiency of the operator to be detected with the capability of the standard result. Therefore, the problem that proper operators cannot be matched for different hardware devices or different application functions in the related technology is avoided.
Further, the present application is described with reference to fig. 2, which illustrates the following specific steps:
step 1, acquiring an operator to be detected, and configuring a corresponding calculation task for the operator to be detected.
In one mode, the application does not limit the number of operators to be detected, and for example, the operators can be one or a plurality of operators.
Similarly, the present application is not limited to the number of calculation tasks of the operator to be detected, and for example, the number may be one or more.
Wherein the computing task includes at least one computing rule and a corresponding computing device. In one approach, the computing tasks may be computing tasks required to implement various types of application functions. The embodiment of the application can determine the matching degree of the operator to be detected and each application function through the capability expression of the operator to be detected under different calculation tasks.
It should be noted that, since the present application needs to determine the computing capability of an operator to be detected under different computing devices, the computing task configured for the operator to be detected needs to include the computing task of the operator under one or more computing devices. To achieve the purpose of configuring each operator to be detected under corresponding computing equipment.
Step 2, acquiring a computing framework language represented by a computing rule; and obtaining an operator function for constructing the operator to be detected.
Wherein the computation rules include specific business computation logic and the computation framework language required to execute the business computation logic.
In one approach, business computing logic is used to instruct operators to be detected to perform the action of computation. Such as specific processing (e.g., identifying a particular object, solving a particular result, etc.) of a set of data (e.g., one or more of a field set, an image set, a text set).
In another manner, the computing framework language provides the language context required to execute the business computing logic, and may include, for example, various system languages such as JAVA, various model languages, various database languages, and so forth.
And step 3, converting the first data format of the operator function into a second data format matched with the computing frame language.
Further, since the operator unit is essentially a function calculation, and the function calculation can determine the execution of the function as long as the input and output are determined.
Therefore, the application can define the data conversion of the operator function according to the data format of the target computing frame language so as to convert the data format into a second data format matched with the computing frame language. So as to realize that the operator to be detected can execute corresponding one or more computing tasks in the scene under the target computing framework language.
And 4, obtaining the calculated circulation times represented by the calculation rules.
And 5, respectively starting the operator to be detected in at least one computing device to execute the computing tasks under the computing cycle times, and obtaining the computing result to be detected of the operator to be detected in at least one computing device.
Further, the embodiment of the application configures one or more corresponding computing devices, computing cycle times and computing frameworks for the computing task of the operator to be detected. And the detection of the computing power of the operator to be detected is realized aiming at different scenes.
Alternatively, the embodiment provided in the application can detect one operator, and also detect one operator set one by one in the same way, and obtain the detection result one by one.
And 6, acquiring a calculated value, a calculated time length and the number of calculation failures included in the calculation result to be detected.
Furthermore, the embodiment of the application needs to compare and evaluate the results obtained by calculating the operator to be detected. To learn the computing power of the operator to be detected in each computing device.
Specifically, the embodiment of the application needs to compare the calculation result to be detected of the operator with the standard result, and then evaluate the calculation capability (the capability depends on the calculation accuracy and the calculation efficiency) by calculating the error between the calculation result and the standard result.
And 7, acquiring a standard operator name lookup table.
The standard operator name lookup table comprises a plurality of standard calculation results obtained by the standard operator executing a plurality of different calculation tasks under a plurality of different calculation devices.
And 8, searching a standard calculation result matched with a calculation task corresponding to the operator to be detected in a standard operator name lookup table.
In one mode, the standard result may be obtained by calculating each calculation task by using a standard operator under different calculation devices in advance, and then storing the obtained standard result.
It can be understood that the compatibility and the calculation efficiency of each hardware device to the operator are automatically analyzed and judged from the angle of the operator, so that the description and judgment of the supporting capability of different hardware devices to the operator unit are obtained.
And 9, determining the calculation accuracy and the calculation efficiency of the operator to be detected based on the comparison of the calculated value, the calculation duration and the calculation failure times with the standard calculation result, and taking the calculation accuracy and the calculation efficiency as the corresponding calculation capacity of the operator to be detected.
In one mode, the main object of the application is to orient to different artificial intelligence computing hardware and computing frameworks, learn which operators can be operated by hardware equipment through an automatic monitoring technology, and select operators with higher computing efficiency and computing precision from the operators which can be operated to configure. Considering the different language expressions of different frameworks, the unified detection method of the operators is realized by adopting the idea of data format conversion, so that the operators can automatically translate from the intermediate table to the source code level of the specific framework, and the automatic detection of the operators can be realized.
And step 10, if the computing capacity corresponding to the operator to be detected is determined to be greater than a preset threshold, determining that the detection result of the operator to be detected is qualified, and storing the association relation between the operator to be detected and the detection result into a call log.
In the application, an operator to be detected is obtained, and a corresponding calculation task is configured for the operator to be detected, wherein the calculation task comprises at least one calculation rule and corresponding calculation equipment; starting a calculation task of an operator to be detected in the calculation equipment, and obtaining a calculation result to be detected corresponding to the operator to be detected; determining the computing capacity corresponding to the operator to be detected based on the computing result to be detected and the standard computing result, wherein the standard computing result is the computing result obtained by the standard operator under the computing task; and determining the detection result of the operator to be detected according to the corresponding calculation capability of the operator to be detected. By applying the technical scheme of the application, the operator supporting capability of the operator to be detected under different computing devices can be automatically tested. And obtaining the calculation capability judgment of the operator under different scenes by comparing the calculation precision and calculation efficiency of the operator to be detected with the capability of the standard result. Therefore, the problem that the required operators cannot be applied to different hardware devices or different application functions in the related technology is avoided.
Optionally, in another embodiment of the above method according to the present application, after the configuring of the corresponding computing task for the operator to be detected, the method further includes:
acquiring a computing frame language characterized by the computing rule; obtaining an operator function for constructing the operator to be detected;
the first data format of the operator function is converted into a second data format that matches the computing framework language.
Optionally, in another embodiment of the foregoing method according to the present application, the starting, in the computing device, a computing task of the operator to be detected, and obtaining a computing result to be detected corresponding to the operator to be detected, includes:
acquiring the calculated circulation times represented by the calculation rule;
and respectively starting the operator to be detected in at least one computing device to execute the computing task under the computing cycle times to obtain a computing result to be detected of the operator to be detected in at least one computing device.
Optionally, in another embodiment of the above method according to the present application, the determining, based on the to-be-detected calculation result and the standard calculation result, the calculation capability corresponding to the to-be-detected operator includes:
acquiring a calculated value, a calculated time length and the number of calculation failures included in the calculation result to be detected;
determining the calculation accuracy and calculation efficiency of the operator to be detected based on the calculation value, the calculation time length and the comparison of the calculation failure times and the standard calculation result;
and taking the calculation accuracy and the calculation efficiency as the calculation capacity corresponding to the operator to be detected.
Optionally, in another embodiment of the above method according to the present application, before the determining, based on the to-be-detected calculation result and the standard calculation result, a calculation capability corresponding to the to-be-detected operator further includes:
obtaining a standard operator name lookup table, wherein the standard operator name lookup table comprises a plurality of standard calculation results obtained by executing a plurality of different calculation tasks by a standard operator under a plurality of different calculation devices;
searching the standard calculation result matched with the calculation task corresponding to the operator to be detected in the standard operator name lookup table.
Optionally, in another embodiment of the above method according to the present application, the determining, according to the computing capability corresponding to the operator to be detected, a detection result of the operator to be detected includes:
if the computing capacity corresponding to the operator to be detected is determined to be greater than a preset threshold, determining that the detection result of the operator to be detected is qualified, and storing the association relation between the operator to be detected and the detection result into a call log;
or alternatively, the first and second heat exchangers may be,
and if the computing capacity corresponding to the operator to be detected is smaller than or equal to the preset threshold, determining that the detection result of the operator to be detected is unqualified.
In one mode, the embodiment of the present application further describes the scheme:
and a step a, constructing each operator to be detected.
And b, constructing a standard operator and a function name set corresponding to the standard result to form a standard operator name lookup table.
And c, constructing a name set of operators to be detected, which is required to be detected, and indicating the computing equipment, the computing cycle times and the data format corresponding to the frame language to which each operator to be detected belongs.
And d, constructing a test program template, wherein the test program template comprises a program initialization part and a template part.
And e, automatically calling a configuration file by the test program template part, and forming the call of an operator calculation task according to the operator name.
Step f, the detection result call log of the operator to be detected is saved, and the step f comprises the following steps: operator name to be detected, operator calculation accuracy, calculation time length, failure information and the like.
And g, when the follow-up service is needed, obtaining a detection result of the operator to be detected by checking the call log.
Optionally, in another embodiment of the above method according to the present application, the acquiring an operator to be detected includes:
calling a data processing function module, and constructing an initial operator by a preset method, wherein the preset method comprises data definition, data conversion and data loading;
and calling a data processing function module, and defining an operator function of the initial operator to obtain the operator to be detected.
Further, for the construction of the operator to be detected, an initial operator can be constructed in a data definition, data conversion and data loading mode by calling a data processing function module.
Wherein, the data definition mainly defines the type of data, including scalar, vector, matrix, tensor, etc., and the precision of the data includes byte, integer, mixed precision, single precision, double precision, etc. The data definition here will use the array type of NumPy.
In addition, data conversion is mainly conversion of various standard data definitions into a target framework. Finally, data loading primarily defines the various I/O functions for which data is loaded from a file. And subsequently calling a data processing function module, and defining an operator function of the initial operator to obtain the operator to be detected.
By applying the technical scheme of the application, the operator supporting capability of the operator to be detected under different computing devices can be automatically tested. And obtaining the calculation capability judgment of the operator under different scenes by comparing the calculation precision and calculation efficiency of the operator to be detected with the capability of the standard result. Therefore, the problem that the required operators cannot be applied to different hardware devices or different application functions in the related technology is avoided.
Optionally, in another embodiment of the present application, as shown in fig. 3, the present application further provides an operator automatic detection device. The method comprises the following steps:
a configuration module 201, configured to obtain an operator to be detected, and configure a corresponding computing task for the operator to be detected, where the computing task includes at least one computing rule and a corresponding computing device;
the starting module 202 is configured to start a computing task of the operator to be detected in the computing device, and obtain a computing result to be detected corresponding to the operator to be detected;
the determining module 203 is configured to determine, based on the to-be-detected calculation result and a standard calculation result, a calculation capability corresponding to the operator to be detected, where the standard calculation result is a calculation result obtained by the standard operator under the calculation task;
the generating module 204 is configured to determine a detection result of the operator to be detected according to the computing capability corresponding to the operator to be detected.
In the application, an operator to be detected is obtained, and a corresponding calculation task is configured for the operator to be detected, wherein the calculation task comprises at least one calculation rule and corresponding calculation equipment; starting a calculation task of an operator to be detected in the calculation equipment, and obtaining a calculation result to be detected corresponding to the operator to be detected; determining the computing capacity corresponding to the operator to be detected based on the computing result to be detected and the standard computing result, wherein the standard computing result is the computing result obtained by the standard operator under the computing task; and determining the detection result of the operator to be detected according to the corresponding calculation capability of the operator to be detected. By applying the technical scheme of the application, the operator supporting capability of the operator to be detected under different computing devices can be automatically tested. And obtaining the calculation capability judgment of the operator under different scenes by comparing the calculation precision and calculation efficiency of the operator to be detected with the capability of the standard result. Therefore, the problem that the required operators cannot be applied to different hardware devices or different application functions in the related technology is avoided.
In another embodiment of the present application, the start module 202 is configured to perform steps comprising:
acquiring a computing frame language characterized by the computing rule; obtaining an operator function for constructing the operator to be detected;
the first data format of the operator function is converted into a second data format that matches the computing framework language.
In another embodiment of the present application, the start module 202 is configured to perform steps comprising:
acquiring the calculated circulation times represented by the calculation rule;
and respectively starting the operator to be detected in at least one computing device to execute the computing task under the computing cycle times to obtain a computing result to be detected of the operator to be detected in at least one computing device.
In another embodiment of the present application, the start module 202 is configured to perform steps comprising:
acquiring a calculated value, a calculated time length and the number of calculation failures included in the calculation result to be detected;
determining the calculation accuracy and calculation efficiency of the operator to be detected based on the calculation value, the calculation time length and the comparison of the calculation failure times and the standard calculation result;
and taking the calculation accuracy and the calculation efficiency as the calculation capacity corresponding to the operator to be detected.
In another embodiment of the present application, the start module 202 is configured to perform steps comprising:
obtaining a standard operator name lookup table, wherein the standard operator name lookup table comprises a plurality of standard calculation results obtained by executing a plurality of different calculation tasks by a standard operator under a plurality of different calculation devices;
searching the standard calculation result matched with the calculation task corresponding to the operator to be detected in the standard operator name lookup table.
In another embodiment of the present application, the start module 202 is configured to perform steps comprising:
if the computing capacity corresponding to the operator to be detected is determined to be greater than a preset threshold, determining that the detection result of the operator to be detected is qualified, and storing the association relation between the operator to be detected and the detection result into a call log;
or alternatively, the first and second heat exchangers may be,
and if the computing capacity corresponding to the operator to be detected is smaller than or equal to the preset threshold, determining that the detection result of the operator to be detected is unqualified.
In another embodiment of the present application, the start module 202 is configured to perform steps comprising:
calling a data processing function module, and constructing an initial operator by a preset method, wherein the preset method comprises data definition, data conversion and data loading;
and calling a data processing function module, and defining an operator function of the initial operator to obtain the operator to be detected.
The embodiment of the application also provides electronic equipment for executing the automatic detection method of the operator. Referring to fig. 4, a schematic diagram of an electronic device according to some embodiments of the present application is shown. As shown in fig. 4, the electronic device 3 includes: a processor 300, a memory 301, a bus 302 and a communication interface 303, the processor 300, the communication interface 303 and the memory 301 being connected by the bus 302; the memory 301 stores a computer program executable on the processor 300, and the processor 300 executes the operator automatic detection method provided by any one of the foregoing embodiments of the present application when the computer program is executed.
The memory 301 may include a high-speed random access memory (RAM: random Access Memory), and may further include a non-volatile memory (non-volatile memory), such as at least one magnetic disk memory. The communication connection between the device network element and at least one other network element is achieved through at least one communication interface 303 (which may be wired or wireless), the internet, a wide area network, a local network, a metropolitan area network, etc. may be used.
Bus 302 may be an ISA bus, a PCI bus, an EISA bus, or the like. The buses may be classified as address buses, data buses, control buses, etc. The memory 301 is configured to store a program, and the processor 300 executes the program after receiving an execution instruction, and the operator automatic detection method disclosed in any of the foregoing embodiments of the present application may be applied to the processor 300 or implemented by the processor 300.
The processor 300 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in the processor 300 or by instructions in the form of software. The processor 300 may be a general-purpose processor, including a processor (Central Processing Unit, CPU for short), a network processor (Network Processor, NP for short), etc.; but may also be a Digital Signal Processor (DSP), application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components. The disclosed methods, steps, and logic blocks in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present application may be embodied directly in the execution of a hardware decoding processor, or in the execution of a combination of hardware and software modules in a decoding processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in the memory 301, and the processor 300 reads the information in the memory 301, and in combination with its hardware, performs the steps of the above method.
The electronic equipment provided by the embodiment of the application and the operator automatic detection method provided by the embodiment of the application have the same beneficial effects as the method adopted, operated or realized by the electronic equipment based on the same inventive concept.
The present application further provides a computer readable storage medium corresponding to the method for automatically detecting an operator provided in the foregoing embodiment, referring to fig. 5, the computer readable storage medium is shown as an optical disc 40, on which a computer program (i.e. a program product) is stored, where the computer program, when executed by a processor, performs the method for automatically detecting an operator provided in any of the foregoing embodiments.
It should be noted that examples of the computer readable storage medium may also include, but are not limited to, a phase change memory (PRAM), a Static Random Access Memory (SRAM), a Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a flash memory, or other optical or magnetic storage medium, which will not be described in detail herein.
The computer readable storage medium provided by the above embodiment of the present application has the same advantages as the method adopted, operated or implemented by the application program stored in the computer readable storage medium, because of the same inventive concept as the method for automatically detecting operators provided by the embodiment of the present application.
It should be noted that:
in the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the application may be practiced without these specific details. In some instances, well-known structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the above description of exemplary embodiments of the application, various features of the application are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be construed as reflecting the following schematic diagram: i.e., the claimed application requires more features than are expressly recited in each claim.
Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this application.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features but not others included in other embodiments, combinations of features of different embodiments are meant to be within the scope of the application and form different embodiments.
For example, in the following claims, any of the claimed embodiments can be used in any combination.
The present application is not limited to the above-mentioned embodiments, and any changes or substitutions that can be easily understood by those skilled in the art within the technical scope of the present application are intended to be included in the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims (8)
1. An automatic operator detection method, comprising:
acquiring an operator to be detected, and configuring a corresponding computing task for the operator to be detected, wherein the computing task comprises at least one computing rule and corresponding computing equipment;
acquiring a computing frame language characterized by the computing rule; obtaining an operator function for constructing the operator to be detected;
converting the first data format of the operator function into a second data format matched with the computing framework language;
starting a calculation task of the operator to be detected in the calculation equipment, and obtaining a calculation result to be detected corresponding to the operator to be detected;
determining the computing capacity corresponding to the operator to be detected based on the computing result to be detected and a standard computing result, wherein the standard computing result is a computing result obtained by the standard operator under the computing task, and the computing capacity corresponding to the operator to be detected is used for representing the matching degree of the operator to be detected and each application function;
determining a detection result of the operator to be detected according to the corresponding computing capacity of the operator to be detected;
before determining the computing capability corresponding to the operator to be detected based on the computing result to be detected and the standard computing result, the method further comprises the following steps:
obtaining a standard operator name lookup table, wherein the standard operator name lookup table comprises a plurality of standard calculation results obtained by executing a plurality of different calculation tasks by a standard operator under a plurality of different calculation devices;
searching the standard calculation result matched with the calculation task corresponding to the operator to be detected in the standard operator name lookup table.
2. The method of claim 1, wherein the starting, in the computing device, a computing task of the operator to be detected, and obtaining a result of the computation to be detected corresponding to the operator to be detected, includes:
acquiring the calculated circulation times represented by the calculation rule;
and respectively starting the operator to be detected in at least one computing device to execute the computing task under the computing cycle times to obtain a computing result to be detected of the operator to be detected in at least one computing device.
3. The method of claim 1, wherein the determining the computing power corresponding to the operator to be detected based on the result to be detected and a standard result of computation comprises:
acquiring a calculated value, a calculated time length and the number of calculation failures included in the calculation result to be detected;
determining the calculation accuracy and calculation efficiency of the operator to be detected based on the calculation value, the calculation time length and the comparison of the calculation failure times and the standard calculation result;
and taking the calculation accuracy and the calculation efficiency as the calculation capacity corresponding to the operator to be detected.
4. The method of claim 1, wherein the determining the detection result of the operator to be detected according to the computing capability corresponding to the operator to be detected comprises:
if the computing capacity corresponding to the operator to be detected is determined to be greater than a preset threshold, determining that the detection result of the operator to be detected is qualified, and storing the association relation between the operator to be detected and the detection result into a call log;
or alternatively, the first and second heat exchangers may be,
and if the computing capacity corresponding to the operator to be detected is smaller than or equal to the preset threshold, determining that the detection result of the operator to be detected is unqualified.
5. The method of claim 1, wherein the obtaining the operator to be detected comprises:
calling a data processing function module, and constructing an initial operator by a preset method, wherein the preset method comprises data definition, data conversion and data loading;
and calling a data processing function module, and defining an operator function of the initial operator to obtain the operator to be detected.
6. An operator automatic detection device, comprising:
the configuration module is configured to acquire an operator to be detected and configure a corresponding calculation task for the operator to be detected, wherein the calculation task comprises at least one calculation rule and corresponding calculation equipment;
acquiring a computing frame language characterized by the computing rule; obtaining an operator function for constructing the operator to be detected;
converting the first data format of the operator function into a second data format matched with the computing framework language;
the starting module is configured to start a calculation task of the operator to be detected in the computing equipment and obtain a calculation result to be detected corresponding to the operator to be detected;
the determining module is configured to determine the computing capacity corresponding to the operator to be detected based on the computing result to be detected and a standard computing result, wherein the standard computing result is a computing result obtained by the standard operator under the computing task, and the computing capacity corresponding to the operator to be detected is used for representing the matching degree of the operator to be detected and each application function;
the generating module is configured to determine a detection result of the operator to be detected according to the corresponding computing capacity of the operator to be detected;
before determining the computing capability corresponding to the operator to be detected based on the computing result to be detected and the standard computing result, the method further comprises the following steps:
obtaining a standard operator name lookup table, wherein the standard operator name lookup table comprises a plurality of standard calculation results obtained by executing a plurality of different calculation tasks by a standard operator under a plurality of different calculation devices;
searching the standard calculation result matched with the calculation task corresponding to the operator to be detected in the standard operator name lookup table.
7. An electronic device, comprising:
a memory for storing executable instructions; the method comprises the steps of,
a processor for executing the executable instructions to perform the operations of the method for automatically detecting operators of any of claims 1-5.
8. A computer readable storage medium storing computer readable instructions which, when executed by a processor, perform the operations of the method of automatic detection of operators of any of claims 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211689392.8A CN115934346B (en) | 2022-12-28 | 2022-12-28 | Operator automatic detection method and device, electronic equipment and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211689392.8A CN115934346B (en) | 2022-12-28 | 2022-12-28 | Operator automatic detection method and device, electronic equipment and medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115934346A CN115934346A (en) | 2023-04-07 |
CN115934346B true CN115934346B (en) | 2023-10-20 |
Family
ID=86652400
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211689392.8A Active CN115934346B (en) | 2022-12-28 | 2022-12-28 | Operator automatic detection method and device, electronic equipment and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115934346B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116402165B (en) * | 2023-06-07 | 2023-09-01 | 之江实验室 | Operator detection method and device, storage medium and electronic equipment |
CN117076282B (en) * | 2023-10-16 | 2023-12-15 | 北京大学 | Method and device for detecting time performance of hardware operator |
CN118378727B (en) * | 2024-06-26 | 2024-09-03 | 浪潮电子信息产业股份有限公司 | Data processing method, system, product, equipment and medium based on mixed precision |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113033757A (en) * | 2019-12-09 | 2021-06-25 | 中科寒武纪科技股份有限公司 | Method, apparatus and computer-readable storage medium for testing operator precision in neural networks |
CN113918472A (en) * | 2021-12-13 | 2022-01-11 | 北京壁仞科技开发有限公司 | Test method, test system and storage medium for operator library |
CN114218166A (en) * | 2021-11-04 | 2022-03-22 | 北京百度网讯科技有限公司 | Data processing method and device, electronic equipment and readable storage medium |
CN114564374A (en) * | 2022-02-21 | 2022-05-31 | 北京百度网讯科技有限公司 | Operator performance evaluation method and device, electronic equipment and storage medium |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11580433B2 (en) * | 2019-03-09 | 2023-02-14 | International Business Machines Corporation | Validating and estimating runtime for quantum algorithms |
-
2022
- 2022-12-28 CN CN202211689392.8A patent/CN115934346B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113033757A (en) * | 2019-12-09 | 2021-06-25 | 中科寒武纪科技股份有限公司 | Method, apparatus and computer-readable storage medium for testing operator precision in neural networks |
CN114218166A (en) * | 2021-11-04 | 2022-03-22 | 北京百度网讯科技有限公司 | Data processing method and device, electronic equipment and readable storage medium |
CN113918472A (en) * | 2021-12-13 | 2022-01-11 | 北京壁仞科技开发有限公司 | Test method, test system and storage medium for operator library |
CN114564374A (en) * | 2022-02-21 | 2022-05-31 | 北京百度网讯科技有限公司 | Operator performance evaluation method and device, electronic equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN115934346A (en) | 2023-04-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN115934346B (en) | Operator automatic detection method and device, electronic equipment and medium | |
CN111104335B (en) | C language defect detection method and device based on multi-level analysis | |
US20180011693A1 (en) | Methods and apparatus to eliminate partial-redundant vector loads | |
CN112100072B (en) | Static detection method, device, equipment and medium for application program code | |
CN112765023A (en) | Test case generation method and device | |
US11507348B2 (en) | Method and apparatus for generating chip-based computing function, device, and storage medium | |
US20230258718A1 (en) | Fault Detection Method and Related Apparatus | |
US20230367516A1 (en) | Program Detection Method and Apparatus | |
CN112181411A (en) | Menu generation method, menu generation device and diagnosis equipment | |
CN111897711B (en) | Positioning method and device for bug in code, electronic equipment and readable storage medium | |
CN111427578B (en) | Data conversion method, device and equipment | |
CN117195568A (en) | Simulation engine performance analysis method and device based on discrete event | |
CN115309499A (en) | Method and device for processing numerical groups in virtual machine, electronic equipment and readable storage medium | |
WO2023207973A1 (en) | Compiler test method and apparatus, case generation method and apparatus, and instruction storage structure | |
CN116107669A (en) | Operator registration method, device and equipment of deep learning framework and storage medium | |
CN114727100B (en) | Joint debugging method and device for monitoring equipment | |
JP4870956B2 (en) | Embedded program generation method, embedded program development system, and information table section | |
US20210182041A1 (en) | Method and apparatus for enabling autonomous acceleration of dataflow ai applications | |
CN112116083B (en) | Neural network accelerator and detection method and device thereof | |
CN113704687B (en) | Tensor calculation operation method, device and operation system | |
US11144435B1 (en) | Test case generation for software development using machine learning | |
CN114691496A (en) | Unit testing method, unit testing device, computing equipment and medium | |
US20120005055A1 (en) | Dynamic computation of roi for test automation | |
CN118069224B (en) | Address generation method, address generation device, computer equipment and storage medium | |
CN112612471B (en) | Code processing method, device, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |