Algorithm combination tuning processing method, device, computer equipment and storage medium

By constructing a state transfer matrix and algorithm selection matrix, recording the minimum sum of performance costs under different combination methods, the problem of inefficient algorithm combination tuning in inference calculation is solved, and the preferred one is achieved efficiently finding the Algorithm combination.

CN114925322BActive Publication Date: 2024-12-20SHENZHEN DEEPROUTE AI CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202210568020.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-24
Publication Date
2024-12-20
Estimated Expiration
2042-05-24

AI Technical Summary

Technical Problem

During the inference calculation process, due to the large number of algorithm combinations, the time efficiency of finding preferred combinations is low, and it is difficult for the prior art to efficiently perform algorithm combination tuning.

Method used

By obtaining multiple algorithms and their operators to which they belong, a state transfer matrix and algorithm selection matrix are constructed, state transfer processing and algorithm selection are performed based on resource usage and performance cost, and the minimum sum of performance cost under different combination methods is recorded, thereby determining the Combination of algorithms that minimize performance costs.

Benefits of technology

This method can directly use the algorithm combination and its performance cost sum minimum value recorded in the previous period without repeated calculations, reduce the time complexity, and reduce it from exponential to polynomial level, improving the efficiency of algorithm combination tuning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114925322B_ABST
    Figure CN114925322B_ABST
Patent Text Reader

Abstract

The present application relates to an algorithm combination tuning processing method, device, computer equipment and storage medium. The method includes: obtaining multiple algorithms and operators to which each algorithm belongs, each operator including multiple algorithms; obtaining an initial state transfer matrix and an initial algorithm selection matrix; based on the operators, resource occupancy and performance cost to which each algorithm belongs, performing state transfer processing in the state transfer matrix, and recording the state after the state transfer processing; in the algorithm selection matrix, recording the algorithm selected from each operator to achieve the minimum sum of performance costs according to different operator combinations and preset total resource occupancy; based on the contents recorded in the state transfer matrix and the algorithm selection matrix, determining the algorithm combination that minimizes the sum of performance costs composed of the algorithms selected from each operator. This method can efficiently find the preferred algorithm combination from multiple operators.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computing technology, and in particular to an algorithm combination tuning processing method, device, computer equipment and storage medium. Background Art

[0002] With the development of computer technology, there are more operators in the reasoning and calculation process. Each operator corresponds to multiple algorithms. Different combinations have different performances on the hardware platform. It is necessary to tune the algorithm combination to obtain the best performance.

[0003] However, due to the large number of operators that need to be tuned, the number of final solutions increases rapidly, and the time to find the optimal combination solution also increases, which is inefficient. Summary of the invention

[0004] Based on this, it is necessary to provide an algorithm combination tuning processing method, device, computer equipment and storage medium that can efficiently find the optimal algorithm combination from multiple operators to address the above technical problems.

[0005] In a first aspect, the present application provides an algorithm combination tuning processing method. The method comprises:

[0006] Get multiple algorithms and the operators to which each algorithm belongs. Each operator includes multiple algorithms.

[0007] Obtain the initial state transfer matrix and the initial algorithm selection matrix;

[0008] Based on the operators, resource usage and performance cost of each algorithm, state transfer processing is performed in the state transfer matrix, and the state after the state transfer processing is recorded; the recorded state represents the minimum sum of performance costs corresponding to the algorithms selected from each operator according to different operator combinations and preset total resource usage;

[0009] In the algorithm selection matrix, the algorithm selected from each operator according to different operator combinations and preset total resource occupancy to achieve the minimum total performance cost is recorded;

[0010] Based on the contents recorded in the state transfer matrix and the algorithm selection matrix respectively, an algorithm combination that minimizes the sum of performance costs, which is formed by the algorithms selected from each operator, is determined.

[0011] In one embodiment, based on the operator, resource usage and performance cost of each algorithm, performing state transfer processing in the state transfer matrix and recording the state after the state transfer processing include:

[0012] traversing each algorithm from the plurality of operators according to different total resource occupancy;

[0013] Get the resource usage of the traversal algorithm and the performance cost of the traversal algorithm;

[0014] Subtract the resource occupation amount of the traversed algorithm from the total resource occupation amount of the traversal to obtain a first resource occupation intermediate amount;

[0015] According to the first resource occupancy intermediate amount, determine the historical state from each state of the operator combination traversed last time in the state transfer matrix;

[0016] Determine the traversed operator and the candidate state under the total resource occupancy of the traversal based on the performance cost of the traversal algorithm and the historical state;

[0017] In the state transfer matrix, the minimum value among the candidate states is determined as the state under the traversed operator and the total resource occupancy of the traversal.

[0018] In one of the embodiments, traversing each algorithm from the multiple operators according to different total resource occupancy includes: first traversing each operator among the multiple operators, then traversing the preset total resource occupancy under the operator, and then traversing each algorithm in the traversed operators under the traversed total resource occupancy.

[0019] In one embodiment, the first dimension i of the state transfer matrix represents the operator combination of the first i operators among the multiple operators; the second dimension j of the state transfer matrix represents the total resource usage of each algorithm selected from the first i operators; when each algorithm is selected from the first i operators so that the total resource usage of the selected algorithm is j, the minimum value of the total performance cost of the selected algorithm is recorded as the state dp in the state transfer matrix. i,j ; Where i is an integer not less than 0, and j is a discrete value not less than 0;

[0020] The state transfer process is performed according to the following formula:

[0021]

[0022] Among them, resource i,k represents the resource usage of selecting the kth algorithm from the i-th operator, cost i,k represents the performance cost of selecting the kth algorithm from the i-th operator, j-resource i,k The first resource occupancy intermediate amount is obtained by subtracting the resource occupancy of the kth algorithm selected from the i-th operator from the total resource occupancy j. Characterizes the intermediate amount j-resource occupied by the first resource i,k The historical state is determined from the various states of the combination of the previous i-1 operators, and min{} means taking the minimum value.

[0023] In one embodiment, the state transfer matrix is ​​obtained by traversing different operator combinations, and when a new operator combination is traversed, the order of the newly added operators is the largest in the new operator combination, and the algorithm selection matrix records the order of the newly added operators when the operator combination is traversed; and the algorithm combination that minimizes the total performance cost, composed of the algorithms selected from each operator based on the contents recorded in the state transfer matrix and the algorithm selection matrix, comprises:

[0024] Start with the operator with the largest order and traverse in reverse order;

[0025] When the maximum order is reached by traversing in reverse order, an algorithm with a minimum state corresponding to the maximum order in the state transfer matrix is ​​determined from the algorithm selection matrix as the algorithm in the algorithm combination;

