A method, apparatus, device, and medium for operator mapping of heterogeneous systems
By modeling the operator mapping problem as a multi-objective optimization problem and using a non-dominated sorting genetic algorithm and a multinomial fitting method, the performance degradation caused by single-index optimization in traditional methods is solved. This achieves a balanced optimization of computation time, energy consumption, and load balancing in heterogeneous systems, thereby improving the overall system performance.
Patent Information
- Application Number
- CN202511156438.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-19
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2045-08-19
AI Technical Summary
Traditional operator mapping methods often focus only on a single performance metric, ignoring the multi-objective optimization requirements of the overall system performance. This can lead to the potential damage to other performance metrics while improving one metric, making it difficult to achieve global optimization.
The operator mapping problem is modeled as a multi-objective optimization problem. A non-dominated sorting genetic algorithm is used to generate the Pareto front solution set, and a multinomial fitting method is used to optimize the operator mapping scheme, taking into account multiple performance indicators such as computation time, energy consumption, and load balancing.
It achieves a precise balance and optimization of multiple performance indicators such as computation time, energy consumption, and load balancing under the constraints, and obtains a smooth and balanced operator mapping scheme, thereby improving the overall system performance.
Smart Images

Figure CN120654786B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of heterogeneous computing technology, and in particular to an operator mapping method, apparatus, device and medium for heterogeneous systems. Background Technology
[0002] With the ever-increasing demands for computing power, modern computing systems are increasingly reliant on heterogeneous architectures, including various processing units such as Central Processing Units (CPUs), Graphics Processing Units (GPUs), and Field-Programmable Gate Arrays (FPGAs). These processing units each possess different performance characteristics and computing capabilities, making them suitable for handling different types of tasks. Effectively allocating operators (i.e., computational tasks) within an application to these processing units to optimize overall system performance and resource utilization has become a crucial issue in computing system design. This process requires comprehensive consideration of multiple objectives, such as computational speed, energy consumption, and load balancing, rather than focusing solely on a single performance metric.
[0003] The operator mapping process described above involves the optimization of multiple performance metrics. Therefore, a key challenge is how to transform the operator mapping problem into a multi-objective optimization problem and solve it. This requires accurately modeling each objective and constraint in the optimization model and using appropriate optimization algorithms to find an effective balance point among multiple performance metrics to achieve optimal system performance.
[0004] However, traditional operator mapping methods often focus only on a single performance metric, such as computation speed or energy consumption, neglecting the multi-objective optimization requirements of the overall system performance. This can lead to the potential compromise of other performance metrics while improving one metric, making it difficult to achieve global optimization. Although some operator mapping methods attempt to introduce multi-objective optimization, their handling of multi-objective optimization is not flexible enough, failing to effectively balance and optimize multiple key performance metrics such as computation time, energy consumption, and load balancing. Summary of the Invention
[0005] The purpose of this invention is to provide an operator mapping method, apparatus, device, and medium for heterogeneous systems, which can transform the operator mapping problem into a multi-objective optimization problem, effectively balancing and optimizing multiple optimization objectives and their constraints, such as computation time, energy consumption, and load balancing.
[0006] To address the aforementioned technical problems, embodiments of the present invention provide an operator mapping method for heterogeneous systems, comprising the following steps:
[0007] The operator mapping problem is modeled as a multi-objective optimization problem: the objectives are to minimize the total execution time of multiple different operators, minimize the total execution energy consumption, and maximize the total load balance of the corresponding processing units, with the execution resource requirements of multiple different operators as constraints, and the operator mapping scheme formed by allocating multiple different operators to different processing units as decision variables.
[0008] A multi-objective optimization problem is solved based on a non-dominated sorting genetic algorithm, resulting in a Pareto front solution set consisting of multiple different operator mapping schemes;
[0009] Based on the objective functions constructed with the objectives of minimizing the total execution time, minimizing the total execution energy consumption, and maximizing the total load balance of the corresponding processing units for multiple different operators, the objective function values of each objective corresponding to each operator mapping scheme in the Pareto front solution set are obtained;
[0010] Using a polynomial fitting method, curve fitting is performed on each operator mapping scheme and the corresponding objective function value of each objective in the Pareto front solution set to obtain the Pareto polynomial for each objective.
[0011] Based on the objectives to be optimized in the pre-defined multi-objective optimization problem, the optimal operator mapping scheme is selected from the Pareto front solution set through the Pareto polynomial corresponding to the objective.
[0012] Optionally, the polynomial fitting method is used to perform curve fitting on each operator mapping scheme and the corresponding objective function value of each objective in the Pareto front solution set, to obtain the Pareto polynomial for each objective, including:
[0013] For each objective, a corresponding multinomial fitting model is defined as follows:
[0014] ;
[0015] In the formula, It is targeted The fitting polynomial, These are the coefficients to be determined. is the decision variable, and n is the number of operator mapping schemes in the Pareto front solution set;
[0016] Substitute the n operator mapping schemes in the Pareto front solution set into the polynomial fitting model of each objective to form a linear equation system consisting of n equations for each objective.
[0017] The coefficients to be determined in the polynomial fitting model are obtained by solving a system of linear equations to obtain the Pareto polynomial for each objective.
[0018] Optionally, the step of selecting the optimal operator mapping scheme from the Pareto front solution set based on the Pareto polynomial corresponding to the target in the preset multi-objective optimization problem includes:
[0019] For any objective to be optimized in a multi-objective optimization problem, use the corresponding Pareto polynomial to calculate the objective function value of each operator mapping scheme in the Pareto front solution set under that objective.
[0020] The operator mapping scheme that minimizes the objective function value is selected as the optimal operator mapping scheme for that objective.
[0021] Alternatively, based on any number of objectives to be optimized in a multi-objective optimization problem, use the corresponding multiple Pareto polynomials to calculate the objective function values of each operator mapping scheme in the Pareto front solution set under multiple objectives.
[0022] Based on the weights of multiple preset objectives, the objective function values of each operator mapping scheme under multiple objectives are weighted to obtain the comprehensive performance of each operator mapping scheme under multiple objectives.
[0023] The operator mapping scheme with the best overall performance is selected as the optimal operator mapping scheme for multiple objectives.
[0024] Optionally, before performing curve fitting on each operator mapping scheme and the corresponding objective function value of each objective in the Pareto front solution set, the method further includes:
[0025] Based on the objective function value of each operator mapping scheme in the Pareto front solution set under each objective, multiple operator mapping schemes in the Pareto front solution set are selected.
[0026] Optionally, the solution set of the Pareto front composed of multiple different operator mapping schemes obtained by solving the multi-objective optimization problem based on the non-dominated sorting genetic algorithm includes:
[0027] A set of operator mapping schemes is randomly generated based on a non-dominated sorting genetic algorithm.
[0028] Based on the computational complexity and execution resource requirements of each operator, as well as the hardware resources of the processing unit, the randomly generated operator mapping scheme is adjusted to obtain the initial population;
[0029] The Pareto front solution set, consisting of multiple different operator mapping schemes, is obtained by initializing the population.
[0030] Optionally, before modeling the operator mapping problem as a multi-objective optimization problem, the method further includes:
[0031] The execution resource requirements are mapped as output parameters to a preset vector, where each element of the preset vector represents an execution resource requirement.
[0032] The execution resource requirements in the preset vector are dynamically adjusted according to the preset operator requirements.
[0033] Optionally, the execution resource requirements include at least the following: computing resource requirements, storage resource requirements, and input / output bandwidth requirements.
[0034] Embodiments of the present invention also provide an operator mapping apparatus for heterogeneous systems, comprising:
[0035] The problem modeling module is used to model the operator mapping problem as the following multi-objective optimization problem: with the objectives of minimizing the total execution time of multiple different operators, minimizing the total execution energy consumption, and maximizing the total load balance of the corresponding processing units, with the execution resource requirements of multiple different operators as constraints, and the operator mapping scheme formed by allocating multiple different operators to different processing units as decision variables;
[0036] The problem-solving module is used to solve multi-objective optimization problems based on the non-dominated sorting genetic algorithm, and obtain the Pareto front solution set composed of multiple different operator mapping schemes;
[0037] The solution optimization module is used to obtain the objective function value of each objective corresponding to each operator mapping scheme in the Pareto front solution set, based on the objective functions constructed with the objectives of minimizing the total execution time of multiple different operators, minimizing the total execution energy consumption, and maximizing the total load balance of the corresponding processing units.
[0038] Using a polynomial fitting method, curve fitting is performed on each operator mapping scheme and the corresponding objective function value of each objective in the Pareto front solution set to obtain the Pareto polynomial for each objective.
[0039] Based on the objectives to be optimized in the pre-defined multi-objective optimization problem, the optimal operator mapping scheme is selected from the Pareto front solution set through the Pareto polynomial corresponding to the objective.
[0040] Embodiments of the present invention also provide a computer device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to execute the above-described operator mapping method for heterogeneous systems.
[0041] Embodiments of the present invention also provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described operator mapping method for heterogeneous systems.
[0042] The operator mapping method for heterogeneous systems provided by this invention has at least the following beneficial effects:
[0043] By transforming the operator mapping problem into a multi-objective optimization problem, we accurately model multiple optimization objectives and their constraints, including operator execution time, execution energy consumption, and processing unit load balancing. This forms an optimization framework suitable for heterogeneous systems. Under the constraint conditions, the decision variables of the operator mapping scheme can be iteratively adjusted through the solution algorithm to minimize the objective functions of multiple objectives, ultimately obtaining the ideal Pareto front solution set. In solving the operator mapping scheme, a non-dominated sorting genetic algorithm is introduced to generate the Pareto front solution set, and further fitting is performed using Pareto polynomials. This ensures the smoothness and balance of the final solution set, thereby achieving more accurate and diverse operator mapping schemes across different performance metrics. Attached Figure Description
[0044] One or more embodiments are illustrated by way of example with reference to the accompanying drawings, and these illustrative descriptions do not constitute a limitation on the embodiments.
[0045] Figure 1 This is a flowchart of an operator mapping method for heterogeneous systems according to an embodiment of the present invention;
[0046] Figure 2 This is a flowchart of a Pareto front solution calculation using a genetic algorithm, provided according to an embodiment of the present invention.
[0047] Figure 3 This is a flowchart illustrating fitting a Pareto front solution set using Pareto polynomials, according to an embodiment of the present invention. Detailed Implementation
[0048] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the various embodiments of the present invention will be described in detail below with reference to the accompanying drawings. However, those skilled in the art will understand that many technical details are presented in the embodiments of the present invention to facilitate a better understanding of the invention. However, the technical solutions claimed in the present invention can be implemented even without these technical details and various variations and modifications based on the following embodiments. The division of the following embodiments is for ease of description and should not constitute any limitation on the specific implementation of the present invention. The various embodiments can be combined with and referenced by each other without contradiction.
[0049] One embodiment of the present invention relates to an operator mapping method for heterogeneous systems. The specific flow of the operator mapping method for heterogeneous systems in this embodiment can be as follows: Figure 1 As shown, it includes:
[0050] Step 101: Model the operator mapping problem as the following multi-objective optimization problem: with the objectives of minimizing the total execution time of multiple different operators, minimizing the total execution energy consumption, and maximizing the total load balance of the corresponding processing units, with the execution resource requirements of multiple different operators as constraints, and the operator mapping scheme formed by allocating multiple different operators to different processing units as decision variables.
[0051] Step 102: Solve the multi-objective optimization problem based on the non-dominated sorting genetic algorithm to obtain the Pareto front solution set composed of multiple different operator mapping schemes.
[0052] Step 103: Based on the objective functions constructed with the objectives of minimizing the total execution time of multiple different operators, minimizing the total execution energy consumption, and maximizing the total load balance of the corresponding processing units, obtain the objective function value of each objective corresponding to each operator mapping scheme in the Pareto front solution set.
[0053] Step 104: Using the polynomial fitting method, curve fitting is performed on each operator mapping scheme and the corresponding objective function value of each objective in the Pareto front solution set to obtain the Pareto polynomial corresponding to each objective.
[0054] Step 105: Based on the objectives to be optimized in the preset multi-objective optimization problem, select the optimal operator mapping scheme from the Pareto front solution set through the Pareto polynomial corresponding to the objective.
[0055] In this embodiment, the operator mapping problem is transformed into a multi-objective optimization problem. Multiple optimization objectives and their constraints, including operator execution time, execution energy consumption, and processing unit load balancing, are accurately modeled, forming an optimization framework suitable for heterogeneous systems. This allows for iterative adjustment of the operator mapping scheme decision variables through a solution algorithm, minimizing the objective functions of multiple objectives while satisfying the constraints, ultimately yielding the ideal Pareto front solution set. When solving the operator mapping scheme, a non-dominated sorting genetic algorithm is introduced to generate the Pareto front solution set, which is further fitted using Pareto polynomials. This ensures the smoothness and balance of the final solution set, thereby achieving more accurate and diverse operator mapping schemes across different performance metrics.
[0056] The implementation details of the operator mapping method for heterogeneous systems in this embodiment are described below. The following content is only for the convenience of understanding and is not necessary for implementing this solution.
[0057] In step 101, firstly, a constraint model based on resource constraints and task-specific constraints is established to generate constraints under resource limitations and specific computing task configurations. Then, an objective function model based on resource constraints and task-specific constraints is established to output the objective function value under specific task configurations through different heterogeneous system operator mapping schemes. Next, based on the objective function model and constraint model, a multi-objective operator mapping mathematical model (i.e., a model of a multi-objective optimization problem) is established to comprehensively optimize decision variables affecting the overall system performance under specific task configurations and resource constraints, thereby realizing the modeling of the operator mapping problem as a multi-objective optimization problem.
[0058] Regarding constraint condition models:
[0059] First, the information related to each operator that needs to be mapped to a heterogeneous computing system is encapsulated into an operator tuple. This tuple describes the execution requirements and resource consumption characteristics of the operator on different computing units. The operator tuple is defined as follows:
[0060] ;
[0061] In the formula, A number used to identify each operator; Used to identify the set of heterogeneous computing units that can be mapped; Used to represent the computational resources required when an operator is executed; Used to indicate the storage resource requirements during execution, including the required memory size and cache size; This indicates the input and output bandwidth requirements when the operator is executed.
[0062] Resource requirements for each task are extracted from each operator tuple, and these requirements are mapped to specific resource types in the system, identifying the specific constraints for each resource type. This information is then used as input parameters and mapped to corresponding positions in a vector. Constraints are represented in vector form, with each element representing a specific system constraint. The constraints in the vector can be dynamically adjusted based on specific task requirements, including adding or removing specific constraints, as shown in the following formula:
[0063] ;
[0064] The specific descriptions of each element are as follows:
[0065] Mappable computational units:
[0066] ;
[0067] In the formula, This set represents different types of computational units, and it represents the computational units that the current operator can map to.
[0068] Computing resource requirements:
[0069] ;
[0070] In the formula, Indicates the calculation period. Indicates the calculation time.
[0071] Storage requirements:
[0072] ;
[0073] In the formula, Indicates memory usage. Indicates the cache size.
[0074] IO bandwidth requirements:
[0075] ;
[0076] In the formula, Indicates input bandwidth. This indicates the output bandwidth.
[0077] When performing constraint checks, first target A check is performed to ensure that the task requirements of each operator are guaranteed and the computational units mapped to by the operators are guaranteed. Secondly, the constraints of all operators are summed to obtain a global constraint vector. This is compared with the overall available resources. If the condition is not met, it means that the current operator mapping scheme is not feasible, and the operator mapping or optimization scheme needs to be adjusted.
[0078] ;
[0079] Regarding the objective function model:
[0080] In order to model the operator mapping problem as a multi-objective optimization problem, this embodiment first defines three main optimization objective functions.
[0081] One is to minimize the total execution time. Its formula can be expressed as:
[0082] ;
[0083] In the formula, Operator In the processing unit The computation time on the surface Operator Communication latency for data transmission between different processing units. The optimization objective is to select an appropriate operator allocation method to minimize the total execution time of all operators.
[0084] The second optimization objective is to minimize the system's total energy consumption. Its formula can be modeled as:
[0085] ;
[0086] In the formula, It is a processing unit Execution operator Energy consumption, combined with processing time The present invention aims to reduce the energy consumption of the entire system by optimizing the allocation of operators.
[0087] The third objective is to maximize load balancing across processing units, that is, to distribute the workload of each processing unit as evenly as possible. Load balancing This can be achieved by calculating the percentage of time each processing unit takes and minimizing the difference, defined by the following formula:
[0088] ;
[0089] In the formula, Indication processing unit The total execution time. By minimizing the time difference between different processing units, it is possible to avoid some units being overloaded while others remain idle.
[0090] Furthermore, for certain insensitive objective functions, a threshold can be set. If the threshold condition is met, the objective function will no longer be considered for further optimization. For example, if the current optimization objective is insensitive to energy consumption, a higher threshold can be set, allowing the system to find an acceptable solution even with slightly higher energy consumption.
[0091] ;
[0092] Regarding the mathematical model of multi-objective operator mapping:
[0093] In this model, decision variables are variables that can be optimized and adjusted to determine how operators are mapped to different processing units. In the operator mapping problem, decision variables mainly refer to the mapping relationship between operators and processing units.
[0094] Specifically, the set decision variables Operator Is it assigned to a processing unit? Above, defined as follows:
[0095] ;
[0096] In the formula, It is an operator index. This is the processor index. Each operator can only be assigned to one processing unit, therefore the following constraints must be satisfied:
[0097] ;
[0098] This means that each operator can only be assigned to a specific processing unit, rather than being assigned to multiple units simultaneously. Decision variables These are the mapping matrices from operators to processing units, which, together with the objective function and constraints, constitute the core structure of the entire multi-objective optimization problem.
[0099] By integrating the above objective function, constraints, and decision variables, a multi-objective optimization model of operator mapping is constructed. Formally, it can be expressed as:
[0100] ;
[0101] In the formula, This represents minimizing the total execution time. Represents minimizing energy consumption. This represents minimizing load imbalance; each objective is a function value calculated based on a mapping scheme.
[0102] In step 102, as Figure 2 As shown, the specific steps include:
[0103] Step 1: Initialize the population;
[0104] Step 2: Classify the initial population using non-dominated sorting;
[0105] Step 3: The parent population with N individuals generates a child population of the same number through selection, crossover, and mutation.
[0106] Step 4: Merge the parent population with the offspring population, and re-sort the merged 2N population using non-dominated sorting and calculate the crowding degree.
[0107] Step 5: Regenerate a next-generation population of size N based on the non-dominated ranking and crowding calculation results;
[0108] Step 6: Repeat steps 3-5 until the maximum algebra is reached, thus obtaining the approximate Pareto front solution set.
[0109] Step 1 further includes:
[0110] (1) Randomly generate a set of mapping schemes from operators to processing units.
[0111] In the process of initializing the population, it is first necessary to define the problem size and decision variables, including the total number of operators that need to be mapped. and the total number of available processing units Each decision variable It is a binary variable, where Indicates the first The operator is assigned to the first... One processing unit. This indicates that no allocation has been made.
[0112] Next, the number of individuals in the population is set. Each individual represents a mapping scheme from an operator to a processing unit. To generate the mapping scheme, each operator is first traversed. And randomly select a processing unit for each operator. The assignment is then performed. Random selection can be achieved by generating a random number between 0 and 1 and mapping it to the index of the processing unit. For example, this process can be implemented using a uniformly distributed random number generator. The generated random number determines which processing unit each operator should be assigned to.
[0113] For each selected processing unit, update the decision variable matrix and set... Indicates the first The operator was assigned to the first... There are several processing units, ensuring that each operator can only be assigned to one processing unit. The mapping results of all operators' processing units are combined to form a mapping scheme, thus forming an initial population. Each individual can be represented as a vector or a matrix; for example, a vector form is... ,in Indicates the first Each operator is assigned a processing unit. Through the above process, the population is generated one by one. This ensures that the mapping scheme for each individual has a certain degree of diversity, thereby providing a rich set of initial solutions for the subsequent optimization process.
[0114] (2) Improve the initial population based on heuristics. Utilize known task characteristics or hardware resource conditions to update the initial mapping scheme using heuristics, thereby improving the quality of the initial population.
[0115] First, source information on task characteristics and hardware operators is collected. Task characteristics include the computational complexity, memory requirements, and data transfer volume of each operator. For example, convolution operators typically have high computational complexity and large data transfer volumes, while activation operators have lower computational complexity. Hardware resource information includes the computational power, load, and resource utilization of each processing unit. For example, a GPU's computational power may be far greater than a CPU's, but its current load may be high. Next, priorities are set based on task characteristics. Different priorities are assigned to each operator according to its computational complexity and resource requirements. Operators with high computational requirements (such as convolution) are prioritized for allocation to processing units with strong computational power. Operators with low computational requirements (such as activation) can be allocated to processing units with weaker computational power. This allocation strategy helps improve overall computational efficiency. Then, heuristic mapping schemes are generated. By utilizing the set priority information, high-priority operators are allocated to processing units with sufficient resources. Finally, an initial population is generated and adjusted. These schemes will serve as the initial population for a genetic algorithm, which will further optimize these schemes.
[0116] Step 2 further includes:
[0117] The process of non-dominated ranking involves stratifying the individuals in the population to determine which individuals are not dominated by other individuals, thus forming a Pareto front. First, for each individual in the current population, two key variables need to be initialized. Each individual... Domination set Used to store the other individuals it dominates, and the number of those dominated. Used to record How many other individuals dominate the entity? Initially, the domination set for all individuals is empty, and the number of dominated individuals is set to zero.
[0118] Next, we begin calculating the dominance relationships among all individuals in the population. For each pair of individuals... and They are compared based on the objective function values of the multi-objective optimization problem. If individual No more than individuals in all goals Poor, but better than at least one objective. Then it is believed Dominate In this situation, the individual Will be added to The dominance of the concentration, while the individual Number of people dominated Add 1. Similarly, if Dominate ,but Number of people dominated Add 1. Through this process, the dominance and subordination of each individual can be determined.
[0119] Once the dominance relationships are calculated, the first Pareto front (i.e., individuals with a non-dominated rank of 1) is determined. These individuals are not dominated by any other individuals, therefore their dominated rank is 0. These non-dominated individuals are selected and assigned to the first-level front. And assign them a non-dominant level of 1. Next, for each belonging to the first layer frontier... individual Find all the individuals it dominates. For each dominated individual, decrement its dominance count by 1. If the dominance count reaches 0, it means that the individual is no longer dominated by other individuals, and it will be moved to the second-level Pareto front. It also assigns a non-dominant rank of 0.9.
[0120] This process continues recursively. For each Pareto front, individuals are searched for their dominant counterparts, and the number of dominated individuals is updated. Each time an individual's dominant count decreases to 0, it is added to the next Pareto front. This process continues layer by layer until all individuals are assigned to a front at some level. Through this non-dominated ranking process, all individuals in the population are divided into multiple levels, each representing a non-dominated front. Individuals at the Pareto front are not dominated by other individuals on any objective; the higher the level of the front, the stronger the individual's dominance.
[0121] Step 3 further includes:
[0122] During the selection phase, a ranking-based selection mechanism, such as tournament selection or roulette wheel selection, is employed. Specifically, all individuals are first ranked according to their non-dominant rank, with higher-ranked (superior) individuals having higher fitness. Then, the selection operation randomly selects individuals from the parent population based on their fitness values as candidate parents for the next generation. This selection method ensures that individuals with better performance are more likely to be selected, thus preserving superior genes.
[0123] In the crossover phase, individuals selected in the selection operation undergo crossover with a certain probability (usually set to a crossover probability of 0.8) to generate new individuals. The crossover operation combines portions of genes from two parents to form two new offspring individuals. Specifically, the mapping schemes of the two individuals are cut at random positions, and then the gene segments on either side of the cut point are exchanged to generate new mapping schemes. Through this crossover method, the desirable traits of different parents can be passed on and combined in offspring, forming new individuals and enriching the solution space.
[0124] After crossover, the new individuals undergo mutation with a certain probability (usually a small probability, such as 0.01). The purpose of mutation is to increase population diversity and prevent the algorithm from getting trapped in local optima. Mutation is implemented by randomly selecting one or more gene positions (i.e., the mapping positions of a certain operator) in the new individual and randomly changing their values to other possible processing units. This mutation operation breaks the current mapping pattern, introduces new solutions, and enhances population diversity.
[0125] Step 4 further includes:
[0126] The parent population of size N is merged with the offspring population of size N to generate a new population of size 2N. The new population is first subjected to the non-dominated sorting shown in step 2 to obtain hierarchical information. Then, the crowding degree is calculated for each individual in the new population. The crowding degree calculation process specifically includes:
[0127] (1) For each individual in the non-dominated level, sort these individuals in ascending order according to the objective function value for each optimization objective (e.g., computation time, energy consumption, and load balancing). For each individual, record its ranking position for different objective function values.
[0128] (2) For the boundary individuals (i.e. the minimum and maximum values) in the objective function sorting, directly assign an infinite crowding distance (e.g., set to a very large constant) to ensure that the boundary individuals are not easily eliminated, because they represent extreme solutions in the solution space.
[0129] (3) For non-boundary individuals, the calculation of crowding needs to consider the difference in objective function values between them and their neighboring individuals. Specifically, for a given individual... Calculate the distance difference between its neighbors on each objective function. The formula is:
[0130] ;
[0131] in, It is the first Individuals in the goal Crowded distances. and They represent the first Individuals in the goal The target value of the adjacent individuals before and after. and These represent the current population's position in the target area. The maximum and minimum values are calculated. The crowding distance is normalized in this way to ensure that the contributions of each objective are comparable.
[0132] (4) The total crowding degree of each individual is the sum of its crowding distances across all objective functions:
[0133] ;
[0134] This calculation The larger the value, the sparser the individual is in the target space, and the less crowded the solution space.
[0135] Step 5 further includes:
[0136] (1) Prioritize individuals with higher ranking based on non-dominant ranking.
[0137] Based on the non-dominant ranking of the merged parent and offspring populations, individuals are selected sequentially starting from the first non-dominant ranking. Individuals within each non-dominant ranking are non-dominant, therefore individuals from higher rankings are prioritized for retention. Starting from non-dominant ranking 1, individuals are selected and added to the next generation population one by one. If the number of individuals in the current non-dominant ranking is insufficient... If the number of individuals added to the current non-dominant level has exceeded the limit of NNN, then proceed to the next step and select the remaining individuals based on crowding.
[0138] (2) When the non-dominant ranking is the same, select individuals with higher diversity based on the crowding degree calculation results.
[0139] When the number of individuals within a certain non-dominant hierarchy causes the total population to exceed [a certain threshold]... Individuals are sorted according to their crowding level. Higher crowding levels indicate greater sparsity in the solution space, meaning these individuals can maintain better solution diversity in multi-objective optimization problems. The specific steps are as follows: Sort individuals in the current non-dominated level according to their crowding level from highest to lowest. Then, select individuals with higher crowding levels from the sorted results until the next generation population is filled. Individual.
[0140] Step 6 further includes:
[0141] During the iterative process of the genetic algorithm, the first step is to check whether the current generation has reached the preset maximum number of generations. If the maximum number of generations has been reached, the algorithm terminates and outputs the final Pareto front solution set as the optimization result. If the maximum number of generations has not been reached, the next round of iterations continues, including selection, crossover, and mutation operations to generate a new offspring population. The new offspring population is merged into the current population, and the non-dominated sorting and crowding calculation are re-performed. Subsequently, the next generation population is re-selected based on the non-dominated sorting level and crowding. This process is repeated until the maximum number of generations is reached.
[0142] In steps 103 to 105, the Pareto front solution set is fitted and optimized using a Pareto multinomial-based fitting method to generate a set of smooth and balanced operator mapping solutions.
[0143] like Figure 3 As shown, the processing steps include the following:
[0144] Step 1: Sort and filter the Pareto front solution set, retaining the high-quality solutions in the non-dominated solution set;
[0145] Step 2: Apply the polynomial fitting method to perform curve fitting on the selected Pareto front solution set to generate a smooth Pareto front for prediction and optimization.
[0146] Step 3: Optimize the solution set based on the fitted curve. By analyzing the fitted curve, extract a set of optimal mapping schemes that are balanced among the objectives.
[0147] Specifically, step 1 further includes:
[0148] First, all solution sets are divided into non-dominated ranks. The solution sets generated by the genetic algorithm are compared according to the objective function, and individuals in each solution set are sorted by non-dominated rank. Specifically, for each solution, its performance on all objectives (such as computation time, energy consumption, and load balancing) is compared. If a solution outperforms other solutions on all objectives, it is assigned to non-dominated rank 1. For other solutions, if they are better than or equal to other solutions on only some objectives, they are assigned to lower non-dominated ranks. This process is repeated until all solutions are assigned to their respective non-dominated ranks.
[0149] Next, the solutions within the non-dominated levels are further sorted. Within each non-dominated level, the system sorts these solutions one by one according to the objective value. Specifically, for each optimization objective (such as computation time, energy consumption, etc.), all solutions within that non-dominated level are sorted in ascending or descending order according to the value of that objective to further determine the ranking of the solutions on that objective. This process is repeated for each optimization objective to ensure that the relative position of each solution on each objective is clearly marked.
[0150] Then, for individuals with a non-dominance level of 1, we select those who perform well across multiple objectives by ranking them according to the objective function. Assume the objective function... Represents the calculation time. Representing energy consumption, individuals ranking high in both objectives are prioritized during the selection process. These individuals are chosen as the high-quality solution set. .
[0151] Next, we address the boundary solutions. Among the individuals after the non-dominated sorting, those whose objective function values approach the limit (e.g.) Extremely small Boundary solutions that are maximal will be handled specially. For these solutions, we retain them in the high-quality solution set as reference data for extreme cases. These boundary solutions will not be eliminated due to their extreme performance, in order to ensure the diversity of the solution set.
[0152] Finally, output the high-quality solution set. After non-dominated sorting and filtering, the high-quality solution set is... It contains solutions that achieve balanced performance across different optimization objectives and will serve as the basis for subsequent Pareto polynomial fitting.
[0153] Step 2 further includes:
[0154] First, the selected non-dominated Pareto front solution set Preprocessing is performed. The solutions in each solution set can be represented as a set of decision variables. and objective function value In the formula, This refers to the number of objectives in a multi-objective optimization problem. The purpose of preprocessing is to sort these solutions according to the magnitude of each objective function value for subsequent fitting operations.
[0155] For each objective function Set up the corresponding polynomial fitting model, and the fitting formula is as follows:
[0156] ;
[0157] In the formula, It is for the objective function The fitting polynomial, These are the coefficients to be determined. It is a decision variable.
[0158] Based on the existing solutions in the Pareto front solution set We find several solution points and substitute them into a polynomial expression to form a system of equations. For each mapping scheme... Target value The following relationship must be satisfied:
[0159] ;
[0160] This yields n equations, forming a system of linear equations, where the unknowns of the system are the coefficients of the polynomials. The least squares method is used to find the optimal combination of coefficients by minimizing the sum of squares of the fitting error. The fitting error can be expressed as:
[0161] ;
[0162] Step 3 further includes:
[0163] Based on the current priority objective or the trade-off between different objectives, an optimal solution is selected from the fitted Pareto front solution set. For example, in some scenarios, if there are higher requirements for computation time, the solution that optimizes time can be selected; in other scenarios, if energy consumption constraints are more important, the solution that optimizes energy consumption can be selected. The specific operation method is as follows:
[0164] For each solution in the Pareto front solution set, a Pareto polynomial is used to calculate its value under the computational time objective. This step obtains the computational time performance of each solution by substituting the corresponding value of each solution into the fitted polynomial. After calculation, all solutions are sorted according to the objective function value, with the goal of finding the solution with the minimum computation time. After sorting, the solution with the smallest objective function value is selected, which is considered to be the best performing solution under the current objective.
[0165] When balancing multiple optimization objectives, such as striking a trade-off between computation time and energy consumption, simply optimizing a single objective is insufficient. In such cases, multiple objectives need to be considered comprehensively, typically by assigning weights to each objective to reflect their relative importance. The specific steps are as follows:
[0166] First, determine the weight of each objective; for example, weight 1 represents the importance of computation time, and weight 2 represents the importance of energy consumption. The weights can be dynamically adjusted based on user needs or the current system priority. Calculate the performance value of each solution under different objectives using the Pareto polynomial for each objective. These two polynomials yield the performance of each solution under both computation time and energy consumption objectives. Combine the performance of the two objectives to calculate a weighted composite value. This value represents the overall performance of each solution after considering different objectives. Sort all solutions and select the one with the best overall performance.
[0167] Therefore, this embodiment achieves great flexibility in the operator mapping process through a vectorized constraint model. The resource requirements, storage requirements, and computational requirements of each operator can be encapsulated as different constraints, which are then integrated into a vector for unified management. In this way, the system can dynamically add or remove specific constraints according to actual task requirements. This makes operator mapping optimization more flexible under different task scenarios, greatly improving the system's adaptability.
[0168] Furthermore, it provides customized optimizations for specific task requirements. In heterogeneous systems, the computational requirements, execution time, and resource configurations of each task may differ. The patented method dynamically adjusts the operator mapping scheme based on the constraints of task requirements, ensuring that tasks can efficiently complete computations while meeting resource constraints. Especially in real-time computing scenarios, this method can generate customized optimization objective function values according to the specific needs of the task, enabling the system to quickly switch between different tasks and reallocate resources, significantly improving the efficiency and flexibility of task execution.
[0169] Furthermore, the operator mapping problem is transformed into a multi-objective optimization problem. Traditional operator mapping methods often focus on a single objective, while this invention constructs a multi-objective optimization mathematical model that comprehensively considers multiple performance indicators such as system computational speed, energy consumption, and load balancing. This transformation enables the system to find the optimal balance point among multiple objectives, thereby improving the overall system performance.
[0170] The steps of the various methods described above are only for clarity. In practice, they can be combined into one step or some steps can be split into multiple steps. As long as they include the same logical relationship, they are all within the protection scope of this invention. Adding insignificant modifications or introducing insignificant designs to the algorithm or process, without changing the core design of the algorithm and process, are also within the protection scope of this invention.
[0171] Another embodiment of the present invention relates to an operator mapping device for heterogeneous systems. The implementation details of the heterogeneous system operator mapping device of this embodiment are described below. The following implementation details are provided for ease of understanding and are not essential for implementing this solution. The heterogeneous system operator mapping device of this embodiment includes:
[0172] The problem modeling module is used to model the operator mapping problem as the following multi-objective optimization problem: with the objectives of minimizing the total execution time of multiple different operators, minimizing the total execution energy consumption, and maximizing the total load balance of the corresponding processing units, with the execution resource requirements of multiple different operators as constraints, and the operator mapping scheme formed by allocating multiple different operators to different processing units as decision variables;
[0173] The problem-solving module is used to solve multi-objective optimization problems based on the non-dominated sorting genetic algorithm, and obtain the Pareto front solution set composed of multiple different operator mapping schemes;
[0174] The solution optimization module is used to obtain the objective function value of each objective corresponding to each operator mapping scheme in the Pareto front solution set, based on the objective functions constructed with the objectives of minimizing the total execution time of multiple different operators, minimizing the total execution energy consumption, and maximizing the total load balance of the corresponding processing units.
[0175] Using a polynomial fitting method, curve fitting is performed on each operator mapping scheme and the corresponding objective function value of each objective in the Pareto front solution set to obtain the Pareto polynomial for each objective.
[0176] Based on the objectives to be optimized in the pre-defined multi-objective optimization problem, the optimal operator mapping scheme is selected from the Pareto front solution set through the Pareto polynomial corresponding to the objective.
[0177] It is not difficult to see that this embodiment is a device embodiment corresponding to the above method embodiments, and this embodiment can be implemented in conjunction with the above method embodiments. The relevant technical details and technical effects mentioned in the above embodiments are still valid in this embodiment, and will not be repeated here to reduce repetition. Accordingly, the relevant technical details mentioned in this embodiment can also be applied to the above embodiments.
[0178] It is worth mentioning that all modules involved in this embodiment are logical modules. In practical applications, a logical unit can be a physical unit, a part of a physical unit, or a combination of multiple physical units. Furthermore, to highlight the innovative aspects of this invention, this embodiment does not introduce units that are not closely related to solving the technical problem proposed by this invention; however, this does not mean that other units are absent from this embodiment.
[0179] Another embodiment of the present invention relates to a computer device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the operator mapping method for heterogeneous systems in the above embodiments.
[0180] The memory and processor are connected via a bus, which can include any number of interconnecting buses and bridges, connecting various circuits of one or more processors and memories. The bus can also connect various other circuits, such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and will not be described further herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be a single element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices over a transmission medium. Data processed by the processor is transmitted over the wireless medium via an antenna, which further receives data and transmits it to the processor.
[0181] The processor manages the bus and general processing, and also provides various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory is used to store data used by the processor during operation.
[0182] Another embodiment of the present invention relates to a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the method embodiments described above.
[0183] That is, those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware. This program is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0184] Those skilled in the art will understand that the above embodiments are specific embodiments for implementing the present invention, and in practical applications, various changes can be made to them in form and detail without departing from the spirit and scope of the present invention.
Claims
1. An operator mapping method for heterogeneous systems, characterized in that, The method includes: The operator mapping problem is modeled as a multi-objective optimization problem: the objectives are to minimize the total execution time of multiple different operators, minimize the total execution energy consumption, and maximize the total load balance of the corresponding processing units; the constraints are the execution resource requirements of multiple different operators; and the decision variables are the operator mapping schemes formed by allocating multiple different operators to different processing units. The execution resource requirements include at least the following: computational resource requirements including computation cycles and computation time; storage resource requirements including memory usage and cache size; and I / O bandwidth requirements including input bandwidth and output bandwidth. A multi-objective optimization problem is solved based on a non-dominated sorting genetic algorithm, resulting in a Pareto front solution set consisting of multiple different operator mapping schemes; Based on the objective functions constructed with the objectives of minimizing the total execution time, minimizing the total execution energy consumption, and maximizing the total load balance of the corresponding processing units for multiple different operators, the objective function values of each objective corresponding to each operator mapping scheme in the Pareto front solution set are obtained; Using a polynomial fitting method, curve fitting is performed on each operator mapping scheme and the corresponding objective function value of each objective in the Pareto front solution set to obtain the Pareto polynomial for each objective. Based on the objectives to be optimized in the pre-defined multi-objective optimization problem, the optimal operator mapping scheme is selected from the Pareto front solution set through the Pareto polynomial corresponding to the objective.
2. The operator mapping method for heterogeneous systems according to claim 1, characterized in that, The method employs a polynomial fitting approach to perform curve fitting on each operator mapping scheme and the corresponding objective function value in the Pareto front solution set, obtaining the Pareto polynomial for each objective, including: For each objective, a corresponding multinomial fitting model is defined as follows: In the formula, It is targeted The fitting polynomial, These are the coefficients to be determined. is the decision variable, and n is the number of operator mapping schemes in the Pareto front solution set; Substitute the n operator mapping schemes in the Pareto front solution set into the polynomial fitting model of each objective to form a linear equation system consisting of n equations for each objective. The coefficients to be determined in the polynomial fitting model are obtained by solving a system of linear equations to obtain the Pareto polynomial for each objective.
3. The operator mapping method for heterogeneous systems according to claim 2, characterized in that, The step of selecting the optimal operator mapping scheme from the Pareto front solution set based on the objectives to be optimized in the preset multi-objective optimization problem, using the Pareto polynomial corresponding to the objective, includes: For any objective to be optimized in a multi-objective optimization problem, use the corresponding Pareto polynomial to calculate the objective function value of each operator mapping scheme in the Pareto front solution set under that objective. The operator mapping scheme that minimizes the objective function value is selected as the optimal operator mapping scheme for that objective. Alternatively, based on any number of objectives to be optimized in a multi-objective optimization problem, use the corresponding multiple Pareto polynomials to calculate the objective function values of each operator mapping scheme in the Pareto front solution set under multiple objectives. Based on the weights of multiple preset objectives, the objective function values of each operator mapping scheme under multiple objectives are weighted to obtain the comprehensive performance of each operator mapping scheme under multiple objectives. The operator mapping scheme with the best overall performance is selected as the optimal operator mapping scheme for multiple objectives.
4. The operator mapping method for heterogeneous systems according to claim 3, characterized in that, Before performing curve fitting on each operator mapping scheme and the corresponding objective function value of each objective in the Pareto front solution set, the method further includes: Based on the objective function value of each operator mapping scheme in the Pareto front solution set under each objective, multiple operator mapping schemes in the Pareto front solution set are selected.
5. The operator mapping method for heterogeneous systems according to claim 1, characterized in that, The non-dominated sorting genetic algorithm is used to solve multi-objective optimization problems, resulting in a Pareto front solution set composed of multiple different operator mapping schemes, including: A set of operator mapping schemes is randomly generated based on a non-dominated sorting genetic algorithm. Based on the computational complexity and execution resource requirements of each operator, as well as the hardware resources of the processing unit, the randomly generated operator mapping scheme is adjusted to obtain the initial population; The Pareto front solution set, consisting of multiple different operator mapping schemes, is obtained by initializing the population.
6. The operator mapping method for heterogeneous systems according to claim 1, characterized in that, Before modeling the operator mapping problem as a multi-objective optimization problem, the following is also included: The execution resource requirements are mapped as output parameters to a preset vector, where each element of the preset vector represents an execution resource requirement. The execution resource requirements in the preset vector are dynamically adjusted according to the preset operator requirements.
7. An operator mapping device for a heterogeneous system, characterized in that, The device includes: The problem modeling module is used to model the operator mapping problem as a multi-objective optimization problem: with the objectives of minimizing the total execution time of multiple different operators, minimizing the total execution energy consumption, and maximizing the total load balance of the corresponding processing units, the constraints are the execution resource requirements of multiple different operators, and the decision variables are the operator mapping schemes formed by allocating multiple different operators to different processing units; wherein, the execution resource requirements include at least the following: computing resource requirements including computation cycle and computation time, storage resource requirements including memory usage and cache size, and I / O bandwidth requirements including input bandwidth and output bandwidth; The problem-solving module is used to solve multi-objective optimization problems based on the non-dominated sorting genetic algorithm, and obtain the Pareto front solution set composed of multiple different operator mapping schemes; The solution optimization module is used to obtain the objective function value of each objective corresponding to each operator mapping scheme in the Pareto front solution set, based on the objective functions constructed with the objectives of minimizing the total execution time of multiple different operators, minimizing the total execution energy consumption, and maximizing the total load balance of the corresponding processing units. Using a polynomial fitting method, curve fitting is performed on each operator mapping scheme and the corresponding objective function value of each objective in the Pareto front solution set to obtain the Pareto polynomial for each objective. Based on the objectives to be optimized in the pre-defined multi-objective optimization problem, the optimal operator mapping scheme is selected from the Pareto front solution set through the Pareto polynomial corresponding to the objective.
8. A computer device, characterized in that, include: At least one processor; And a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the operator mapping method for heterogeneous systems as described in any one of claims 1 to 6.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the operator mapping method for heterogeneous systems as described in any one of claims 1 to 6.
Citation Information
Patent Citations
FPGA resource-oriented neural network reconfigurable configuration mapping method
CN116245150A
Heterogeneous missile group task reliability planning method based on multi-target dynamic optimization
CN116702633A