Evolutionary learning algorithm operation method and system based on algorithm operation system, and medium
By determining the resource status and selecting the appropriate device in the algorithm running system, and using gradient-free optimization strategies to run evolutionary learning algorithms on low-precision AI accelerator cards, the limitations of computing accuracy and hardware application scope are solved, and efficient hardware deployment and computing are achieved Accuracy.
Patent Information
- Application Number
- CN202411178880.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-27
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2044-08-27
AI Technical Summary
Existing evolutionary learning algorithm-related systems face limitations in computing accuracy and hardware application range when running on low-precision AI accelerator cards, and it is difficult to effectively deploy in low-precision data formats.
By determining the resource occupation status of high-precision computing devices and AI accelerators in the algorithm running system, selecting the appropriate target computing device, and generating initial solutions based on the gradient-free optimization strategy, using the target computing device to evaluate the fitness for iterative optimization, ensuring evolutionary learning Computational accuracy of the algorithm running on low-precision AI accelerator cards.
While ensuring the computing accuracy of evolutionary learning algorithms, it expands its hardware application scope, realizes effective deployment in low-precision data formats, and improves computing efficiency and hardware utilization.
Smart Images

Figure CN119150956A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to but is not limited to the field of computer technology, and in particular to an evolutionary learning algorithm operation method, system, and medium based on an algorithm operation system. Background Art
[0002] Evolutionary learning algorithms are a type of optimization algorithm based on the principles of natural selection and genetics. They simulate the biological evolution process to find the optimal solution. Common evolutionary computing techniques include genetic algorithms, evolutionary strategies, and genetic programming. In the field of optimization problems and machine learning, evolutionary learning algorithms have been widely used as an important optimization method. They are usually applied to complex optimization problems and scenarios with a wide search space, such as structural optimization scenarios in engineering design, gene sequence alignment scenarios in bioinformatics, and protein structure prediction scenarios. Existing evolutionary learning algorithm-related systems such as the DEAP system, PYMOO system, and PAGMO system are mainly based on CPUs. Applying evolutionary learning algorithms to low-precision AI accelerator cards and their cluster systems still faces challenges. Summary of the invention
[0003] The embodiments of the present application provide an evolutionary learning algorithm operation method, system, and medium based on an algorithm operation system, which can ensure the computational accuracy of the evolutionary learning algorithm while enabling the evolutionary learning algorithm to run on a low-precision AI acceleration card, thereby expanding the hardware application scope of the evolutionary learning algorithm.
[0004] In a first aspect, an embodiment of the present application provides an evolutionary learning algorithm operation method based on an algorithm operation system, which is applied to the algorithm operation system, wherein the algorithm operation system includes a high-precision computing device and an AI accelerator, and the method includes:
[0005] In response to a request to run a target algorithm, determine a first resource occupancy state of the high-precision computing device and a second resource occupancy state of the AI accelerator, and determine a target computing device from the high-precision computing device and the AI accelerator based on the first resource occupancy state and the second resource occupancy state, wherein the target algorithm is used to indicate an evolutionary learning algorithm to be run;
[0006] When the target computing device is the AI accelerator, determining optimization attribute information of the target algorithm, wherein the optimization attribute information includes an objective function for solving the target algorithm, a dimension of a solution for the target algorithm, and a search space range;
[0007] Determining a first objective optimization strategy from a preset set of gradient-free optimization strategies based on the objective function, the dimension of the solution, and the search space range, and generating a first initial solution for the target algorithm based on the first objective optimization strategy;
[0008] Using the target computing device to evaluate a first fitness of the first initial solution in a first target simulation environment, wherein the first fitness is used to indicate a performance level of the first initial solution in the first target simulation environment;
[0009] The first initial solution is iteratively optimized based on a preset evolutionary operator and the first fitness to obtain a target solution of the target algorithm.
[0010] In some embodiments, there are multiple high-precision computing devices, each of which has the first resource occupancy status, and there are multiple AI accelerators, each of which has the second resource occupancy status. The step of determining a target computing device from the high-precision computing devices and the AI accelerator based on the first resource occupancy status and the second resource occupancy status includes:
[0011] Determine the algorithm type, input data type and performance requirement information of the target algorithm from the execution request;
[0012] Determine a first candidate device from the high-precision computing devices based on the algorithm type, the input data type, and the performance requirement information;
[0013] When the first resource occupancy state of the first candidate device indicates that the first candidate device is in an occupied state, determining a second candidate device from the AI accelerator based on the algorithm type, the input data type, and the performance requirement information;
[0014] When the second resource occupation state of the second candidate device indicates that the second candidate device is in an unoccupied state, the second candidate device is determined as the target computing device.
[0015] In some embodiments, there are multiple target computing devices, there are multiple first initial solutions, and using the target computing devices to evaluate the first fitness of each of the first initial solutions in the first target simulation environment includes:
[0016] Determine a target number of the target computing devices, group the first initial solutions based on the target number, and obtain a plurality of reference solution sets, wherein each of the reference solution sets includes at least one of the first initial solutions, each of the first initial solutions corresponds to one first fitness evaluation task in the first target simulation environment, and the number of the reference solution sets is equal to the number of the target computing devices;
[0017] Allocate each of the first fitness evaluation tasks corresponding to each of the reference solution sets to each of the corresponding target computing devices to obtain each of the corresponding first fitnesses.
[0018] In some embodiments, performing iterative optimization processing on the corresponding first initial solutions based on a preset evolutionary operator and each of the first fitnesses to obtain a target solution of the target algorithm includes:
[0019] When the first fitness is greater than a preset first fitness threshold, determining the corresponding first initial solution as the target solution;
[0020] or,
[0021] When the first fitness is less than or equal to the first fitness threshold, performing an evolution operation on the corresponding first initial solution based on the evolution operator to generate a first intermediate solution, and recording a first iteration number of the evolution operation;
[0022] The target computing device is used to evaluate the first fitness of the first intermediate solution in the first target simulation environment. When the first fitness corresponding to the first intermediate solution is less than or equal to a preset first fitness threshold, the evolution operation is re-performed, the new first fitness is re-evaluated, and a new first intermediate solution is generated until the first iteration number is equal to the first iteration number threshold or the new first fitness is greater than the first fitness threshold, and the corresponding new first intermediate solution is determined as the target solution.
[0023] In some embodiments, the method further comprises:
[0024] When the target computing device is the high-precision computing device, determining a second target optimization strategy from a preset gradient optimization strategy set based on the target function corresponding to the target algorithm, the dimension of the solution, and the search space range, and generating a second initial solution for the target algorithm based on the second target optimization strategy;
[0025] Using the target computing device to evaluate a second fitness of the second initial solution in a second target simulation environment, wherein the second fitness is used to indicate a performance level of the second initial solution in the second target simulation environment;
[0026] The second initial solution is iteratively optimized based on the second fitness to obtain the target solution of the target algorithm.
[0027] In some embodiments, performing iterative optimization processing on the second initial solution based on the second fitness to obtain the target solution of the target algorithm includes:
[0028] When the second fitness is greater than a preset second fitness threshold, determining the corresponding second initial solution as the target solution;
[0029] or,
[0030] When the second fitness is less than or equal to the second fitness threshold, the gradient information of the second initial solution is calculated, and the search distribution information of the second initial solution is updated, and the second initial solution is optimized based on the gradient information and the updated search distribution information to obtain a second intermediate solution, and the target computing device is used to evaluate the second fitness of the second intermediate solution in the second target simulation environment, and the second number of iterations is recorded until the second fitness corresponding to the second intermediate solution is greater than the second fitness threshold or the second number of iterations is equal to the second number of iterations threshold, and the corresponding second intermediate solution is determined as the target solution.
[0031] In a second aspect, an embodiment of the present application provides an algorithm operation system, including:
[0032] High-precision computing equipment;
[0033] AI accelerators;
[0034] a target computing device determination module, configured to determine, in response to a request to execute a target algorithm, a first resource occupancy state of the high-precision computing device and a second resource occupancy state of the AI accelerator, and determine a target computing device from the high-precision computing device and the AI accelerator based on the first resource occupancy state and the second resource occupancy state, wherein the target algorithm is used to indicate an evolutionary learning algorithm to be executed;
[0035] A multi-precision adaptive solution module, used for determining optimization attribute information of the target algorithm when the target computing device is the AI accelerator, wherein the optimization attribute information includes an objective function for solving the target algorithm, a dimension of a solution for the target algorithm, and a search space range, determining a first target optimization strategy from a preset gradient-free optimization strategy set based on the objective function, the dimension of the solution, and the search space range, and generating a first initial solution for the target algorithm based on the first target optimization strategy;
[0036] A target solution calculation module is used to use the target computing device to evaluate the first fitness of the first initial solution in the first target simulation environment, wherein the first fitness is used to indicate the performance of the first initial solution in the first target simulation environment, and to iteratively optimize the first initial solution based on a preset evolutionary operator and the first fitness to obtain a target solution of the target algorithm.
[0037] In some embodiments, it also includes:
[0038] A task scheduling module is used to determine the target number of the target computing devices when the target solution calculation module executes the operation of evaluating the first fitness of each first initial solution in the first target simulation environment by using the target computing device, and group the first initial solutions based on the target number to obtain multiple reference solution sets, wherein each reference solution set includes at least one first initial solution, each first initial solution corresponds to one first fitness evaluation task in the first target simulation environment, the number of the reference solution sets is equal to the number of the target computing devices, and each first fitness evaluation task corresponding to each reference solution set is allocated to the corresponding target computing device to obtain the corresponding first fitness.
[0039] In some embodiments, the multi-precision adaptive solution module is further used to:
[0040] When the target computing device is the high-precision computing device, a second target optimization strategy is determined from a preset gradient optimization strategy set based on the objective function corresponding to the target algorithm, the dimension of the solution and the search space range, and a second initial solution for the target algorithm is generated based on the second target optimization strategy.
[0041] In some embodiments, the target solution calculation module is further used to:
[0042] The target computing device is used to evaluate a second fitness of the second initial solution in a second target simulation environment, wherein the second fitness is used to indicate the performance degree of the second initial solution in the second target simulation environment, and the second initial solution is iteratively optimized based on the second fitness to obtain the target solution of the target algorithm.
[0043] In a third aspect, an embodiment of the present application provides an algorithm operation system, comprising at least one control processor and a memory for communicating with the at least one control processor; the memory stores instructions executable by the at least one control processor, and the instructions are executed by the at least one control processor so that the at least one control processor can execute the evolutionary learning algorithm operation method based on the algorithm operation system as described in the first aspect.
[0044] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the evolutionary learning algorithm operation method based on the algorithm operation system as described in the first aspect.
[0045] The embodiments of the present application provide an evolutionary learning algorithm operation method, system, and medium based on an algorithm operation system, the method comprising: in response to an operation request of a target algorithm, determining a first resource occupancy state of the high-precision computing device and a second resource occupancy state of the AI accelerator, and determining a target computing device from the high-precision computing device and the AI accelerator based on the first resource occupancy state and the second resource occupancy state, wherein the target algorithm is used to indicate the evolutionary learning algorithm to be run; when the target computing device is the AI accelerator, determining optimization attribute information of the target algorithm, wherein the optimization attribute information includes solving an objective function of the target algorithm, a dimension of a solution for the target algorithm, and a search space range; determining a first target optimization strategy from a preset set of gradient-free optimization strategies based on the objective function, the dimension of the solution, and the search space range, and generating a first initial solution for the target algorithm based on the first target optimization strategy; evaluating a first fitness of the first initial solution in a first target simulation environment using the target computing device, wherein the first fitness is used to indicate the performance degree of the first initial solution in the first target simulation environment; performing iterative optimization processing on the first initial solution based on a preset evolutionary operator and the first fitness to obtain a target solution of the target algorithm. According to the solution provided in the embodiment of the present application, it is possible to deploy the evolutionary learning algorithm on an AI accelerator card with a low-precision data format while ensuring the computational accuracy of the evolutionary learning algorithm, thereby expanding the hardware application scope of the evolutionary learning algorithm. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 It is a flowchart of the steps of an evolutionary learning algorithm operation method based on an algorithm operation system provided by an embodiment of the present application;
[0047] Figure 2 is a schematic diagram of an evolutionary learning algorithm operation method based on an algorithm operation system provided by another embodiment of the present application;
[0048] Figure 3 It is a structural diagram of an algorithm operation system provided in another embodiment of the present application. DETAILED DESCRIPTION
[0049] 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.
[0050] It is understood that although the functional modules are divided in the device schematic diagram and the logical order is shown in the flow chart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flow chart. The terms "first", "second", etc. in the specification, claims or the above drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0051] The concepts mentioned in this application are explained below:
[0052] (1) Low-precision numerical format. Low-precision numerical format refers to a format that uses fewer bits to represent numerical data. It includes FP16, BF16, INT8 and other numerical formats with lower precision than FP32 floating point numbers. Unlike traditional high-precision floating point numbers, low-precision data formats (such as half-precision floating point numbers and fixed-point numbers) use less storage space and computing resources. Despite the lower precision, it can still maintain sufficient accuracy in many applications (such as deep learning and neural network reasoning processes), while significantly improving computing efficiency and reducing power consumption.
[0053] (2) Gradient-Free Gradient-free refers to problems that do not rely on gradient information for optimization or solution. Traditional optimization methods (such as gradient descent) rely on the gradient information of the objective function to update parameters, while gradient-free methods do not need to calculate gradients. Gradient-free methods include particle swarm optimization, simulated annealing, genetic algorithms, etc., and are suitable for complex optimization problems where the objective function is not differentiable, the gradient is difficult to calculate, or there are multiple local extreme values.
[0054] Evolutionary learning algorithms are a type of optimization algorithm based on the principles of natural selection and genetics. They simulate the biological evolution process to find the optimal solution. Common evolutionary computing techniques include genetic algorithms, evolutionary strategies, and genetic programming. In the field of optimization problems and machine learning, evolutionary learning algorithms have been widely used as an important optimization method. They are usually applied to complex optimization problems and scenarios with a wide search space, such as structural optimization scenarios in engineering design, gene sequence alignment scenarios in bioinformatics, and protein structure prediction scenarios. Existing evolutionary learning algorithm-related systems such as the DEAP system, PYMOO system, and PAGMO system are mainly based on CPUs. Applying evolutionary learning algorithms to low-precision AI accelerator cards and their cluster systems still faces challenges.
[0055] To solve the above-mentioned problems, an embodiment of the present application provides an evolutionary learning algorithm operation method, system, and medium based on an algorithm operation system, the method comprising: in response to an operation request of a target algorithm, determining a first resource occupancy state of the high-precision computing device and a second resource occupancy state of the AI accelerator, and determining a target computing device from the high-precision computing device and the AI accelerator based on the first resource occupancy state and the second resource occupancy state, wherein the target algorithm is used to indicate the evolutionary learning algorithm to be run; when the target computing device is the AI accelerator, determining optimization attribute information of the target algorithm, wherein the optimization attribute information includes: The method includes solving the objective function of the target algorithm, the dimension of the solution for the target algorithm, and the search space range; determining a first target optimization strategy from a preset set of gradient-free optimization strategies based on the objective function, the dimension of the solution, and the search space range, and generating a first initial solution for the target algorithm based on the first target optimization strategy; using the target computing device to evaluate the first fitness of the first initial solution in the first target simulation environment, wherein the first fitness is used to indicate the performance of the first initial solution in the first target simulation environment; iteratively optimizing the first initial solution based on the preset evolutionary operator and the first fitness to obtain the target solution of the target algorithm. According to the solution provided in the embodiment of the present application, while ensuring the computational accuracy of the evolutionary learning algorithm, it is possible to deploy the evolutionary learning algorithm on an AI accelerator card with a low-precision data format to run, thereby expanding the hardware application scope of the evolutionary learning algorithm.
[0056] The embodiments of the present application are further described below in conjunction with the accompanying drawings.
[0057] refer to Figure 1 , Figure 1 This is a flowchart of the steps of an evolutionary learning algorithm operation method based on an algorithm operation system provided by an embodiment of the present application. The embodiment of the present application provides an evolutionary learning algorithm operation method based on an algorithm operation system. The method is applied to the algorithm operation system. The algorithm operation system includes a high-precision computing device and an AI accelerator. The method includes but is not limited to the following steps:
[0058] Step S10, in response to a request to run the target algorithm, determine a first resource occupancy state of the high-precision computing device and a second resource occupancy state of the AI accelerator, and determine the target computing device from the high-precision computing device and the AI accelerator based on the first resource occupancy state and the second resource occupancy state, wherein the target algorithm is used to indicate the evolutionary learning algorithm to be run.
[0059] Specifically, the high-precision computing device of this embodiment is a computing module that supports high-precision numerical formats and processes high-precision data operations, such as a CPU or a GPU.
[0060] Specifically, the AI accelerator of this embodiment does not support high-precision numerical formats and is a hardware device used to improve the computing speed and efficiency of AI algorithms.
[0061] Specifically, the running request of this embodiment may include relevant attribute information of the target algorithm, such as the algorithm type, input data type and performance requirement information of the target algorithm, providing an effective data basis for the system to allocate specific system resources for running the target algorithm.
[0062] It can be understood that when a request to run the evolutionary learning algorithm to be run, that is, the target algorithm, is received, the algorithm running system determines the first resource occupancy state of the high-precision computing device and the second resource occupancy state of the AI accelerator, and determines the hardware resources in the system that can be used to execute the target algorithm from the high-precision computing device and the AI accelerator based on the first resource occupancy state and the second resource occupancy state. It can make full use of various computing resources from high-end GPUs to low-precision AI acceleration cards, and can provide effective hardware support for subsequent algorithm running steps.
[0063] Specifically, in some embodiments, when there are multiple high-precision computing devices, each of which corresponds to a first resource occupancy state, and there are multiple AI accelerators, each of which corresponds to a second resource occupancy state, Figure 1 The step of determining the target computing device from the high-precision computing device and the AI accelerator based on the first resource occupancy status and the second resource occupancy status in step S10 includes but is not limited to the following steps:
[0064] Step S11, determining the algorithm type, input data type and performance requirement information of the target algorithm from the operation request;
[0065] Step S12, determining a first candidate device from high-precision computing devices based on the algorithm type, input data type, and performance requirement information;
[0066] Step S13: when the first resource occupancy state of the first candidate device indicates that the first candidate device is in an occupied state, determining a second candidate device from the AI accelerator based on the algorithm type, the input data type, and the performance requirement information;
[0067] Step S14: when the second resource occupation state of the second candidate device indicates that the second candidate device is in an unoccupied state, the second candidate device is determined as the target computing device.
[0068] It can be understood that since the algorithm operation hardware resources of the algorithm running system of the embodiment of the present application include two types: AI accelerator and high-precision computing device, the high-precision computing device supports the processing of high-precision data and has high computing power, which can ensure the high precision and high efficiency required for the algorithm operation. Therefore, the high-precision computing device is considered first, and a first candidate device that meets the operation requirements is determined from multiple high-precision computing devices based on the algorithm type, input data type and performance requirement information of the target algorithm. When the system detects that the first candidate device is in an unoccupied state, the first candidate device is determined as the target computing device. When the first candidate device is in an occupied state, a second candidate device that meets the target algorithm operation requirements is determined from the AI accelerator based on the algorithm type, input data type and performance requirement information. When the second candidate device is in an unoccupied state, the second candidate device is determined as the target computing device.
[0069] Step S20, when the target computing device is an AI accelerator, determining optimization attribute information of the target algorithm, wherein the optimization attribute information includes an objective function for solving the target algorithm, a dimension of a solution for the target algorithm, and a search space range;
[0070] Step S30, determining a first objective optimization strategy from a preset set of gradient-free optimization strategies based on the objective function, the dimension of the solution and the search space range, and generating a first initial solution for the target algorithm based on the first objective optimization strategy.
[0071] Specifically, the embodiments of the present application do not limit the various optimization strategies in the gradient-free optimization strategy set, and those skilled in the art can set them according to actual needs. For example, the optimization strategies may include genetic algorithms, particle swarm optimization PSO algorithms, simulated annealing SA algorithms, etc.
[0072] It can be understood that this embodiment, by determining the optimization property information of the target algorithm, that is, solving the objective function of the target algorithm, the dimension of the solution to the target algorithm, and the search space range, can provide an effective data basis for subsequently determining the optimization problem for the target algorithm and solving the initial solution corresponding to the target algorithm.
[0073] It can be understood that since the AI accelerator of this embodiment does not support high-precision numerical formats, gradient calculation in the low-precision environment of the AI accelerator will lead to the introduction of significant rounding errors, resulting in instability in the subsequent optimization process or convergence to a suboptimal solution. Therefore, this embodiment configures a gradient-free evolution strategy set for the AI accelerator, so that the above-mentioned defects can be avoided when the target algorithm is executed by the AI accelerator, and the gradient-free evolution strategy is executed on the AI accelerator, which has the following characteristics: it can handle continuous, discrete, mixed and non-smooth optimization problems; it has strong robustness, that is, it has strong resistance to noise and local optimal solutions, is insensitive to numerical accuracy, and can maintain stability in a low-precision environment; it has good parallelism and is easy to implement on a parallel architecture, making full use of the parallel computing capabilities of the AI accelerator card; it has low parameter dependence. Compared with many optimization algorithms that require fine parameter adjustment, the gradient-free evolutionary algorithm is less sensitive to parameter settings and is easier to jump out of the local optimum than the gradient method.
[0074] Step S40: using the target computing device to evaluate a first fitness of the first initial solution in the first target simulation environment, wherein the first fitness is used to indicate a performance level of the first initial solution in the first target simulation environment.
[0075] Specifically, the first target simulation environment of this embodiment is an operation scenario corresponding to the fitness function corresponding to the calculation of the first fitness.
[0076] Specifically, the first fitness reflects the performance of the first initial solution and the degree to which it meets the requirements under specific environments or conditions. The process of the target computing device evaluating the first fitness of the first initial solution is used to quantify the quality of the first initial solution and guide the search process to evolve towards a better solution.
[0077] It can be understood that calculating the first fitness of the first initial solution can be used as a judgment condition for the optimal target solution for solving the optimization problem, thereby providing an effective data basis for the subsequent determination of the target solution.
[0078] In addition, in some embodiments, the number of target computing devices is multiple, the number of first initial solutions is multiple, Figure 1 The step of evaluating the first fitness of the first initial solution in the first target simulation environment by using the target computing device in step S40 includes but is not limited to the following steps:
[0079] Step S41, determining a target number of target computing devices, grouping the first initial solutions based on the target number, and obtaining a plurality of reference solution sets, wherein each reference solution set includes at least one first initial solution, each first initial solution corresponds to one first fitness evaluation task in a first target simulation environment, and the number of reference solution sets is equal to the number of target computing devices;
[0080] Step S42, allocating each first fitness evaluation task corresponding to each reference solution set to each corresponding target computing device to obtain each corresponding first fitness.
[0081] It can be understood that when there are multiple target computing devices and multiple first initial solutions, the algorithm operation system of this embodiment can evenly distribute the fitness evaluation tasks of multiple first initial solutions to multiple target computing devices through the task scheduler, so that multiple fitness evaluation tasks can be processed in parallel, maximizing the use of heterogeneous computing resources and improving the algorithm operation efficiency.
[0082] Step S50, performing iterative optimization processing on the first initial solution based on a preset evolutionary operator and a first fitness to obtain a target solution of the target algorithm.
[0083] Specifically, the evolutionary operator of this embodiment is a key mechanism in the evolutionary algorithm for simulating the biological evolution process, and is used to solve the optimization problem of evolutionary learning. It may include selection operators, crossover operators, and mutation operators, etc. The specific selection type is selected by technical personnel in this field according to actual needs.
[0084] It can be understood that this embodiment combines the preset evolution operator and the first fitness to perform iterative optimization processing on the first initial solution, and can use the evolution operator and the first fitness to perform multiple iterative optimizations on the first initial solution until the optimal target solution that meets the first iteration termination condition is solved.
[0085] Additionally, in some embodiments, Figure 1 Step S50 includes but is not limited to the following steps:
[0086] Step S51, when the first fitness is greater than a preset first fitness threshold, the corresponding first initial solution is determined as a target solution;
[0087] or,
[0088] Step S52, when the first fitness is less than or equal to the first fitness threshold, performing an evolution operation on the corresponding first initial solution based on the evolution operator to generate a first intermediate solution, and recording a first iteration number of the evolution operation;
[0089] Step S53, using the target computing device to evaluate the first fitness of the first intermediate solution in the first target simulation environment, when the first fitness corresponding to the first intermediate solution is less than or equal to the preset first fitness threshold, re-perform the evolution operation, re-evaluate the new first fitness and generate a new first intermediate solution until the first iteration number is equal to the first iteration number threshold or the new first fitness is greater than the first fitness threshold, and the corresponding new first intermediate solution is determined as the target solution.
[0090] Specifically, the first iterative termination condition for the target solution of the target algorithm of this embodiment is that the first fitness corresponding to the first initial solution or the first intermediate solution solved by the iterative optimization is greater than the first fitness threshold, or the first number of iterations corresponding to the iterative optimization operation reaches the first number of iterations threshold. This embodiment does not limit the specific values of the first fitness threshold and the first number of iterations threshold, and technical personnel in this field can set them according to actual conditions.
[0091] Understandably, reference Figure 2 The left branch of the flowchart specifically includes the following steps of iteratively optimizing the first initial solution based on the first iteration termination condition: when the first fitness is greater than a preset first fitness threshold, determining the corresponding first initial solution as the target solution; or, when the first fitness is less than or equal to the first fitness threshold, performing an evolutionary operation on the corresponding first initial solution based on an evolutionary operator to generate a first intermediate solution, and recording the first iteration number of the evolutionary operation; evaluating the first fitness of the first intermediate solution in the first target simulation environment using a target computing device, and when the first fitness corresponding to the first intermediate solution is less than or equal to the preset first fitness threshold, re-evaluating a new first fitness on the AI accelerator, and generating a new first intermediate solution, until the first iteration number is equal to the first iteration number threshold or the new first fitness is greater than the first fitness threshold, determining the corresponding new first intermediate solution as the target solution, while ensuring the necessary accuracy, making full use of the high throughput characteristics of low-precision devices, and realizing gradient-free evolutionary algorithm operations on AI accelerators with low-precision data formats, thereby expanding the hardware application range of evolutionary learning algorithms.
[0092] In addition, in some embodiments, the evolutionary learning algorithm operation method based on the algorithm operation system provided in the embodiments of the present application also includes but is not limited to the following steps:
[0093] Step S61, when the target computing device is a high-precision computing device, a second target optimization strategy is determined from a preset gradient optimization strategy set based on the target function corresponding to the target algorithm, the dimension of the solution, and the search space range, and a second initial solution for the target algorithm is generated based on the second target optimization strategy;
[0094] Step S62, using the target computing device to evaluate a second fitness of the second initial solution in the second target simulation environment, wherein the second fitness is used to indicate a performance level of the second initial solution in the second target simulation environment;
[0095] Step S63, performing iterative optimization processing on the second initial solution based on the second fitness to obtain a target solution of the target algorithm.
[0096] In addition, in some embodiments, step S63 includes but is not limited to the following steps:
[0097] Step S631, when the second fitness is greater than a preset second fitness threshold, the corresponding second initial solution is determined as the target solution;
[0098] or,
[0099] Step S632, when the second fitness is less than or equal to the second fitness threshold, calculate the gradient information of the second initial solution, and update the search distribution information of the second initial solution, optimize the second initial solution based on the gradient information and the updated search distribution information to obtain a second intermediate solution, and use the target computing device to evaluate the second fitness of the second intermediate solution in the second target simulation environment, and record the second number of iterations, until the second fitness corresponding to the second intermediate solution is greater than the second fitness threshold or the second number of iterations is equal to the second number of iterations threshold, and determine the corresponding second intermediate solution as the target solution.
[0100] Specifically, the embodiments of the present application do not limit the various optimization strategies in the gradient optimization strategy set, and those skilled in the art can set them according to actual needs. For example, the optimization strategy may include a gradient descent algorithm, a batch gradient descent method, an adaptive learning rate method, etc.
[0101] It can be understood that steps S61 to S63 are similar to the technical principles of the above-mentioned steps S20 to S50. The difference is that the target computing device corresponding to steps S61 to S63 is a high-precision computing device, and the corresponding selection source of the second target optimization strategy is a gradient optimization strategy set, which will not be elaborated here.
[0102] Specifically, when the target computing device is a high-precision computing device, the corresponding second iteration termination condition is that the second fitness corresponding to the second initial solution or the second intermediate solution solved by the iterative optimization is greater than the second fitness threshold, or the second iteration number corresponding to the iterative optimization operation reaches the second iteration number threshold. This embodiment does not limit the specific values of the second fitness threshold and the second iteration number threshold, and technical personnel in this field can set them according to actual conditions.
[0103] Understandably, reference Figure 2The right branch of the flowchart, the step of iteratively optimizing the second initial solution based on the above-mentioned second iteration termination condition specifically includes: when the second fitness is greater than the preset second fitness threshold, determining the corresponding second initial solution as the target solution; or, when the second fitness is less than or equal to the second fitness threshold, performing an evolutionary operation on the corresponding second initial solution based on the evolutionary operator to generate a second intermediate solution, and recording the second iteration number of the evolutionary operation; using the target computing device to evaluate the second fitness of the second intermediate solution in the second target simulation environment, when the second fitness corresponding to the second intermediate solution is less than or equal to the preset second fitness threshold, re-evaluating the new second fitness in the AI accelerator, and generating a new second intermediate solution, until the second iteration number is equal to the second iteration number threshold or the new second fitness is greater than the second fitness threshold, and the corresponding new second intermediate solution is determined as the target solution.
[0104] In addition, in order to provide a more detailed explanation of the evolutionary learning algorithm operation method based on the algorithm operation system provided by the present application, the technical solution of the present application is described below with a specific example.
[0105] Example 1: The algorithm operation system includes a hardware-aware problem definition module, a multi-precision adaptive solution set module, a heterogeneous parallel evaluation module, an algorithm adaptive module, and an intelligent task scheduler. In addition, when the target computing device is determined to be an AI accelerator and the first target optimization strategy is a particle swarm optimization (PSO) algorithm, the steps of the evolutionary learning algorithm operation method are as follows:
[0106] (1) In the initialization phase, the hardware perception problem definition module detects that only low-precision AI accelerators are available, determines the target algorithm’s objective function, solution dimension, search space range and other optimization attribute information, and determines the PSO algorithm as the optimization strategy based on the optimization attribute information. The inverted pendulum simulation environment (i.e., the first target simulation environment) is set based on the neural network structure and PSO parameters. The multi-precision adaptive solution set module initializes the particle swarm, and each particle X in the obtained initial particle swarm is i =(x i1 ,x i2 ,…,x iD ) (i.e., the first initial solution) represents a set of neural network weights. The algorithm adaptive module initializes PSO parameters, such as inertia weight w, cognitive learning factor c1, social learning factor c2, and sets the fitness function: runs the neural network controller in the first target simulation environment and returns the equilibrium duration. The intelligent task scheduler evenly distributes the initial particle swarm to the available AI accelerators, that is, deploys the neural network model on the AI accelerator.
[0107] (2) In the iterative optimization phase, for each iteration, the heterogeneous parallel evaluation module evaluates the fitness of each particle in parallel on the AI accelerator. The specific calculation process is as follows: iteratively run the following steps in the first target simulation environment:
[0108] a1. Get the parameters corresponding to the inverted pendulum state (angle, angular velocity, base position, base velocity);
[0109] b1. Use the AI accelerator to perform forward propagation of the neural network and obtain control output;
[0110] c1. Applying the control output to the first target simulation environment;
[0111] d1. Update the state of the first target simulation environment, check whether the balance fails, and use the calculated average balance duration as the fitness.
[0112] The intelligent task scheduler distributes the fitness evaluation tasks of multiple particles in parallel to the available AI accelerators, collects the evaluation results, and returns them to the algorithm adaptation module;
[0113] The algorithm adaptive module updates the individual optimal position of each particle (P Best ), update the global optimal position (g Best ), specifically, the following operations are performed for each particle:
[0114] a2. Update the particle velocity according to the following formula:
[0115]
[0116] in, is the velocity of the ith particle in the dth dimension at time t is the position of the ith particle in the dth dimension at time t, p id is the individual optimal position of the i-th particle in the d-th dimension, g d is the global optimal position of the group in the dth dimension, r1, r2 are random numbers between [0,1];
[0117] b2. Update the particle position according to the following formula:
[0118]
[0119] It is used to handle boundary constraints and ensure that the particle position is within the search space. The multi-precision adaptive solution collection module updates the particle swarm and stores the new generation of particle positions and velocities.
[0120] (3) Termination check: The hardware-aware problem definition module checks whether the particle swarm corresponding to the latest iteration number has reached the first iteration termination condition (i.e., whether the maximum number of iterations has been reached or whether the fitness meets the preset fitness threshold).
[0121] (4) Result output: the multi-precision adaptive solution set module extracts the global optimal solution g Best , i.e. the optimal neural network weights, the hardware-aware problem definition module receives the global optimal solution, performs precision conversion and result interpretation, uses the optimal weights to build the final neural network controller, tests it in the first target simulation environment, and outputs the results (i.e. the target solution).
[0122] In addition, the embodiment of the present application also discloses an algorithm operation system, including:
[0123] High-precision computing equipment;
[0124] AI accelerators;
[0125] a target computing device determination module, configured to determine, in response to a request to run a target algorithm, a first resource occupancy state of a high-precision computing device and a second resource occupancy state of an AI accelerator, and to determine a target computing device from the high-precision computing device and the AI accelerator based on the first resource occupancy state and the second resource occupancy state, wherein the target algorithm is used to indicate an evolutionary learning algorithm to be run;
[0126] A multi-precision adaptive solution module, used for determining optimization attribute information of a target algorithm when the target computing device is an AI accelerator, wherein the optimization attribute information includes an objective function for solving the target algorithm, a dimension of a solution for the target algorithm, and a search space range, determining a first target optimization strategy from a preset set of gradient-free optimization strategies based on the objective function, the dimension of the solution, and the search space range, and generating a first initial solution for the target algorithm based on the first target optimization strategy;
[0127] A target solution calculation module is used to evaluate the first fitness of the first initial solution in the first target simulation environment using a target computing device, wherein the first fitness is used to indicate the performance of the first initial solution in the first target simulation environment, and iteratively optimize the first initial solution based on a preset evolutionary operator and the first fitness to obtain a target solution of the target algorithm.
[0128] In some embodiments, the algorithm execution system further includes:
[0129] A task scheduling module is used to determine the target number of target computing devices when the target solution computing module executes the operation of evaluating the first fitness of each first initial solution in the first target simulation environment by using the target computing device, group the first initial solutions based on the target number, and obtain multiple reference solution sets, wherein each reference solution set includes at least one first initial solution, each first initial solution corresponds to one first fitness evaluation task in the first target simulation environment, the number of reference solution sets is equal to the number of target computing devices, and each first fitness evaluation task corresponding to each reference solution set is allocated to each corresponding target computing device to obtain each corresponding first fitness.
[0130] In some embodiments, the multi-precision adaptive solution module is further used to:
[0131] When the target computing device is a high-precision computing device, a second target optimization strategy is determined from a preset gradient optimization strategy set based on the objective function, solution dimension and search space range corresponding to the target algorithm, and a second initial solution for the target algorithm is generated based on the second target optimization strategy.
[0132] In some embodiments, the target solution calculation module is further configured to:
[0133] The target computing device is used to evaluate the second fitness of the second initial solution in the second target simulation environment, wherein the second fitness is used to indicate the performance degree of the second initial solution in the second target simulation environment, and the second initial solution is iteratively optimized based on the second fitness to obtain the target solution of the target algorithm.
[0134] It should be noted that the specific implementation of the algorithm operation system is basically the same as the specific implementation example of the evolutionary learning algorithm operation method based on the algorithm operation system, and will not be repeated here.
[0135] like Figure 3 As shown, Figure 3 3 is a structural diagram of an algorithm operation system provided by an embodiment of the present application. The present invention also provides an algorithm operation system 300, including:
[0136] The processor 310 may be implemented by a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0137] The memory 320 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 320 can store an operating system and other applications. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 320, and the processor 310 calls and executes the evolutionary learning algorithm operation method based on the algorithm operation system of the embodiment of this application;
[0138] Input / output interface 330, used to implement information input and output;
[0139] Communication interface 340, used to realize communication interaction between the apparatus and other devices, which can be realized by wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.);
[0140] bus 350 , which transmits information between the various components of the device (e.g., processor 310 , memory 320 , input / output interface 330 , and communication interface 340 );
[0141] The processor 310 , the memory 320 , the input / output interface 330 and the communication interface 340 are connected to each other in communication within the device via the bus 350 .
[0142] In addition, an embodiment of the present application further provides a storage medium, which is a computer-readable storage medium and stores a computer program. When the computer program is executed by a processor, the above-mentioned evolutionary learning algorithm operation method based on the algorithm operation system is implemented.
[0143] As a non-transient computer-readable storage medium, the memory can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage devices. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. The device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and are implemented to be located in one place, or may also be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.
[0144] It will be appreciated by those skilled in the art that all or some of the steps and systems in the disclosed method above may be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that may be used to store desired information and may be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media generally include computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0145] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the above-mentioned implementation mode. Technical personnel familiar with the field can also make various equivalent deformations or substitutions under the shared conditions without violating the spirit of the present invention. These equivalent deformations or substitutions are all included in the scope defined by the claims of the present invention.
Claims
1. An evolutionary learning algorithm operation method based on an algorithm operation system, It is characterized in that Applied to an algorithm operation system, the algorithm operation system includes a high-precision computing device and an AI accelerator, and the method includes: In response to a request to run a target algorithm, determine a first resource occupancy state of the high-precision computing device and a second resource occupancy state of the AI accelerator, and determine a target computing device from the high-precision computing device and the AI accelerator based on the first resource occupancy state and the second resource occupancy state, wherein the target algorithm is used to indicate an evolutionary learning algorithm to be run; When the target computing device is the AI accelerator, determining optimization attribute information of the target algorithm, wherein the optimization attribute information includes an objective function for solving the target algorithm, a dimension of a solution for the target algorithm, and a search space range; Determining a first objective optimization strategy from a preset set of gradient-free optimization strategies based on the objective function, the dimension of the solution, and the search space range, and generating a first initial solution for the target algorithm based on the first objective optimization strategy; Using the target computing device to evaluate a first fitness of the first initial solution in a first target simulation environment, wherein the first fitness is used to indicate a performance level of the first initial solution in the first target simulation environment; The first initial solution is iteratively optimized based on a preset evolutionary operator and the first fitness to obtain a target solution of the target algorithm.
2. The evolutionary learning algorithm operation method based on the algorithm operation system according to claim 1, It is characterized in that There are a plurality of high-precision computing devices, each of which corresponds to the first resource occupancy state; there are a plurality of AI accelerators, each of which corresponds to the second resource occupancy state; and determining a target computing device from the high-precision computing devices and the AI accelerators based on the first resource occupancy state and the second resource occupancy state includes: Determine the algorithm type, input data type and performance requirement information of the target algorithm from the execution request; Determine a first candidate device from the high-precision computing devices based on the algorithm type, the input data type, and the performance requirement information; When the first resource occupancy state of the first candidate device indicates that the first candidate device is in an occupied state, determining a second candidate device from the AI accelerator based on the algorithm type, the input data type, and the performance requirement information; When the second resource occupation state of the second candidate device indicates that the second candidate device is in an unoccupied state, the second candidate device is determined as the target computing device.
3. The evolutionary learning algorithm operation method based on the algorithm operation system according to claim 1, It is characterized in that There are multiple target computing devices, and there are multiple first initial solutions. Using the target computing devices to evaluate the first fitness of each of the first initial solutions in the first target simulation environment includes: Determine a target number of the target computing devices, group the first initial solutions based on the target number, and obtain a plurality of reference solution sets, wherein each of the reference solution sets includes at least one of the first initial solutions, each of the first initial solutions corresponds to one first fitness evaluation task in the first target simulation environment, and the number of the reference solution sets is equal to the number of the target computing devices; Allocate each of the first fitness evaluation tasks corresponding to each of the reference solution sets to each of the corresponding target computing devices to obtain each of the corresponding first fitnesses.
4. The evolutionary learning algorithm operation method based on the algorithm operation system according to claim 1, It is characterized in that Iteratively optimizing each of the first initial solutions based on a preset evolutionary operator and each of the first fitnesses to obtain a target solution of the target algorithm includes: When the first fitness is greater than a preset first fitness threshold, determining the corresponding first initial solution as the target solution; or, When the first fitness is less than or equal to the first fitness threshold, performing an evolution operation on the corresponding first initial solution based on the evolution operator to generate a first intermediate solution, and recording a first iteration number of the evolution operation; The target computing device is used to evaluate the first fitness of the first intermediate solution in the first target simulation environment. When the first fitness corresponding to the first intermediate solution is less than or equal to a preset first fitness threshold, the evolution operation is re-performed, the new first fitness is re-evaluated, and a new first intermediate solution is generated until the first iteration number is equal to the first iteration number threshold or the new first fitness is greater than the first fitness threshold, and the corresponding new first intermediate solution is determined as the target solution.
5. The evolutionary learning algorithm operation method based on the algorithm operation system according to claim 1, It is characterized in that The method further comprises: When the target computing device is the high-precision computing device, determining a second target optimization strategy from a preset gradient optimization strategy set based on the target function corresponding to the target algorithm, the dimension of the solution, and the search space range, and generating a second initial solution for the target algorithm based on the second target optimization strategy; Using the target computing device to evaluate a second fitness of the second initial solution in a second target simulation environment, wherein the second fitness is used to indicate a performance level of the second initial solution in the second target simulation environment; The second initial solution is iteratively optimized based on the second fitness to obtain the target solution of the target algorithm.
6. The evolutionary learning algorithm operation method based on the algorithm operation system according to claim 5, It is characterized in that Performing iterative optimization processing on the second initial solution based on the second fitness to obtain the target solution of the target algorithm includes: When the second fitness is greater than a preset second fitness threshold, determining the corresponding second initial solution as the target solution; or, When the second fitness is less than or equal to the second fitness threshold, the gradient information of the second initial solution is calculated, and the search distribution information of the second initial solution is updated, and the second initial solution is optimized based on the gradient information and the updated search distribution information to obtain a second intermediate solution, and the target computing device is used to evaluate the second fitness of the second intermediate solution in the second target simulation environment, and the second number of iterations is recorded until the second fitness corresponding to the second intermediate solution is greater than the second fitness threshold or the second number of iterations is equal to the second number of iterations threshold, and the corresponding second intermediate solution is determined as the target solution.
7. An algorithm operation system, It is characterized in that include: High-precision computing equipment; AI accelerators; a target computing device determination module, configured to determine, in response to a request to execute a target algorithm, a first resource occupancy state of the high-precision computing device and a second resource occupancy state of the AI accelerator, and determine a target computing device from the high-precision computing device and the AI accelerator based on the first resource occupancy state and the second resource occupancy state, wherein the target algorithm is used to indicate an evolutionary learning algorithm to be executed; A multi-precision adaptive solution module, used for determining optimization attribute information of the target algorithm when the target computing device is the AI accelerator, wherein the optimization attribute information includes an objective function for solving the target algorithm, a dimension of a solution for the target algorithm, and a search space range, determining a first target optimization strategy from a preset gradient-free optimization strategy set based on the objective function, the dimension of the solution, and the search space range, and generating a first initial solution for the target algorithm based on the first target optimization strategy; A target solution calculation module is used to use the target computing device to evaluate the first fitness of the first initial solution in the first target simulation environment, wherein the first fitness is used to indicate the performance of the first initial solution in the first target simulation environment, and to iteratively optimize the first initial solution based on a preset evolutionary operator and the first fitness to obtain a target solution of the target algorithm.
8. The algorithm operation system according to claim 7, It is characterized in that Also includes: A task scheduling module is used to determine the target number of the target computing devices when the target solution calculation module executes the operation of evaluating the first fitness of each first initial solution in the first target simulation environment by using the target computing device, and group the first initial solutions based on the target number to obtain multiple reference solution sets, wherein each reference solution set includes at least one first initial solution, each first initial solution corresponds to one first fitness evaluation task in the first target simulation environment, the number of the reference solution sets is equal to the number of the target computing devices, and each first fitness evaluation task corresponding to each reference solution set is allocated to the corresponding target computing device to obtain the corresponding first fitness.
9. An algorithmic operation system, It is characterized in that It includes at least one control processor and a memory for communicating with the at least one control processor; the memory stores instructions that can be executed by the at least one control processor, and the instructions are executed by the at least one control processor to enable the at least one control processor to execute the evolutionary learning algorithm operation method based on the algorithm operation system as described in any one of claims 1 to 6.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the evolutionary learning algorithm operation method based on the algorithm operation system as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Method and device for adaptively accelerating operator fusion
CN115659281A
AI algorithm acceleration method, device and equipment and readable storage medium
CN118536565A
Machine learning model scaling system with energy efficient network data transfer for power aware hardware
US20220036123A1
