CN115934346A - Automatic operator detection method and device, electronic equipment and medium - Google Patents

Automatic operator detection method and device, electronic equipment and medium Download PDF

Info

Publication number
CN115934346A
CN115934346A CN202211689392.8A CN202211689392A CN115934346A CN 115934346 A CN115934346 A CN 115934346A CN 202211689392 A CN202211689392 A CN 202211689392A CN 115934346 A CN115934346 A CN 115934346A
Authority
CN
China
Prior art keywords
operator
detected
calculation
computing
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.)
Granted
Application number
CN202211689392.8A
Other languages
Chinese (zh)
Other versions
CN115934346B (en
Inventor
曾炜
陈建平
袁孝宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Peking University
Original Assignee
Peking University
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Peking University filed Critical Peking University
Priority to CN202211689392.8A priority Critical patent/CN115934346B/en
Publication of CN115934346A publication Critical patent/CN115934346A/en
Application granted granted Critical
Publication of CN115934346B publication Critical patent/CN115934346B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE 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/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The application discloses an automatic operator detection method, an automatic operator detection device, electronic equipment and a medium. By applying the technical scheme of the application, the automatic test of the operator supporting capacity of the operator to be detected under different computing devices can be realized. And obtaining the calculation capability judgment of the operator under different scenes by comparing the calculation accuracy and the calculation efficiency of the operator to be detected with the capability of the standard result. Therefore, the problem that operators needed by different hardware devices or different application functions cannot be applied in the related technology is solved.

Description

Automatic operator detection method and device, electronic equipment and medium
Technical Field
The present application relates to data processing technologies, and in particular, to an automatic operator detection method, an automatic operator detection device, an electronic apparatus, and a medium.
Background
The operator is a computing unit for constructing an artificial intelligence application algorithm, is packaged by related hardware, and can be called by artificial intelligence application and obtain a return result.
In the related art, an operator interface defines the calling form and the function description of an operator, but different hardware devices have different support capabilities for the operator, and the difference is mainly reflected in the calculation efficiency and the calculation precision. This also leads to a situation in the prior art where different application functions are running efficiently on the same hardware device. And the same application function is good or bad to run on different hardware devices. This is often the case because of the lack of operator units to configure the hardware device or application function with the proper algorithmic capabilities.
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 automatic operator detection method, an automatic operator detection device, electronic equipment and a medium. The method is used for solving the problem that the algorithm capability of the operator unit cannot be detected in the related technology.
According to an aspect of the embodiments of the present application, a method for automatically detecting an operator is provided, including:
acquiring an operator to be detected, and configuring a corresponding calculation task 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 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 the detection result of the operator to be detected according to the corresponding computing capacity of the operator to be detected.
Optionally, in another embodiment based on the foregoing method of the present application, after configuring the corresponding computation task for the operator to be detected, the method further includes:
acquiring a computing framework language represented by the computing rule; acquiring an operator function for constructing the operator to be detected;
and converting the first data format of the operator function into a second data format matched with the computing framework language.
Optionally, in another embodiment based on the foregoing method of the present application, the starting, in the computing device, a calculation task of the operator to be detected, and obtaining a calculation result to be detected corresponding to the operator to be detected includes:
acquiring the number of calculation cycles represented by the calculation rule;
and respectively starting the operator to be detected in at least one piece of computing equipment to execute the computing task under the computing cycle number, so as to obtain the computing result to be detected of the operator to be detected in the at least one piece of computing equipment.
Optionally, in another embodiment based on the foregoing method of the present application, the determining, based on the to-be-detected calculation result and a standard calculation result, a calculation capability corresponding to the to-be-detected operator includes:
acquiring a calculation value, a calculation duration and calculation failure times included in the calculation result to be detected;
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 calculation capacity corresponding to the operator to be detected.
Optionally, in another embodiment based on the foregoing method of the present application, before determining, based on the to-be-detected calculation result and a standard calculation result, a calculation capability corresponding to the to-be-detected operator, the method further includes:
acquiring 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;
and 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 based on the foregoing method of the present application, the determining a detection result of the operator to be detected according to a computing capability corresponding to the operator to be detected includes:
if the calculation capacity corresponding to the operator to be detected is determined to be larger than a preset threshold value, determining that the detection result of the operator to be detected is qualified, and storing the incidence relation between the operator to be detected and the detection result into a call log;
or the like, or, alternatively,
and if the calculation capacity corresponding to the operator to be detected is determined to be smaller than or equal to the preset threshold value, determining that the detection result of the operator to be detected is unqualified.
Optionally, in another embodiment based on the foregoing method of 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, defining an operator function of the initial operator, and obtaining the operator to be detected.
According to another aspect of the embodiments of the present application, there is provided an apparatus for automatically detecting an operator, including:
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;
and the generation module is configured to determine the detection result of the operator to be detected according to the calculation capacity corresponding to the operator to be detected.
According to another aspect of the embodiments of the present application, there is provided an electronic device including:
a memory for storing executable instructions; and
a display, for communicating with the memory to execute the executable instructions to perform the operations of the method for automatic detection of an operator.
According to a further aspect of the embodiments of the present application, there is provided a computer-readable storage medium for storing computer-readable instructions, which when executed, perform the operations of the automatic detection method for an operator described above.
According to the method, 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 a standard computing result, wherein the standard computing result is a 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 computing capacity of the operator to be detected. By applying the technical scheme of the application, the automatic test of the operator supporting capacity of the operator to be detected under different computing devices can be realized. And obtaining the calculation capability judgment of the operator under different scenes by comparing the calculation accuracy and the calculation efficiency of the operator to be detected with the capability of the standard result. Therefore, the problem that operators needed by different hardware devices or different application functions cannot be applied in the related technology is solved.
The technical solution of the present application is further described in detail by the accompanying drawings and examples.
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 present application may be more clearly understood from the following detailed description with reference to the accompanying drawings, in which:
fig. 1 is a schematic diagram illustrating an automatic detection method for an operator according to an embodiment of the present application;
fig. 2 is a schematic flow chart illustrating an automatic operator detection method according to an embodiment of the present application;
FIG. 3 is a schematic diagram illustrating an electronic device according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 5 is 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, the numerical expressions, and numerical values set forth in these embodiments do not limit the scope of the present application unless specifically stated otherwise.
Meanwhile, it should be understood that the sizes of the respective portions shown in the drawings are not drawn in an actual proportional relationship for the convenience of description.
The following description of at least one exemplary embodiment is merely illustrative 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 numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
In addition, technical solutions between the various embodiments of the present application may be combined with each other, but it must be based on the realization of the technical solutions by a person skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination of technical solutions should be considered to be absent and not within the protection scope of the present application.
It should be noted that all directional indicators (such as upper, lower, left, right, front, and rear … …) in the embodiments of the present application are only used to explain the relative position relationship between the components, the motion situation, etc. in a specific posture (as shown in the drawing), and if the specific posture is changed, the directional indicator is changed accordingly.
An automatic detection method for performing operators according to an exemplary embodiment of the present application is described below with reference to fig. 1-2. It should be noted that the following application scenarios are merely illustrated for the convenience of understanding the spirit and principles of the present application, and the embodiments of the present application are not limited in this respect. Rather, embodiments of the present application may be applied to any scenario where applicable.
The application also provides an automatic operator detection method, an automatic operator detection device, electronic equipment and a medium.
Fig. 1 schematically shows a flow chart of an automatic detection method of an operator according to an embodiment of the present application. The method comprises the following steps:
s101, 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.
S102, 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.
S103, 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 S104, determining the detection result of the operator to be detected according to the corresponding calculation capacity of the operator to be detected.
In one approach, the operators are computing units that construct the artificial intelligence application algorithm, are encapsulated by the relevant hardware devices, can be invoked 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 support capabilities for the operator, and the difference is mainly embodied in the calculation efficiency and the calculation precision. When an artificial intelligence application wishes to accelerate using a hardware device of some type, it is first determined whether the hardware device of this type supports the operator called 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 working well on the piece of hardware equipment.
Wherein, different hardware devices are carriers of artificial intelligence application operation. The special artificial intelligence hardware equipment can improve the calculation speed by several orders of magnitude higher than that of a CPU (central processing unit), thereby ensuring that the artificial intelligence application finishes calculation on time. In order to realize the acceleration of hardware equipment by applying a common operator to artificial intelligence, special artificial intelligence hardware equipment can be specially designed and realized. Therefore, the calculation speed and calculation accuracy of operators are different for different artificial intelligence hardware devices.
The artificial intelligence framework is the basic software for artificial intelligence applications. An independently operating artificial intelligence application can be quickly formed using an artificial intelligence framework. The artificial intelligence framework manages the CPU and the artificial intelligence hardware equipment, and the cooperation calculation of the CPU calculation and the CPU and the artificial intelligence calculation can be realized through the interaction of the driving software and the hardware equipment.
Wherein the operators exist in a computing library provided by a hardware device in the framework. The compiler of the framework decides which operators are assigned to run on the CPU and which operators 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 executed. For mainstream interpreted languages such as Python, the operation of the language is executed by adopting side interpretation and execution, and the specific execution details of the operator can be obtained only by executing.
In one mode, the operator is a special operation for artificial intelligence application, the hardware device is a carrier executed by the operator, and the framework is a code that compiles the application into a hardware device, thereby effectively using the operator. However, compilers do not focus on the computational power and efficiency of the operators. The application can not effectively confirm the support condition of the hardware equipment to the operator. This makes it difficult for the application to evaluate the computing power and compatibility of the hardware device from the operator perspective, and the hardware device can only be viewed as a result of the computation. Therefore, different artificial intelligence applications are often caused to run on the same hardware equipment at a high speed and a low speed; the same application also runs well or poorly on different hardware devices. In this case, the problem of not being able to match the proper operators for different hardware devices or different application functions is often caused. And further seriously influences the accuracy of hardware equipment type selection and the development efficiency of application.
In order to solve the problems, the application provides an automatic detection method of an operator, and the idea is to realize automatic detection of algorithm support capability of the operator to be detected under different computing devices. And the calculation capability of the operator to be detected under different scenes is obtained by comparing the calculation accuracy and the calculation 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 solved.
Further, the present application, with reference to fig. 2, describes the specific steps of the scheme:
step 1, acquiring an operator to be detected, and configuring a corresponding calculation task for the operator to be detected.
In one embodiment, the number of operators to be detected is not limited, and may be, for example, one or more.
Similarly, the number of computing tasks of the operator to be detected is not limited, and may be, for example, one or more.
The computing task comprises at least one computing rule and corresponding computing equipment. In one approach, the computing tasks may be computing tasks required to implement various types of application functionality. That is, the embodiment of the application can determine the matching degree between the operator to be detected and each application function by the capability expression of the operator to be detected under different computing tasks.
It should be noted that, since the computing capability of the operator to be detected under different computing devices needs to be determined, 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. So as to achieve the purpose of subsequently configuring each operator to be detected under the corresponding computing equipment.
Step 2, obtaining a calculation framework language represented by a calculation rule; and acquiring an operator function for constructing an operator to be detected.
The calculation rule comprises specific business calculation logic and a calculation framework language required by executing the business calculation logic.
In one approach, the business computation logic is configured to instruct the to-be-detected operator to perform the computed action. Such as specific processing (e.g., identifying a particular object, solving for a particular result, etc.) of a set of data (e.g., one or more of a field set, a group of images, a group of words).
In another mode, the computing framework language provides the language scenario required for executing the business computing logic, and may include various system languages such as JAVA language, various model languages, various database languages, and the like.
And 3, converting the first data format of the operator function into a second data format matched with the calculation 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 the output are determined.
Therefore, the data conversion of the operator function can be defined according to the data format of the target computing framework language, so that the data format of the operator function is converted into a second data format matched with the computing framework language. So as to realize that the operator to be detected can execute one or more corresponding calculation tasks in the scene under the target calculation framework language.
And 4, acquiring the number of calculation cycles represented by the calculation rule.
And 5, respectively starting the operator to be detected in at least one computing device to execute the computing task under the computing cycle number, so as to obtain the computing result to be detected of the operator to be detected in at least one computing device.
Furthermore, the calculation task of the operator to be detected is configured with one or more corresponding calculation devices, calculation cycle times and calculation frameworks. And the detection of the computing power of the operator to be detected is realized by aiming at different scenes.
Optionally, the embodiment provided in the present application may perform detection on one operator, and also perform detection on one operator set and one by one in the same manner, and obtain detection results one by one.
And 6, acquiring a calculated value, a calculation time and calculation failure times included in the calculation result to be detected.
Further, in the embodiment of the present application, comparison and evaluation need to be performed according to a result obtained by calculating an operator to be detected. So as to obtain the computing capacity of the operator to be detected in each computing device.
Specifically, the embodiment of the present application needs to compare the to-be-detected calculation result of the operator with the standard result, and then evaluate the calculation capability of the operator by calculating the error between the to-be-detected calculation result and the standard result (the capability depends on the calculation accuracy and the calculation efficiency).
And 7, acquiring a standard operator name lookup table.
The standard operator name lookup table comprises a plurality of standard calculation results obtained by executing a plurality of different calculation tasks by the standard operator under a plurality of different calculation devices.
And 8, searching a standard calculation result matched with the calculation task corresponding to the operator to be detected in the standard operator name lookup table.
In one mode, the standard result may be obtained by calculating each calculation task by using a standard operator in advance in different calculation devices, and then storing the obtained standard result.
The method 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 the judgment of the supporting capacity 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 between the calculated value, the calculation duration and 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 one mode, the main objective of the present application is to find out which operators can be operated by hardware devices through an automated monitoring technology, and select an operator with higher calculation efficiency and calculation accuracy from the operators that can be operated, to configure, for different artificial intelligence computing hardware and computing frameworks. Considering that language expressions of different frames are different, a unified detection method of an operator is realized by adopting a data format conversion idea, so that the operator can automatically translate from a middle table to a source code level of a specific frame, and the automatic detection of the operator is realized.
And step 10, if the calculation capacity corresponding to the operator to be detected is determined to be larger than a preset threshold value, determining that the detection result of the operator to be detected is qualified, and storing the incidence relation between the operator to be detected and the detection result into a call log.
According to the method, 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 a standard computing result, wherein the standard computing result is a 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 computing capacity of the operator to be detected. By applying the technical scheme of the application, the automatic test of the operator supporting capacity of the operator to be detected under different computing devices can be realized. And obtaining the calculation capability judgment of the operator under different scenes through the capability comparison of the calculation precision and the calculation efficiency of the operator to be detected and the standard result. Therefore, the problem that operators required by different hardware devices or different application functions cannot be applied in the related technology is solved.
Optionally, in another embodiment based on the foregoing method of the present application, after configuring the corresponding computation task for the operator to be detected, the method further includes:
acquiring a computing framework language represented by the computing rule; acquiring an operator function for constructing the operator to be detected;
and converting the first data format of the operator function into a second data format matched with the computing framework language.
Optionally, in another embodiment based on the foregoing method of the present application, the starting, in the computing device, a computation task of the operator to be detected, and obtaining a computation result to be detected corresponding to the operator to be detected includes:
acquiring the number of calculation cycles represented by the calculation rule;
and respectively starting the operator to be detected in at least one piece of computing equipment to execute the computing task under the computing cycle number, so as to obtain the computing result to be detected of the operator to be detected in the at least one piece of computing equipment.
Optionally, in another embodiment based on the foregoing method of the present application, the determining, based on the to-be-detected calculation result and a standard calculation result, a calculation capability corresponding to the to-be-detected operator includes:
acquiring a calculation value, a calculation duration and calculation failure times included in the calculation result to be detected;
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 calculation capacity corresponding to the operator to be detected.
Optionally, in another embodiment based on the foregoing method of the present application, before determining, based on the to-be-detected calculation result and a standard calculation result, a calculation capability corresponding to the to-be-detected operator, the method further includes:
acquiring 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;
and 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 based on the foregoing method of the present application, the determining a detection result of the operator to be detected according to a computing capability corresponding to the operator to be detected includes:
if the calculation capacity corresponding to the operator to be detected is determined to be larger than a preset threshold value, determining that the detection result of the operator to be detected is qualified, and storing the incidence relation between the operator to be detected and the detection result into a call log;
or the like, or, alternatively,
and if the calculation capacity corresponding to the operator to be detected is determined to be less than or equal to the preset threshold value, determining that the detection result of the operator to be detected is unqualified.
In one mode, the embodiments of the present application will be further described below:
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 the operators to be detected, which needs to be detected, and indicating the computing equipment, the computing cycle number 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 the configuration file by the test program template part, and forming calling of an operator calculation task according to the operator name.
Step f, calling a log to store the detection result of the operator to be detected, wherein the method comprises the following steps: the name of the operator to be detected, the calculation precision of the operator, the calculation time length, the failure information and the like.
And g, when the follow-up service is needed, obtaining the detection result of the operator to be detected by checking the call log.
Optionally, in another embodiment based on the foregoing method of 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, defining an operator function of the initial operator, and obtaining the operator to be detected.
Further, for the construction of the operator to be detected, the initial operator can be constructed in the modes of data definition, data conversion and data loading by calling a data processing function module.
The data definition mainly defines the type of data, including scalar quantity, vector quantity, matrix quantity and tensor quantity, and the precision of data includes byte, integer, mixed precision, single precision and double precision. The data definition herein will be of array type NumPy.
In addition, data transformation is primarily the transformation of various standard data definitions into a target framework. Finally, data loading essentially defines the various I/O functions by which data is loaded from a file. And subsequently calling a data processing function module, defining an operator function of the initial operator, and obtaining the operator to be detected.
By applying the technical scheme of the application, the automatic test of the operator supporting capacity of the operator to be detected under different computing devices can be realized. And obtaining the calculation capability judgment of the operator under different scenes through the capability comparison of the calculation precision and the calculation efficiency of the operator to be detected and the standard result. Therefore, the problem that operators needed by different hardware devices or different application functions cannot be applied in the related technology is solved.
Optionally, in another embodiment of the present application, as shown in fig. 3, the present application further provides an automatic detection apparatus for an operator. Which comprises the following steps:
the configuration module 201 is configured to acquire an operator to be detected and configure a corresponding calculation task for the operator to be detected, where the calculation task includes at least one calculation rule and a corresponding calculation device;
the starting module 202 is configured to start a calculation task of the operator to be detected in the computing device, and obtain a calculation 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, the calculation capability corresponding to the to-be-detected operator, 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.
According to the method, 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 a standard computing result, wherein the standard computing result is a 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 computing capacity of the operator to be detected. By applying the technical scheme of the application, the automatic test of the operator supporting capacity of the operator to be detected under different computing devices can be realized. And obtaining the calculation capability judgment of the operator under different scenes through the capability comparison of the calculation precision and the calculation efficiency of the operator to be detected and the standard result. Therefore, the problem that operators required by different hardware devices or different application functions cannot be applied in the related technology is solved.
In another embodiment of the present application, the starting module 202 is configured to perform the following steps:
acquiring a computing framework language represented by the computing rule; acquiring an operator function for constructing the operator to be detected;
and converting the first data format of the operator function into a second data format matched with the computing framework language.
In another embodiment of the present application, the starting module 202 is configured to perform the steps of:
acquiring the number of calculation cycles represented by the calculation rule;
and respectively starting the operator to be detected to execute the calculation task under the calculation cycle number in at least one calculation device to obtain the calculation result to be detected of the operator to be detected in the at least one calculation device.
In another embodiment of the present application, the starting module 202 is configured to perform the following steps:
acquiring a calculation value, a calculation duration and calculation failure times included in the calculation result to be detected;
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 calculation capacity corresponding to the operator to be detected.
In another embodiment of the present application, the starting module 202 is configured to perform the steps of:
acquiring 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;
and 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 starting module 202 is configured to perform the steps of:
if the computing capacity corresponding to the operator to be detected is larger than a preset threshold value, determining that the detection result of the operator to be detected is qualified, and storing the incidence relation between the operator to be detected and the detection result into a call log;
or the like, or a combination thereof,
and if the calculation capacity corresponding to the operator to be detected is determined to be smaller than or equal to the preset threshold value, determining that the detection result of the operator to be detected is unqualified.
In another embodiment of the present application, the starting module 202 is configured to perform the steps of:
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, defining an operator function of the initial operator, and obtaining 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 provided in some embodiments of the present application is shown. As shown in fig. 4, the electronic apparatus 3 includes: the system comprises a processor 300, a memory 301, a bus 302 and a communication interface 303, wherein the processor 300, the communication interface 303 and the memory 301 are connected through the bus 302; the memory 301 stores a computer program that can be executed on the processor 300, and the processor 300 executes the automatic detection method of the operator provided in any of the foregoing embodiments when executing the computer program.
The Memory 301 may include a Random Access Memory (RAM) and a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. The communication connection between the network element of the apparatus and at least one other network element is realized through at least one communication interface 303 (which may be wired or wireless), and the internet, a wide area network, a local network, a metropolitan area network, etc. may be used.
Bus 302 can be an ISA bus, PCI bus, EISA bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. The memory 301 is configured to store a program, and the processor 300 executes the program after receiving an execution instruction, where the method for automatically detecting an operator disclosed in any embodiment of the present application may be applied to the processor 300, or implemented by the processor 300.
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 or instructions in the form of software in the processor 300. The Processor 300 may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components. The various methods, steps, and logic blocks disclosed 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 directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is 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 completes the steps of the method in combination with the hardware thereof.
The electronic device provided by the embodiment of the application and the automatic detection method of the operator provided by the embodiment of the application have the same inventive concept and have the same beneficial effects as the method adopted, operated or realized by the electronic device.
Referring to fig. 5, the computer-readable storage medium is an optical disc 40, on which a computer program (i.e., a program product) is stored, and when the computer program is executed by a processor, the computer program performs the method for automatically detecting an operator according to 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 Memories (RAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a flash memory, or other optical and magnetic storage media, which are not described in detail herein.
The computer-readable storage medium provided by the above embodiment of the present application and the automatic operator detection method provided by the embodiment of the present application have the same advantages as the method adopted, operated or implemented by the application program stored in the computer-readable storage medium.
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 foregoing 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 application and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted to reflect the following schematic diagram: this application is intended to cover such departures from the present disclosure as come within known or customary practice in the art to which this invention pertains.
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 included in other embodiments, rather than other features, 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 may be used in any combination.
The above description is only for the preferred embodiment of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present application should be covered within 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 (10)

1. An automatic detection method for an operator is characterized by comprising the following steps:
acquiring an operator to be detected, and configuring a corresponding calculation task 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 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 the detection result of the operator to be detected according to the corresponding computing capacity of the operator to be detected.
2. The method of claim 1, wherein after configuring the corresponding computation task for the operator to be detected, further comprising:
acquiring a computing framework language represented by the computing rule; acquiring an operator function for constructing the operator to be detected;
and converting the first data format of the operator function into a second data format matched with the computing framework language.
3. The method of claim 1, wherein starting a computation task of the operator to be detected in the computing device and obtaining a computation result to be detected corresponding to the operator to be detected comprises:
acquiring the number of calculation cycles represented by the calculation rule;
and respectively starting the operator to be detected to execute the calculation task under the calculation cycle number in at least one calculation device to obtain the calculation result to be detected of the operator to be detected in the at least one calculation device.
4. The method as claimed in claim 1, wherein said determining the computation capability corresponding to the operator to be detected based on the computation result to be detected and a standard computation result comprises:
acquiring a calculation value, a calculation duration and calculation failure times included in the calculation result to be detected;
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 calculation capacity corresponding to the operator to be detected.
5. The method according to claim 1 or 4, wherein before determining the computing power corresponding to the operator to be detected based on the computed result to be detected and a standard computed result, the method further comprises:
acquiring 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;
and searching the standard calculation result matched with the calculation task corresponding to the operator to be detected in the standard operator name lookup table.
6. The method according to claim 1, wherein the determining the detection result of the operator to be detected according to the corresponding computation capability of the operator to be detected comprises:
if the calculation capacity corresponding to the operator to be detected is determined to be larger than a preset threshold value, determining that the detection result of the operator to be detected is qualified, and storing the incidence relation between the operator to be detected and the detection result into a call log;
or the like, or a combination thereof,
and if the calculation capacity corresponding to the operator to be detected is determined to be less than or equal to the preset threshold value, determining that the detection result of the operator to be detected is unqualified.
7. The method of claim 1, wherein said obtaining operators 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, defining an operator function of the initial operator, and obtaining the operator to be detected.
8. An apparatus for automatic detection of an operator, 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;
and the generation module is configured to determine the detection result of the operator to be detected according to the calculation capacity corresponding to the operator to be detected.
9. An electronic device, comprising:
a memory for storing executable instructions; and (c) a second step of,
a processor for executing said executable instructions to perform the operations of the method for automatic detection of an operator according to any of claims 1-7.
10. A computer-readable storage medium storing computer-readable instructions that, when executed by a processor, perform the operations of the method for automatic detection of an operator of any of claims 1-7.
CN202211689392.8A 2022-12-28 2022-12-28 Operator automatic detection method and device, electronic equipment and medium Active CN115934346B (en)

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 true CN115934346A (en) 2023-04-07
CN115934346B 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)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116402165A (en) * 2023-06-07 2023-07-07 之江实验室 Operator detection method and device, storage medium and electronic equipment
CN117076282A (en) * 2023-10-16 2023-11-17 北京大学 Method and device for detecting time performance of hardware operator

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200285986A1 (en) * 2019-03-09 2020-09-10 International Business Machines Corporation Validating and estimating runtime for quantum algorithms
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

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200285986A1 (en) * 2019-03-09 2020-09-10 International Business Machines Corporation Validating and estimating runtime for quantum algorithms
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

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116402165A (en) * 2023-06-07 2023-07-07 之江实验室 Operator detection method and device, storage medium and electronic equipment
CN116402165B (en) * 2023-06-07 2023-09-01 之江实验室 Operator detection method and device, storage medium and electronic equipment
CN117076282A (en) * 2023-10-16 2023-11-17 北京大学 Method and device for detecting time performance of hardware operator
CN117076282B (en) * 2023-10-16 2023-12-15 北京大学 Method and device for detecting time performance of hardware operator

Also Published As

Publication number Publication date
CN115934346B (en) 2023-10-20

Similar Documents

Publication Publication Date Title
CN115934346B (en) Operator automatic detection method and device, electronic equipment and medium
US10268454B2 (en) Methods and apparatus to eliminate partial-redundant vector loads
US7836435B2 (en) Checking for memory access collisions in a multi-processor architecture
CN112100072B (en) Static detection method, device, equipment and medium for application program code
CN103559123B (en) Based on function call stack analytical approach and the device of vxworks operating system
US8612944B2 (en) Code evaluation for in-order processing
CN112529206A (en) Model operation method and system
CN111897711B (en) Positioning method and device for bug in code, electronic equipment and readable storage medium
CN104965687A (en) Big data processing method and apparatus based on instruction set generation
CN114579452A (en) Interface influence detection method and related equipment
US20230367516A1 (en) Program Detection Method and Apparatus
CN110837446A (en) Equipment management method and device applied to embedded system, medium and embedded equipment
WO2023207973A1 (en) Compiler test method and apparatus, case generation method and apparatus, and instruction storage structure
CN117273171A (en) Deep learning framework adaptation method, deep learning framework adaptation device, computer equipment and storage medium
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
US11449317B2 (en) Detection of semantic equivalence of program source codes
CN114443042A (en) Service arrangement execution method based on rule engine and related equipment
CN114253845A (en) Automatic testing method and device for special-shaped architecture integration system
US7222064B1 (en) Instruction processor emulation having inter-processor messaging accounting
CN113076244A (en) Function call relation detection method and device
CN112540915A (en) Interface test method, device and system
US10365906B2 (en) Compile time interface to run-time libraries
US20220180152A1 (en) Information processing apparatus and method for analyzing errors of neural network processing device therein
CN112733145B (en) Android application detection and analysis method, electronic 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