[0026] When the reverse-order traversal reaches an order less than the maximum order, the total resource occupancy corresponding to the algorithm determined in the previous reverse-order traversal in the algorithm selection matrix is ​​subtracted from the resource occupancy of the algorithm determined in the previous reverse-order traversal to obtain a second intermediate resource occupancy; the total resource occupancy is matched according to the second intermediate resource occupancy to determine the algorithm for this reverse-order traversal from the operators of the order of this reverse-order traversal of the algorithm selection matrix as the algorithm in the algorithm combination.

[0027] In one embodiment, the first dimension i of the algorithm selection matrix represents the i-th operator of the operator sequence; the second dimension j of the algorithm selection matrix represents the total resource usage of each algorithm selected from each of the first i operators; the content selected recorded by the algorithm selection matrix i,j Representation of the state dp recorded in the state transfer matrix i,j The selected algorithm; where i is an integer not less than 0 and j is a discrete value not less than 0.

[0028] In one of the embodiments, in the initial state transfer matrix, except for the operator combination of the first 0 operators whose state is 0 when the total resource occupancy is 0, the initial value of the state in other cases is infinite; the content recorded in the initial algorithm selection matrix is ​​empty.

[0029] In a second aspect, the present application also provides an algorithm combination optimization processing device. The device comprises:

[0030] The algorithm information acquisition module is used to obtain multiple algorithms and operators to which each algorithm belongs, and each operator includes multiple algorithms;

[0031] A matrix acquisition module is used to obtain an initial state transfer matrix and an initial algorithm selection matrix;

[0032] A state transfer processing module, used for performing state transfer processing in the state transfer matrix based on the operators, resource usage and performance cost of each algorithm;

[0033] A state recording module is used to record the state after the state transfer process; the recorded state represents the minimum sum of performance costs corresponding to the algorithm selected from each operator according to different operator combinations and preset total resource usage;

[0034] An algorithm selection recording module, used for recording in the algorithm selection matrix the algorithm selected from each operator to achieve the minimum total performance cost according to different operator combinations and preset total resource occupancy;

[0035] The algorithm combination determination module is used to determine the algorithm combination that minimizes the total performance cost, which is composed of the algorithms selected from each operator, based on the contents recorded in the state transfer matrix and the algorithm selection matrix respectively.

[0036] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0037] Get multiple algorithms and the operators to which each algorithm belongs. Each operator includes multiple algorithms.

[0038] Obtain the initial state transfer matrix and the initial algorithm selection matrix;

[0039] Based on the operators, resource usage and performance cost of each algorithm, state transfer processing is performed in the state transfer matrix, and the state after the state transfer processing is recorded; the recorded state represents the minimum sum of performance costs corresponding to the algorithms selected from each operator according to different operator combinations and preset total resource usage;

[0040] In the algorithm selection matrix, the algorithm selected from each operator according to different operator combinations and preset total resource occupancy to achieve the minimum total performance cost is recorded;

[0041] Based on the contents recorded in the state transfer matrix and the algorithm selection matrix respectively, an algorithm combination that minimizes the sum of performance costs, which is formed by the algorithms selected from each operator, is determined.

[0042] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0043] Get multiple algorithms and the operators to which each algorithm belongs. Each operator includes multiple algorithms.

[0044] Obtain the initial state transfer matrix and the initial algorithm selection matrix;

[0045] Based on the operators, resource usage and performance cost of each algorithm, state transfer processing is performed in the state transfer matrix, and the state after the state transfer processing is recorded; the recorded state represents the minimum sum of performance costs corresponding to the algorithms selected from each operator according to different operator combinations and preset total resource usage;

[0046] In the algorithm selection matrix, the algorithm selected from each operator according to different operator combinations and preset total resource occupancy to achieve the minimum total performance cost is recorded;

[0047] Based on the contents recorded in the state transfer matrix and the algorithm selection matrix respectively, an algorithm combination that minimizes the sum of performance costs, which is formed by the algorithms selected from each operator, is determined.

[0048] The above algorithm combination tuning processing method, device, computer equipment and storage medium obtain multiple algorithms and operators of each algorithm, and then perform state transfer processing in the state transfer matrix. By recording the minimum sum of performance costs corresponding to the algorithms selected from each operator according to different operator combinations and preset total resource occupancy during the state transfer processing, and recording the algorithm selected from each operator to achieve the minimum sum of performance costs through the algorithm selection matrix, the algorithm combination that minimizes the sum of performance costs composed of the algorithms selected from each operator is determined. When performing algorithm combination selection, the algorithm combination and its corresponding minimum sum of performance costs recorded before the state transfer processing can be directly used without repeated calculations, which saves the time of algorithm combination tuning processing, reduces the time complexity from exponential level to polynomial level, and can efficiently find the preferred algorithm combination from multiple operators. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 An application environment diagram of an algorithm combination tuning processing method in an embodiment;

[0050] Figure 2 A schematic diagram of a process flow of an algorithm combination tuning processing method in one embodiment;

[0051] Figure 3A flowchart of the steps of performing state transfer processing in a state transfer matrix and recording the state after the state transfer processing based on the operators, resource usage and performance cost of each algorithm in one embodiment;

[0052] Figure 4 It is a structural block diagram of an algorithm combination tuning processing device in one embodiment;

[0053] Figure 5 is a structural block diagram of a state transfer processing module in one embodiment;

[0054] Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0055] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0056] The algorithm combination tuning processing method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other servers. The reasoning engine can be integrated on the server 104, or it can run on the cloud, other servers or the terminal 102. Among them, the terminal 102 can be but is not limited to various desktop computers, laptops, smart phones, tablets, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.

[0057] In one embodiment, Figure 2 As shown, an algorithm combination tuning processing method is provided, which can be used to find a preferred algorithm combination in an artificial intelligence application scenario to solve the problem in the scenario. The application scenario can be an electronic financial scenario, a medical data processing scenario, an autonomous driving scenario, a simulation scenario, or a logistics data processing scenario. This embodiment uses the method applied to a computer device as an example, and the computer device can be Figure 1 The server 104 or the terminal 102 in the computer device implements the method through the inference engine on the computer device, and the method includes the following steps:

[0058] Step 202: Acquire multiple algorithms and operators to which each algorithm belongs, where each operator includes multiple algorithms.

[0059] Operators refer to different operations used by computer devices to solve computational problems. They can be computational units in artificial intelligence models, such as convolution operators, deconvolution operators, and normalization operators, which are used to implement basic functions in artificial intelligence models. Algorithms are code instructions with specific computational logic that perform computational functions in operators, such as convolution algorithms, deconvolution algorithms, and normalization algorithms.

