Method, apparatus, device, and medium for constructing relationship between parameter scale and processing engine

By building the relationship between parameter scale and processing engine, selecting the appropriate processing engine to execute heterogeneous API calls, solving the problem of inefficiency in heterogeneous systems and achieving efficient execution of heterogeneous API calls.

CN114116416BActive Publication Date: 2025-07-08HUAWEI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202010865085.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-08-25
Publication Date
2025-07-08
Estimated Expiration
2040-08-25

AI Technical Summary

Technical Problem

In the prior art, heterogeneous systems are less efficient when executing heterogeneous API calls and lack effective methods to select appropriate processing engines for calls.

Method used

By constructing the relationship between parameter scale and processing engine, the heterogeneous API is used to microclassify the heterogeneous API when it is called, and according to the scheduling reference information of the execution efficiency of multiple processing engines in the heterogeneous system under each classification, the appropriate processing engine is selected for scheduling.

Benefits of technology

It improves the execution efficiency of heterogeneous API calls and improves the overall execution efficiency of heterogeneous applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114116416B_ABST
    Figure CN114116416B_ABST
Patent Text Reader

Abstract

The present application provides a method for constructing the relationship between parameter scale and processing engine, including: obtaining multiple test cases of a heterogeneous application programming interface (API), and obtaining the relationship between parameter scale and processing engine according to the parameter scale value of a target test case among the multiple test cases and scheduling reference information used to describe the execution efficiency of multiple processing engines in a heterogeneous system. This method micro-classifies the heterogeneous API using the parameter scale value, and constructs the relationship between parameter scale and processing engine according to the scheduling reference information describing the execution efficiency of the heterogeneous API on multiple processing engines in the heterogeneous system, so that when the heterogeneous API is called, the heterogeneous API call can be reasonably scheduled to a suitable processing engine according to the above relationship, improving the execution efficiency of the heterogeneous API call, and further improving the execution efficiency of the heterogeneous application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computing technologies, and in particular, to a method, apparatus, device, and computer-readable storage medium for constructing a relationship between parameter scales and processing engines. Background Art

[0002] With the in-depth promotion of intelligent devices such as computers in different application fields, more and more domain specific architectures (DSAs) are emerging. Based on these domain specific architectures, new processing engines have emerged. Among them, a processing engine refers to a processor for processing data.

[0003] For example, in the field of image processing, processing engines based on domain specific architectures include graphical processing units (GPUs), image processors (IPs), etc. In the field of digital signal processing, processing engines based on domain specific architectures include digital signal processors (DSPs). In the field of artificial intelligence, processing engines based on domain specific architectures include neural-network processing units (NPUs), etc.

[0004] Among them, a data processing system including two or more processing engines is called a heterogeneous system. An application developed for this heterogeneous system is a heterogeneous application. A heterogeneous application usually includes at least one heterogeneous application programming interface (API) call. Among them, a heterogeneous API is an API with a unified interface but different optimized implementations on different processing engines.

[0005] Currently, due to the lack of an effective method to select a suitable processing engine to execute a specific heterogeneous API call in a heterogeneous application, the efficiency of a heterogeneous system in executing a heterogeneous API call is low. The industry urgently needs to provide a method for constructing a relationship between parameter scales and processing engines so that when a heterogeneous system executes a heterogeneous API call, it can select a suitable processing engine to execute according to the above relationship, thereby improving the execution efficiency of the heterogeneous API call. Summary of the Invention

[0006] This application provides a method for constructing a relationship between parameter scales and processing engines. The relationship constructed based on this method can be used to select a suitable processing engine to execute a specific heterogeneous API call in a heterogeneous application and improve the execution efficiency of the heterogeneous API call. This application also provides a corresponding apparatus, device, computer-readable storage medium, and computer program product for the above method.

[0007] In a first aspect, the present application provides a method for constructing a relationship between a parameter scale and a processing engine. Among them, the parameter scale can describe the size of the parameters required for calling the heterogeneous API. It should be noted that in the embodiments of the present application, the size of the parameter does not refer to the numerical size of the parameter, but the number of bytes occupied by the parameter in memory or in the processing engine. Based on this, the value of the parameter scale (i.e., the parameter scale value) can take any integer in the interval (0, +∞).

[0008] The processing engine, also known as the hardware engine, is specifically a unit capable of performing data processing operations. The present application does not limit the specific type and form of the processing engine. Any unit capable of performing data processing operations can be used as the processing engine. In some embodiments, the processing engine can be a central processing unit (CPU), a graphical processing unit (GPU), an image processor (IP), a digital signal processor (DSP), a neural-network processing unit (NPU), a field programmable gate array (FPGA), and so on.

[0009] The above method for constructing the relationship between the parameter scale and the processing engine can be executed by any processing device with data processing capabilities. The processing device can be a terminal or a computing node such as a server. Among them, the terminal includes, but is not limited to, one or more of a desktop computer, a laptop computer, a tablet computer, or a smart phone. In some embodiments, the processing device can also be a cluster formed by multiple computing devices.

[0010] Specifically, the processing device can obtain multiple test cases of a heterogeneous application programming interface (API), and then obtain the relationship between the parameter scale and the processing engine according to the parameter scale value of the target test case in the multiple test cases and the scheduling reference information used to describe the execution efficiency of multiple processing engines in the heterogeneous system.

[0011] This method micro-classifies heterogeneous APIs using the parameter scale values when heterogeneous APIs are called, and constructs the relationship between the parameter scale and the processing engine according to the scheduling reference information that describes the execution efficiency of multiple processing engines of heterogeneous APIs in heterogeneous systems under each classification. So that when a heterogeneous API is called, the heterogeneous system can reasonably schedule the call of the heterogeneous API to an appropriate processing engine according to the above relationship between the parameter scale and the processing engine, improving the execution efficiency of the heterogeneous API call, and thus improving the execution efficiency of heterogeneous applications.

[0012] In some possible implementation manners, the parameter scale value of the target test case falls within a target subset of the value range of the parameter scale, that is, the parameter scale value of the target test case falls within a target subset of the interval (0, +∞). The processing device can obtain the relationship between the parameter scale and the processing engine according to the target subset and the scheduling reference information of the target test case. In this way, when subsequently executing a heterogeneous API call, it can be determined which target subset the parameter scale value falls into according to the above relationship between the parameter scale and the processing engine, and then an appropriate processing engine can be selected according to the scheduling reference information corresponding to the target subset to execute the heterogeneous API call, improving the execution efficiency of the heterogeneous API call.

