Equipment parameter adjusting method and system, equipment, server, product and medium
Adjust the batch processing of GPU through particle group optimization algorithms, solve the problem of how to optimize the energy efficiency and performance of GPU, achieve the balance of energy efficiency and delay, and improve the efficiency of computing devices and the competitiveness of cloud computing services.
Patent Information
- Application Number
- CN202411976961.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2044-12-31
AI Technical Summary
In the age of cloud computing, how to optimize GPU's energy efficiency and performance and find the best batch size and core frequency configuration to balance GPU's energy efficiency and latency.
By obtaining multiple batch processing size and kernel frequency combination of computing devices, use particle group optimization algorithm to initialize the position of the particles. To obtain prediction and actual performance performance value according to the position of the particles, the particle location is updated until the end of the iteration is met, and the optimal solution is finally based on the optimal solution. The batch processing size and kernel frequency combination control the operation of the computing equipment.
The energy efficiency and delay of computing equipment have been achieved, the work efficiency of computing equipment is improved, operating costs are reduced, and the competitiveness of cloud computing services has been enhanced.
Smart Images

Figure CN119376959A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of servers, and in particular to a device parameter adjustment method, system, device, server, product and medium. Background Art
[0002] In the era of cloud computing, the demand for GPU (Graphics Processing Unit) accelerated reasoning continues to rise, and optimizing GPU energy efficiency and performance has become critical. Batch size and kernel frequency are key parameters for adjusting GPU performance. Adjusting the batch size affects the GPU's memory utilization and parallel processing efficiency, while adjusting the GPU's kernel frequency directly affects the processing speed and energy consumption. Therefore, finding the optimal batch size and kernel frequency configuration to balance GPU energy efficiency and latency is a problem that technicians in this field currently need to solve. Summary of the invention
[0003] The purpose of the present invention is to provide a device parameter adjustment method, system, device, server, product and medium, which can balance the energy efficiency and delay of computing devices, improve the working efficiency of computing devices, reduce operating costs, and enhance the competitiveness of cloud computing services.
[0004] In order to solve the above technical problems, the present invention provides a device parameter adjustment method, including: obtaining multiple batch processing size and kernel frequency combinations of a computing device; initializing the positions of multiple particles in a particle group based on the multiple batch processing size and kernel frequency combinations; for each particle in the multiple particle groups, according to the position of the particle in this iteration, obtaining the predicted performance value and the actual performance value of the computing device in this iteration, updating the position of the particle in the next iteration based on the predicted performance value and the actual performance value, and repeating this step until the iteration end condition is met; taking the particle corresponding to the optimal actual performance value when the iteration end condition is met as the optimal solution, and controlling the operation of the computing device according to the batch processing size and kernel frequency combination in the optimal solution.
[0005] Optionally, the process of obtaining the actual performance value of the computing device according to the position of the particle in this iteration includes: determining the current batch size and kernel frequency combination at the position of the particle in this iteration; and obtaining the actual performance value of the computing device running under the current batch size and kernel frequency combination.
[0006] Optionally, the process of obtaining the predicted performance value of the computing device according to the position of the particle in this iteration includes: inputting the position of the particle in consecutive preset iterations including this iteration and the corresponding actual performance value into a timing network to obtain the predicted performance value of the computing device in this iteration.
[0007] Optionally, the process of updating the position of the particle in the next iteration based on the predicted performance value and the actual performance value includes: determining the individual optimal position of the particle in this iteration based on the actual performance value of the particle in this iteration; determining the global optimal position in this iteration based on the individual optimal positions of each particle in the particle group in this iteration; and updating the position of the particle in the next iteration according to the predicted performance value, the actual performance value, the individual optimal position, and the global optimal position.
[0008] Optionally, the process of determining the individual best position of the particle in this iteration based on the actual performance value of the particle in this iteration includes: judging whether the actual performance value of the particle in this iteration is greater than the actual performance value corresponding to the individual best position of the particle in the previous iteration; if so, determining the position of the particle in this iteration as the individual best position of the particle in this iteration; if not, determining the individual best position of the particle in the previous iteration as the individual best position of the particle in this iteration.
[0009] Optionally, based on the individual best positions of each particle in the particle swarm in this iteration, the process of determining the global best position in this iteration includes: determining the maximum value of actual performance values corresponding to the individual best positions of each particle in the particle swarm in this iteration; and determining the individual best position corresponding to the maximum value as the global best position in this iteration.
[0010] Optionally, the process of updating the position of the particle in the next iteration according to the predicted performance value, the actual performance value, the individual best position, and the global best position includes: obtaining gradient information corresponding to the position of the particle in this iteration; updating the position of the particle in the next iteration according to the predicted performance value, the actual performance value, the individual best position, the global best position and the gradient information.
[0011] Optionally, the process of updating the position of the particle in the next iteration according to the predicted performance value, the actual performance value, the individual optimal position, the global optimal position and the gradient information includes: updating the speed of the particle in the next iteration according to a speed update relation, wherein the speed update relation is: ; Update the position of the particle in the next iteration according to the position update relationship, the position update relationship is ; Wherein, j is the number of the particle, w is the inertia weight, c1, c2, c3, c4 are all learning factors, r1, r2, r3, r4 are all random numbers, is the velocity of the particle in the next iteration, is the predicted performance value of the particle in this iteration, Gradient j is the gradient information corresponding to the position of the particle in this iteration, is the position of the particle in the next iteration, is the position of the particle in this iteration, V j is the velocity of the particle in this iteration, P best,j is the individual best position of the particle in this iteration, G best is the global best position in this iteration, f(X j ) is the actual performance value of the particle in this iteration.
[0012] Optionally, after obtaining multiple batch size and kernel frequency combinations of the computing device, the device parameter adjustment method also includes: calculating the actual performance value of the computing device under each batch size and kernel frequency combination; filling the position points of a preset two-dimensional grid based on the multiple batch size and kernel frequency combinations and their corresponding actual performance values to obtain a current energy efficiency gradient map; for each position point on the current energy efficiency gradient map, calculating the gradient information corresponding to the position point; the process of obtaining the gradient information corresponding to the position of the particle in this iteration includes: determining the current batch size and kernel frequency combination in the position of the particle in this iteration; determining the target position point corresponding to the current batch size and kernel frequency combination on the current energy efficiency gradient map; and using the gradient information corresponding to the target position point as the gradient information corresponding to the position of the particle in this iteration.
[0013] Optionally, for each of the position points on the current energy efficiency gradient map, the process of calculating the gradient information corresponding to the position point includes: for each of the position points on the current energy efficiency gradient map, determining the first adjacent point and the second adjacent point corresponding to the position point on the current energy efficiency gradient map; the kernel frequency of the first adjacent point is the same as the kernel frequency of the position point, the batch size of the first adjacent point is different from the batch size of the position point, the kernel frequency of the second adjacent point is different from the kernel frequency of the position point, and the batch size of the second adjacent point is the same as the batch size of the position point; calculating the first gradient value of the position point based on the actual performance value of the first adjacent point and the actual performance value of the position point; calculating the second gradient value of the position point based on the actual performance value of the second adjacent point and the actual performance value of the position point; and obtaining the gradient information corresponding to the position point using the first gradient value and the second gradient value.
[0014] Optionally, the process of calculating the first gradient value of the location point based on the actual performance value of the first neighboring point and the actual performance value of the location point includes: obtaining a first difference between the actual performance value of the first neighboring point and the actual performance value of the location point; obtaining a first increment between the batch size of the first neighboring point and the batch size of the location point; and calculating a first gradient value based on the first difference and the first increment.
[0015] Optionally, the process of calculating the second gradient value of the location point based on the actual performance value of the second neighboring point and the actual performance value of the location point includes: obtaining a second difference between the actual performance value of the second neighboring point and the actual performance value of the location point; obtaining a second increment between the kernel frequency of the second neighboring point and the kernel frequency of the location point; and calculating a second gradient value based on the second difference and the second increment.
[0016] Optionally, the process of calculating the actual performance value of the computing device under each combination of the batch size and the kernel frequency includes: for each combination of the batch size and the kernel frequency, obtaining the energy efficiency data and delay data of the computing device under the combination of the batch size and the kernel frequency, and calculating the actual performance value under the combination of the batch size and the kernel frequency based on the energy efficiency data and the delay data.
[0017] Optionally, the process of calculating the actual performance value under the combination of the batch size and the kernel frequency based on the energy efficiency data and the delay data includes: calculating the actual performance value under the combination of the batch size and the kernel frequency based on a first relationship, wherein the first relationship is ;in, For the batch size and kernel frequency combination, is the actual performance value for the batch size and kernel frequency combination, is the energy efficiency data for the batch size and kernel frequency combination, is the latency data for the batch size and kernel frequency combination, is the first preset weight value, is the second preset weight value.
[0018] Optionally, the iteration termination condition includes reaching a maximum number of iterations, or a change in an actual performance value corresponding to a global optimal position in consecutive preset iterations including the current iteration is less than a preset threshold.
[0019] In order to solve the above technical problems, the present invention also provides a device parameter adjustment system, including: an acquisition module, used to acquire multiple batch processing size and kernel frequency combinations of a computing device; an initialization module, used to initialize the positions of multiple particles in a particle group based on the multiple batch processing size and kernel frequency combinations; an iterative update module, used to obtain, for each particle in the multiple particle groups, a predicted performance value and an actual performance value of the computing device in this iteration according to the position of the particle in this iteration, update the position of the particle in the next iteration based on the predicted performance value and the actual performance value, and repeat this step until the iteration end condition is met; a configuration module, used to take the particle corresponding to the optimal actual performance value when the iteration end condition is met as the optimal solution, and control the operation of the computing device according to the batch processing size and kernel frequency combination in the optimal solution.
[0020] To solve the above technical problems, the present invention further provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the device parameter adjustment method as described in any one of the above.
[0021] To solve the above technical problems, the present invention further provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of the device parameter adjustment method as described in any one of the above when executing the computer program.
[0022] In order to solve the above technical problem, the present invention also provides a server, including multiple computing devices and the electronic device mentioned above.
[0023] To solve the above technical problems, the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the device parameter adjustment method as described in any one of the above are implemented.
[0024] The present invention provides a device parameter adjustment method. First, multiple batch sizes and kernel frequency combinations of a computing device are obtained, and a particle swarm optimization algorithm is used to initialize the position of each particle to a different batch size and kernel frequency combination, so as to provide a diverse initial population for searching for an optimal configuration, which helps to avoid a local optimal solution. In each iteration, the predicted performance value and the actual performance value of the current position of the particle (i.e., a specific batch size and kernel frequency combination) are evaluated. By comparing the predicted and actual performance, the next movement of the particle can be more accurately guided, so as to converge to the optimal solution more quickly. Through iterative updating, the particle gradually approaches the optimal batch size and kernel frequency combination, so as to realize dynamic optimization of the configuration of the computing device. After all iterations are completed, a particle with the best performance value is selected, and its position is the optimal configuration. The optimal batch size and kernel frequency combination finally determined can balance the energy efficiency and delay of the computing device, which not only improves the working efficiency of the computing device, but also reduces the operating cost and enhances the competitiveness of cloud computing services.
[0025] The present invention also provides a device parameter adjustment system, a computer program product, an electronic device, a server and a computer-readable storage medium. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0027] Figure 1 The present invention provides a flow chart of the steps of a method for adjusting device parameters.
[0028] Figure 2 This is a structural schematic diagram of a device parameter adjustment system provided by the present invention.
[0029] Figure 3 The present invention is a schematic structural diagram of an electronic device provided by the present invention.
[0030] Figure 4 This is a schematic diagram of the structure of a computer-readable storage medium provided by the present invention. DETAILED DESCRIPTION
[0031] The core of the present invention is to provide a device parameter adjustment method, system, device, server, product and medium, which can balance the energy efficiency and delay of computing devices, improve the working efficiency of computing devices, reduce operating costs, and enhance the competitiveness of cloud computing services.
[0032] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0033] First, please refer to Figure 1 The present invention provides a method for adjusting device parameters, comprising:
[0034] S101: Obtain multiple batch size and kernel frequency combinations of a computing device.
[0035] In this embodiment, the computing device is a computing device in a server, including but not limited to a GPU, FPGA (Field-Programmable Gate Array), etc. The server may be a server deployed in a cloud computing center. It can be understood that when the computing device operates under different batch sizes and kernel frequency combinations, its energy efficiency and latency will vary. In order to determine a batch size and kernel frequency combination that can balance energy efficiency and latency, this embodiment obtains multiple possible batch sizes and kernel frequency combinations of the computing device. Any batch size and kernel frequency combination can be expressed in the following form (batchsize, f i ), where b represents the batch size, f i As an optional embodiment, before selecting multiple batch sizes and kernel frequencies, the batch size range (batchsize min , batchsize min ) and the core frequency range [f min , f max ], multiple batch sizes are determined within the batch size range, multiple kernel frequencies are determined within the kernel frequency range, and then multiple batch sizes and multiple kernel frequencies are arranged and combined to obtain multiple batch size and kernel frequency combinations (batchsize, f i ).
[0036] Specifically, after determining the batch size range and the kernel frequency range, a reasonable increment is determined for each increase in the batch size and the kernel frequency. For example, the batch size can be increased by 1, 4, or 8 each time, depending on the overall range and the expected number of data points, and the kernel frequency increment can be set according to the frequency step size of the computing device. The increment can be fixed or dynamically changed, and can be set according to actual engineering needs. This embodiment does not limit this. After determining the increment, it is possible to determine multiple batch sizes (b1, b2, ...b m ) where b1=b min , b m =b max Similarly, multiple core frequencies (f1, f2, ... f n ) where f1=f min , f n =f max After determining the multiple kernel frequencies and the multiple batch sizes, the multiple batch sizes and the multiple kernel frequencies are arranged and combined to generate multiple batch size and kernel frequency combinations.
[0037] As an optional embodiment, you can choose to fix a batch size first, then traverse all kernel frequencies, then adjust the batch size, traverse all kernel frequencies again, and so on, until all batch sizes are fixed once. For example, you can first fix b1, then traverse all kernel frequencies, and the resulting batch size and kernel frequency combinations include (b1, f1), (b1, f2) ..., (b1, f n ), then fix b2, and then traverse all kernel frequencies, the resulting batch size and kernel frequency combinations include (b2, f1), (b2, f2)..., (b2, f n ), and so on, until b is fixed m , and traverse all kernel frequencies to obtain batch size and kernel frequency combinations including (b m , f1), (b m , f2)……、(b m , f n ). Another strategy is to fix a frequency, iterate over all batch sizes, and then change the kernel frequency and repeat this process until f is reached. max The process of obtaining the batch size and kernel frequency combination is the same as above, and will not be repeated here in this embodiment.
[0038] S102: Initialize positions of multiple particles in the particle swarm based on multiple batch sizes and kernel frequency combinations.
[0039] In this embodiment, the particle swarm algorithm is used to find the optimal batch size and kernel frequency combination. First, the particle swarm size (N) is determined, that is, the total number of particles in the particle swarm is selected. Then, the search space is defined. The search space can be the possible range of batch size and kernel frequency. For example, the batch size range [batchsize min , batchsize max ], kernel frequency range [f min , f max ], firstly, the position X of each particle j (j=1,2,…,N) in the particle swarm is calculated based on multiple batch sizes and kernel frequencies. j and speed V j Initialize.
[0040] That is, for each particle j, a batch size and kernel frequency combination is randomly selected as its initial position X j_0 =[batchsize j_0 , f i,j_0 ]; where batchsize j_0 batchsize min , batchsize max ] a random value in the range, f i,j_0 for [f min , f max ] is a random value in the range.
[0041] For each particle j, randomly initialize its velocity V j_0 :V j_0 =[v batchsizej_0 , v fi,j_0 ]; It can be understood that the velocity of a particle can represent the movement trend of the particle in the search space. As an optional embodiment, the velocity can be limited to a certain preset range to ensure that the particle does not move excessively in the search space. batchsizej_0 is the particle at the position X j_0 The rate of change of batch size, v fi,j_0 is the particle at the position X j_0 The rate of change of the core frequency when .
[0042] The above completes the initialization of each particle in the particle swarm. Through random initialization, each particle represents a potential solution in the search space. The particle swarm starts searching from different starting points, which ensures that the particle swarm algorithm can fully cover the search space at the beginning and explore different batch sizes and kernel frequency combinations, so that the optimal batch size and kernel frequency combination can be found by iteratively updating the position of the particles.
[0043] S103: For each particle in the plurality of particle groups, according to the position of the particle in this iteration, obtain the predicted performance value and the actual performance value of the computing device in this iteration, update the position of the particle in the next iteration based on the predicted performance value and the actual performance value, and repeat this step until the iteration end condition is met.
[0044] In this embodiment, one particle in a particle group is taken as an example for explanation, and the iterative updating process of the speed and position of other particles is similar.
[0045] First, get the position X of particle j in this iteration j_c =(batchsize j_c , f i,j_c ), c represents this iteration, X j_c is the position of particle j in this iteration, batchsize j_c is the batch size of particle j in this iteration, f i,j_c is the kernel frequency of particle j in this iteration. Then based on the batch size and kernel frequency combination of particle j in this iteration (batchsize j_c , f i,j_c ) controls the operation of the computing device and obtains the batch size and kernel frequency combination of the computing device (batchsize j_c , f i,j_c ), including but not limited to energy efficiency and delay time, and the actual performance value of the computing device in this iteration is calculated based on energy efficiency and delay time. At the same time, the position X of particle j in this iteration is calculated. j_c Input a pre-established temporal network (such as LSTM (Long Short-Term Memory)), the input of which at least includes the position X of particle j in this iteration j_c , the timing network predicts the performance indicators of the computing device in this iteration, including but not limited to the predicted energy efficiency and the predicted delay time, and then calculates and outputs the predicted performance value based on the predicted energy efficiency and the predicted delay time. It can be understood that the difference between the predicted performance indicator and the actual performance indicator of the computing device in this iteration is used to update the position of particle j in the next iteration, and the above steps are repeated until the iteration end conditions are met. These conditions may include reaching the maximum number of iterations, the improvement of the performance indicator is lower than a certain threshold, or a satisfactory performance value is found. This process ensures that the particle swarm algorithm can dynamically adjust the search strategy according to the actual and predicted performance values, so as to search for the optimal solution more effectively. By combining the actual performance and the prediction model, the particle swarm algorithm can converge to a good solution more quickly and reduce the dependence on actual hardware testing.
[0046] S104: The particle corresponding to the optimal actual performance value when the iteration end condition is met is taken as the optimal solution, and the operation of the computing device is controlled according to the batch size and kernel frequency combination in the optimal solution.
[0047] It can be understood that during the iteration process, each particle will continuously update its position and record its best performance value in history (individual optimal solution P best At the same time, the entire particle swarm will also record the best individual optimal solution among all particles, that is, the global optimal solution (G best ).
[0048] The particle swarm algorithm will continue to iterate until the preset end conditions are met. These conditions may include: reaching a predetermined maximum number of iterations, the performance improvement is lower than a certain threshold, indicating that there is limited room for further optimization, and finding a solution that meets specific performance requirements. Once the iteration end conditions are met, the particle with the best actual performance value is selected from all particles as the optimal solution. From the selected optimal particle, the combination of its batch size and kernel frequency is extracted, and these parameters correspond to the optimal actual performance value. Use the batch size and kernel frequency combination in the optimal solution to configure and control the operation of the computing device, that is, apply these parameters to the actual hardware or software environment in the hope of obtaining the best performance.
[0049] In this way, the particle swarm optimization algorithm not only helps find the theoretically optimal parameter combination, but also transforms these theoretical results into practical applications, thereby improving the performance and efficiency of computing devices to adapt to scenarios that require finding the best configuration among multiple parameter combinations, such as cloud computing, high-performance computing, and big data processing.
[0050] It can be seen that in this embodiment, first, multiple batch sizes and kernel frequency combinations of the computing device are obtained, and the particle swarm optimization algorithm is used to initialize the position of each particle to a different batch size and kernel frequency combination, which provides a diverse initial population for searching the optimal configuration and helps to avoid local optimal solutions. In each iteration, the predicted performance value and the actual performance value of the current position of the particle (i.e., a specific batch size and kernel frequency combination) are evaluated. By comparing the predicted and actual performance, the next movement of the particle can be more accurately guided, thereby converging to the optimal solution faster. Through iterative updates, the particles gradually approach the optimal batch size and kernel frequency combination, thereby realizing dynamic optimization of the configuration of the computing device. After all iterations are completed, the particle with the best performance value is selected, and its position is the optimal configuration. The optimal batch size and kernel frequency combination finally determined can balance the energy efficiency and latency of the computing device, which not only improves the working efficiency of the computing device, but also reduces the operating cost and enhances the competitiveness of cloud computing services.
[0051] Based on the above embodiments:
[0052] In an exemplary embodiment, the process of obtaining the predicted performance value of the computing device according to the position of the particle in this iteration includes: inputting the position of the particle in consecutive preset iterations including the current iteration and the corresponding actual performance value into the timing network to obtain the predicted performance value of the computing device in this iteration.
[0053] In this embodiment, the preset number of iterations is first determined, that is, how many consecutive iterations need to be considered to predict the performance value of the current iteration. The input parameters of the timing network include the position X in this iteration. j_c and its corresponding actual performance value, and also includes the position and its corresponding actual performance value in the consecutive preset iterations before this iteration. For the case where the preset number of times is 2, the data to be collected include: the position X of particle j in this iteration (iteration c) j_c and its corresponding actual performance value, including the position X of particle j in the previous iteration (iteration c-1) j_c-1 and its corresponding actual performance value, the position X of particle j in the previous iteration (iteration c-2) j_c-2 and its corresponding actual performance values. The above collected data constitute a historical parameter setting sequence and are input into the timing network. The timing network can process these sequence data and consider the time dependency, so as to predict the predicted performance value of the computing device in this iteration. This prediction takes into account the historical changes in the position of particle j and the corresponding performance values, and can provide more accurate predictions.
[0054] It can be understood that the timing network can capture the impact of particle position changes on the performance value of the computing device and predict the performance value of future iterations. It is suitable for scenarios where there is a time dependency between the performance value and the position of the particle, and can improve the efficiency and accuracy of the optimization process.
[0055] In an exemplary embodiment, the process of updating the position of a particle in the next iteration based on the predicted performance value and the actual performance value includes: determining the individual best position of the particle in this iteration based on the actual performance value of the particle in this iteration; determining the global best position in this iteration based on the individual best positions of each particle in the particle group in this iteration; and updating the position of the particle in the next iteration according to the predicted performance value, the actual performance value, the individual best position, and the global best position.
[0056] Among them, the process of determining the individual best position of the particle in this iteration based on the actual performance value of the particle in this iteration includes: judging whether the actual performance value of the particle in this iteration is greater than the actual performance value corresponding to the individual best position of the particle in the previous iteration; if so, determining the position of the particle in this iteration as the individual best position of the particle in this iteration; if not, determining the individual best position of the particle in the previous iteration as the individual best position of the particle in this iteration.
[0057] The process of determining the global best position in this iteration based on the individual best position of each particle in the particle swarm in this iteration includes: determining the maximum value of the actual performance value corresponding to the individual best position of each particle in the particle swarm in this iteration; and determining the individual best position corresponding to the maximum value as the global best position in this iteration.
[0058] In this embodiment, for each particle j, the individual optimal position P is determined according to its actual performance value in this iteration. best,j , this position is the position where particle j obtains the best actual performance value as of this iteration. In the entire particle group, compare the individual best positions of all particles to determine the global best position (G best ), the global optimal position is the position where the best actual performance value is obtained in the history of the entire particle swarm.
[0059] According to the predicted performance value, actual performance value, and individual best position of particle j (P best,j ) and the global optimal position (G best ), update the position of particle j in the next iteration. The update of particle velocity takes into account the current velocity of the particle, the distance from the current position of the particle to the individual best position, and the distance from the current position of the particle to the global best position. The update of particle position is based on the updated velocity.
[0060] For example, suppose that in the cth iteration, the position of particle j is X j_c =[batchsize j_c ,f i,j_c ], its actual performance value is p c,j The best individual position of particle j in the c-1th iteration is P best,j =[batchsize j_best ,f i,j_best ], and its corresponding actual performance value is p best,j , if p c,j >p best,j , then X j_c =[batchsize j_c ,f i,j_c] is the new individual optimal position of particle j, that is, X j_c =[batchsize j_c ,f i,j_c ] is the individual best position P of particle j in this iteration best,j , if p c,j ≤p best,j , then keep the individual best position P of the previous iteration best,j =[batchsize best,j ,f i,best,j ] is the individual best position of particle j in this iteration, and the global best position G in this iteration best Similarly, in the entire particle swarm, the actual performance values corresponding to the individual best positions of all particles are compared, the maximum value among these values is determined, and the corresponding individual best position is found. This position is determined as the global best position of this iteration.
[0061] Through this process, the particle swarm optimization algorithm can dynamically adjust the positions of particles to find the optimal batch size and kernel frequency combination, thereby optimizing the performance of the computing device, while enabling the particle swarm optimization algorithm to adaptively search the solution space and gradually approach the optimal solution.
[0062] In an exemplary embodiment, the process of updating the position of the particle in the next iteration according to the predicted performance value, the actual performance value, the individual best position, and the global best position includes: obtaining gradient information corresponding to the position of the particle in this iteration; updating the position of the particle in the next iteration according to the predicted performance value, the actual performance value, the individual best position, the global best position and the gradient information.
[0063] In this embodiment, for the position X of particle j in this iteration, j_c =[batchsize j_c ,f i,j_c ] calculates the gradient information of the corresponding actual performance value. The gradient information provides local information about the parameter changes of the performance value relative to the position of particle j, so as to adjust the position of the particle more accurately and make the particle move faster in the direction of increasing performance value. By introducing gradient information, the particle swarm optimization algorithm can search the solution space more effectively, especially when the performance value function is more complex or nonlinear. This method combines the global search capability of the particle swarm optimization algorithm and the local search capability of the gradient descent method, improving the performance and robustness of the algorithm.
[0064] In an exemplary embodiment, the process of updating the position of the particle in the next iteration according to the predicted performance value, the actual performance value, the individual best position, the global best position and the gradient information includes: updating the speed of the particle in the next iteration according to the speed update relation, and the speed update relation is ; Update the position of the particle in the next iteration according to the position update relationship. The position update relationship is ; where j is the particle number, w is the inertia weight, c1, c2, c3, c4 are all learning factors, r1, r2, r3, r4 are all random numbers, is the velocity of the particle in the next iteration, is the predicted performance value of the particle in this iteration, Gradient j is the gradient information corresponding to the particle’s position in this iteration, is the position of the particle in the next iteration, is the position of the particle in this iteration, V j is the velocity of the particle in this iteration, P best,j is the individual best position of the particle in this iteration, G best is the global best position in this iteration, f(X j ) is the actual performance value of the particle in this iteration.
[0065] It can be understood that the inertia weight controls the degree to which particle j retains the speed of this iteration, and the learning factor is used to control the degree to which particle j moves in different directions. The learning factor is a number randomly drawn from the interval [0,1]. The random number is used to increase the randomness and exploration ability of the algorithm.
[0066] In an exemplary embodiment, after obtaining multiple batch processing size and kernel frequency combinations of the computing device, the device parameter adjustment method also includes: calculating the actual performance value of the computing device under each batch processing size and kernel frequency combination; filling the position points of the preset two-dimensional grid based on the multiple batch processing size and kernel frequency combinations and their corresponding actual performance values to obtain the current energy efficiency gradient map; for each position point on the current energy efficiency gradient map, calculating the gradient information corresponding to the position point; the process of obtaining the gradient information corresponding to the position of the particle in this iteration includes: determining the current batch processing size and kernel frequency combination in the position of the particle in this iteration; determining the target position point corresponding to the current batch size and kernel frequency combination on the current energy efficiency gradient map; and using the gradient information corresponding to the target position point as the gradient information corresponding to the position of the particle in this iteration.
[0067] In this embodiment, after obtaining multiple batch sizes and kernel frequency combinations of the computing device, the computing device is allowed to run under each batch size and kernel frequency combination one by one. It can be understood that, considering the impact that the test order may have on the results, for example, before changing the batch size and kernel frequency combination, a certain cooling time is given to the computing device to avoid the impact of the previous batch size and kernel frequency combination on the test results of the next batch size and kernel frequency combination. Then for each batch size and kernel frequency combination, the number of tests and the duration of each test are determined, which need to be determined according to the specific needs of the test, ensuring that the data under each configuration is representative and reliable enough. The actual performance value of the computing device running under each batch size and kernel frequency combination is obtained, and then the actual performance value corresponding to each batch size and kernel frequency combination is filled into the position points of the two-dimensional grid, thereby creating an energy efficiency gradient map of the computing device. This map provides an intuitive way to understand the performance under different configurations and can help determine the optimal batch size and kernel frequency combination.
[0068] In an exemplary embodiment, the process of calculating the actual performance value of a computing device under each batch processing size and core frequency combination includes: for each batch processing size and core frequency combination, obtaining energy efficiency data and latency data of the computing device under the batch processing size and core frequency combination, and calculating the actual performance value under the batch processing size and core frequency combination based on the energy efficiency data and latency data.
[0069] Specifically, the actual performance value under the combination of batch size and kernel frequency can be calculated according to the following relationship: ;in, is the batch size and kernel frequency combination, is the actual performance value for the batch size and kernel frequency combination, is the energy efficiency data for the batch size and kernel frequency combination, Here are the latency data for each batch size and kernel frequency combination, is the first preset weight value, is the second preset weight value.
[0070] Specifically, in this embodiment, after the computing device is controlled to run under a certain batch size and kernel frequency combination, the energy efficiency data and delay data of the computing device are obtained, wherein the energy efficiency data is the energy consumed by the computing device for each batch of calculations under the batch size and kernel frequency, and the delay data is the delay time of the computing device under the batch size and kernel frequency combination. The energy efficiency data can be obtained by reading the real-time power value of the graphics card of the computing device and integrating it with the delay time to obtain the total energy value.
[0071] In order to comprehensively consider energy efficiency and latency, this embodiment defines an inference revenue model, and the formula is as follows: ; ;in, is the inference income model, batchsize is the batch size, s is seconds, is the number of images processed per second, p is the power consumption, t is the time, E is the total energy consumption, W is watt, is the batch size and kernel frequency combination, is the actual performance value for the batch size and kernel frequency combination, is the energy efficiency data for the batch size and kernel frequency combination, Here are the latency data for each batch size and kernel frequency combination, is the first preset weight value, is the second preset weight value.
[0072] Understandably, as batch size increases, both energy efficiency and latency increase, so the performance tradeoff is the ratio of the two, f i is the frequency of the ith core of the computing device, that is, the ith core frequency of the computing device. and the second preset weight value , which is used to balance the importance of energy efficiency and latency. In short, this model aims to optimize the "revenue" of the inference task by considering energy efficiency and latency. The first preset weight and the second preset weight are set according to actual engineering needs, allowing the model to adjust the emphasis on energy efficiency and latency according to the requirements of the task. For example, if the first preset weight is greater than the second preset weight, the inference revenue model pays more attention to energy efficiency rather than latency. Conversely, if the first preset weight is less than the second preset weight, the inference revenue model pays more attention to latency. The goal of this optimization problem is to find an optimal b and f i value to maximize .
[0073] pass Shows how to maximize inference revenue by choosing the optimal batch size and core frequency model , which is expressed as an optimization problem and can be expressed as: max b,fi , b and f i They need to satisfy: b∈N, f i ∈C gpu .
[0074] In the above representation, max means finding the maximum objective function The value of b represents the batch size, which must be an element in the positive integer set N, and fi represents the GPU kernel frequency, which must be the same as the kernel frequency set C. gpu An element in To maximize the profit model, based on energy efficiency and delay And the first preset weight value and the second preset weight value Sure.
[0075] In an exemplary embodiment, the computing device parameter adjustment method also includes: performing data fitting on energy efficiency data of multiple core frequencies to obtain an energy efficiency fitting curve; performing data fitting on delay data under multiple batch sizes to obtain a delay fitting curve; and filling in position points in the current energy efficiency gradient map that are not filled with actual performance values based on the energy efficiency fitting curve and the delay fitting curve.
[0076] In this embodiment, considering that when deploying the model in a cloud data center, in order to effectively balance the time and resources of data sampling, a coarse-grained and large-span method is used to initially establish Therefore, in order to further improve the accuracy, comprehensiveness and reliability of the energy efficiency gradient map, this embodiment also performs data fitting based on the preliminary data, which not only improves the time efficiency and cost efficiency, but also because of its flexibility and adaptability, it can easily cope with changes in hardware and workloads without comprehensive data sampling each time, thereby continuously optimizing and iterating the model in a dynamically changing environment.
[0077] Specifically, data fitting can be performed on the energy efficiency data of multiple core frequencies to obtain an energy efficiency fitting curve, including but not limited to data fitting of the energy efficiency data of multiple core frequencies through a Fourier curve. The Fourier curve can handle periodic changes well and is suitable for handling regular changes that may occur at certain frequencies.
[0078] When fitting the Fourier curve, the general form of the Fourier curve is: ; Among them, EE(f i ) represents the energy efficiency data of the core frequency, a0 is the average or DC component, a n and b n is the Fourier coefficient, which is the parameter that needs to be determined through the fitting process, and N is the maximum number of harmonics selected. Parameter estimation: Use numerical methods (such as least squares method) to estimate the Fourier coefficient a n and b n This usually involves constructing a cost function, such as mean squared error, and then optimizing the coefficients to minimize that cost function.
[0079] Data fitting can be performed on the delay data under multiple batch sizes to obtain a delay fitting curve, including but not limited to using rational function curve fitting. Rational functions are suitable for describing nonlinear relationships and help to better understand the changes in delay with frequency and batch size.
[0080] Of course, in addition to using the above curves for data fitting, you can also use the least squares method to fit the energy efficiency data and latency data at each batch size, or to fit the energy efficiency data and latency data at each core frequency, to ensure the accuracy and reliability of the fitting.
[0081] Then, for the position points in the current energy efficiency gradient map that are not filled with actual performance values, based on the batch size and kernel frequency combination corresponding to the position point, there is no need to control the computing device to run at the batch size and kernel frequency combination, and the energy efficiency data corresponding to the batch size and kernel frequency combination is directly determined based on the energy efficiency fitting curve, and the delay data corresponding to the batch size and kernel frequency combination is determined based on the delay fitting curve. The actual performance value corresponding to the batch size and kernel frequency combination is calculated based on the energy efficiency data and delay data determined on the fitting curve, and filled into the position point.
[0082] In this embodiment, there is no need to actually test every possible batch size and kernel frequency combination, which can significantly reduce the time and resources required for testing. By fitting the curve, data in untested areas can be quickly estimated, thereby accelerating and improving the process of creating the energy efficiency gradient map.
[0083] It can be understood that for particle j, according to the position X of particle j in this iteration j_c =[batchsize j_c ,f i,j_c ] Match the corresponding target position point on the current energy efficiency gradient map, and use the actual performance value corresponding to the target position point as the actual performance value of the computing device in this iteration. If no completely matching position point is found, it may be necessary to interpolate or find the closest position point, which can be set according to actual engineering needs. This embodiment is not specifically limited here. It can be understood that by traversing the energy efficiency gradient map, the position point corresponding to position X is found. j_c =[batchsize j_c ,f i,j_c ] Completely matching position points ensures that adjustments are based on the most accurate data, improves the accuracy of adjustments, and avoids performance degradation caused by adjustments based on inaccurate data. When there are no completely matching position points, interpolation or finding the closest point is used to estimate performance data. Even when the energy efficiency gradient map data is incomplete, reasonable performance estimates and adjustments can be made, improving the flexibility and robustness of the system.
[0084] In an exemplary embodiment, for each position point on the current energy efficiency gradient map, the process of calculating the gradient information corresponding to the position point includes: for each position point on the current energy efficiency gradient map, determining the first neighboring point and the second neighboring point corresponding to the position point on the current energy efficiency gradient map; the kernel frequency of the first neighboring point is the same as the kernel frequency of the position point, the batch size of the first neighboring point is different from the batch size of the position point, the kernel frequency of the second neighboring point is different from the kernel frequency of the position point, and the batch size of the second neighboring point is the same as the batch size of the position point; calculating the first gradient value of the position point based on the actual performance value of the first neighboring point and the actual performance value of the position point; calculating the second gradient value of the position point based on the actual performance value of the second neighboring point and the actual performance value of the position point; and obtaining the gradient information corresponding to the position point using the first gradient value and the second gradient value.
[0085] In this embodiment, for each position point on the energy efficiency gradient map, the corresponding gradient information is calculated. The gradient information represents the change trend of the actual energy efficiency performance value when the batch size and the kernel frequency are adjusted at the position point. Specifically, for the filled energy efficiency gradient map, the gradient information of each position point is calculated. The gradient information can reveal in which direction to adjust the batch size and the kernel frequency to maximize the actual energy efficiency performance value.
[0086] First, determine the first neighboring point in the batch direction and the second neighboring point in the kernel frequency direction for each position point. For example, the position point is (b, f i ), the first neighbor point may be , that is, the kernel frequency of the first neighboring point is the same as the kernel frequency of the position point, and the second neighboring point may be , that is, the batch size of the second neighboring point is the same as the batch size of the position point, where and is the minimum increment of batch size and frequency.
[0087] Then based on R(b,f i )and Calculate the first gradient value of the position point based on R(b,f i )and The second gradient value of the position point is calculated, and the gradient information corresponding to the position point is obtained using the first gradient value and the second gradient value. It can be understood that the gradient information can be represented as a vector, which contains two components: one corresponding to the gradient in the direction of the batch size, and the other corresponding to the gradient in the direction of the kernel frequency.
[0088] Specifically, a first difference between the actual performance value of the first neighboring point and the actual performance value of the location point, and a first increment between the batch size of the first neighboring point and the batch size of the location point may be obtained, and a first gradient value may be calculated based on the first difference and the first increment. A second difference between the actual performance value of the second neighboring point and the actual performance value of the location point, and a second increment between the kernel frequency of the second neighboring point and the kernel frequency of the location point may be obtained, and a second gradient value may be calculated based on the second difference and the second increment.
[0089] For the batch size direction, calculate the difference: ; is the first difference, is the actual performance value of the first adjacent point, R(b,f i ) is the actual performance value of the location point.
[0090] For the core frequency direction, calculate the difference: ; is the second difference, is the actual performance value of the second adjacent point, R(b,f i ) is the actual performance value of the position point. The gradient can be approximated by dividing these differences by the corresponding increments: the gradient direction b = ; Gradient direction fi = ; Get the gradient vector, which can be expressed as: = (gradient direction b , gradient direction fi ).
[0091] Through this process, the gradient information of each position point can be obtained. The gradient information indicates in which direction adjusting the batch size and the core frequency can maximize the actual energy efficiency performance value, which is convenient for optimizing the performance of the computing device. It can be understood that the gradient information provides the performance change rate in the direction of the batch size and the core frequency, which enables the particle swarm optimization algorithm to more accurately identify the direction of performance improvement, thereby more effectively searching the solution space. Using the gradient information, particles can move faster in the direction of increasing performance value, which helps the particle swarm algorithm to accelerate convergence to the optimal solution or the approximate optimal solution. The gradient information reduces the need for random search, making the particle swarm optimization algorithm more efficient in the search process. In the case where the performance value function is more complex or there are multiple local optimal solutions, the gradient information can help the algorithm avoid falling into the local optimal solution. Since the gradient information provides a clear search direction, it can reduce the number of unnecessary iterations, thereby reducing the consumption of computing resources. In this embodiment, by combining the timing network prediction and the gradient map information, the particle swarm optimization algorithm can navigate the parameter space more effectively and is expected to find the batch size and core frequency settings with the best performance more quickly. In summary, the present invention proposes a systematic approach to optimize the energy efficiency and performance of GPUs in cloud data centers, achieving higher energy efficiency and improved performance by precisely adjusting the batch size and GPU core frequency. The accuracy and practicality of the optimization strategy are ensured by driving the decision-making process through detailed data collection and analysis. The energy efficiency gradient map is constructed and utilized to provide an intuitive view of the performance under different GPU core frequencies and batch sizes, and a comprehensive benefit model considering energy efficiency and latency is developed to provide a multi-dimensional framework for evaluating the performance of different configurations. The use of meta-heuristic learning-based algorithms, such as particle swarm optimization, combined with timing network prediction, provides an effective method for finding the optimal configuration. It provides practical guidance for GPU optimization in cloud data centers, which helps to improve operational efficiency and reduce energy consumption.
[0092] Second, please refer to Figure 2 The present invention also provides a device parameter adjustment system, comprising:
[0093] The acquisition module 11 is used to acquire multiple batch size and kernel frequency combinations of the computing device.
[0094] The initialization module 12 is used to initialize the positions of multiple particles in the particle swarm based on multiple batch sizes and kernel frequency combinations.
[0095] The iterative update module 13 is used to obtain the predicted performance value and the actual performance value of the computing device in this iteration for each particle in the multiple particle groups according to the position of the particle in this iteration, update the position of the particle in the next iteration based on the predicted performance value and the actual performance value, and repeat this step until the iteration end condition is met.
[0096] The configuration module 14 is used to take the particle corresponding to the optimal actual performance value when the iteration end condition is met as the optimal solution, and control the operation of the computing device according to the batch size and kernel frequency combination in the optimal solution.
[0097] In an exemplary embodiment, the process of obtaining the actual performance value of the computing device according to the position of the particle in this iteration includes: determining the current batch size and kernel frequency combination in the position of the particle in this iteration; and obtaining the actual performance value of the computing device running under the current batch size and kernel frequency combination.
[0098] In an exemplary embodiment, the process of obtaining the predicted performance value of the computing device according to the position of the particle in this iteration includes: inputting the position of the particle in consecutive preset iterations including the current iteration and the corresponding actual performance value into the timing network to obtain the predicted performance value of the computing device in this iteration.
[0099] In an exemplary embodiment, the process of updating the position of a particle in the next iteration based on the predicted performance value and the actual performance value includes: determining the individual best position of the particle in this iteration based on the actual performance value of the particle in this iteration; determining the global best position in this iteration based on the individual best positions of each particle in the particle group in this iteration; and updating the position of the particle in the next iteration according to the predicted performance value, the actual performance value, the individual best position, and the global best position.
[0100] In an exemplary embodiment, the process of determining the individual best position of a particle in this iteration based on the actual performance value of the particle in this iteration includes: determining whether the actual performance value of the particle in this iteration is greater than the actual performance value corresponding to the individual best position of the particle in the previous iteration; if so, determining the position of the particle in this iteration as the individual best position of the particle in this iteration; if not, determining the individual best position of the particle in the previous iteration as the individual best position of the particle in this iteration.
[0101] In an exemplary embodiment, based on the individual best positions of each particle in the particle swarm in this iteration, the process of determining the global best position in this iteration includes: determining the maximum value of the actual performance value corresponding to the individual best position of each particle in the particle swarm in this iteration; and determining the individual best position corresponding to the maximum value as the global best position in this iteration.
[0102] In an exemplary embodiment, the process of updating the position of the particle in the next iteration according to the predicted performance value, the actual performance value, the individual best position, and the global best position includes: obtaining gradient information corresponding to the position of the particle in this iteration; updating the position of the particle in the next iteration according to the predicted performance value, the actual performance value, the individual best position, the global best position and the gradient information.
[0103] In an exemplary embodiment, the process of updating the position of the particle in the next iteration according to the predicted performance value, the actual performance value, the individual best position, the global best position and the gradient information includes: updating the speed of the particle in the next iteration according to the speed update relation, and the speed update relation is ; Update the position of the particle in the next iteration according to the position update relationship. The position update relationship is ; where j is the particle number, w is the inertia weight, c1, c2, c3, c4 are all learning factors, r1, r2, r3, r4 are all random numbers, is the velocity of the particle in the next iteration, is the predicted performance value of the particle in this iteration, Gradient j is the gradient information corresponding to the particle’s position in this iteration, is the position of the particle in the next iteration, is the position of the particle in this iteration, V j is the velocity of the particle in this iteration, P best,j is the individual best position of the particle in this iteration, G best is the global best position in this iteration, f(X j ) is the actual performance value of the particle in this iteration.
[0104] In an exemplary embodiment, after obtaining multiple batch processing size and kernel frequency combinations of the computing device, the device parameter adjustment system is also used to: calculate the actual performance value of the computing device under each batch processing size and kernel frequency combination; fill the position points of the preset two-dimensional grid based on the multiple batch processing size and kernel frequency combinations and their corresponding actual performance values to obtain the current energy efficiency gradient map; for each position point on the current energy efficiency gradient map, calculate the gradient information corresponding to the position point; the process of obtaining the gradient information corresponding to the position of the particle in this iteration includes: determining the current batch processing size and kernel frequency combination in the position of the particle in this iteration; determining the target position point corresponding to the current batch size and kernel frequency combination on the current energy efficiency gradient map; and using the gradient information corresponding to the target position point as the gradient information corresponding to the position of the particle in this iteration.
[0105] In an exemplary embodiment, for each position point on the current energy efficiency gradient map, the process of calculating the gradient information corresponding to the position point includes: for each position point on the current energy efficiency gradient map, determining the first neighboring point and the second neighboring point corresponding to the position point on the current energy efficiency gradient map; the kernel frequency of the first neighboring point is the same as the kernel frequency of the position point, the batch size of the first neighboring point is different from the batch size of the position point, the kernel frequency of the second neighboring point is different from the kernel frequency of the position point, and the batch size of the second neighboring point is the same as the batch size of the position point; calculating the first gradient value of the position point based on the actual performance value of the first neighboring point and the actual performance value of the position point; calculating the second gradient value of the position point based on the actual performance value of the second neighboring point and the actual performance value of the position point; and obtaining the gradient information corresponding to the position point using the first gradient value and the second gradient value.
[0106] In an exemplary embodiment, the process of calculating the first gradient value of a location point based on the actual performance value of the first neighboring point and the actual performance value of the location point includes: obtaining a first difference between the actual performance value of the first neighboring point and the actual performance value of the location point; obtaining a first increment between the batch size of the first neighboring point and the batch size of the location point; and calculating the first gradient value based on the first difference and the first increment.
[0107] In an exemplary embodiment, the process of calculating the second gradient value of the location point based on the actual performance value of the second neighboring point and the actual performance value of the location point includes: obtaining a second difference between the actual performance value of the second neighboring point and the actual performance value of the location point; obtaining a second increment between the kernel frequency of the second neighboring point and the kernel frequency of the location point; and calculating the second gradient value based on the second difference and the second increment.
[0108] In an exemplary embodiment, the process of calculating the actual performance value of a computing device under each batch processing size and core frequency combination includes: for each batch processing size and core frequency combination, obtaining energy efficiency data and latency data of the computing device under the batch processing size and core frequency combination, and calculating the actual performance value under the batch processing size and core frequency combination based on the energy efficiency data and latency data.
[0109] In an exemplary embodiment, the process of calculating the actual performance value under the combination of batch size and kernel frequency based on energy efficiency data and latency data includes: calculating the actual performance value under the combination of batch size and kernel frequency based on a first relational expression, wherein the first relational expression is: ;in, is the batch size and kernel frequency combination, is the actual performance value for the batch size and kernel frequency combination, is the energy efficiency data for the batch size and kernel frequency combination, Here are the latency data for each batch size and kernel frequency combination, is the first preset weight value, is the second preset weight value.
[0110] In an exemplary embodiment, the iteration termination condition includes reaching a maximum number of iterations, or a change in an actual performance value corresponding to the global optimal position in consecutive preset iterations including the current iteration is less than a preset threshold.
[0111] In a third aspect, the present invention further provides a computer program product, comprising a computer program / instruction, which, when executed by a processor, implements the steps of the device parameter adjustment method described in any one of the embodiments above.
[0112] For an introduction to a computer program product provided by the present invention, please refer to the above embodiments, and the present invention will not be described in detail here.
[0113] A computer program product provided by the present invention has the same beneficial effects as the above-mentioned device parameter adjustment method.
[0114] Fourth, please refer to Figure 3 The present invention also provides an electronic device, comprising:
[0115] A memory 21, used for storing computer programs;
[0116] The processor 22 is used to implement the steps of the device parameter adjustment method described in any one of the above embodiments when executing the computer program.
[0117] The electronic device also includes:
[0118] The input interface 23 is connected to the processor 22 via the communication bus 26, and is used to obtain the computer programs, parameters and instructions imported from the outside, and save them in the memory 21 under the control of the processor 22. The input interface can be connected to an input device to receive parameters or instructions manually input by the user. The input device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the terminal housing.
[0119] The display unit 24 is connected to the processor 22 via the communication bus 26 and is used to display the data sent by the processor 22. The display unit can be a liquid crystal display or an electronic ink display.
[0120] The network port 25 is connected to the processor 22 via the communication bus 26, and is used to communicate with various external terminal devices. The communication technology used in the communication connection can be a wired communication technology or a wireless communication technology, such as mobile high-definition link technology, universal serial bus, high-definition multimedia interface, wireless fidelity technology, Bluetooth communication technology, low-power Bluetooth communication technology, communication technology based on IEEE802.11s, etc.
[0121] For an introduction to an electronic device provided by the present invention, please refer to the above embodiments, and the present invention will not be described in detail here.
[0122] The electronic device provided by the present invention has the same beneficial effects as the above-mentioned device parameter adjustment method.
[0123] In a fifth aspect, the present invention further provides a server, comprising a plurality of computing devices and the above electronic device.
[0124] For an introduction to a server provided by the present invention, please refer to the above-mentioned embodiment, and the present invention will not be described in detail here.
[0125] A server provided by the present invention has the same beneficial effects as the above-mentioned device parameter adjustment method.
[0126] For the sixth aspect, please refer to Figure 4 The present invention further provides a computer-readable storage medium 30, on which a computer program 31 is stored. When the computer program 31 is executed by a processor, the steps of the device parameter adjustment method described in any of the above embodiments are implemented.
[0127] The computer-readable storage medium 30 may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0128] For an introduction to a computer-readable storage medium provided by the present invention, please refer to the above embodiments, and the present invention will not be described in detail here.
[0129] A computer-readable storage medium provided by the present invention has the same beneficial effects as the above-mentioned device parameter adjustment method.
[0130] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises", "comprising" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0131] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for adjusting device parameters, characterized in that: include: Obtain multiple batch size and core frequency combinations of a computing device; Initialize positions of a plurality of particles in a particle swarm based on a plurality of said batch size and kernel frequency combinations; For each particle in the plurality of particle groups, according to the position of the particle in the current iteration, obtain a predicted performance value and an actual performance value of the computing device in the current iteration, update the position of the particle in the next iteration based on the predicted performance value and the actual performance value, and repeat this step until an iteration end condition is met; The particle corresponding to the optimal actual performance value when the iteration end condition is met is taken as the optimal solution, and the operation of the computing device is controlled according to the batch size and kernel frequency combination in the optimal solution.
2. The device parameter adjustment method according to claim 1, characterized in that: The process of obtaining the actual performance value of the computing device according to the position of the particle in this iteration includes: determining a current batch size and kernel frequency combination in the position of the particle in this iteration; Obtain an actual performance value of the computing device running under the current batch size and kernel frequency combination.
3. The device parameter adjustment method according to claim 1, characterized in that: The process of obtaining the predicted performance value of the computing device according to the position of the particle in this iteration includes: The positions of the particles in consecutive preset iterations including the current iteration and the corresponding actual performance values are input into a timing network to obtain a predicted performance value of the computing device in the current iteration.
4. The device parameter adjustment method according to claim 1, characterized in that: The process of updating the position of the particle in the next iteration based on the predicted performance value and the actual performance value includes: Determine the individual best position of the particle in this iteration based on the actual performance value of the particle in this iteration; Determine the global best position in this iteration based on the individual best position of each particle in the particle group in this iteration; The position of the particle in the next iteration is updated according to the predicted performance value, the actual performance value, the individual optimal position, and the global optimal position.
5. The device parameter adjustment method according to claim 4, characterized in that: The process of determining the individual optimal position of the particle in this iteration based on the actual performance value of the particle in this iteration includes: Determine whether the actual performance value of the particle in this iteration is greater than the actual performance value corresponding to the individual best position of the particle in the previous iteration; If so, the position of the particle in this iteration is determined as the individual best position of the particle in this iteration; If not, the individual best position of the particle in the previous iteration is determined as the individual best position of the particle in this iteration.
6. The device parameter adjustment method according to claim 4, characterized in that: The process of determining the global best position in this iteration based on the individual best position of each particle in the particle group in this iteration includes: Determine the maximum value of the actual performance value corresponding to the individual best position of each particle in the particle group in this iteration; The individual optimal position corresponding to the maximum value is determined as the global optimal position in this iteration.
7. The device parameter adjustment method according to claim 4, characterized in that: The process of updating the position of the particle in the next iteration according to the predicted performance value, the actual performance value, the individual optimal position, and the global optimal position includes: Obtaining the gradient information corresponding to the position of the particle in this iteration; The position of the particle in the next iteration is updated according to the predicted performance value, the actual performance value, the individual optimal position, the global optimal position and the gradient information.
8. The device parameter adjustment method according to claim 7, characterized in that: The process of updating the position of the particle in the next iteration according to the predicted performance value, the actual performance value, the individual optimal position, the global optimal position and the gradient information includes: The velocity of the particle in the next iteration is updated according to the velocity update relation, which is: ; The position of the particle in the next iteration is updated according to the position update relation, which is: ; Wherein, j is the number of the particle, w is the inertia weight, c1, c2, c3, c4 are all learning factors, r1, r2, r3, r4 are all random numbers, is the velocity of the particle in the next iteration, is the predicted performance value of the particle in this iteration, Gradient j is the gradient information corresponding to the position of the particle in this iteration, is the position of the particle in the next iteration, is the position of the particle in this iteration, V j is the velocity of the particle in this iteration, P best,j is the individual best position of the particle in this iteration, G best is the global best position in this iteration, f(X j ) is the actual performance value of the particle in this iteration.
9. The device parameter adjustment method according to claim 7, characterized in that: After obtaining multiple batch sizes and kernel frequency combinations of the computing device, the device parameter adjustment method further includes: Calculating an actual performance value of the computing device under each combination of the batch size and the core frequency; Filling the position points of a preset two-dimensional grid based on a plurality of batch size and core frequency combinations and their corresponding actual performance values to obtain a current energy efficiency gradient map; For each of the position points on the current energy efficiency gradient map, calculating the gradient information corresponding to the position point; The process of obtaining the gradient information corresponding to the position of the particle in this iteration includes: determining a current batch size and kernel frequency combination in the position of the particle in this iteration; Determine a target position point corresponding to the current batch size and kernel frequency combination on the current energy efficiency gradient map; The gradient information corresponding to the target position point is used as the gradient information corresponding to the position of the particle in this iteration.
10. The device parameter adjustment method according to claim 9, characterized in that: For each of the position points on the current energy efficiency gradient map, the process of calculating the gradient information corresponding to the position point includes: For each of the position points on the current energy efficiency gradient map, determine a first adjacent point and a second adjacent point corresponding to the position point on the current energy efficiency gradient map; the kernel frequency of the first adjacent point is the same as the kernel frequency of the position point, the batch size of the first adjacent point is different from the batch size of the position point, the kernel frequency of the second adjacent point is different from the kernel frequency of the position point, and the batch size of the second adjacent point is the same as the batch size of the position point; Calculating a first gradient value of the location point based on an actual performance value of the first adjacent point and an actual performance value of the location point; Calculating a second gradient value of the location point based on the actual performance value of the second adjacent point and the actual performance value of the location point; The gradient information corresponding to the position point is obtained by using the first gradient value and the second gradient value.
11. The device parameter adjustment method according to claim 10, characterized in that: The process of calculating the first gradient value of the location point based on the actual performance value of the first adjacent point and the actual performance value of the location point includes: Obtaining a first difference between an actual performance value of the first adjacent point and an actual performance value of the position point; Obtaining a first increment between a batch size of the first neighboring point and a batch size of the position point; A first gradient value is calculated based on the first difference value and the first increment.
12. The device parameter adjustment method according to claim 10, characterized in that: The process of calculating the second gradient value of the location point based on the actual performance value of the second adjacent point and the actual performance value of the location point includes: Obtaining a second difference between an actual performance value of the second adjacent point and an actual performance value of the position point; Obtaining a second increment between the kernel frequency of the second adjacent point and the kernel frequency of the position point; A second gradient value is calculated based on the second difference value and the second increment.
13. The device parameter adjustment method according to claim 9, characterized in that: The process of calculating the actual performance value of the computing device under each combination of the batch size and the kernel frequency includes: For each of the batch size and kernel frequency combinations, energy efficiency data and latency data of the computing device under the batch size and kernel frequency combination are obtained, and an actual performance value under the batch size and kernel frequency combination is calculated based on the energy efficiency data and the latency data.
14. The device parameter adjustment method according to claim 13, characterized in that: The process of calculating the actual performance value under the combination of the batch size and the kernel frequency based on the energy efficiency data and the delay data includes: The actual performance value under the combination of the batch size and the kernel frequency is calculated based on the first relationship, where the first relationship is: ; in, For the batch size and kernel frequency combination, is the actual performance value for the batch size and kernel frequency combination, is the energy efficiency data for the batch size and kernel frequency combination, is the latency data for the batch size and kernel frequency combination, is the first preset weight value, is the second preset weight value.
15. The device parameter adjustment method according to any one of claims 1 to 14, characterized in that: The iteration termination condition includes reaching the maximum number of iterations, or the change in the actual performance value corresponding to the global optimal position in consecutive preset iterations including the current iteration is less than a preset threshold.
16. A device parameter adjustment system, characterized in that: include: An acquisition module, used for acquiring a plurality of batch size and core frequency combinations of a computing device; An initialization module, used for initializing positions of a plurality of particles in a particle swarm based on a plurality of combinations of the batch size and the kernel frequency; An iterative update module, for obtaining, for each particle in the plurality of particle groups, a predicted performance value and an actual performance value of the computing device in this iteration according to the position of the particle in this iteration, updating the position of the particle in the next iteration based on the predicted performance value and the actual performance value, and repeating this step until an iteration end condition is met; The configuration module is used to take the particle corresponding to the optimal actual performance value when the iteration end condition is met as the optimal solution, and control the operation of the computing device according to the batch size and kernel frequency combination in the optimal solution.
17. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the steps of the device parameter adjustment method as described in any one of claims 1 to 15 are implemented.
18. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the device parameter adjustment method as described in any one of claims 1 to 15 when executing the computer program.
19. A server, characterized in that: The invention comprises a plurality of computing devices and the electronic device as claimed in claim 18.
20. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the device parameter adjustment method according to any one of claims 1 to 15 are implemented.
Citation Information
Patent Citations
Coal mining machine fault prediction method based on time sequence prediction method
CN112381123A
GPU-based battery parameter identification method, system, device and medium
CN117454128A
Batch size adjusting method in distributed data parallel online asynchronous training
CN118245809A
Micro-grid optimization scheduling system based on improved particle swarm optimization
CN118589588A
Parameter optimization method, device, equipment, medium and product
CN119051863A
Cited By
Computing device parameter adjustment method, product, device, server and medium
CN119376960A
A method, product, device, server, and medium for adjusting computing device parameters
CN119376960B