[0060] In one embodiment, a computer device may obtain algorithm information of each of a plurality of algorithms, each algorithm information including an algorithm identifier of the corresponding algorithm and an operator identifier of an operator to which the corresponding algorithm belongs. For each operator, the obtained algorithm information includes at least two algorithm information, and the at least two algorithm information include the operator identifier of the operator. In this embodiment, the algorithm information of each algorithm is expressed in a formatted manner to facilitate storage and subsequent calculations. Among them, the algorithm identifier is used to uniquely identify the corresponding algorithm, and the operator identifier is used to uniquely identify the corresponding operator.

[0061] Step 204: Obtain an initial state transfer matrix and an initial algorithm selection matrix.

[0062] Among them, state transfer refers to the transition from one state to another state, and the state transfer matrix is ​​used to record the state generated by the state transfer process. The computer device initializes the state transfer matrix to obtain the initial state transfer matrix. The state transfer matrix is ​​initialized to generate the initial state in the state transfer matrix, so that based on the initial state in the initial state transfer matrix, the state transfer process can be accurately started to avoid calculation errors during the state transfer process.

[0063] In the process of state transfer processing based on the state transfer matrix, the selection of the algorithm is involved. The algorithm selection matrix is ​​used to record the selected algorithm, and specifically can record the algorithm identifier of the selected algorithm. The computer device initializes the algorithm selection matrix to obtain an initial algorithm selection matrix. The initial algorithm selection matrix is ​​convenient for efficiently recording the algorithm selected during the state transfer processing. In one embodiment, the initial algorithm selection matrix can be an empty matrix.

[0064] Step 206, based on the operators, resource usage and performance cost of each algorithm, perform state transfer processing in the state transfer matrix and record the state after the state transfer processing; the recorded state represents the minimum sum of performance costs corresponding to the algorithms selected from each operator according to different operator combinations and the preset total resource usage.

[0065] Among them, the resource usage of the algorithm represents the size of the resources occupied by the algorithm when it is running, and specifically may include at least one of the size of the storage space occupied by the algorithm and the size of the computing resources occupied. For example, the size of the video memory space occupied by the intermediate quantity generated by the algorithm when executing the computing function determined by the algorithm's own parameters in the inference engine. The performance cost of the algorithm is used to quantitatively represent the performance of the algorithm, and specifically may be the time required for the algorithm to run. In one embodiment, the smaller the performance cost of the algorithm, the better the performance of the algorithm.

[0066] In one embodiment, the first dimension i of the state transfer matrix represents different operator combinations of multiple operators, and specifically can represent the first i operators in the operator sequence of multiple operators. The second dimension j of the state transfer matrix represents a plurality of preset and discrete total resource occupancy amounts. When the state transfer matrix is ​​represented in the form of a row-column table, the first dimension and the second dimension can be the rows and columns of the row-column table, or can be the columns and rows of the row-column table, respectively.

[0067] The matrix unit composed of the first dimension and the second dimension in the state transfer matrix is ​​used to record the state dp after the state transfer processing. i,j Specifically, according to the operator combination method represented by the first dimension i and the total resource usage j of the second dimension, an algorithm is selected from each operator so that the sum of the performance costs of the selected algorithms is the smallest among multiple selection methods. The minimum value of the total performance cost at this time is recorded as the state dp in the state transfer matrix i,j .

[0068] In one embodiment, a computer device may obtain algorithm information of each of a plurality of algorithms, each algorithm information including an algorithm identifier of the corresponding algorithm, an operator identifier of an operator to which the corresponding algorithm belongs, resource usage of the corresponding algorithm, and performance cost of the corresponding algorithm. For each operator, the obtained algorithm information includes at least two algorithm information, and the at least two algorithm information include the operator identifier of the operator. For example, the obtained algorithm information of the plurality of algorithms can be seen as shown in the following Table 1:

[0069] Table 1:

[0070] Algorithm Identification Operator ID Resource usage Performance cost g0 1 3 3 g1 1 4 2 g2 2 1 3 g3 2 2 1

[0071] In one embodiment, the computer device can traverse different operator combinations in the state transfer matrix based on the algorithm information recorded in Table 1 above, so as to transfer from the state of the operator combination previously traversed to the state of the operator combination currently traversed in the state transfer matrix according to the state transfer equation, and record the state after the state transfer processing in the state transfer matrix. The state transfer equation represents: the mathematical relationship that needs to be satisfied between the states in the state transfer matrix under the constraint of selecting an algorithm that minimizes the sum of performance costs among multiple operators under different first dimensions and second dimensions.

[0072] Step 208 : recording in the algorithm selection matrix the algorithms that are selected from each operator to achieve the minimum total performance cost according to different operator combinations and preset total resource occupancy.

[0073] Specifically, there are a first dimension i and a second dimension j in the algorithm selection matrix, the first dimension i represents the i-th operator among multiple operators, and the second dimension j represents the preset and discrete total resource occupancy of multiple types. Among them, the first dimensions in the state transfer matrix and the algorithm selection matrix have different but related meanings, which are related to the functions of the corresponding matrices. The second dimensions in the state transfer matrix and the algorithm selection matrix have the same meaning. The algorithm selection matrix is ​​used to record the algorithm selected in step 206, which achieves the minimum total performance cost in step 206.

[0074] Step 210: Based on the contents recorded in the state transfer matrix and the algorithm selection matrix, determine an algorithm combination that minimizes the total performance cost and is composed of algorithms selected from each operator.

[0075] Specifically, the state transition matrix records the states generated by the state transition processing, and there is a mathematical relationship between the states in terms of operator combination and total resource usage; the algorithm selection matrix, corresponding to the state in the state transition matrix, records the algorithms selected from different operators under each total resource usage to minimize the total performance cost. Therefore, based on the connection between the state transition matrix and the algorithm selection matrix and the contents recorded in each, it is possible to determine the algorithm combination that minimizes the total performance cost, which is composed of the algorithms selected from each operator.

[0076] In one embodiment, the computer device may determine candidate algorithm combinations based on the state transition matrix and the algorithm selection matrix, thereby finding an algorithm combination that minimizes the sum of performance costs from among the candidate algorithm combinations.