[0013] In some possible implementation manners, the processing device can group multiple test cases and determine the target subset corresponding to the parameter scale value of the target test case according to the parameter scale values of at least one group of test cases. Specifically, the processing device can determine the target subset corresponding to the parameter scale value of the target test case according to the maximum and minimum values of the parameter scale values in a group of test cases. For example, if the minimum value of the parameter scale values in a group of test cases is 3 and the maximum value is 7, the target subset can be (3, 7].

[0014] In this way, the target subset can be quickly determined, improving the efficiency of constructing the relationship between the parameter scale and the processing engine, and providing help for the subsequent execution of heterogeneous API calls in heterogeneous applications.

[0015] In some possible implementation manners, the processing device can group multiple test cases by using the average classification method. Specifically, the processing device can sort the multiple test cases according to the parameter scale values, and then evenly distribute the sorted test cases into multiple groups.

[0016] Assume that the parameter scale values of multiple test cases (specifically the sorted parameter scale values) are V1, V2,... V W , the processing device can determine the group size according to the number of test cases and the number of groups. Wherein, the group size refers to the number of V iThe number. It should be noted that the group size and the interval size of the subset may not be equal. In some embodiments, the processing device may round down the ratio of the number W of test cases to the number S of groups to determine the group size, as follows:

[0017]

[0018] where D represents the group size. It should be noted that when W is divisible by S, the group size of each group is the same. When W is not divisible by S, the group sizes of the first S - 1 groups are the same, and the group size of the last group is greater than that of the first S - 1 groups.

[0019] Grouping multiple test cases by the average classification method can quickly obtain the grouping result, and there is no need for complex operations, which is easy to implement and has high availability. Moreover, the average classification method can make the number of V included in each group i as balanced as possible. In this way, it can be ensured that each group includes sufficient test cases to determine the scheduling reference information corresponding to the test cases in the group.

[0020] In some possible implementation manners, the target test case is a test case in a group of test cases whose parameter scale value is close to the average value or the median value of the parameter scale values of this group of test cases. Among them, being close to the average value or the median value may be that the absolute value of the difference from the average value or the absolute value of the difference from the median value is less than a preset threshold.

[0021] The average value or the median value can represent the characteristics of a group of test cases. Therefore, test cases close to the above average box or median value can be used as target test cases, and the scheduling reference information of the target test cases can be used to represent the reference information of this group of test cases. In this way, the time spent on executing other test cases can be saved, and the efficiency of obtaining the scheduling reference information can be improved.

[0022] In some possible implementation manners, the processing device can also group by the greedy classification method, so as to determine the target subset according to the grouping, and obtain the relationship between the parameter scale and the processing engine according to the target subset and the scheduling reference information. Specifically, the target test case is each test case among multiple test cases. The processing device can divide the test cases with the same scheduling reference information and adjacent in the multiple test cases sorted according to the parameter scale value into the same group, and then obtain the relationship between the parameter scale and the processing engine according to the target subset corresponding to the parameter scale values of at least one group of test cases and the scheduling reference information.

[0023] This method groups based on the scheduling reference information of each test case. Compared with the grouping by the average classification method, the grouping result is more reasonable, and the relationship between the parameter scale and the processing engine constructed based on this grouping result is more accurate.

[0024] In some possible implementation manners, more groups can be obtained through the greedy classification method, and the processing device can reduce the number of groups to a reasonable range through a merging method. Specifically, when the similarity of the scheduling reference information of adjacent groups is greater than the similarity threshold, the processing device merges the adjacent groups. Thereby, the number of groups can be reduced, and when performing heterogeneous API calls subsequently, the target subset corresponding to the parameter scale value of the heterogeneous API call can be quickly determined, improving the execution efficiency of the heterogeneous API call.

[0025] In some possible implementation manners, more groups can be obtained through the greedy classification method, and the processing device can reduce the number of groups to a reasonable range through a clustering method. Specifically, the processing device can cluster multiple groups of test cases according to the similarity of the scheduling reference information of the multiple groups of test cases.

[0026] It should be noted that the target subset determined by merging adjacent groups is usually a continuous interval, and the target subset determined by clustering the groups can be a continuous region or a discontinuous interval. Through clustering, groups with similar scheduling reference information but non-adjacent parameter scale values can be merged. Compared with merging adjacent groups, the clustering accuracy is higher. The relationship between the parameter scale and the processing engine constructed based on this clustering result is more accurate.

[0027] In some possible implementation manners, the processing device can execute the target test case on multiple processing engines respectively, obtain the execution time of the target test case on the multiple processing engines, and then obtain the scheduling reference information corresponding to the target test case according to the execution time of the target test case on the multiple processing engines.

[0028] Among them, the processing device can determine the execution efficiency according to the execution time and use the execution efficiency as the scheduling reference information corresponding to the target test case. Of course, the execution time can also be used to represent the execution efficiency. The shorter the execution time, the higher the execution efficiency, and the longer the execution time, the lower the execution efficiency. Based on this, the processing device can also directly use the execution time as the scheduling reference information corresponding to the target test case.

[0029] Furthermore, the processing device can also sort the execution time or the execution efficiency and use the obtained ranking as the scheduling reference information corresponding to the target test case. For example, the processing device can sort the execution time in ascending order to obtain the ranking of the execution efficiency of various processing engines, and this ranking can also be used to represent the scheduling priority. The processing device can use the scheduling priority vector formed by the scheduling priorities of various processing engines as the scheduling reference information corresponding to the target test case.

[0030] The processing device can also form key-value pairs with the processing engine, its execution time or execution efficiency, and the ranking of the execution efficiency, and use the key-value pairs of multiple processing engines as the scheduling reference information corresponding to the target test case.

[0031] Based on the above implementation method, the processing device can quickly obtain the scheduling reference information of the target test case, thereby accelerating the construction process of the relationship between the parameter scale and the processing engine and improving the construction efficiency.

[0032] In some possible implementation manners, the processing device can store the relationship between the parameter scale and the processing engine through at least one of a relationship table, a relationship text, or a relationship graph. In this way, when performing a heterogeneous API call, an appropriate processing engine can be selected by looking up the above relationship table, relationship text, or relationship graph to execute the heterogeneous API call and improve the execution efficiency.

[0033] In some possible implementation manners, the heterogeneous system includes a single-node heterogeneous system or a heterogeneous cluster. Among them, a single-node heterogeneous system refers to a single node including multiple processing engines. A heterogeneous cluster includes multiple nodes deployed with multiple processing engines. It should be noted that the multiple processing engines deployed on multiple nodes can be that at least one node deploys different processing engines, or each node deploys one processing engine, but at least two nodes have different architectures of the deployed processing engines.

[0034] In a second aspect, the present application provides a device for constructing a relationship between a parameter scale and a processing engine. The device includes:

[0035] An obtaining module, configured to obtain multiple test cases of a heterogeneous application programming interface (API);

