Computing device parameter adjustment method, product, device, server and medium
By acquiring and analyzing the energy -efficient gradient map of the GPU, automatically adjust the batch processing size and kernel frequency, solving the problem of optimizing GPU energy efficiency and performance in the cloud computing era, and realizing the dynamic balance between energy efficiency and delay.
Patent Information
- Application Number
- CN202411976965.4
- 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 cloud computing era, 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 the current energy gradient map of the computing device, determine the target position point and perform the adjustment operation, in response to the new configuration to meet the delay and energy efficiency balance conditions, and continuously adjust the batch processing size and kernel frequency of the computing device.
The dynamic balance between the computing equipment in performance and energy efficiency is implemented to ensure the optimal operating status of computing equipment in different working loads and operating environments.
Smart Images

Figure CN119376960A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of servers, and in particular to a method, product, device, server and medium for adjusting parameters of a computing device. 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 computing device parameter adjustment method, product, device, server and medium, which can automatically adjust the configuration according to the actual operation of the computing device, adapt to different workloads and operating environments, achieve a dynamic balance between energy efficiency and latency, and ensure the computing device is in the optimal operating state between performance and energy efficiency.
[0004] To solve the above technical problems, the present invention provides a method for adjusting parameters of a computing device, comprising: obtaining a current energy efficiency gradient map of the computing device; the position points of the current energy efficiency gradient map are used to characterize the comprehensive performance values of energy efficiency and delay of the computing device under the corresponding batch size and core frequency combination; determining a target position point on the current energy efficiency gradient map according to the current batch size and current core frequency of the computing device, and performing a current adjustment operation on the computing device based on the comprehensive performance values of energy efficiency and delay corresponding to the target position point; in response to the new batch size and new core frequency after the current adjustment operation are completed, satisfying the delay and energy efficiency balance condition, controlling the computing device to continue to operate according to the new batch size and the new core frequency.
[0005] Optionally, the process of obtaining the current energy efficiency gradient map of the computing device includes: determining a reference batch size range and a reference kernel frequency range corresponding to the computing device according to the specifications and / or performance constraints of the computing device; selecting multiple batch sizes in the reference batch size range; selecting multiple kernel frequencies in the reference kernel frequency range; arranging and combining multiple batch sizes and multiple kernel frequencies to generate multiple batch size and kernel frequency combinations; calculating the comprehensive performance value of energy efficiency and latency of the computing device under each batch size and kernel frequency combination; and filling the position points of a preset two-dimensional grid based on the multiple batch size and kernel frequency combinations and their corresponding comprehensive performance values of energy efficiency and latency to obtain the current energy efficiency gradient map.
[0006] Optionally, the process of calculating the comprehensive performance value of energy efficiency and latency 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 latency data of the computing device under the combination of the batch size and the kernel frequency, and calculating the comprehensive performance value of energy efficiency and latency under the combination of the batch size and the kernel frequency based on the energy efficiency data and the latency data.
[0007] Optionally, the computing device parameter adjustment method also includes: performing data fitting on the energy efficiency data of multiple core frequencies to obtain an energy efficiency fitting curve; performing data fitting on the delay data under multiple batch sizes to obtain a delay fitting curve; and filling the position points in the current energy efficiency gradient map that are not filled with the comprehensive performance value of energy efficiency and delay based on the energy efficiency fitting curve and the delay fitting curve.
[0008] Optionally, the process of calculating the comprehensive performance value of energy efficiency and delay under the combination of batch size and kernel frequency based on the energy efficiency data and the delay data includes: calculating the comprehensive performance value of energy efficiency and delay under the combination of batch size and kernel frequency based on a first relationship, wherein the first relationship is ;in, For the batch size and kernel frequency combination, is the comprehensive performance value of energy efficiency and latency under the combination of batch size and kernel frequency, is the energy efficiency data for the batch size and kernel frequency combination, Here are the latency data for the batch size and kernel frequency combination, is the first preset weight value, is the second preset weight value.
[0009] Optionally, the process of performing the current adjustment operation on the computing device based on the comprehensive performance value of energy efficiency and delay corresponding to the target location point includes: obtaining the actual operating state of the computing device, the actual operating state including the current batch size, the current kernel frequency, the current performance index, and the comprehensive performance value of energy efficiency and delay corresponding to the target location point; inputting the actual operating state into the action prediction model to obtain the predicted optimal adjustment operation;
[0010] A current adjustment operation is obtained based on the predicted optimal adjustment operation, and the current adjustment operation is performed on the computing device.
[0011] Optionally, the actual operating status also includes a comprehensive performance value of energy efficiency and delay corresponding to a neighborhood position point, and the neighborhood position point is a position point on the current energy efficiency gradient map that is within a preset range from the target position point.
[0012] Optionally, the computing device parameter adjustment method further includes: for each of the position points on the current energy efficiency gradient map, calculating a gradient vector corresponding to the position point; and the process of obtaining the current adjustment operation based on the predicted optimal adjustment operation includes: obtaining the gradient vector of the target position point;
[0013] A current adjustment operation is obtained by using the gradient vector and the predicted optimal adjustment operation.
[0014] Optionally, the process of obtaining the current adjustment operation by using the gradient vector and the predicted optimal adjustment operation includes: obtaining the current adjustment operation based on a second relational expression, where the second relational expression is Among them, A exec For the current adjustment operation, A DQN is the predicted optimal adjustment operation, W is the third preset weight value, and G is the gradient vector of the target position point.
[0015] Optionally, the computing device parameter adjustment method also includes: using the action prediction model to obtain a predicted reward function value corresponding to the current adjustment operation; obtaining an observation result after performing the current adjustment operation on the computing device, the observation result including a new actual operating state and an immediate reward function value of the computing device; and updating the action prediction model using the observation result, the current adjustment operation, and the actual operating state before performing the current adjustment operation to minimize the difference between the immediate reward function value and the predicted reward function value.
[0016] Optionally, the computing device parameter adjustment method also includes: determining the maximum value of the comprehensive performance values of energy efficiency and delay corresponding to each position point on the current energy efficiency gradient map; determining the maximum value as the optimal performance value; in response to the difference between the comprehensive performance value of energy efficiency and delay corresponding to the target position point and the optimal performance value not being within a preset range, obtaining a new energy efficiency gradient map as the current energy efficiency gradient map.
[0017] Optionally, after performing the current adjustment operation on the computing device based on the comprehensive performance value of energy efficiency and delay corresponding to the target location point, the computing device parameter adjustment method also includes: obtaining a measured comprehensive performance value of the computing device when it is running at the new batch size and the new core frequency; in response to the measured comprehensive performance value being within a high-performance range, controlling the computing device to run a preset number of times according to the new batch size and the new core frequency, and if the measured comprehensive performance values obtained each time are within the high-performance range, determining that the new batch size and the new core frequency meet the delay and energy efficiency balance condition.
[0018] Optionally, after obtaining the measured comprehensive performance value of the computing device when running under the new batch size and the new core frequency, the computing device parameter adjustment method also includes: in response to the measured comprehensive performance value not being within the high-performance range, determining that the new batch size and the new core frequency do not satisfy the latency and energy efficiency balance condition, using the new batch size as the current batch size and the new core frequency as the current core frequency, and performing an operation of determining the target position point on the current energy efficiency gradient map according to the current batch size and the current core frequency of the computing device.
[0019] To solve the above technical problem, the present invention also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the computing device parameter adjustment method as described in any one of the above.
[0020] To solve the above technical problems, the present invention also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of the computing device parameter adjustment method as described in any one of the above when executing the computer program.
[0021] 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.
[0022] To solve the above technical problems, the present invention also 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 computing device parameter adjustment method as described in any one of the above are implemented.
[0023] The present invention provides a method for adjusting parameters of a computing device. First, a current energy efficiency gradient map of the computing device is obtained. The current energy efficiency gradient map shows the comprehensive performance of energy efficiency and delay of the computing device under different batch sizes and kernel frequency combinations. Through the energy efficiency gradient map, all possible batch sizes and kernel frequency combinations are considered to ensure the comprehensiveness of the solution. During the actual operation of the computing device, the current batch size and the current kernel frequency of the computing device are monitored, and a position point matching the current batch size and the current kernel frequency is found on the energy efficiency gradient map. The batch size and the kernel frequency of the computing device are adjusted based on the comprehensive performance value of energy efficiency and delay at the position point. After the adjustment is completed, it is verified whether the new configuration meets the preset delay and energy efficiency balance condition. If it meets the condition, the computing device will continue to run according to this configuration, and the configuration is automatically adjusted according to the actual operation of the computing device to adapt to different workloads and operating environments, so as to achieve a dynamic balance between energy efficiency and delay, and ensure the optimal operating state of the computing device between performance and energy efficiency.
[0024] The present invention also provides a computer program product, an electronic device, a server and a computer-readable storage medium, which have the same beneficial effects as the above-mentioned computing device parameter adjustment method. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] 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.
[0026] Figure 1 A flowchart of the steps of a method for adjusting parameters of a computing device provided by the present invention.
[0027] Figure 2 This is a structural schematic diagram of a computing device parameter adjustment system provided by the present invention.
[0028] Figure 3 The present invention is a schematic structural diagram of an electronic device provided by the present invention.
[0029] Figure 4 This is a schematic diagram of the structure of a computer-readable storage medium provided by the present invention. DETAILED DESCRIPTION
[0030] The core of the present invention is to provide a computing device parameter adjustment method, product, device, server and medium, which can automatically adjust the configuration according to the actual operation of the computing device, adapt to different workloads and operating environments, achieve a dynamic balance between energy efficiency and latency, and ensure the computing device is in the optimal operating state between performance and energy efficiency.
[0031] 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.
[0032] First, please refer to Figure 1 The present invention provides a method for adjusting parameters of a computing device, comprising:
[0033] S101: Obtain a current energy efficiency gradient map of a computing device; the position points of the current energy efficiency gradient map are used to characterize the comprehensive performance value of energy efficiency and latency of the computing device under a corresponding batch size and core frequency combination.
[0034] 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., and a corresponding energy efficiency gradient map is pre-created for each computing device in the server. Considering that the same computing device may exhibit different performance even under the same workload as the computing device is used and the environmental conditions change, the energy efficiency gradient map of the computing device can be dynamically updated as the computing device is used, and the energy efficiency gradient map currently used by the computing device is determined as the current energy efficiency gradient map of the computing device.
[0035] It can be understood that the energy efficiency gradient map can be a two-dimensional grid, in which one dimension is the batch size and the other dimension is the kernel frequency. The batch size affects the memory usage, throughput and parallel processing capability of the computing device, and the change of the kernel frequency affects the power consumption and computing speed of the device. Each position point on the energy efficiency gradient map is used to represent the computing device at the corresponding batch size and kernel frequency combination (b j , f i ) under the comprehensive performance value of energy efficiency and delay R (b j , f i ), where b j represents the j-th batch size, f iRepresents the frequency of the ith core. The energy efficiency and latency comprehensive performance value combines the two key performance indicators of energy efficiency and latency. The larger the energy efficiency and latency comprehensive performance value, the better the balance between energy efficiency and latency of the computing device under the batch size and core frequency combination. This balance is the key to optimizing the performance of computing devices, ensuring that power consumption is effectively controlled while meeting performance requirements.
[0036] S102: Determine a target location point on the current energy efficiency gradient map according to the current batch size and the current kernel frequency of the computing device, and perform a current adjustment operation on the computing device based on the comprehensive performance value of energy efficiency and latency corresponding to the target location point.
[0037] In this embodiment, firstly, the current batch size (b 当前 ) and the current core frequency (f 当前 ), find the value corresponding to b on the current energy efficiency gradient map 当前 and f 当前 Matching position points, specifically, traverse each position point on the current energy efficiency gradient map (b j , f i ), for each location point, check whether the following conditions are met, b j (Batch size for this location) is equal to b 当前 (the current batch size of the computing device), and f i (The kernel frequency at this location) is equal to f 当前 (the current kernel frequency of the device). If a position point is found that satisfies b j =b 当前 And f i =f 当前 , then the position point is the target position point. 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 the actual engineering needs, and this embodiment is not specifically limited here. It can be understood that by traversing the energy efficiency gradient map and finding the position point that completely matches the current batch size and the current kernel frequency, it is ensured that the adjustment is based on the most accurate data, the accuracy of the adjustment is improved, and the performance degradation caused by adjustment based on inaccurate data is avoided. When there is no completely matching position point, the method of interpolation or finding the closest point is used to estimate the performance data. Even when the energy efficiency gradient map data is incomplete, reasonable performance estimation and adjustment can be made, thereby improving the flexibility and robustness of the system.
[0038] It can be understood that each position point in the current energy efficiency gradient map of the computing device has its own corresponding comprehensive performance value of energy efficiency and delay. After determining the target position point, this embodiment obtains the comprehensive performance value of energy efficiency and delay corresponding to the target position point, and performs an adjustment operation on the computing device according to the comprehensive performance value of energy efficiency and delay corresponding to the target position point. The comprehensive performance value of energy efficiency and delay is used to analyze whether it is necessary to perform an adjustment operation on the computing device. By way of example, assuming that the comprehensive performance value of energy efficiency and delay of the target position point is lower than a preset threshold, it means that the computing device operates according to the current batch size and the current adjustment direction, and cannot achieve a balance between energy efficiency and delay. At this time, it is necessary to adjust the operating parameters (batch size and / or kernel frequency) of the computing device. The adjustment operation includes an adjustment direction and an adjustment amplitude of the current batch size of the computing device, and also includes an adjustment direction and an adjustment amplitude of the current kernel frequency of the computing device. In this embodiment, the batch size and the kernel frequency are adjusted according to the situation that the comprehensive performance value is lower than the threshold value, which can improve the energy efficiency and delay performance of the device, enhance the overall performance, optimize the energy efficiency, reduce unnecessary energy consumption, reduce the operating cost, avoid the computing device from running for a long time in a non-optimal state, reduce failures and downtime, avoid extreme working conditions, and help extend the service life of the computing device.
[0039] S103: In response to the new batch size and the new kernel frequency satisfying the delay and energy efficiency balance condition after the current adjustment operation is completed, controlling the computing device to continue to operate according to the new batch size and the new kernel frequency.
[0040] After the current adjustment operation is completed on the computing device, the new batch size and new kernel frequency of the computing device need to be monitored. If the adjusted new batch size and new kernel frequency can make the computing device meet the delay and energy efficiency balance conditions, the new batch size and new kernel frequency are used as the optimal operating parameters of the computing device, and the computing device is controlled to operate according to the new batch size and new kernel frequency to ensure the balance between energy efficiency and delay. Through this process, the computing device can operate in a continuously optimized environment, which not only improves the performance of the device, but also improves the overall efficiency and reliability of the data center.
[0041] In response to the measured comprehensive performance value not being within the high-performance range, it is determined that the new batch size and the new kernel frequency do not satisfy the latency and energy efficiency balance condition, the new batch size is used as the current batch size, the new kernel frequency is used as the current kernel frequency, and an operation of determining a target position point on a current energy efficiency gradient map according to the current batch size and the current kernel frequency of the computing device is performed.
[0042] The delay and energy efficiency balance condition is set according to actual engineering needs, and this embodiment does not make any specific limitations here.
[0043] It can be seen that in this embodiment, the current energy efficiency gradient map of the computing device is first obtained. The current energy efficiency gradient map shows the comprehensive performance of the energy efficiency and latency of the computing device under different batch sizes and kernel frequency combinations. Through the energy efficiency gradient map, all possible batch sizes and kernel frequency combinations are considered to ensure the comprehensiveness of the solution. During the actual operation of the computing device, the current batch size and the current kernel frequency of the computing device are monitored, and the position points that match the current batch size and the current kernel frequency are found on the energy efficiency gradient map. The batch size and the kernel frequency of the computing device are adjusted based on the comprehensive performance value of energy efficiency and latency at the position points. After the adjustment is completed, it is verified whether the new configuration meets the preset latency and energy efficiency balance conditions. If so, the computing device will continue to operate according to this configuration, and automatically adjust the configuration according to the actual operation of the computing device to adapt to different workloads and operating environments, thereby achieving a dynamic balance between energy efficiency and latency and ensuring the optimal operating state of the computing device between performance and energy efficiency.
[0044] Based on the above embodiments:
[0045] In an exemplary embodiment, the process of obtaining the current energy efficiency gradient map of a computing device includes: determining a reference batch size range and a reference kernel frequency range corresponding to the computing device according to the specifications and / or performance constraints of the computing device; selecting multiple batch sizes in the reference batch size range; selecting multiple kernel frequencies in the reference kernel frequency range; arranging and combining multiple batch sizes and multiple kernel frequencies to generate multiple batch size and kernel frequency combinations; calculating the comprehensive performance value of energy efficiency and latency 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 comprehensive performance values of energy efficiency and latency to obtain the current energy efficiency gradient map.
[0046] In this embodiment, it is first necessary to determine the reference batch size range and the reference kernel frequency range, which should include possible values from the minimum to the maximum to ensure that the data can cover all operating points. Specifically, the possible value ranges of the batch size and the kernel frequency are determined based on the specifications and performance constraints of the computing device. For example, the batch size range can start from 1 and gradually increase to the maximum value that each computing device in the cloud data center can effectively process, and the kernel frequency starts from the lowest frequency supported by the computing device and increases to the highest frequency.
[0047] In determining the reference batch size range (b min to b max ) and the reference core frequency range (f min to f max), for each increase in batch size and kernel frequency, a reasonable increment is determined. For example, the batch size can be increased by 1, 4, or 8 each time, depending on the overall scope 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, which is not limited in this embodiment.
[0048] After the increment is determined, multiple batch sizes (b1, b2, ... b1) can be determined in the reference batch size range. 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 multiple kernel frequencies and 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. Specifically, 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. Exemplarily, 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 kernel frequency first, then iterate over all batch sizes, 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.
[0049] Assume the following ranges and increments:
[0050] Batch size range: b min =16, b max=64, increment =16, then multiple batch sizes include 16, 32, 48, 64;
[0051] Core frequency range: f min =1000MHz, f max =1500MHz, increment =100MHz, then the multiple core frequencies include 1000MHz, 1100MHz, 1200MHz, 1300MHz, 1400MHz, and 1500MHz.
[0052] The following batch size and kernel frequency combinations are available: (16, 1000MHz), (16, 1100MHz), …, (16, 1500MHz), (32, 1000MHz), (32, 1100MHz), …, (32, 1500MHz) … (64, 1000MHz), (64, 1100MHz), …, (64, 1500MHz).
[0053] These batch size and core frequency combinations will be used to test and evaluate the performance of computing devices under different conditions, thereby building an energy efficiency gradient map.
[0054] Then let the computing device 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, give the computing device a certain cooling time 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, determine the number of tests and the duration of each test. It needs to be determined according to the specific needs of the test to ensure that the data under each configuration is representative and reliable enough. Obtain the energy efficiency and latency comprehensive performance value of the computing device running under each batch size and kernel frequency combination, and then fill the energy efficiency and latency comprehensive performance value corresponding to each batch size and kernel frequency combination into the position points of the two-dimensional grid, so as to create 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.
[0055] In an exemplary embodiment, the process of calculating the comprehensive performance value of energy efficiency and latency 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 comprehensive performance value of energy efficiency and latency under the batch processing size and core frequency combination based on the energy efficiency data and latency data.
[0056] In this embodiment, after the computing device is controlled to run under a certain batch size and kernel frequency combination, 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.
[0057] In order to comprehensively consider energy efficiency and latency, this embodiment defines an inference revenue model, and the formula is as follows:
[0058] ;
[0059] ;
[0060] 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 comprehensive performance value of energy efficiency and latency under the combination of batch size and kernel frequency, 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.
[0061] It is understandable that as the batch size increases, both the energy efficiency and latency figures increase, so the performance tradeoff is the ratio of the two, f i is the frequency of the i-th core of the computing device, that is, the i-th core frequency of the computing device. is the first preset weight value, is 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 Combination to maximize .
[0062] 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 .
[0063] 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 f i Represents the GPU core frequency, which must be the same as the core 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.
[0064] 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 the position points of the current energy efficiency gradient map that are not filled with the comprehensive performance values of energy efficiency and delay based on the energy efficiency fitting curve and the delay fitting curve.
[0065] 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.
[0066] 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.
[0067] When fitting the Fourier curve, the general form of the Fourier curve is:
[0068] .
[0069] 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 a parameter that needs to be determined through the fitting process, n represents the harmonic order, 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.
[0070] 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.
[0071] 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.
[0072] Then, for the position points in the current energy efficiency gradient map that are not filled with the comprehensive performance values of energy efficiency and delay, according to 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. According to the energy efficiency data and delay data determined on the fitting curve, the comprehensive performance value of energy efficiency and delay corresponding to the batch size and kernel frequency combination is calculated and filled into the position point.
[0073] 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.
[0074] In an exemplary embodiment, the process of performing a current adjustment operation on a computing device based on a comprehensive performance value of energy efficiency and delay corresponding to a target location point includes: obtaining an actual operating state of the computing device, the actual operating state including a current batch size, a current core frequency, a current performance index, and a comprehensive performance value of energy efficiency and delay corresponding to the target location point; inputting the actual operating state into an action prediction model to obtain a predicted optimal adjustment operation; obtaining a current adjustment operation based on the predicted optimal adjustment operation, and performing the current adjustment operation on the computing device.
[0075] It can be understood that in order to facilitate the adjustment of the optimal batch size and kernel frequency of the computing device, this embodiment pre-builds and trains a reinforcement learning network for the kernel frequency and batch size of the computing device to obtain an action prediction model. Specifically, a reinforcement learning algorithm is constructed: Assume that a deep Q-network (DQN) is selected as the learning algorithm, and DQN is used. This is a reinforcement learning algorithm that combines Q learning and deep learning, and is suitable for dealing with complex problems with continuous state spaces. DQN uses a deep neural network to estimate the reward function value of a state-action pair. It combines Q learning and a deep neural network reinforcement learning algorithm to estimate the expected total reward of taking an action in a given state. In the reinforcement learning framework, especially in DQN (deep Q network), the input is the state (State), and the output is the best action (Action) for a given state (State). The action here refers to how f should be adjusted in the current state (State). i and batchsize to maximize the long-term reward, DQN selects actions by evaluating the Q-value of each possible action.
[0076] Environment definition: In the cloud data center environment, the environment includes the current configuration and performance indicators of the computing equipment. The current configuration includes but is not limited to core frequency and batch size, and the current performance indicators generated by this configuration include but are not limited to processing speed, energy efficiency and latency.
[0077] State definition: The state S is a multidimensional vector that contains the current batch size batchsize of the computing device, the kernel frequency f i , performance indicators metrics And the current energy efficiency and delay comprehensive performance value R current , that is, S=[batchsize,f i , performance metrics , R current ].
[0078] Action definition: Action A is predicted by the DQN network and indicates how the current kernel frequency and the current batch size should be adjusted. .
[0079] It can be understood that after obtaining the actual operating state of the computing device, as the input of the action prediction model, that is, the current state S, the current state S is sent to the action prediction model for optimal action prediction, and the predicted optimal adjustment operation A output by the action prediction model is obtained. DQN , sending the predicted optimal adjustment operation to the external controller of the computing device, executing f i And batchsize adjustment.
[0080] The DQN network can automatically select the optimal action based on the current state and adapt to the changing workload and environmental conditions. Through continuous learning and adjustment, the DQN network can find the configuration that maximizes the comprehensive performance of energy efficiency and latency. The automated adjustment process reduces manual intervention and improves the operational efficiency of the data center. In this way, the reinforcement learning network can effectively optimize the performance of computing equipment and improve the overall efficiency and reliability of the data center.
[0081] In an exemplary embodiment, the actual operating status also includes a comprehensive performance value of energy efficiency and delay corresponding to a neighborhood position point, and the neighborhood position point is a position point within a preset range from the target position point on the current energy efficiency gradient map.
[0082] In this embodiment, the input of the DQN model, that is, the current state S, includes not only the energy efficiency and delay comprehensive performance value corresponding to the target position point, but also the energy efficiency and delay comprehensive performance value corresponding to the neighboring position point of the target position point. This can provide more local information, allowing DQN to consider the immediate effect of the state and its performance in the neighboring state, which helps to make more comprehensive decisions when selecting actions and select better actions. That is, S=[batchsize, f i , performance metrics , R current , R local ];
[0083] Among them, R local is a vector containing batchsize, f i The comprehensive performance of energy efficiency and latency within a certain range, including but not limited to , , , wait.
[0084] In this embodiment, incorporating neighborhood information into the state space of the DQN model can improve the accuracy and robustness of model decision-making and accelerate the convergence speed.
[0085] In an exemplary embodiment, the computing device parameter adjustment method also includes: for each position point on the current energy efficiency gradient map, calculating the gradient vector corresponding to the position point; the process of obtaining the current adjustment operation based on the predicted optimal adjustment operation includes: obtaining the gradient vector of the target position point; and obtaining the current adjustment operation using the gradient vector and the predicted optimal adjustment operation.
[0086] In this embodiment, for each position point on the energy efficiency gradient map, the corresponding gradient vector is calculated. The gradient vector represents the change trend of the comprehensive performance value of energy efficiency and latency when the batch size and kernel frequency are adjusted at this position point. DQN After that, the gradient vector of the target position point is compared with the optimal adjustment operation A predicted by DQN DQN Combined, the actual adjustment operation is obtained. The gradient vector provides local information about the energy efficiency change trend around the target position point, which can help the DQN model make more accurate decisions. Specifically, for the filled gradient map, the gradient vector of each position point is calculated. The gradient vector can reveal in which direction to adjust the batch size and kernel frequency to maximize the comprehensive performance of energy efficiency and latency.
[0087] The scheme for calculating the gradient vector is as follows:
[0088] S1: Select neighboring points: For each position point on the current energy efficiency gradient map, select its neighboring points in the direction of batch size and core frequency. For example, the position point is (b,f i ), the neighboring point may be the first neighboring point (b+ b,f i ) and the second nearest point (b,f i + f i ),in b is the minimum increment of batch size, f i is the minimum increment of the core frequency.
[0089] S2: Calculate the difference: For the batch size direction, calculate the difference R b =R(b+ b,f i )-R(b,f i ); R b is the first difference, R(b+ b,f i ) is the actual performance value of the first adjacent point, R(b,f i) is the actual performance value of the location point; for the core frequency direction, calculate the difference R fi =R(b,f i + f i )-R(b,f i ); R fi is the second difference, R(b,f i + f i ) is the actual performance value of the second adjacent point, R(b,f i ) is the actual performance value of the location point.
[0090] S3: Gradient approximation, the gradient can be approximated by dividing these differences by the corresponding increments: Gradient direction b =( R b ) / b; Gradient direction fi =( R fi ) / f i .
[0091] S4: Get the gradient vector, which can be expressed as: R=(gradient direction b , gradient direction fi ).
[0092] In this embodiment, combining local gradient information can make up for the defect of the DQN model's insufficient understanding of local information, thereby improving the accuracy of decision-making. Gradient information can help the DQN model find the optimal solution more quickly, thereby improving search efficiency, thereby improving the efficiency and accuracy of computing device configuration.
[0093] In an exemplary embodiment, the process of obtaining the current adjustment operation by using the gradient vector and the predicted optimal adjustment operation includes: obtaining the current adjustment operation based on a second relational expression, where the second relational expression is Among them, A exec is the current adjustment operation, A DQN To predict the optimal adjustment operation, W is the third preset weight value, and G is the gradient vector of the target position point.
[0094] In this embodiment, G is from R local The calculated local gradient vector ( R b , R i ), the third preset weight value W is set according to the actual project needs. localIt is a vector containing the comprehensive performance values of energy efficiency and delay within a certain range around the target location point, that is, the local gradient vector G reflects the energy efficiency change trend near the target location point, for example: R b Indicates the change in the comprehensive performance value when the batch size changes, R fi Indicates the change in the overall performance value when the core frequency changes.
[0095] By considering local gradient information, this embodiment can better understand the impact of the current state and predict the changing trend of the future state. Local gradient information can help the DQN model find the optimal solution more quickly, thereby improving search efficiency and making more accurate adjustment operations.
[0096] In an exemplary embodiment, the method for adjusting parameters of a computing device also includes: using an action prediction model to obtain a predicted reward function value corresponding to a current adjustment operation; obtaining an observation result after performing the current adjustment operation on the computing device, the observation result including a new actual operating state and an immediate reward function value of the computing device; and updating the action prediction model using the observation result, the current adjustment operation, and the actual operating state before performing the current adjustment operation to minimize the difference between the immediate reward function value and the predicted reward function value.
[0097] In this embodiment, the reward function of the action prediction model is described. The reward function R' is intended to measure the improvement in performance after taking a specific action. It can be defined according to the changes in energy efficiency and latency. Specifically, the reward function should encourage higher energy efficiency and lower latency, and is defined according to the following structure:
[0098] ; where b is the batch size, f i is the core frequency, For processing batch size b and kernel frequency f i The energy efficiency data below, For processing batch size b and kernel frequency f i The delayed data below, and is a weight used to balance the importance of energy efficiency and latency in reward calculation, is the reward function value.
[0099] There is another definition of reward function. Aims to measure the improvement in performance after taking a specific action, and can be defined in terms of changes in energy efficiency and latency: ;in, and is a weighting factor used to balance the importance of energy efficiency and latency in decision making, It is the energy efficiency data. is delayed data, It is the reward function value under state S and action A.
[0100] It can be understood that in addition to the above-mentioned reward function, other reward functions that are intended to measure the improvement in performance after taking a specific action can also be used, and this embodiment is not limited here.
[0101] In the reinforcement learning model, the agent (i.e., the reinforcement learning algorithm) performs each action (i.e., changes b or f i ) and then calculate the new energy efficiency and delay, and then apply the reward function to get the predicted reward function value of the action .
[0102] After sending the current adjustment operation to the computing device, obtain the observation result after executing the current adjustment operation on the computing device, which includes the new state S' and the observed immediate reward function value .
[0103] Use observation results To update the DQN model, the network is trained by minimizing the difference between the predicted reward function value and the observed immediate reward function value. During the actual operation of the computing device, the above steps are repeated to execute a cycle of selecting actions, executing actions, obtaining observation results, and updating the model, so that the DQN model gradually learns what actions to take in different states to obtain the maximum reward, thereby achieving dynamic optimization of the computing device configuration.
[0104] In this embodiment, the computing device configuration can be dynamically adjusted according to different tasks and environments to keep it in the best state at all times. The DQN model can learn complex nonlinear relationships and gradually improve its prediction capabilities. In addition, this embodiment can be applied to various types of computing devices and tasks, and only the reward function and model structure need to be adjusted according to the actual situation.
[0105] In an exemplary embodiment, the computing device parameter adjustment method also includes: determining the maximum value of the comprehensive performance values of energy efficiency and delay corresponding to each position point on the current energy efficiency gradient map; determining the maximum value as the optimal performance value; in response to the difference between the comprehensive performance value of energy efficiency and delay corresponding to the target position point and the optimal performance value not being within a preset range, obtaining a new energy efficiency gradient map as the current energy efficiency gradient map.
[0106] In this embodiment, after defining the above reinforcement learning parameters, reinforcement learning training is started. First, each computing device in the cloud data center selects the optimal f within the delay tolerance range according to its established energy efficiency gradient map. i And batchsize value, that is, the batch size and kernel frequency corresponding to the maximum value of the comprehensive performance of energy efficiency and latency, from which the DQN network is trained.
[0107] At the same time, the maximum value of the comprehensive performance value of energy efficiency and delay is determined as the optimal R value. During the actual operation of the computing device, it is determined that the comprehensive performance value of energy efficiency and delay corresponding to the current batch size and the current core frequency deviates from the optimal R value by more than a certain threshold, that is, when the difference between the comprehensive performance value of energy efficiency and delay corresponding to the target position point and the optimal performance value is not within the preset range, it means that the current energy efficiency gradient map is no longer valid and needs to be recreated. At this time, the energy efficiency gradient map of the computing device is recreated to ensure that the model always runs in the best state.
[0108] In an exemplary embodiment, after performing the current adjustment operation on the computing device based on the comprehensive performance value of energy efficiency and delay corresponding to the target location point, the computing device parameter adjustment method further includes:
[0109] Obtain a measured comprehensive performance value of the computing device when it runs at a new batch size and a new core frequency; in response to the measured comprehensive performance value being within a high-performance range, control the computing device to run a preset number of times at the new batch size and the new core frequency, and if the measured comprehensive performance values obtained each time are within the high-performance range, determine that the new batch size and the new core frequency meet the delay and energy efficiency balance conditions.
[0110] In this embodiment, if the measured comprehensive performance value remains within the high performance range of the delta threshold for a long time within h steps after changing to the new batch size and the new kernel frequency, the new batch size and the new kernel frequency are fixed, and the computing device reaches the highest energy efficiency operation state. If after a certain period of time, due to changes in the environmental state such as delay failure or abnormal energy consumption, the DQN model is restarted to predict and adjust the batch size and kernel frequency.
[0111] For example, assume that the DQN model predicts that the optimal batch size is 128 and the core frequency is 1.5GHz. After executing this configuration, the energy efficiency and latency of the GPU meet the requirements. At this time, the DQN model parameters no longer change. If the comprehensive performance values of 10 consecutive steps (h=10) are all within the high performance range (delta=0.1), it can be determined that the configuration meets the latency and energy efficiency balance conditions and is fixed. If after a period of time, due to the increase in server load, the GPU latency no longer meets the requirements, it means that the environmental state has changed. At this time, it is necessary to restart the DQN model, predict the new optimal configuration, and make adjustments.
[0112] As above, the online training of reinforcement learning network and the adaptive adjustment of batch size and core frequency fi are completed, so as to optimize the energy efficiency and performance of computing equipment in big data processing and deep learning tasks in the long-term operation of cloud servers. The reinforcement learning technology is used to automatically find the optimal GPU configuration within the given delay tolerance range, and an energy efficiency gradient map is established. The data-driven method is used to guide the adjustment of GPU configuration, which improves the accuracy and efficiency of decision-making. The Fourier curve fitting method is used to accurately fit the energy efficiency data, effectively handle periodic changes, and enhance the adaptability and accuracy of the model. For tasks with strict running time requirements, such as real-time and interactive tasks, optimization strategies are proposed to minimize energy consumption while ensuring performance.
[0113] Second, please refer to Figure 2 The present invention provides a computing device parameter adjustment system, comprising:
[0114] The acquisition module 11 is used to obtain the current energy efficiency gradient map of the computing device; the position points of the current energy efficiency gradient map are used to characterize the comprehensive performance value of energy efficiency and latency of the computing device under the corresponding batch size and kernel frequency combination.
[0115] The determination module 12 is used to determine the target position point on the current energy efficiency gradient map according to the current batch size and the current kernel frequency of the computing device, and perform the current adjustment operation on the computing device based on the comprehensive performance value of energy efficiency and delay corresponding to the target position point.
[0116] The control module 13 is used to control the computing device to continue to operate according to the new batch size and the new kernel frequency in response to the new batch size and the new kernel frequency satisfying the delay and energy efficiency balance condition after the current adjustment operation is completed.
[0117] In an exemplary embodiment, the process of obtaining the current energy efficiency gradient map of a computing device includes: determining a reference batch size range and a reference kernel frequency range corresponding to the computing device according to the specifications and / or performance constraints of the computing device; selecting multiple batch sizes in the reference batch size range; selecting multiple kernel frequencies in the reference kernel frequency range; arranging and combining multiple batch sizes and multiple kernel frequencies to generate multiple batch size and kernel frequency combinations; calculating the comprehensive performance value of energy efficiency and latency 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 comprehensive performance values of energy efficiency and latency to obtain the current energy efficiency gradient map.
[0118] In an exemplary embodiment, the process of calculating the comprehensive performance value of energy efficiency and latency 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 comprehensive performance value of energy efficiency and latency under the batch processing size and core frequency combination based on the energy efficiency data and latency data.
[0119] In an exemplary embodiment, the computing device parameter adjustment system is also used to: perform data fitting on energy efficiency data of multiple core frequencies to obtain an energy efficiency fitting curve; perform data fitting on delay data under multiple batch sizes to obtain a delay fitting curve; and fill in the position points of the current energy efficiency gradient map that are not filled with the comprehensive performance values of energy efficiency and delay based on the energy efficiency fitting curve and the delay fitting curve.
[0120] In an exemplary embodiment, the process of calculating the comprehensive performance value of energy efficiency and delay under the combination of batch size and core frequency based on energy efficiency data and delay data includes: calculating the comprehensive performance value of energy efficiency and delay under the combination of batch size and core frequency based on a first relational expression, the first relational expression being: ;in, is the batch size and kernel frequency combination, is the comprehensive performance value of energy efficiency and latency under the combination of batch size and kernel frequency, 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.
[0121] In an exemplary embodiment, the process of performing a current adjustment operation on a computing device based on a comprehensive performance value of energy efficiency and delay corresponding to a target location point includes: obtaining an actual operating state of the computing device, the actual operating state including a current batch size, a current core frequency, a current performance index, and a comprehensive performance value of energy efficiency and delay corresponding to the target location point; inputting the actual operating state into an action prediction model to obtain a predicted optimal adjustment operation; obtaining a current adjustment operation based on the predicted optimal adjustment operation, and performing the current adjustment operation on the computing device.
[0122] In an exemplary embodiment, the actual operating status also includes a comprehensive performance value of energy efficiency and delay corresponding to a neighborhood position point, and the neighborhood position point is a position point within a preset range from the target position point on the current energy efficiency gradient map.
[0123] In an exemplary embodiment, the computing device parameter adjustment system is also used to: calculate the gradient vector corresponding to each position point on the current energy efficiency gradient map; the process of obtaining the current adjustment operation based on the predicted optimal adjustment operation includes: obtaining the gradient vector of the target position point; and obtaining the current adjustment operation using the gradient vector and the predicted optimal adjustment operation.
[0124] In an exemplary embodiment, the process of obtaining the current adjustment operation by using the gradient vector and the predicted optimal adjustment operation includes: obtaining the current adjustment operation based on a second relational expression, where the second relational expression is Among them, A exec is the current adjustment operation, A DQN To predict the optimal adjustment operation, W is the third preset weight value, and G is the gradient vector of the target position point.
[0125] In an exemplary embodiment, the computing device parameter adjustment system is also used to: use an action prediction model to obtain a predicted reward function value corresponding to a current adjustment operation; obtain an observation result after performing the current adjustment operation on the computing device, the observation result including a new actual operating state of the computing device and an immediate reward function value; and use the observation result, the current adjustment operation, and the actual operating state before performing the current adjustment operation to update the action prediction model so as to minimize the difference between the immediate reward function value and the predicted reward function value.
[0126] In an exemplary embodiment, the computing device parameter adjustment system is also used to: determine the maximum value of the comprehensive performance values of energy efficiency and delay corresponding to each position point on the current energy efficiency gradient map; determine the maximum value as the optimal performance value; in response to the difference between the comprehensive performance value of energy efficiency and delay corresponding to the target position point and the optimal performance value not being within a preset range, obtain a new energy efficiency gradient map as the current energy efficiency gradient map.
[0127] In an exemplary embodiment, after performing the current adjustment operation on the computing device based on the comprehensive performance value of energy efficiency and delay corresponding to the target location point, the computing device parameter adjustment system is also used to: obtain the measured comprehensive performance value of the computing device when it runs at a new batch size and a new core frequency; in response to the measured comprehensive performance value being within a high-performance range, control the computing device to run a preset number of times according to the new batch size and the new core frequency, and if the measured comprehensive performance values obtained each time are within the high-performance range, determine that the new batch size and the new core frequency meet the delay and energy efficiency balance conditions.
[0128] In an exemplary embodiment, after obtaining the measured comprehensive performance value of the computing device when running at a new batch size and a new core frequency, the computing device parameter adjustment system is also used to determine that the new batch size and the new core frequency do not meet the latency and energy efficiency balance conditions in response to the measured comprehensive performance value not being within the high-performance range, use the new batch size as the current batch size, use the new core frequency as the current core frequency, and perform an operation of determining a target position point on the current energy efficiency gradient map according to the current batch size and the current core frequency of the computing device.
[0129] 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 method for adjusting parameters of a computing device as described in any one of the embodiments above.
[0130] 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.
[0131] The computer program product provided by the present invention has the same beneficial effects as the above-mentioned method for adjusting parameters of a computing device.
[0132] Fourth, please refer to Figure 3 The present invention also provides an electronic device, comprising:
[0133] A memory 21, used for storing computer programs;
[0134] The processor 22 is configured to implement the steps of the method for adjusting parameters of a computing device as described in any one of the above embodiments when executing a computer program.
[0135] The electronic device also includes:
[0136] 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.
[0137] 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.
[0138] 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.
[0139] 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.
[0140] The electronic device provided by the present invention has the same beneficial effects as the above-mentioned method for adjusting parameters of a computing device.
[0141] In a fifth aspect, the present invention further provides a server, comprising a plurality of computing devices and the above electronic device.
[0142] 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.
[0143] The server provided by the present invention has the same beneficial effects as the above-mentioned computing device parameter adjustment method.
[0144] 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 method for adjusting the parameters of a computing device as described in any one of the embodiments above are implemented.
[0145] 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.
[0146] For an introduction to a computer-readable storage medium 30 provided by the present invention, please refer to the above embodiment, and the present invention will not be described in detail here.
[0147] The computer-readable storage medium 30 provided by the present invention has the same beneficial effects as the above-mentioned computing device parameter adjustment method.
[0148] 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.
[0149] 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 parameters of a computing device, characterized in that: include: Get the current energy efficiency gradient map of the computing device; The position point of the current energy efficiency gradient map is used to represent the comprehensive performance value of energy efficiency and latency of the computing device under the corresponding batch size and kernel frequency combination; Determine a target location point on the current energy efficiency gradient map according to a current batch size and a current kernel frequency of the computing device, and perform a current adjustment operation on the computing device based on a comprehensive performance value of energy efficiency and latency corresponding to the target location point; In response to the new batch size and the new kernel frequency satisfying a delay and energy efficiency balance condition after the current adjustment operation is completed, the computing device is controlled to continue to operate according to the new batch size and the new kernel frequency.
2. The method for adjusting computing device parameters according to claim 1, characterized in that: The process of obtaining the current energy efficiency gradient map of a computing device includes: Determining a reference batch size range and a reference kernel frequency range corresponding to the computing device according to the specification and / or performance constraints of the computing device; Selecting a plurality of batch sizes within the reference batch size range; Selecting a plurality of kernel frequencies in the reference kernel frequency range; Arrange and combine a plurality of the batch sizes and a plurality of the kernel frequencies to generate a plurality of combinations of the batch sizes and the kernel frequencies; Calculating the comprehensive performance value of energy efficiency and latency of the computing device under each combination of the batch size and the core frequency; Based on the plurality of batch size and kernel frequency combinations and their corresponding energy efficiency and latency comprehensive performance values, the position points of a preset two-dimensional grid are filled to obtain a current energy efficiency gradient map.
3. The method for adjusting computing device parameters according to claim 2, characterized in that: The process of calculating the comprehensive performance value of energy efficiency and latency of the computing device under each combination of the batch size and the core 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 a comprehensive performance value of energy efficiency and latency under the batch size and kernel frequency combination is calculated based on the energy efficiency data and the latency data.
4. The method for adjusting computing device parameters according to claim 3, characterized in that: The computing device parameter adjustment method further includes: Performing data fitting on the energy efficiency data of the plurality of core frequencies to obtain an energy efficiency fitting curve; Performing data fitting on the delay data under the plurality of batch sizes to obtain a delay fitting curve; Based on the energy efficiency fitting curve and the delay fitting curve, the position points in the current energy efficiency gradient map that are not filled with the comprehensive performance value of energy efficiency and delay are filled.
5. The method for adjusting computing device parameters according to claim 3, characterized in that: The process of calculating the comprehensive performance value of energy efficiency and latency under the combination of the batch size and the kernel frequency based on the energy efficiency data and the latency data includes: The comprehensive performance value of energy efficiency and latency under the combination of the batch size and the kernel frequency is calculated based on the first relational expression, where the first relational expression is: ; in, For the batch size and kernel frequency combination, is the comprehensive performance value of energy efficiency and latency under the combination of batch size and kernel frequency, 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.
6. The method for adjusting computing device parameters according to claim 1, characterized in that: The process of performing the current adjustment operation on the computing device based on the comprehensive performance value of energy efficiency and delay corresponding to the target location point includes: Acquire the actual running state of the computing device, wherein the actual running state includes a current batch size, a current kernel frequency, a current performance index, and a comprehensive performance value of energy efficiency and delay corresponding to the target location point; Inputting the actual operating state into an action prediction model to obtain a predicted optimal adjustment operation; A current adjustment operation is obtained based on the predicted optimal adjustment operation, and the current adjustment operation is performed on the computing device.
7. The method for adjusting computing device parameters according to claim 6, characterized in that: The actual operating status also includes a comprehensive performance value of energy efficiency and delay corresponding to a neighborhood position point, and the neighborhood position point is a position point within a preset range from the target position point on the current energy efficiency gradient map.
8. The method for adjusting computing device parameters according to claim 6, characterized in that: The computing device parameter adjustment method further includes: For each of the position points on the current energy efficiency gradient map, calculating a gradient vector corresponding to the position point; The process of obtaining the current adjustment operation based on the predicted optimal adjustment operation includes: Obtaining a gradient vector of the target position point; A current adjustment operation is obtained by using the gradient vector and the predicted optimal adjustment operation.
9. The method for adjusting computing device parameters according to claim 8, characterized in that: The process of obtaining the current adjustment operation by using the gradient vector and the predicted optimal adjustment operation includes: The current adjustment operation is obtained based on the second relational expression, where the second relational expression is: ; Among them, A exec For the current adjustment operation, A DQN is the predicted optimal adjustment operation, W is the third preset weight value, and G is the gradient vector of the target position point.
10. The method for adjusting computing device parameters according to claim 6, characterized in that: The computing device parameter adjustment method further includes: Using the action prediction model to obtain a predicted reward function value corresponding to the current adjustment operation; Obtaining an observation result after executing the current adjustment operation on the computing device, the observation result comprising a new actual operating state and an instant reward function value of the computing device; The action prediction model is updated using the observation result, the current adjustment operation, and the actual running state before the current adjustment operation is performed, so as to minimize the difference between the immediate reward function value and the predicted reward function value.
11. The method for adjusting computing device parameters according to claim 10, characterized in that: The computing device parameter adjustment method further includes: Determine the maximum value of the comprehensive performance values of energy efficiency and delay corresponding to each position point on the current energy efficiency gradient map; determining the maximum value as the optimal performance value; In response to the difference between the energy efficiency and delay comprehensive performance value corresponding to the target position point and the optimal performance value not being within a preset range, a new energy efficiency gradient map is acquired as the current energy efficiency gradient map.
12. The method for adjusting computing device parameters according to any one of claims 1 to 11, characterized in that: After performing the current adjustment operation on the computing device based on the comprehensive performance value of energy efficiency and delay corresponding to the target location point, the computing device parameter adjustment method further includes: obtaining a measured comprehensive performance value of the computing device when operating at the new batch size and the new kernel frequency; In response to the measured comprehensive performance value being within the high-performance range, the computing device is controlled to run a preset number of times according to the new batch size and the new core frequency; if the measured comprehensive performance value obtained each time is within the high-performance range, it is determined that the new batch size and the new core frequency satisfy the delay and energy efficiency balance condition.
13. The method for adjusting computing device parameters according to claim 12, characterized in that: After obtaining the measured comprehensive performance value of the computing device when running at the new batch size and the new kernel frequency, the computing device parameter adjustment method further includes: In response to the measured comprehensive performance value not being within the high-performance range, it is determined that the new batch size and the new kernel frequency do not satisfy the latency and energy efficiency balance condition, the new batch size is used as the current batch size, the new kernel frequency is used as the current kernel frequency, and an operation of determining a target position point on the current energy efficiency gradient map according to the current batch size and the current kernel frequency of the computing device is performed.
14. 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 method for adjusting parameters of a computing device as described in any one of claims 1 to 13 are implemented.
15. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the method for adjusting parameters of a computing device as described in any one of claims 1 to 13 when executing the computer program.
16. A server, characterized in that: The invention comprises a plurality of computing devices and the electronic device as claimed in claim 15.
17. 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 method for adjusting parameters of a computing device according to any one of claims 1 to 13 are implemented.
Citation Information
Patent Citations
Stream processing and batch processing switching method and switching device
CN116841753A
Energy efficiency perception adaptive scheduling method and system for deep learning reasoning of GPU (Graphics Processing Unit) system
CN117667336A
Data acquisition method, training method and electronic equipment
CN117687495A
Collaborative optimization method, system and device based on edge computing and medium
CN117950856A
Big data platform data storage management method
CN118643012A
Cited By
Operation parameter adjusting method and device, electronic equipment and storage medium
CN120872624A
Method and device for adjusting running parameter, electronic equipment and storage medium
CN120872624B
Task processing method and device, electronic equipment and storage medium
CN121116562A
Task processing method and device, electronic equipment and storage medium
CN121116562B