[0077] The above algorithm combination tuning processing method obtains multiple algorithms and operators of each algorithm, performs state transfer processing in the state transfer matrix, and determines the algorithm combination that minimizes the total performance cost by recording the minimum sum of performance costs corresponding to the algorithms selected from each operator according to different operator combinations and preset total resource occupancy during the state transfer processing, and recording the algorithm selected from each operator to achieve the minimum sum of performance costs through the algorithm selection matrix. When performing algorithm combination selection, the algorithm combination and its corresponding minimum sum of performance costs recorded before the state transfer processing can be directly used without repeated calculation, which saves the time of algorithm combination tuning processing, reduces the time complexity from exponential level to polynomial level, and can efficiently find the preferred algorithm combination from multiple operators.

[0078] In one embodiment, referring to Figure 3 , step 206 comprises:

[0079] Step 302: traverse each algorithm from multiple operators according to different total resource occupancy.

[0080] Specifically, the computer device may traverse the i-th operator among the multiple operators, the j-th total resource occupancy, and the k-th algorithm in each operator respectively.

[0081] In one embodiment, step 302 includes: first traversing each operator of the plurality of operators, then traversing the preset total resource occupancy under the operator, and then traversing each algorithm in the traversed operator under the traversed total resource occupancy. In this embodiment, traversing the operator first, then traversing the total resource occupancy, and then traversing the algorithm can avoid repeated selection of the algorithm, and facilitate the processing of the state transfer matrix and the algorithm selection matrix, and can efficiently realize the selection of an algorithm in each operator.

[0082] Step 304, obtaining the resource usage of the traversed algorithm and the performance cost of the traversed algorithm.

[0083] Specifically, the computer device may obtain algorithm information of the traversed kth algorithm, and obtain the resource usage of the algorithm and the performance cost of the algorithm based on the algorithm information.

[0084] For example, referring to Table 1, if the kth algorithm traversed is the algorithm with algorithm identification g0, then according to the algorithm identification g0, the resource usage of algorithm g0 in the corresponding algorithm information is obtained as 3, and the performance cost of algorithm g0 in the corresponding algorithm information is obtained as 3. For another example, continue to traverse the algorithms under the operator with operator identification 1, and traverse to the algorithm with algorithm identification g1, then according to the algorithm identification g1, the resource usage of algorithm g1 in the corresponding algorithm information is obtained as 4, and the performance cost of algorithm g1 in the corresponding algorithm information is obtained as 2.

[0085] Step 306: Subtract the resource occupation of the traversed algorithm from the total resource occupation to obtain a first intermediate resource occupation.

[0086] Specifically, the computer device determines the total resource usage j of the traversal and the resource usage resource of the kth algorithm of the traversal i,k , calculate j-resource i,k That is, the intermediate amount of first resource occupancy is obtained.

[0087] Step 308: Determine the historical state from each state of the operator combination traversed last time in the state transfer matrix according to the intermediate amount of first resource occupancy.

[0088] Specifically, the computer device occupies the intermediate amount j-resource according to the first resource i,k , each state dp of the operator combination traversed in the previous state transfer matrix i-1,...... In the history state

[0089] Step 310 , based on the performance cost and historical state of the traversal algorithm, determine the candidate states of the traversed operators and the total resource usage of the traversal.

[0090] Specifically, the computer device is based on the performance cost of the kth algorithm traversed i,k and historical status Determine the candidate state of the traversed i-th operator under the j-th total resource occupancy

[0091] Step 312: In the state transfer matrix, determine the minimum value among the candidate states as the state under the traversed operator and the traversed total resource occupancy.

[0092] Specifically, the candidate state of the computer device at the traversed i-th operator under the j-th total resource occupancy Calculate the minimum value So that the minimum value Determine the state dp of the traversed i-th operator at the j-th total resource occupancy i,j .

[0093] In the above embodiment, each algorithm is traversed from multiple operators according to different total resource occupancy, and state transfer processing is performed based on the state transfer matrix. The state transfer processing can be realized through simple operations, thereby calculating the state after the state transfer processing, and efficient state transfer processing can be realized, so that the preferred algorithm combination can be efficiently determined.

[0094] In one embodiment, the first dimension i of the state transfer matrix represents the operator combination of the first i operators among the multiple operators; the second dimension j of the state transfer matrix represents the total resource usage of each algorithm selected from the first i operators; when each algorithm is selected from the first i operators so that the total resource usage of the selected algorithm is j, the minimum value of the total performance cost of the selected algorithm is recorded as the state dp in the state transfer matrix. i,j ; wherein i is an integer not less than 0, and j is a discrete value not less than 0. In other embodiments, the first dimension and the second dimension may be interchangeable.

[0095] In one embodiment, the state transition process is performed according to the following formula:

[0096]

[0097] Among them, resource i,k represents the resource usage of selecting the kth algorithm from the i-th operator, cost i,k represents the performance cost of selecting the kth algorithm from the i-th operator, j-resource i,k The first resource occupancy intermediate amount is obtained by subtracting the resource occupancy of the kth algorithm selected from the i-th operator from the total resource occupancy j. Characterizes the intermediate amount j-resource occupied by the first resource i,k The historical state is determined from the various states of the combination of the previous i-1 operators, and min{} means taking the minimum value.

[0098] In the above embodiment, each algorithm is traversed from multiple operators according to different total resource occupancy, and state transfer processing is performed based on the state transfer matrix. The state transfer processing can be realized through simple operations, thereby calculating the state after the state transfer processing, and efficient state transfer processing can be realized, so that the preferred algorithm combination can be efficiently determined.

[0099] In one embodiment, the state transition process is performed according to the following formula:

[0100]

[0101] Among them, dp i-1,jIndicates the status of the jth total resource usage among the first i-1 operators, resource i,k represents the resource usage of selecting the kth algorithm from the i-th operator, cost i,k represents the performance cost of selecting the kth algorithm from the i-th operator, j-resource i,k The first resource occupancy intermediate amount is obtained by subtracting the resource occupancy of the kth algorithm selected from the i-th operator from the total resource occupancy j. Characterizes the intermediate amount j-resource occupied by the first resource i,k The historical state is determined from the various states of the combination of the previous i-1 operators, and min{} means taking the minimum value.

[0102] Furthermore, after state transfer processing, the algorithm selection matrix records the algorithms selected from each operator to achieve the minimum total performance cost according to different operator combinations and preset total resource occupancy, thereby determining the algorithm combination that minimizes the total performance cost composed of the algorithms selected from each operator based on the contents recorded in the state transfer matrix and the algorithm selection matrix.

[0103] In this embodiment, the determined algorithm combination may lack an algorithm under one or some operators. In this case, the operator of the missing algorithm can be determined, so that an algorithm is randomly selected or selected according to a preset logic under the operator to be added to the algorithm combination. The preset logic can be to select the algorithm with the lowest performance cost or the least resource usage under the operator.