[0036] A constructing module, configured to obtain the relationship between the parameter scale and the processing engine according to the parameter scale value of the target test case among the multiple test cases and the scheduling reference information, where the scheduling reference information is used to describe the execution efficiency of multiple processing engines in the heterogeneous system.

[0037] In some possible implementation manners, the parameter scale value of the target test case falls within a target subset of the value space of the parameter scale;

[0038] The constructing module is specifically configured to:

[0039] Obtain the relationship between the parameter scale and the processing engine according to the target subset corresponding to the parameter scale value of the target test case and the scheduling reference information of the target test case.

[0040] In some possible implementation manners, the constructing module is further configured to:

[0041] Group the multiple test cases;

[0042] Determine a target subset corresponding to the parameter scale value of the target test case according to the parameter scale values of at least one set of test cases.

[0043] In some possible implementation manners, the building module is specifically configured to:

[0044] Sort multiple test cases according to the parameter scale values;

[0045] Evenly distribute the sorted test cases into multiple groups.

[0046] In some possible implementation manners, the target test case is a test case in a set of test cases whose parameter scale value is close to the average value or the median value of the parameter scale values of the set of test cases.

[0047] In some possible implementation manners, the target test case is each test case among multiple test cases;

[0048] The building module is specifically configured to:

[0049] Divide test cases with the same scheduling reference information and adjacent in the multiple test cases sorted according to the parameter scale values into the same group;

[0050] Obtain the relationship between the parameter scale and the processing engine according to the target subset corresponding to the parameter scale values of at least one set of test cases and the scheduling reference information.

[0051] In some possible implementation manners, the building module is further configured to:

[0052] When the similarity of the scheduling reference information of adjacent groups is greater than the similarity threshold, merge the adjacent groups.

[0053] In some possible implementation manners, the building module is further configured to:

[0054] Cluster multiple sets of test cases according to the similarity of the scheduling reference information of the multiple sets of test cases.

[0055] In some possible implementation manners, the building module is further configured to:

[0056] Execute the target test case on multiple processing engines respectively, and obtain the execution time of the target test case on the multiple processing engines;

[0057] Obtain the scheduling reference information corresponding to the target test case according to the execution time of the target test case on the multiple processing engines.

[0058] In some possible implementation manners, the apparatus further includes:

[0059] A storage module, configured to store the relationship between the parameter scale and the processing engine through at least one of a relationship table, a relationship text, or a relationship graph.

[0060] In some possible implementations, the heterogeneous system includes a single-node heterogeneous system or a heterogeneous cluster.

[0061] In a third aspect, the present application provides a device, which includes a processor and a memory. The processor and the memory communicate with each other. The processor is configured to execute instructions stored in the memory, so that the device executes the method for constructing the relationship between the parameter scale and the processing engine in the first aspect or any implementation manner of the first aspect.

[0062] In a fourth aspect, the present application provides a computer-readable storage medium, in which instructions are stored, and the instructions instruct a computing device to execute the method for constructing the relationship between the parameter scale and the processing engine in the first aspect or any implementation manner of the first aspect.

[0063] In a fifth aspect, the present application provides a computer program product including instructions, which, when running on a computing device, causes the computing device to execute the method for constructing the relationship between the parameter scale and the processing engine in the first aspect or any implementation manner of the first aspect.

[0064] Based on the implementation manners provided in the above aspects, the present application can be further combined to provide more implementation manners. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] To more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below.

[0066] Figure 1 A scenario diagram of a method for constructing the relationship between the parameter scale and the processing engine provided for an embodiment of the present application;

[0067] Figure 2 A flowchart of a method for constructing the relationship between the parameter scale and the processing engine provided for an embodiment of the present application;

[0068] Figure 3 A schematic diagram of grouping by the average classification method provided for an embodiment of the present application;

[0069] Figure 4 A schematic diagram of grouping by the greedy classification method provided for an embodiment of the present application;

[0070] Figure 5 A schematic structural diagram of a device for constructing the relationship between the parameter scale and the processing engine provided for an embodiment of the present application;

[0071] Figure 6 A schematic structural diagram of a computing device provided for an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0072] The terms "first" and "second" in the embodiments of the present application are only used for descriptive purposes and cannot be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of such features.

[0073] First, some technical terms involved in the embodiments of the present application are introduced.

[0074] A processing engine, also referred to as a hardware engine, is specifically a unit capable of performing data processing operations. The present application does not limit the specific type and form of the processing engine, and any unit capable of performing data processing operations can be used as the processing engine. In some examples, the processing engine may include a central processing unit (CPU).

[0075] Furthermore, the processing engine may further include a processing unit based on a domain specific architecture (DSA). For example, the processing engine may further include any one or more of a graphical processing unit (GPU), an image processor (IP), a digital signal processor (DSP), a neural-network processing unit (NPU), and a field programmable gate array (FPGA).

[0076] A heterogeneous system is specifically a data processing system including multiple different processing engines. Specifically, among the multiple different processing engines included in the heterogeneous system, at least one CPU may be included, and the remaining processing engines may be processing engines of a type different from the CPU. For example, the remaining processing engines may include some or all of the following: GPU, IP, DSP, NPU, or FPGA. Of course, in some embodiments, the remaining processing engines may also include a CPU.

[0077] One of the multiple processing engines may serve as a scheduler for data interaction with the remaining processing engines and assist the remaining processing engines in data processing. In the embodiments of the present application, taking the scheduler as the CPU as an example, for the convenience of description, the CPU serving as the scheduler in the embodiments of the present application is referred to as the scheduling CPU, or the host CPU.

[0078] The embodiments of the present application do not limit the deployment mode of the heterogeneous system. For example, the heterogeneous system can be deployed in a centralized manner on a single computing node. Correspondingly, the heterogeneous system can be a single-node heterogeneous system. Alternatively, the heterogeneous system can also be deployed in a distributed manner on multiple computing nodes. Correspondingly, the heterogeneous system can be a heterogeneous cluster.

[0079] The application developed for the above heterogeneous system is a heterogeneous application. A heterogeneous application typically includes at least one call to a heterogeneous application programming interface (API). Among them, a heterogeneous API is specifically an API with a unified interface but different optimized implementations on different processing engines.

[0080] The parameter scale when the heterogeneous API is called can be different. The parameter scale can describe the size of the parameters required when calling the heterogeneous API. It should be noted that in the embodiments of the present application, the size of the parameter does not refer to the numerical size of the parameter, but the number of bytes occupied by the parameter in memory or in the processing engine. Based on this, the value of the parameter scale (i.e., the parameter scale value) can take any integer value in the interval (0, +∞).

[0081] The parameter scale value can usually be determined according to the expression for calculating the parameter scale. For example, the following statement can be added to the prototype declaration file of the heterogeneous API:

[0082] #pragma HAPI_PARA_SIZE(hapi_para_size_expr)

[0083] #pragma HAPI_PARA_SIZE represents the parameter scale of the heterogeneous API declared here, and hapi_para_size_expr is the expression for the parameter scale.

[0084] For example, the expression for the parameter scale can be max(max(A.Size(), B.Size()), C.Size())). Here, max(max(A.Size(), B.Size()), C.Size()) means taking the largest value of Size among the three parameters A, B, and C as the parameter scale.

[0085] The embodiments of the present application do not limit the specific content of the expression for the parameter scale. Generally, the operands appearing in the expression can be positive integer constants, positive integer parameters in the corresponding heterogeneous API prototype declaration file, positive integer member variables of the parameter, or member functions with a positive integer return value.

[0086] When the heterogeneous APIs are called, the parameter scale values are different, and their execution efficiencies on different processing engines included in the heterogeneous system can be different. To address the problem of low execution efficiency of heterogeneous API calls, the embodiments of the present application provide a method for constructing the relationship between the parameter scale and the processing engine, so that when the heterogeneous system executes heterogeneous API calls, it can select to execute on a suitable processing engine according to the above relationship, thereby improving the execution efficiency of heterogeneous API calls.

[0087] The above method for constructing the relationship between the parameter scale and the processing engine can be executed by any processing device with data processing capabilities. The processing device can be a terminal or a computing node such as a server. Among them, the terminal includes but is not limited to one or more of a desktop computer, a laptop computer, a tablet computer, or a smart phone. In some embodiments, the processing device can also be a cluster formed by multiple computing devices.

[0088] Specifically, the processing device can obtain multiple test cases of the heterogeneous API, and then obtain the relationship between the parameter scale and the processing engine according to the parameter scale value of the target test case in the multiple test cases and the scheduling reference information used to describe the execution efficiencies of multiple processing engines in the heterogeneous system.

[0089] This method micro-classifies the heterogeneous API according to the parameter scale value when the heterogeneous API is called, and constructs the relationship between the parameter scale and the processing engine according to the scheduling reference information describing the execution efficiencies of the heterogeneous API on multiple processing engines in the heterogeneous system, so that when the heterogeneous API is called, the heterogeneous system (specifically, the host CPU in the heterogeneous system) can reasonably schedule the heterogeneous API call to a suitable processing engine according to the above relationship between the parameter scale and the processing engine, improving the execution efficiency of the heterogeneous API call, and further improving the execution efficiency of the heterogeneous application.

[0090] To make the technical solution of the present application clearer and easier to understand, the following will detail the method for constructing the relationship between the parameter scale and the processing engine provided by the embodiments of the present application in combination with a specific application scenario.

[0091] See Figure 1 The application scenario diagram of the method for constructing the relationship between the parameter scale and the processing engine shown in the figure. This scenario includes a heterogeneous system 100 and a processing device 200. The heterogeneous system 100 includes multiple processing engines, and these multiple processing engines include at least two types of processing engines, such as a CPU and a GPU. The processing device 200 can be a terminal, a server, or a cluster. Figure 1 Taking the heterogeneous system 100 including N types of processing engines including processing engine 1, processing engine 2... processing engine N, and the processing device 200 being a terminal as an example for illustration, where N is a positive integer.

[0092] Developers have developed heterogeneous applications for the heterogeneous system 100, and the heterogeneous applications include at least one heterogeneous API call. For any heterogeneous API call, the processing device 200 can obtain multiple test cases of the heterogeneous API, and obtain the relationship between the parameter scale and the processing engine according to the parameter scale value of the target test case in the multiple test cases and the scheduling reference information.

[0093] Specifically, the processing device 200 can divide the W test cases of the heterogeneous API into S groups, and obtain the scheduling reference information corresponding to each group of test cases. Wherein, W and S are positive integers. The parameter scale values of each group of test cases fall into a subset of the value space of the parameter scale, and the subsets corresponding to the parameter scale values of each group of test cases are different. The scheduling reference information of each group of test cases can be characterized by the scheduling reference information of the target test case in each group of test cases. The scheduling reference information is specifically used to describe the execution efficiency of various processing engines in the heterogeneous system 100. The processing device 200 constructs the relationship between the parameter scale and the processing engine according to the target subset corresponding to the parameter scale values of the S groups of test cases and the scheduling reference information.

[0094] The relationship between the parameter scale and the processing engine can be presented by at least one of a relationship table, a relationship text, or a relationship diagram. Figure 1 Taking the presentation of the relationship between the parameter scale and the processing engine in the form of a relationship table as an example. As Figure 1 shown, the relationship table includes the identifier of the heterogeneous API, the target subset corresponding to the parameter scale values of the S groups of test cases (the parameter scale value of the target test case), and the scheduling reference information corresponding to each group of test cases (the target test case).

[0095] It should be noted that the number of groups of test cases for different heterogeneous APIs can be the same or different. In Figure 1 the illustrated embodiment, the heterogeneous API call with the API identifier (API ID) of ID_1 is divided into S1 groups, the heterogeneous API call with the API ID of ID_2 is divided into S2 groups, and so on, and the heterogeneous API call with the API ID of ID_M is divided into S M groups.

[0096] In some embodiments, the above method for constructing the relationship between the parameter scale and the processing engine may also be executed by the heterogeneous system 100 itself, and the embodiments of the present application do not limit this.

[0097] Next, the method for constructing the relationship between the parameter scale and the processing engine provided by the embodiments of the present application will be described in detail from the perspective of the processing device 200.

[0098] See Figure 2 the flowchart of the method for constructing the relationship between the parameter scale and the processing engine shown, and the method includes:

[0099] S202: The processing device 200 obtains multiple test cases of the heterogeneous API.

[0100] A test case of the heterogeneous API is a set of test inputs, execution conditions, and expected results prepared for a specific goal, used to verify whether the heterogeneous API meets a specific software requirement. Among them, the test inputs include parameter values of the heterogeneous API, such as actual parameters of the heterogeneous API or storage addresses of actual parameters, etc.

[0101] In some implementation manners, developers can construct test cases corresponding to typical parameter scenarios of the heterogeneous API, and the processing device 200 can obtain W test cases corresponding to typical parameter scenarios of the heterogeneous API, so that the relationship between the parameter scale constructed by the processing device 200 and the processing engine can cover the typical parameter scenarios.

[0102] Among them, the typical parameter scenario refers to a scenario where the parameter values are representative. The parameter values being representative includes any one or more of the parameter values being the maximum value, the minimum value, the median value, and the values with higher probabilities, etc. The values with higher probabilities can be determined according to historical data. Specifically, the processing device 200 can determine the distribution of parameter values according to historical data, and according to this distribution, it can determine that the parameter values with probability values higher than the preset value are the values with higher probabilities.