[0104] In this embodiment, the state transfer processing is implemented through simple calculations, so that the state after the state transfer processing is calculated, and efficient state transfer processing can be implemented, so that the preferred algorithm combination can be efficiently determined.

[0105] In one embodiment, the state transfer matrix is ​​obtained by traversing different operator combinations, and when traversing to a new operator combination, the order of the newly added operators is the largest in the new operator combination, and the algorithm selection matrix is ​​recorded in the order of the newly added operators when traversing the operator combination. Step 210 includes: starting from the operator with the largest order and performing a reverse traversal; when the reverse traversal reaches the largest order, determining the algorithm with the minimum state corresponding to the largest order in the state transfer matrix from the algorithm selection matrix as the algorithm in the algorithm combination; when the reverse traversal reaches an order less than the largest order, subtracting the resource occupancy of the algorithm determined in the previous reverse traversal from the total resource occupancy corresponding to the algorithm in the algorithm selection matrix determined in the previous reverse traversal to obtain the second resource occupancy intermediate amount; matching the total resource occupancy according to the second resource occupancy intermediate amount to determine the algorithm of this reverse traversal from the operators in the order of this reverse traversal of the algorithm selection matrix as the algorithm in the algorithm combination.

[0106] Specifically, the computer device may traverse the operator combination consisting of the first i operators among the multiple operators, where i is a positive integer. Each time a newly traversed operator combination is added with one operator in the previously traversed operator combination, the order of the newly added operator is increased by 1 based on the maximum order of the operators in the previously traversed operator combination. When the computer device records the algorithms selected from the operators in the algorithm selection matrix, it is also recorded in ascending order according to the order of the operators.

[0107] If there are two operators in total, the computer device traverses to the operator combination composed of the first operator, which has one operator and its order is 1. The algorithm selected from the operator with order 1 is first recorded in the algorithm selection matrix. The computer device traverses to the operator combination composed of the first two operators, which has two operators and their orders are 1 and 2 respectively. The algorithm selected from the operator with order 2 is recorded after the operator with order 1 in the algorithm selection matrix.

[0108] The computer device may start from the maximum order of the operator (expressed as imax) and perform a reverse traversal of the order i of the operator until the reverse traversal reaches the minimum order (expressed as imin). For example, when the maximum order of the operator is 2, the reverse traversal is performed in order of i=2, i=1.

[0109] Furthermore, when traversing i in reverse order to the maximum order imax, take the minimum value dp from each state whose first dimension is imax in the state transfer matrix imax,jimax , so as to determine the minimum value dp according to the algorithm selection matrix imax,jimax Corresponding algorithm selection imax,jimax , and use this algorithm as one of the algorithms in the algorithm combination. Where jimax is the total resource usage represented by the minimum value in each state of imax.

[0110] Furthermore, when the reverse traversal order i reaches an order smaller than imax, the total resource occupancy of the algorithm determined in the previous reverse traversal in the algorithm selection matrix is ​​represented as j i+1 , the resource usage of the algorithm determined in the previous reverse traversal is resource i+1 , then the intermediate amount of the second resource occupation is calculated as j i+1 -resource i+1 .

[0111] Further, from the algorithm selection matrix, according to the second resource occupancy intermediate amount j i+1 -resource i+1Determine the total resource occupancy that matches the second resource occupancy intermediate amount, and then determine the algorithm corresponding to the record of the matching total resource occupancy in the operator of this reverse traversal, and use it as the algorithm in the algorithm combination. When i=0, end the loop; when i>0, continue to execute this step.

[0112] In this embodiment, the algorithm selection matrix is ​​used for reverse search, and the preferred algorithm combination can be determined through simple calculations, which further improves the efficiency of algorithm combination tuning.

[0113] In one embodiment, the first dimension i of the algorithm selection matrix represents the i-th operator of the operator sequence; the second dimension j of the algorithm selection matrix represents the total resource usage of each algorithm selected from each of the first i operators; the content selected recorded by the algorithm selection matrix i,j Representation of the state dp recorded in the state transfer matrix i,j The selected algorithm; where i is an integer not less than 0 and j is a discrete value not less than 0.

[0114] In one embodiment, in the initial state transfer matrix, except for the state of the operator combination of the first 0 operators when the total resource occupancy is 0, the initial value of the state in other cases is infinite; the content recorded in the initial algorithm selection matrix is ​​empty. In this embodiment, the state of the operator combination of the first 0 operators when the total resource occupancy is 0 is 0, and the initial state dp 0,0 It conforms to basic logic. In other cases, the initial value of the state is infinite. After the state is updated in the state transfer matrix, the updated state is less than infinity, so that the updated state can be selected when selecting the state, avoiding the influence of other invalid states. The content recorded in the initial algorithm selection matrix is ​​empty, which makes it easy to use the algorithm selection matrix to determine the selected algorithm.

[0115] In one embodiment, the algorithm combination tuning processing method provided by the present application can be specifically applied in the field of autonomous driving, and the artificial intelligence model can be a deep residual network (ResNet) model, which is used to identify the category of the image monitored by the vehicle sensor during the autonomous driving process. For example, when the autonomous driving vehicle drives to the intersection, the vehicle sensor collects the traffic light image, calls the Resnet model, and uses the model for reasoning through the inference engine to realize the recognition of the color of the traffic light in the traffic light image.

[0116] The Resnet model includes multiple layers of convolution operators, and each layer of convolution operators includes multiple convolution algorithms. The minimum and maximum values ​​of the order i of each convolution operator combination are 0 and operators, respectively. 0 represents the lower bound of the order of the convolution operator combination, and operators represents the upper bound of the order of the convolution operator combination. The minimum and maximum values ​​of the total resource usage j are 0 and resource, respectively. limit , 0 represents the lower bound of the total resource usage j, resource limit Represents the upper bound of the total resource usage j, including:

[0117] In the initial state transfer matrix, in addition to dp 0,0 =0, set dp in other cases i,j = inf (infinity), algorithm selection matrix select i,j Initialize to empty

[0118] Construct state transfer processing equations, operators and total resource usage resource limit is the independent variable of the equation. The minimum performance cost during the initialization state transfer process optimal is infinite, achieving the minimum performance cost optimal The total resource usage of the selected algorithm is the initial value resource optimal Set to 0.