[0103] S204: The processing device 200 obtains the relationship between the parameter scale and the processing engine according to the parameter scale value of the target test case and the scheduling reference information in the multiple test cases.

[0104] The target test case is one or more of the multiple test cases obtained by the processing device 200. The parameter scale value of each target test case falls into a target subset of the value space of the parameter scale (for example, (0, +∞)). Among them, the value space of the parameter scale can be (0, +∞), specifically any integer in (0, +∞). The value space of this parameter scale can be divided into multiple subsets, for example, it can be divided into S subsets. Any parameter scale value can fall into one of the above S subsets.

[0105] The parameter scale value of each target test case falling into the subset of the value space of the parameter scale is the target subset. The target subsets corresponding to each target test case are different. For example, the parameter scale values of different target test cases fall into the following target subsets respectively: (0, a], (a, b], and (b, +∞].

[0106] The scheduling reference information is used to describe the execution efficiency of multiple processing engines in a heterogeneous system. The execution efficiency refers to the amount of work performed for heterogeneous API calls per unit time. The execution efficiency can be determined based on the execution time of the heterogeneous API. Assuming the amount of work for a heterogeneous API call is 1, the execution efficiency is the reciprocal of the execution time. In some embodiments, the scheduling reference information may include the execution efficiencies of multiple processing engines. In other embodiments, the scheduling reference information may include the execution times of multiple processing engines, and the execution times can be used to describe the execution efficiency.

[0107] Of course, the scheduling reference information can also be a rank obtained by sorting the execution efficiency or the execution time, and this rank can describe the level of the execution efficiency. Specifically, the scheduling reference information can be a rank obtained by sorting the execution efficiency or the execution time in descending or ascending order. This rank can be used as the scheduling priority for heterogeneous API calls. Taking the rank obtained by sorting the execution time in ascending order as an example, the higher the rank, the higher the scheduling priority, and the lower the rank, the lower the scheduling priority.

[0108] Among them, the format of the scheduling reference information is diverse. For example, the scheduling reference information can be in vector format, or in key-value pair format, or in other formats, which are not listed one by one in the embodiments of this application.

[0109] In some possible implementation manners, the scheduling reference information can be characterized by a scheduling priority vector as Figure 1 shown. The element value of each element of the scheduling priority vector represents the scheduling priority of a processing engine. In some embodiments, the smaller the element value, the higher the scheduling priority. In other embodiments, the larger the element value, the higher the scheduling priority.

[0110] Of course, the scheduling reference information can also be characterized by key-value pairs of processing engines and scheduling priorities. Specifically, the scheduling reference information can include N key-value pairs, and each key-value pair in these N key-value pairs corresponds to a processing engine and its scheduling priority respectively.

[0111] The processing device 200 can obtain the scheduling reference information of each target test case as the scheduling reference information of the test cases whose parameter scale values fall within the corresponding target subsets, and then obtain the relationship between the parameter scale and the processing engine according to the target subsets and the corresponding scheduling reference information.

[0112] Specifically, the processing device 200 can associate the subsets corresponding to the parameter scale values of the S groups of test cases with the scheduling reference information in any one of the ways such as a relationship table, a relationship text, or a relationship graph, so as to construct the relationship between the parameter scale and the processing engine.

[0113] In some possible implementation manners, the processing device 200 may use the target subset corresponding to the parameter scale value of the target test case as a row or a column of the relationship table, and use the scheduling reference information as a row or a column of the relationship table, thereby obtaining a relationship table between the target subset corresponding to the parameter scale value and the scheduling reference information. The scheduling reference information is used to characterize the execution efficiency of each processing engine. Therefore, the relationship table includes the relationship between the parameter scale and the processing engine. The processing device 200 may store the above relationship table, thereby storing the relationship between the parameter scale and the processing engine.

[0114] In some other possible implementation manners, the processing device 200 may write the target subset corresponding to the parameter scale value of the target test case and the corresponding scheduling reference information into a relationship text. The scheduling reference information is used to characterize the execution efficiency of each processing engine. Therefore, the relationship text includes the relationship between the parameter scale and the processing engine. The processing device 200 stores the above relationship text, thereby storing the relationship between the parameter scale and the processing engine. The relationship text may be in the format of JavaScript Object Notation (JSON), or in the format of Extensible Markup Language (XML), or in the format of plain text (txt). The embodiments of the present application do not limit this.

[0115] In some possible implementation manners, the processing device 200 may use each target subset in the target subset corresponding to the parameter scale value of the target test case as a node of a graph, and use the scheduling reference information as an edge of the node, thereby constructing a relationship graph. The scheduling reference information is used to characterize the execution efficiency of each processing engine. Therefore, the relationship graph includes the relationship between the parameter scale and the processing engine. The processing device 200 may store the above relationship graph, thereby storing the relationship between the parameter scale and the processing engine.

[0116] Based on the above description, the embodiments of the present application provide a method for constructing a relationship between a parameter scale and a processing engine. This method micro-classifies heterogeneous APIs by using the parameter scale values when heterogeneous APIs are called, so as to distinguish the same heterogeneous API that appears at different call points. Further, this method supports constructing the relationship between the parameter scale and the processing engine according to the execution efficiency of heterogeneous APIs in multiple processing engines in a heterogeneous system under each classification, so that when a heterogeneous API is called, the heterogeneous API call can be reasonably scheduled to a suitable processing engine according to the above relationship between the parameter scale and the processing engine, improving the execution efficiency of the heterogeneous API call, and further improving the execution efficiency of the heterogeneous application.

[0117] In Figure 2In the illustrated embodiment, the processing device 200 may group multiple test cases. For example, it may divide W test cases into S groups and determine the target test cases in at least one group of test cases. Then, the processing device 200 determines the target subset corresponding to at least one group of test cases according to the parameter scale value of at least one group of test cases, that is, the target subset corresponding to the parameter scale value of the target test cases. In this way, the processing device 200 can obtain the relationship between the parameter scale and the processing engine according to the target subset corresponding to the parameter scale value of at least one group of test cases and the scheduling reference information.

[0118] The parameter scale value of each group of test cases falls within a subset of the value range of the parameter scale, and the subsets corresponding to the parameter scale values of each group of test cases are different. Among them, the parameter scale value can be obtained by calculating the parameter value. For example, the processing device 200 can substitute the parameter value into the expression for calculating the parameter scale to obtain the corresponding parameter scale value.

[0119] In the above embodiment, the processing device 200 can group the W test cases in various ways and obtain the scheduling reference information corresponding to each group of test cases. For example, the processing device 200 can evenly divide the W test cases into S groups by the average classification method, or the processing device 200 can divide the W test cases into S groups by the greedy classification method. The average classification method and the greedy classification method will be introduced in detail below.