[0119] Through multi-layer loop statements, first traverse the order i of each convolution operator combination among multiple convolution operators, traverse the preset total resource occupancy j under the order i of the convolution operator combination, and traverse each convolution algorithm algorithm in the order i of the traversed convolution operator combination under the traversed total resource occupancy j i . Get the resource usage resource of each convolution algorithm and the performance cost cost of each convolution algorithm. Among them, the resource usage resource of the convolution algorithm can be obtained by calling the function calculation in the CUDA Deep Neural Ntework library (cuDNN) of the Compute Unified Device Architecture (CUDA). The performance cost cost of the convolution algorithm can be directly measured by the timing function.

[0120] When the judgment conditions resource ≤ j and dp are met i,j >dp i–1,j-resource +cost, then through dp i,j =dp i–1,j-resource +cost vs dpi,j Perform assignment update through select i,j =algorithm i Select i,j Perform assignment update, algorithm i Represents the convolution algorithm when the order of the convolution operator combination is i. When the condition i = operators and cost is satisfied optimal >dp i,j When optimal =dp i,j Cost optimal Perform assignment update through select i,j =algorithm i Select i,j Perform assignment updates and return to the beginning of the loop until all algorithms are traversed i , get the return value resource optimal .

[0121] In the process of determining the convolution algorithm combination, the convolution algorithm combination plan is initialized as Initialize i = operators and j = resource before traversal optimal , through the loop instruction according to algorithm = select i,j Assign and update algorithm, where algorithm represents the convolution algorithm in the determined convolution algorithm combination. Assign and update plan through plan=plan∪algorithm. After each loop traversal, i=i-1, j=j-resource, and return to the loop start statement until all operators are traversed and the algorithm combination plan is output. In this embodiment, the operator combination tuning method is adopted to effectively accelerate the reasoning process of the Resnet model, improve the efficiency of image recognition during autonomous driving, and improve safety during driving. The following is a specific example to illustrate the process of the above algorithm combination tuning processing method.

[0122] 1. Get the algorithm information of multiple algorithms. Each algorithm information is a row in Table 1. Specifically, there are 2 operators, denoted as operator 1 and operator 2. Each operator has two algorithms. The algorithms under operator 1 are g0 and g1, and the algorithms under operator 2 are g2 and g3. The resource usage of algorithms g0, g1, g2, and g3 are 3, 4, 1, and 2, respectively. The performance costs of algorithms g0, g1, g2, and g3 are 3, 2, 3, and 1, respectively.

[0123] 2. Construct the initial state transfer matrix, as shown in Table 2:

[0124] Table 2:

[0125] 0 1 2 3 4 5 0 0 inf inf inf inf inf 1 inf inf inf inf inf inf 2 inf inf inf inf inf inf

[0126] The state transfer matrix has columns representing the first i operators, i is 0, 1, 2. The state transfer matrix has rows representing different total resource usage j, j is 0, 1, 2, 3, 4, 5. 0,0 =0, other states dp i,j Initialized to infinity inf.

[0127] 3. Construct the initial algorithm selection matrix, as shown in Table 3:

[0128] Table 3:

[0129] 0 1 2 3 4 5 1 2

[0130] The list of the algorithm selection matrix represents operator i, i is selected from 1, 2. The rows of the algorithm selection matrix represent different total resource usage j, j is selected from 0, 1, 2, 3, 4, 5. The content recorded in the algorithm selection matrix is ​​initialized to empty.

[0131] 4. Using the state transfer equation State transfer processing is performed in the state transfer matrix. Algorithm selection is involved in the state transfer processing, and the algorithm selection matrix is ​​used to record the selected algorithm.

[0132] Specifically, refer to the state transition process demonstrated in Table 4:

[0133] Table 4:

[0134] 0 1 2 3 4 5 0 0 inf inf inf inf inf 1 inf inf inf 3 2 inf 2 inf inf inf inf 6 4

[0135] Among them, when traversing to i=1 and j=3, using the state transfer equation, dp 1,3 =min{dp 0,0 +3}=3. When traversing to i=1 and j=4, using the state transition equation, dp 1,4 =min{dp 0,0 +2}=2. When traversing to i=1 and j=0, 1, 2 or 5, using the state transfer equation, it can be known that the states are all infinite inf.

[0136] Furthermore, when traversing to i=2 and j=0, 1, 2 or 3, the state is infinite. When traversing to i=2 and j=4, using the state transition equation, dp 2,4 =min{dp 1,3 +3}=6. When traversing to i=2 and j=5, using the state transition equation, dp 2,5=min{dp 1,3 +1, dp 1,4 +3}=4.

[0137] Refer to Table 5 and record the algorithm selected in each operator:

[0138] Table 5:

[0139] 0 1 2 3 4 5 1 g0 g1 2 g2 g3

[0140] Among them, when dp 1,3 =3, the algorithm g0 is selected in operator 1, that is, select 1,3 =g0. When dp 1,4 =2, the algorithm g1 is selected in operator 1, that is, select 1,4 =g1. When dp 2,4 =6, correspondingly select algorithm g2 in operator 2, that is, select 2,4 =g2. When dp 2,5 =4, correspondingly select algorithm g3 in operator 2, that is, select 2,5 =g3.

[0141] 5. Based on the state transfer matrix and algorithm selection matrix, start from the last row of the state transfer matrix and find the minimum state dp 2,5 =4, corresponding to the algorithm select in the algorithm selection matrix 2,5 =g3, add g3 to the algorithm combination. Then use select 2,5 The column coordinate 5 minus the resource usage of g3 2, we get select 1,3 =g0, add g0 to the algorithm combination to obtain the algorithm combination {g0, g3}.

[0142] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0143] Based on the same inventive concept, the embodiment of the present application also provides an algorithm combination tuning processing device for implementing the algorithm combination tuning processing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the one or more algorithm combination tuning processing device embodiments provided below can refer to the limitations of the algorithm combination tuning processing method above, and will not be repeated here.

[0144] In one embodiment, Figure 4 As shown, an algorithm combination tuning processing device is provided, including: an algorithm information acquisition module 402, a matrix acquisition module 404, a state transfer processing module 406, a state recording module 408, an algorithm selection recording module 410 and an algorithm combination determination module 412, wherein:

[0145] The algorithm information acquisition module 402 is used to acquire multiple algorithms and operators to which each algorithm belongs, and each operator includes multiple algorithms.

[0146] The matrix acquisition module 404 is used to acquire an initial state transfer matrix and an initial algorithm selection matrix.

[0147] The state transfer processing module 406 is used to perform state transfer processing in the state transfer matrix based on the operators, resource usage and performance cost of each algorithm.

[0148] The state recording module 408 is used to record the state after the state transfer process; the recorded state represents the minimum sum of performance costs corresponding to the algorithms selected from each operator according to different operator combinations and preset total resource occupancy;

[0149] The algorithm selection recording module 410 is used to record in the algorithm selection matrix the algorithm that achieves the minimum total performance cost selected from each operator according to different operator combinations and preset total resource occupancy;

[0150] The algorithm combination determination module 412 is used to determine the algorithm combination that minimizes the total performance cost, which is composed of the algorithms selected from each operator, based on the contents recorded in the state transfer matrix and the algorithm selection matrix.

[0151] In one embodiment, Figure 5 As shown, the state transfer processing module 406 includes:

[0152] The algorithm traversal module 502 is used to traverse each algorithm from multiple operators according to different total resource occupancy amounts.

[0153] The algorithm information acquisition module 504 is used to obtain the resource usage of the traversed algorithm and the performance cost of the traversed algorithm.

[0154] The historical state determination module 506 is used to obtain a first intermediate resource occupancy amount by subtracting the resource occupancy amount of the traversed algorithm from the total resource occupancy amount of the traversal, and determine the historical state from each state of the operator combination of the previous traversal in the state transfer matrix according to the first intermediate resource occupancy amount.

[0155] The candidate state determination module 508 is used to determine the candidate states of the traversed operators and the total resource usage of the traversal based on the performance cost and historical state of the traversal algorithm.

[0156] The state determination module 510 is used to determine the minimum value among the candidate states in the state transfer matrix as the state under the traversed operator and the traversed total resource occupancy.

[0157] In one embodiment, the algorithm traversal module 502 is further used to first traverse each operator of the multiple operators, then traverse a preset total resource occupancy under the operator, and then traverse each algorithm in the traversed operator under the traversed total resource occupancy.

[0158] In one embodiment, the first dimension i of the state transfer matrix represents the operator combination of the first i operators among the multiple operators; the second dimension j of the state transfer matrix represents the total resource usage of each algorithm selected from the first i operators; when each algorithm is selected from the first i operators so that the total resource usage of the selected algorithm is j, the minimum value of the total performance cost of the selected algorithm is recorded as the state dp in the state transfer matrix. i,j ; Where i is an integer not less than 0, and j is a discrete value not less than 0.

[0159] The state transition processing module 406 is further configured to perform state transition processing according to the following formula:

[0160]

[0161] Among them, resource i,k represents the resource usage of selecting the kth algorithm from the i-th operator, cost i,k represents the performance cost of selecting the kth algorithm from the i-th operator, j-resource i,k The first resource occupancy intermediate amount is obtained by subtracting the resource occupancy of the kth algorithm selected from the i-th operator from the total resource occupancy j. Characterizes the intermediate amount j-resource occupied by the first resource i,k The historical state is determined from the various states of the combination of the previous i-1 operators, and min{} means taking the minimum value.

[0162] In one embodiment, the state transfer matrix is ​​obtained by traversing different operator combinations, and when traversing to a new operator combination, the order of the newly added operators is the largest in the new operator combination, and the algorithm selection matrix is ​​recorded in the order of the newly added operators when traversing the operator combination. The algorithm combination determination module 412 is also used to start the reverse traversal from the operator with the largest order; when the reverse traversal reaches the largest order, the algorithm with the minimum state corresponding to the largest order in the state transfer matrix is ​​determined from the algorithm selection matrix as the algorithm in the algorithm combination; when the reverse traversal reaches an order less than the largest order, the total resource occupancy corresponding to the algorithm determined in the previous reverse traversal in the algorithm selection matrix is ​​subtracted from the resource occupancy of the algorithm determined in the previous reverse traversal to obtain the second resource occupancy intermediate amount; the total resource occupancy is matched according to the second resource occupancy intermediate amount to determine the algorithm of this reverse traversal from the operators in the order of this reverse traversal of the algorithm selection matrix as the algorithm in the algorithm combination.

[0163] In one embodiment, the first dimension i of the algorithm selection matrix represents the i-th operator of the operator sequence; the second dimension j of the algorithm selection matrix represents the total resource usage of each algorithm selected from each of the first i operators; the content selected recorded by the algorithm selection matrix i,j Representation of the state dp recorded in the state transfer matrix i,j The selected algorithm; where i is an integer not less than 0 and j is a discrete value not less than 0.

[0164] In one embodiment, in the initial state transfer matrix, except for the operator combination of the first 0 operators whose state is 0 when the total resource occupancy is 0, the initial value of the state in other cases is infinite; the content recorded in the initial algorithm selection matrix is ​​empty.

[0165] Each module in the above algorithm combination tuning processing device can be implemented in whole or in part by software, hardware and their combination. Each module can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each module above.

[0166] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 6As shown. The computer device includes a processor, a memory, an input / output interface and a communication interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store the inference data of the artificial intelligence model. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless method can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, an algorithm combination tuning processing method is implemented.

[0167] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0168] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.

[0169] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0170] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0171] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0172] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0173] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. An algorithm combination tuning processing method is applied to identify the automatic driving process, calling the Resnet model, using the Resnet model to perform reasoning through an inference engine, and identifying the category of the image monitored by the vehicle sensor, characterized in that: The method comprises: Get multiple algorithms and the operators to which each algorithm belongs. Each operator includes multiple algorithms. Obtain the initial state transfer matrix and the initial algorithm selection matrix; Based on the operators, resource usage and performance cost of each algorithm, state transfer processing is performed in the state transfer matrix, and the state after the state transfer processing is recorded; the recorded state represents the minimum sum of performance costs corresponding to the algorithms selected from each operator according to different operator combinations and preset total resource usage; In the algorithm selection matrix, the algorithm selected from each operator according to different operator combinations and preset total resource occupancy to achieve the minimum total performance cost is recorded; Based on the contents recorded in the state transfer matrix and the algorithm selection matrix, an algorithm combination that minimizes the sum of performance costs is determined by the algorithms selected from each operator; the state transfer matrix is ​​obtained by traversing different operator combinations, and the order of the newly added operators when traversing to a new operator combination is the largest in the new operator combination, and the algorithm selection matrix is ​​recorded in the order of the newly added operators when traversing the operator combination; the determining the algorithm combination that minimizes the sum of performance costs by the algorithms selected from each operator based on the contents recorded in the state transfer matrix and the algorithm selection matrix, includes: Start with the operator with the largest order and traverse in reverse order; When the maximum order is reached by traversing in reverse order, an algorithm with a minimum state corresponding to the maximum order in the state transfer matrix is ​​determined from the algorithm selection matrix as the algorithm in the algorithm combination; When the reverse-order traversal reaches an order less than the maximum order, the total resource occupancy corresponding to the algorithm determined in the previous reverse-order traversal in the algorithm selection matrix is ​​subtracted from the resource occupancy of the algorithm determined in the previous reverse-order traversal to obtain a second intermediate amount of resource occupancy; according to the second intermediate amount of resource occupancy, the algorithm for this reverse-order traversal is determined from the operators of the order of this reverse-order traversal of the algorithm selection matrix as the algorithm in the algorithm combination.