[0120] See Figure 3 the classification schematic diagram shown. The processing device 200 divides the value range (0, +∞) of the parameter scale into S groups according to the parameter scale values V1, V2,... V W (specifically, the sorted parameter scale values) of the W test cases of a certain heterogeneous API, so that the number of V i in each group of test cases is approximately the same, thus achieving average classification.

[0121] Specifically, the processing device 200 can determine the group size according to the number of test cases and the number of groups. Among them, the group size refers to the number of V i in the group. It should be noted that the group size and the interval size of the subset may not be equal. In some embodiments, the processing device 200 can round down the ratio of the number of test cases W to the number of groups S to determine the group size, as shown below:

[0122]

[0123] where D represents the group size. It should be noted that when W is divisible by S, the group size of each group is the same; when W is not divisible by S, the group sizes of the first S - 1 groups are the same, and the group size of the last group is greater than that of the first S - 1 groups.

[0124] After determining the group size, the processing device 200 can divide the W test cases into S groups according to the parameter scale values. The parameter scale values of the S groups of test cases respectively fall into a target subset of the value range (0, +∞) of the parameter scale, as follows:

[0125] C1 = (0, V 1+D ), C2 = [V 1+D , V 1+2D ), C3 = [V 1+2D , V 1+3D )…, C S = [V 1+(S-1)D , +∞)

[0126] Among them, D test cases in the W test cases have parameter scale values that fall into the target subsets C1, C2…C S-1 , and D or more test cases have parameter scale values that fall into the target subset C S .

[0127] After dividing the W test cases into S groups, the processing device 200 can also determine the target test cases in each group of test cases. For example, the processing device 200 can determine the test cases with parameter scale values close to the average value or median value of the parameter scale values of each group of test cases as the target test cases. Among them, close means that the difference or ratio satisfies the set conditions. The set conditions include that the absolute value of the difference is less than the preset threshold, or the absolute value of the difference between the ratio and 1 is less than the preset threshold. When there are multiple test cases that meet the set conditions, the processing device 200 can determine the test case with the smallest absolute value of the difference or the smallest absolute value of the difference between the ratio and 1 as the target test case.

[0128] Then, the processing device 200 executes the target test cases on multiple processing engines respectively, and obtains the execution time of the target test cases on the multiple processing engines. Then, the processing device 200 obtains the scheduling reference information of the target test cases according to the execution time of the target test cases on the multiple processing engines. For example, the processing device 200 can sort the processing engines according to the execution time, and determine the scheduling priorities of the respective processing engines according to the sorting result, thereby obtaining the scheduling reference information of the target test cases. In some possible implementation manners, the processing device 200 can directly use the scheduling reference information of the target test cases as the scheduling reference information of this group of test cases.

[0129] Next, taking the target test case as the test case with a parameter scale value close to the average value of the parameter scale values of each group of test cases as an example, the process of obtaining the scheduling reference information is illustrated.

[0130] First, the processing device 200 determines the average value of the parameter scale values of each group of test cases, as specifically shown in the following formula:

[0131]

[0132] where |C i | represents the number of Vs in C i and V j is the number of Vs in C

[0133] Then, the processing device 200 finds V i from C k such that the absolute value of V k -avg(C i ) is the smallest. Among them, the test case corresponding to V k is T k .

[0134] Next, the processing device 200 can use each processing engine T r (1 ≤ r ≤ N) included in the heterogeneous system 100 to separately execute the target test case T k to obtain the execution time of T k on each processing engine.

[0135] Considering the accidental error of a single measurement, the processing device 200 can execute T k L times on each processing engine to obtain the execution time t l (1 ≤ l ≤ L) each time. Then, the processing device 200 removes the maximum value and the minimum value from t l and calculates the average value t avg (i, r) of the remaining L - 2 execution times.

[0136] Finally, the processing device 200 can sort t avg (i, r), for example, sort it in ascending order, so as to obtain the scheduling priority vector, that is, the scheduling reference information. It should be noted that the element values of each element in the scheduling priority vector can be the sorting results, such as 1, 2,... N, or the average execution time t avg (i, r).

[0137] Next, please refer to Figure 4In the classification schematic diagram shown, the processing device 200 can use each of the W test cases obtained as a target test case, and execute the W target test cases on various processing engines included in the heterogeneous system 100 respectively to obtain scheduling reference information corresponding to the W target test cases. The scheduling reference information can be a scheduling priority vector, or a key-value pair of a hardware engine and a scheduling priority, etc. Then, the processing device 200 divides the test cases that are adjacent among the W test cases with the same scheduling reference information and sorted according to the parameter scale value into the same group.

[0138] Among them, adjacent test cases among the W test cases refer to test cases with close parameter scale values after sorting the W test cases according to the parameter scale value. For example, after sorting the parameter scale values of the W test cases as V1, V2, …, V W , then the test cases with parameter scale values of V i and V i+1 are adjacent test cases, where 1 ≤ i ≤ W - 1.

[0139] Furthermore, the processing device 200 can also calculate the similarity of the scheduling reference information of adjacent groups. For example, when the scheduling reference information is a scheduling priority vector, the processing device 200 can calculate the distance of the scheduling priority vector and determine the similarity according to this distance. When the similarity of the scheduling reference information is greater than the similarity threshold, for example, when the similarity of the scheduling priority vector is greater than the similarity threshold (the distance of the scheduling priority vector is less than the preset distance), the processing device 200 can merge the adjacent groups, thereby reducing the number of groups.

[0140] In some embodiments, the processing device 200 can calculate the distance of the scheduling priority vector based on the following formula:

[0141] D vec (i, j) = |PVec(i)(1) - PVec(j)(1)| + … |PVec(i)(N) - PVec(j)(N)|.

[0142] Among them, PVec represents the scheduling priority vector, and D Vec represents the distance of the scheduling priority vector. i and j respectively represent the i-th group and the j-th group. When this distance is less than the preset distance, it indicates that the similarity of the scheduling reference information is greater than the similarity threshold, and the processing device 200 can merge the corresponding groups.

[0143] When the element value of the element of the scheduling priority vector is the execution time, the processing device 200 can also sort each processing engine according to the execution time, use the obtained ranking as the scheduling priority, and then the processing device 200 compares the ranking to determine whether the scheduling reference information is the same or similar. Moreover, when the processing device 200 merges adjacent groups with similar scheduling reference information, it can determine the scheduling reference information of the merged group according to the scheduling reference information of the adjacent groups. For example, the processing device 200 can calculate the average value as the scheduling reference information of the merged group, as shown below:

[0144]