2. The method according to claim 1, characterized in that Based on the operator, resource usage and performance cost of each algorithm, state transfer processing is performed in the state transfer matrix, and the state after the state transfer processing is recorded, including: traversing each algorithm from the plurality of operators according to different total resource occupancy; Get the resource usage of the traversal algorithm and the performance cost of the traversal algorithm; Subtract the resource occupation amount of the traversed algorithm from the total resource occupation amount of the traversal to obtain a first resource occupation intermediate amount; According to the first resource occupancy intermediate amount, determine the historical state from each state of the operator combination traversed last time in the state transfer matrix; Determine the traversed operator and the candidate state under the total resource occupancy of the traversal based on the performance cost of the traversal algorithm and the historical state; In the state transfer matrix, the minimum value among the candidate states is determined as the state under the traversed operator and the total resource occupancy of the traversal.

3. The method according to claim 2, characterized in that The step of traversing each algorithm from the plurality of operators according to different total resource occupancy amounts includes: First, each operator in the plurality of operators is traversed, then a preset total resource occupancy is traversed under the operator, and then each algorithm in the traversed operator is traversed under the traversed total resource occupancy.

4. The method according to claim 2 or 3, characterized in that: The first dimension i of the state transfer matrix represents the operator combination of the first i operators among the multiple operators; the second dimension j of the state transfer matrix represents the total resource occupancy of each algorithm taken from the first i operators; When one algorithm is selected from the first i operators, so that the total resource usage of the selected algorithm is j, the minimum sum of the performance costs of the selected algorithms is recorded as the state in the state transfer matrix ; Where i is an integer not less than 0, and j is a discrete value not less than 0; The state transfer process is performed according to the following formula: ; in, represents the resource usage of selecting the kth algorithm from the i-th operator, represents the performance cost of selecting the kth algorithm from the i-th operator, The first resource occupancy intermediate amount is obtained by subtracting the resource occupancy of the kth algorithm selected from the i-th operator from the total resource occupancy j. Characterizes the intermediate amount of first resource occupancy The historical state determined from the states of the previous i-1 operator combinations, Indicates taking the minimum value.

5. The method according to claim 1, characterized in that The first dimension i of the algorithm selection matrix represents the i-th operator of the operator sequence; the second dimension j of the algorithm selection matrix represents the total resource occupancy of one algorithm selected from each operator of the first i operators; The algorithm selects the contents of the matrix record Representation of the state recorded in the state transfer matrix The selected algorithm; where i is an integer not less than 0 and j is a discrete value not less than 0.

6. The method according to claim 1, characterized in that In the initial state transfer matrix, except for the operator combination of the first 0 operators whose state is 0 when the total resource occupancy is 0, the initial value of the state in other cases is infinite; the content recorded in the initial algorithm selection matrix is ​​empty.

7. An algorithm combination tuning processing device is used to identify the automatic driving process, call the Resnet model, use the Resnet model to perform reasoning through an inference engine, and identify the category of the image monitored by the vehicle sensor, characterized in that: The device comprises: The algorithm information acquisition module is used to obtain multiple algorithms and the operators to which each algorithm belongs, and each operator includes multiple algorithms; A matrix acquisition module is used to obtain an initial state transfer matrix and an initial algorithm selection matrix; A state transfer processing module, used for performing state transfer processing in the state transfer matrix based on the operators, resource usage and performance cost of each algorithm; A state recording module is used to record the state after the state transfer process; the recorded state represents the minimum sum of performance costs corresponding to the algorithm selected from each operator according to different operator combinations and preset total resource usage; An algorithm selection recording module, used for recording in the algorithm selection matrix the algorithm selected from each operator to achieve the minimum total performance cost according to different operator combinations and preset total resource occupancy; An algorithm combination determination module is used to determine an algorithm combination that minimizes the sum of performance costs, which is composed of algorithms selected from each operator, based on the contents recorded in the state transfer matrix and the algorithm selection matrix respectively; the state transfer matrix is ​​obtained by traversing different operator combinations, and the order of newly added operators when traversing to a new operator combination is the largest in the new operator combination, and the algorithm selection matrix is ​​recorded in the order of newly added operators when traversing the operator combination; The algorithm combination determination module is also used to perform reverse order traversal starting from the operator of the maximum order; when the reverse order traversal reaches the maximum order, the algorithm of the minimum state corresponding to the maximum order in the state transfer matrix is ​​determined from the algorithm selection matrix as the algorithm in the algorithm combination; when the reverse order traversal reaches an order less than the maximum order, the total resource occupancy corresponding to the algorithm determined in the previous reverse order traversal in the algorithm selection matrix is ​​subtracted from the resource occupancy of the algorithm determined in the previous reverse order traversal to obtain a second intermediate amount of resource occupancy; according to the second intermediate amount of resource occupancy, the algorithm for this reverse order traversal is determined from the operators in the order of this reverse order traversal of the algorithm selection matrix as the algorithm in the algorithm combination.

8. The device according to claim 7, characterized in that The state transfer processing module also includes: An algorithm traversal module, used to traverse each algorithm from the plurality of operators according to different total resource occupancy; An algorithm information acquisition module is used to obtain the resource usage and performance cost of the traversed algorithm; A historical state determination module, configured to obtain a first intermediate resource occupation amount by subtracting the resource occupation amount of the traversed algorithm from the total resource occupation amount of the traversal; and determine the historical state from each state of the operator combination of the previous traversal in the state transfer matrix according to the first intermediate resource occupation amount; A candidate state determination module, used to determine the candidate states of the traversed operators and the total resource occupancy of the traversal based on the performance cost of the traversal algorithm and the historical state; The state determination module is used to determine the minimum value among the candidate states in the state transfer matrix as the state under the traversed operator and the total resource occupancy of the traversal.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Fuel cell and super-capacitor system optimization method based on road condition recognition

    CN108363855A

  • Autonomous driving apparatus and method

    CN112046481A

  • Driving behavior visual perception device and method based on 9-axis sensor

    CN112698660A

  • Safe and balanced unloading method and system for auxiliary driving service

    CN113709249A

  • Identifying similarity matrix for derived perceptions

    US20220101188A1