[0145] where k satisfies D Vec (k,k - 1)=min 2≤i≤j-1 D Vec (i,i - 1).

[0146] In addition to merging adjacent groups with similar scheduling reference information, the processing device 200 can also reduce the number of groups in other ways. Specifically, after obtaining multiple groups through greedy classification, the processing device 200 can also cluster the divided multiple groups according to the similarity of the scheduling reference information of multiple sets of test cases, so as to obtain S sets of test cases.

[0147] It should be noted that in the S sets of test cases obtained by merging adjacent groups, the subset corresponding to the parameter scale value of each set of test cases is a continuous interval. In the S sets of test cases obtained by clustering multiple sets of test cases, the subset corresponding to the parameter scale value of each set of test cases can be a discontinuous interval. In actual use, the complexity of finding a parameter scale value in a continuous interval is less than that in a discontinuous interval. When finding a parameter scale value, the search efficiency in a continuous interval is higher than that in a discontinuous interval.

[0148] Figure 3 、 Figure 4 Mainly use the average classification method and the greedy classification method to Figure 2 detail the specific implementation of S204 in the embodiments shown. In actual applications, S204 can also be implemented in other ways, and the embodiments of the present application do not limit this.

[0149] As mentioned above in combination with Figures 1 to 4 a detailed introduction to the method for constructing the relationship between the parameter scale and the processing engine provided by the embodiments of the present application has been given. Next, the devices and equipment provided by the embodiments of the present application will be introduced with reference to the accompanying drawings.

[0150] See Figure 5 the structural schematic diagram of the device for constructing the relationship between the parameter scale and the processing engine shown. The device 500 includes:

[0151] An obtaining module 502, configured to obtain multiple test cases of a heterogeneous application programming interface (API);

[0152] A building module 504, configured to obtain the relationship between the parameter scale and the processing engine according to the parameter scale value of a target test case among the multiple test cases and the scheduling reference information, where the scheduling reference information is used to describe the execution efficiency of multiple processing engines in a heterogeneous system.

[0153] In some possible implementation manners, the parameter scale value of the target test case falls within a target subset of the value range of the parameter scale;

[0154] Specifically, the building module 504 is configured to:

[0155] Obtain the relationship between the parameter scale and the processing engine according to the target subset corresponding to the parameter scale value of the target test case and the scheduling reference information of the target test case.

[0156] In some possible implementation manners, the building module 504 is further configured to:

[0157] Group the multiple test cases;

[0158] Determine the target subset corresponding to the parameter scale value of the target test case according to the parameter scale values of at least one group of test cases.

[0159] Specifically, the building module 504 is configured to:

[0160] Sort the multiple test cases according to the parameter scale values;

[0161] Evenly distribute the sorted test cases to multiple groups.

[0162] In some possible implementation manners, the target test case is a test case in a group of test cases whose parameter scale value is close to the average value or the median value of the parameter scale values of this group of test cases.

[0163] In some possible implementation manners, the target test case is each test case among the multiple test cases;

[0164] Specifically, the building module 504 is configured to:

[0165] Divide the test cases with the same scheduling reference information and adjacent to each other among the multiple test cases sorted according to the parameter scale values into the same group;

[0166] Obtain the relationship between the parameter scale and the processing engine according to the target subset corresponding to the parameter scale values of at least one group of test cases and the scheduling reference information.

[0167] In some possible implementation manners, the building module 504 is further configured to:

[0168] When the similarity of the scheduling reference information of adjacent groups is greater than the similarity threshold, merge the adjacent groups.

[0169] In some possible implementation manners, the construction module 504 is further configured to:

[0170] Cluster multiple groups of test cases according to the similarity of the scheduling reference information of the multiple groups of test cases.

[0171] In some possible implementation manners, the construction module 504 is further configured to:

[0172] Execute the target test case on multiple processing engines respectively, and obtain the execution time of the target test case on the multiple processing engines;

[0173] Obtain the scheduling reference information corresponding to the target test case according to the execution time of the target test case on the multiple processing engines.

[0174] In some possible implementation manners, the apparatus 500 further includes:

[0175] A storage module, configured to store the relationship between the parameter scale and the processing engine through at least one of a relationship table, a relationship text, or a relationship graph.

[0176] In some possible implementation manners, the heterogeneous system includes a single-node heterogeneous system or a heterogeneous cluster.

[0177] The apparatus 500 for constructing the relationship between the parameter scale and the processing engine according to the embodiment of the present application may correspond to executing the method described in the embodiment of the present application, and the above and other operations and / or functions of each module / unit of the apparatus 500 for constructing the relationship between the parameter scale and the processing engine are respectively for implementing Figure 2 The corresponding processes of the respective methods in the illustrated embodiments, and for the sake of brevity, will not be described herein again.

[0178] The embodiment of the present application further provides a computing device 600. The computing device 600 may be an end-side device such as a notebook computer or a desktop computer, or a cloud computing device in a cloud environment or an edge computing device in an edge environment. Of course, the computing device 600 may also be a computer cluster formed by multiple devices. The computing device 600 is specifically configured to implement as Figure 5 The functions of the apparatus 500 for constructing the relationship between the parameter scale and the processing engine in the illustrated embodiment.

[0179] Figure 6 A structural schematic diagram of a computing device 600 is provided, as Figure 6As shown, the computing device 600 includes a bus 601, multiple processors 602, a communication interface 603, and a memory 604. The processors 602, the memory 604, and the communication interface 603 communicate with each other via the bus 601.

[0180] The bus 601 can be a peripheral component interconnect (PCI) bus, an extended industry standard architecture (EISA) bus, or the like. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of simplicity of representation, Figure 6 it is represented by only one thick line in the figure, but this does not mean that there is only one bus or one type of bus. The communication interface 603 is used for external communication. For example, obtaining training corpus matching the application scenario of unstructured data, or obtaining unstructured data, etc.

[0181] Among them, the processor 602 can be any of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP), etc. For example, the computing device 600 can include 2 types of processors, namely a CPU and a GPU, or include 3 types of processors, namely a CPU, a GPU, and an MP. The embodiments of the present application do not limit this.

[0182] The communication interface 603 is used for external communication. For example, obtaining multiple test cases of heterogeneous APIs, obtaining scheduling reference information of target test cases, and so on.

[0183] The memory 604 can include volatile memory, such as random access memory (RAM). The memory 604 can also include non-volatile memory, such as read-only memory (ROM), flash memory, a hard disk drive (HDD), or a solid state drive (SSD).

[0184] The memory 604 stores executable code, and the processor 602 executes the executable code to execute the foregoing method for constructing the relationship between the parameter scale and the processing engine.

[0185] Specifically, in the implementationFigure 5 In the case of the illustrated embodiment, and Figure 5 when each module of the relationship construction device 500 for the relationship between the parameter scale and the processing engine described in the embodiment is implemented by software, execute Figure 5 The software or program code required for the relationship construction function of the parameter scale and the processing engine in [] is stored in the memory 604.

[0186] The communication interface 603 obtains multiple test cases of heterogeneous APIs, transmits them to the processor 602 through the bus 601, and the processor 602 executes the program code in the memory 604 to perform the following steps:

[0187] Obtain the relationship between the parameter scale and the processing engine according to the target test case parameter scale value and the scheduling reference information in the multiple test cases.

[0188] In some possible implementation manners, the processor 602 may also execute according to the program code Figure 2 The methods and steps corresponding to various implementation manners in the illustrated embodiment are not limited in this embodiment of the present application.

[0189] This embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium may be any available medium that a computing device can store or a data storage device such as a data center including one or more available media. The available medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid-state drive), etc. The computer-readable storage medium includes instructions that direct the computing device to execute the above-mentioned relationship construction method for the parameter scale and the processing engine applied to the relationship construction device 500.

[0190] This embodiment of the present application also provides a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computing device, all or part of the processes or functions described in the embodiments of the present application are generated.

[0191] The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, or data center to another website, computer, or data center by wire (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wirelessly (such as infrared, wireless, microwave, etc.).

[0192] The computer program product may be a software installation package. In the case where any method of the method for constructing the relationship between the parameter scale and the processing engine is required, the computer program product can be downloaded and executed on a computing device.

[0193] The descriptions of the processes or structures corresponding to the above respective drawings have their own emphases. For parts not detailed in a certain process or structure, reference may be made to the relevant descriptions of other processes or structures.

Claims

1. A method for constructing the relationship between parameter scale and processing engine, characterized in that The method includes: Obtaining a plurality of test cases for a heterogeneous application programming interface (API); Grouping the plurality of test cases by using an average classification method or a greedy classification method; Obtaining the relationship between the parameter scale and the processing engine according to the target subset corresponding to the parameter scale value of the target test case among the plurality of test cases and the scheduling reference information, where the scheduling reference information is used to describe the execution efficiency of multiple processing engines in a heterogeneous system, the parameter scale value of a group of test cases where the target test case is located falls within the target subset, and the target subset is a subset of the value range of the parameter scale.

2. The method according to claim 1, wherein The method further includes: Determining the target subset corresponding to the parameter scale value of the target test case according to the parameter scale values of at least one group of test cases.

3. The method according to claim 2, wherein The step of grouping the plurality of test cases by using an average classification method or a greedy classification method includes: Sorting the plurality of test cases according to the parameter scale values; Evenly distributing the sorted test cases into multiple groups.

4. The method according to claim 2, characterized in that The target test case is a test case in a group of test cases whose parameter scale value is close to the average value or median value of the parameter scale values of the group of test cases, and the closeness means that the difference or ratio satisfies a set condition.

5. The method according to claim 1, characterized in that The target test case is each test case among the plurality of test cases; The step of grouping the plurality of test cases by using an average classification method or a greedy classification method includes: Dividing test cases with the same scheduling reference information and adjacent in the plurality of test cases sorted according to the parameter scale values into the same group.

6. The method according to claim 5, wherein The method further includes: When the similarity of the scheduling reference information of adjacent groups is greater than a similarity threshold, merging the adjacent groups.

7. The method according to claim 5, characterized in that, The method further includes: Clustering multiple groups of test cases according to the similarity of the scheduling reference information of the multiple groups of test cases.

8. The method according to any one of claims 1 to 7, characterized in that, The method further includes: Executing the target test case on the multiple processing engines respectively to obtain the execution time of the target test case on the multiple processing engines; Obtaining the scheduling reference information corresponding to the target test case according to the execution time of the target test case on the multiple processing engines.

9. The method according to any one of claims 1 to 7, characterized in that, The method further includes: Storing the relationship between the parameter scale and the processing engine through at least one of a relationship table, a relationship text, or a relationship graph.

10. The method according to any one of claims 1 to 7, characterized in that The heterogeneous system includes a single-node heterogeneous system or a heterogeneous cluster.

11. An apparatus for constructing a relationship between parameter scale and processing engine, characterized in that, The device includes: An obtaining module, configured to obtain a plurality of test cases for a heterogeneous application programming interface (API); A constructing module, configured to group the plurality of test cases by using an average classification method or a greedy classification method; and obtain the relationship between the parameter scale and the processing engine according to the target subset corresponding to the parameter scale value of the target test case among the plurality of test cases and the scheduling reference information, where the scheduling reference information is used to describe the execution efficiency of multiple processing engines in a heterogeneous system, the parameter scale value of a group of test cases where the target test case is located falls within the target subset, and the target subset is a subset of the value range of the parameter scale.

12. The device according to claim 11, characterized in that, The constructing module is further configured to: Determine the target subset corresponding to the parameter scale value of the target test case according to the parameter scale values of at least one group of test cases.

13. The device according to claim 11, characterized in that, The constructing module is specifically configured to: Sort the multiple test cases according to the parameter scale value; Evenly distribute the sorted test cases into multiple groups.

14. The device according to claim 12, characterized in that The target test case is a test case in a group of test cases whose parameter scale value is close to the average value or median value of the parameter scale values of the group of test cases, and the closeness means that the difference or ratio meets the set conditions.

15. The device according to claim 12, characterized in that, The target test case is each test case among the multiple test cases; The building module is further configured to: Divide the test cases with the same scheduling reference information and adjacent to each other in the multiple test cases sorted according to the parameter scale value into the same group.

16. The device according to claim 15, wherein The building module is further configured to: When the similarity of the scheduling reference information of adjacent groups is greater than the similarity threshold, merge the adjacent groups.

17. The device according to claim 15, characterized in that, The building module is further configured to: Cluster the multiple groups of test cases according to the similarity of the scheduling reference information of the multiple groups of test cases.

18. The device according to any one of claims 11 to 17, characterized in that The building module is further configured to: Execute the target test case on the multiple processing engines respectively to obtain the execution time of the target test case on the multiple processing engines; Obtain the scheduling reference information corresponding to the target test case according to the execution time of the target test case on the multiple processing engines.

19. The device according to any one of claims 11 to 17, characterized in that The device further includes: A storage module, configured to store the relationship between the parameter scale and the processing engine through at least one of a relational table, a relational text, or a relational graph.

20. The device according to any one of claims 11 to 17, characterized in that, The heterogeneous system includes a single-node heterogeneous system or a heterogeneous cluster.

21. A computing device, characterized in that, The computing device includes a processor and a memory; The processor is configured to execute the instructions stored in the memory so that the computing device executes the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • API calling method and device

    CN113918290A