Working frequency control method and device and related equipment

Through the operating frequency control method, the operating frequency of the processor is dynamically adjusted according to the performance and energy consumption information of the processor's tasks, solving the problem of low processor performance in the prior art, and achieving both the processor performance in energy consumption management .

CN119440223APending Publication Date: 2025-02-14HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311365825.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-08-04
Filing Date
2023-10-19
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

In processor energy consumption management, the prior art is difficult to take into account the performance of the processor, resulting in low processor performance.

Method used

Through the operating frequency control method, the performance and energy consumption information of the processor performing tasks is used to determine the frequency modulation timing and frequency modulation method, and the operating frequency of the processor is dynamically adjusted to take into account performance and energy consumption.

Benefits of technology

This enables the processor performance to be maintained at a high level in energy consumption management, avoiding the problem of performance degradation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119440223A_ABST
    Figure CN119440223A_ABST
Patent Text Reader

Abstract

The invention provides a working frequency control method and device and related equipment. Determining a task to be processed, the task being a task periodically executed by the processor, such as a model training task, a model reasoning task and the like, and obtaining a frequency modulation opportunity (which can be used for indicating a moment for adjusting the working frequency of the processor) and a frequency modulation mode (such as increasing / decreasing the working frequency) for the working frequency of the processor; the frequency modulation opportunity and the frequency modulation mode are determined based on task execution performance and energy consumption of the processor; and in the process that the processor executes the task, adjusting the working frequency of the processor at the frequency modulation time according to the frequency modulation mode. The frequency modulation mode and the frequency modulation opportunity are determined by utilizing the performance and the energy consumption of the processor for executing the task, and the working frequency of the processor is adjusted, so that the performance of the processor can be considered when the energy consumption management is performed on the processor, and the performance of the processor can be continuously kept at a relatively high level.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method and device for controlling an operating frequency and related equipment. Background Art

[0002] Energy management is one of the most important issues in the computer field. At present, when managing the energy consumption of a processor, the operating frequency of the processor is usually adjusted according to the temperature of the environment in which the processor is located. The operating frequency is used to describe the number of periodic changes completed in a unit time period. Generally, the higher the operating frequency of the processor, the more times it performs operations in a unit time period, and the higher the energy consumption and heat generated.

[0003] In actual applications, when the ambient temperature of the processor is too high, the operating frequency of the processor is usually reduced to reduce the heat generated by the processor, thereby reducing the ambient temperature of the processor or preventing the ambient temperature of the processor from further increasing. However, reducing the operating frequency of the processor will also reduce the performance of the processor. Therefore, when the processor function is managed according to the ambient temperature of the processor, the problem of low processor performance often occurs. Summary of the invention

[0004] In view of this, an embodiment of the present application provides an operating frequency control method for managing the energy consumption of a processor while taking into account the performance of the processor so that the performance of the processor can also be maintained at a high level. The present application also provides a corresponding operating frequency control device, a computing device, a computer-readable storage medium, and a computer program product.

[0005] In the first aspect, an embodiment of the present application provides an operating frequency control method, which can be executed by a corresponding operating frequency control device. Specifically, the operating frequency control device determines a task to be processed, which is a task periodically executed by a processor, such as a model training task, a model reasoning task, etc., and the operating frequency control device can also obtain a frequency modulation timing and a frequency modulation method for the operating frequency of the processor. The frequency modulation timing can be used to indicate the moment to adjust the operating frequency of the processor, and the frequency modulation method can be used to indicate the method of adjusting the operating frequency of the processor, which can be to increase the operating frequency, or to decrease the operating frequency, etc. The frequency modulation timing and the frequency modulation method are determined based on the performance and energy consumption of the processor in executing the task; thereby, the operating frequency control device adjusts the operating frequency of the processor at the frequency modulation timing according to the frequency modulation method during the process of the processor executing the task.

[0006] Since the operating frequency control device uses the performance and energy consumption of the processor in executing tasks to determine the frequency modulation method and frequency modulation timing, and adjusts the operating frequency of the processor accordingly, that is, the operating frequency control device can adjust the operating frequency of the processor in an appropriate manner at an appropriate time from the dimensions of performance and energy consumption. This makes it possible to take into account the performance of the processor when managing the energy consumption of the processor, so that the performance of the processor can be continuously maintained at a high level.

[0007] In a possible implementation, when the operating frequency control device obtains the frequency modulation timing and frequency modulation mode for the operating frequency of the processor, it can specifically first obtain the performance information and energy consumption information corresponding to the processor executing the task. The performance information can be, for example, the time required for the processor to execute the task, and the energy consumption information can be, for example, the energy consumption required for the processor to execute the task (which can be measured by power). Exemplarily, the operating frequency control device can first iteratively execute the task n (n is a positive integer), so as to collect the performance and energy consumption information corresponding to the processor executing the task in the process of executing the task. Thus, the operating frequency control device can determine the frequency modulation timing and frequency modulation mode for the operating frequency of the processor based on the obtained performance information and energy consumption information. In this way, the operating frequency control device can determine the frequency modulation timing and frequency modulation mode according to the energy consumption and performance generated by the processor when executing the task, so that after adjusting the operating frequency of the processor based on the frequency modulation mode and frequency modulation timing, the performance and energy consumption of the processor when executing the task can be kept in a better state at the same time.

[0008] In a possible implementation, the task that the processor needs to perform includes multiple operators. Then, when the operating frequency control device obtains the performance information and energy consumption information corresponding to the processor executing the task, it can specifically record the load information generated during the processor iteratively executing at least one task. The load information is used to indicate the load characteristics of multiple operators, for example, it can be the number of calculation operations performed by the processor when executing the operator, the number of read and write operations performed, data read hit rate, execution time, hardware parameters, operating frequency, operating voltage, current and other characteristic data; so that the operating frequency control device can create performance models and energy consumption models for multiple operators based on the load information, wherein the created performance model is used to infer the performance of the operator in different operating environments, and the created energy consumption model is used to infer the energy consumption of the operator in different operating environments. In this way, the operating frequency control device can perform performance modeling and energy consumption modeling through the information generated during the iterative execution of the task, so as to obtain the performance and energy consumption of the processor executing each operator using the performance model and energy consumption model obtained by modeling. In this way, the operating frequency control device can use the performance and energy consumption determined by the performance model and the energy consumption model to determine the timing and method for adjusting the operating frequency of the processor, so that the performance and energy consumption of the processor when executing the multiple operators can be maintained at a better state at the same time.

[0009] In a possible implementation, the task that the processor needs to perform includes multiple operators. Then, when the operating frequency control device obtains the performance information and energy consumption information corresponding to the processor executing the task, it can specifically estimate the performance information and energy consumption information corresponding to the processor executing the multiple operators based on the attribute characteristics of the multiple operators, such as estimating the time and power required for the processor to execute each operator. The attribute characteristics can be, for example, the amount of data that the processor needs to read / output when executing each operator and the data processing operation of the operator. In this way, the operating frequency control device can estimate the performance and energy consumption information of each operator through theoretical calculation, so as to subsequently determine the frequency modulation method and frequency modulation timing for adjusting the operating frequency of the processor based on the estimated performance and energy consumption information, so as to achieve the performance and energy consumption of the processor in executing the task. Maintaining a better state.

[0010] In a possible implementation, when the operating frequency control device determines the frequency modulation timing and frequency modulation mode for the operating frequency of the processor according to the performance information and the energy consumption information, it can be specifically obtained by processing the modeling results to obtain the optimization result, and the modeling result indicates the performance and energy consumption information of multiple operators at different operating frequencies. For example, the modeling results are processed by heuristic search, grid search, dynamic programming, etc. to determine an optimal frequency modulation position to determine at least one frequency modulation timing and the frequency modulation mode corresponding to the frequency modulation timing. The optimization result includes at least one frequency modulation timing corresponding to multiple operators and the frequency modulation mode corresponding to each frequency modulation timing, and the obtained optimization result satisfies the constraints on the performance and energy consumption of the processor. The constraint condition can be, for example, that the processor has the lowest energy consumption when executing the operator when the performance degradation of the processor does not exceed a preset threshold. In this way, by determining the frequency modulation timing and frequency modulation mode through heuristic search, it is possible to reduce the energy consumption generated by the processor when executing the task, and also reduce the amount of calculation required to determine the frequency modulation timing and the frequency modulation mode.

[0011] In a possible implementation, when the operating frequency control device performs a heuristic search on multiple operators with operators as the granularity according to performance information and energy consumption information, it can specifically first filter multiple operators to obtain memory-intensive operators. In actual application, other operators filtered out can be computing-intensive operators. Then, the operating frequency control device performs a heuristic search on memory-intensive operators with operators as the granularity according to the performance information and energy consumption information of the memory-intensive operators. In this way, the number of operators required to determine the frequency modulation timing and frequency modulation method can be reduced, thereby effectively reducing the resources consumed by the operating frequency control device, including computing resources and storage resources.

[0012] In a possible implementation, the search results obtained by the operating frequency control device through heuristic search may include multiple frequency modulation opportunities, and the intervals between the multiple frequency modulation opportunities are greater than a threshold. In this way, by limiting the interval between two adjacent adjustments of the operating frequency of the processor to be greater than or equal to the threshold, the operating frequency of the processor 101 can be prevented from being frequently switched.

[0013] In a possible implementation, the operating frequency control device can also output a variety of frequency modulation targets, which are used to indicate different requirements for the performance or energy consumption of the processor to perform tasks. For example, the following four frequency modulation targets can be determined, among which frequency modulation target 1 is to minimize energy consumption while keeping the performance of the processor basically unchanged; frequency modulation target 2 is that the performance and energy consumption of the processor are coordinated in the optimal state; frequency modulation target 3 is to adjust the operating frequency of the processor according to the energy consumption of the processor; and frequency modulation target 4 is to adjust the operating frequency of the processor according to the performance of the processor. Then, when the operating frequency control device determines the frequency modulation timing and frequency modulation method for the operating frequency of the processor based on the performance information and energy consumption information, it can specifically determine the frequency modulation timing and frequency modulation method for the operating frequency of the processor based on the frequency modulation target, performance information, and energy consumption information selected by the user from the multiple frequency modulation targets. In this way, the flexibility of the user in adjusting the operating frequency of the processor when performing tasks can be improved, and the user experience can be improved.

[0014] In a possible implementation, when the operating frequency control device determines the frequency adjustment timing and frequency adjustment method for the operating frequency of the processor according to the performance information and energy consumption information, it can specifically first obtain the custom frequency adjustment target provided by the user. The custom frequency adjustment target can, for example, indicate to adjust the operating frequency of the processor according to information of multiple dimensions such as temperature, energy consumption and performance at the same time, so that the operating frequency control device can determine the frequency adjustment timing and frequency adjustment method for the operating frequency of the processor according to the custom frequency adjustment target, performance information and energy consumption information. In this way, the flexibility of the supporter to adjust the operating frequency of the processor when executing a task can be improved, and the user experience can be improved.

[0015] In a possible implementation, when the operating frequency control device obtains the frequency modulation timing and frequency modulation method for the operating frequency of the processor, it can specifically parse the frequency modulation timing and frequency modulation method for the operating frequency of the processor from the task. In this way, the operating frequency control device can use the frequency modulation method and frequency modulation timing parsed from the task to adjust the operating frequency of the processor, so that the performance and energy consumption of the processor when executing the multiple operators can be maintained at a relatively optimal state at the same time.

[0016] In a second aspect, the present application provides an operating frequency control device, which includes various modules for executing the operating frequency control method in the first aspect or any possible implementation of the first aspect.

[0017] In a third aspect, the present application provides a computing device, which includes a processor and a memory, the memory stores program instructions, and the processor runs the program instructions to execute the operating frequency control method in the above-mentioned first aspect or any possible implementation of the first aspect.

[0018] In a fourth aspect, the present application provides a computer-readable storage medium, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is executed on at least one computing device, the at least one computing device executes the method described in the first aspect or any one of the implementations of the first aspect.

[0019] In a fifth aspect, the present application provides a computer program product comprising instructions, which, when executed on at least one computing device, enables the at least one computing device to execute the method described in the first aspect or any one of the implementations of the first aspect.

[0020] Based on the implementations provided in the above aspects, this application can also be further combined to provide more implementations. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 A schematic diagram of the structure of an exemplary data processing system provided in an embodiment of the present application;

[0022] Figure 2 A flow chart of a working frequency control method provided in an embodiment of the present application;

[0023] Figure 3 A schematic diagram of adjusting the operating frequency of the processor 101 during the process of the processor 101 executing multiple operators;

[0024] Figure 4 A schematic diagram of adjusting the operating frequency of the processor 101 during the process of the processor 101 executing multiple operators;

[0025] Figure 5 A schematic diagram of adjusting the operating frequency of the processor 101 during the process of the processor 101 executing multiple operators;

[0026] Figure 6 A schematic diagram of the structure of a working frequency control device provided in an embodiment of the present application;

[0027] Figure 7 A schematic diagram of the structure of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0028] The scheme in the embodiments provided in this application will be described below in conjunction with the drawings in this application.

[0029] See also Figure 1 , which shows a schematic diagram of the structure of a data processing system. Figure 1 As shown, the data processing system 10 includes at least one processor and an operating frequency control device. For ease of understanding and description, Figure 1In the example, the processor 101, the processor 102 and the operating frequency control device 200 are used as an example for exemplary description. For example, the processor 101, the processor 102 and the operating frequency control device 200 can be deployed in a computing device, such as Figure 1 shown.

[0030] In addition, the data processing system 10 can also provide clients to the outside world, such as Figure 1 Client 103 in.

[0031] The client 103 is used to interact with the user and send the task submitted by the user to the data processing system 10. Exemplarily, the client 103 may be an application running on a terminal device at the user side, or may be a web browser provided by the data processing system 10 to the outside.

[0032] The processor 101 (and the processor 102) are used to execute tasks submitted by users, such as model training tasks, model reasoning tasks, etc. Exemplarily, the processor 101 can be any type of processor, such as a central processing unit (CPU), a deep-learning processing unit (DPU), a graphics processing unit (GPU), a neural-network processing unit (NPU), or other types of processors, which are not limited.

[0033] The operating frequency control device 200 is used to adjust the operating frequency of one or more processors (including the processor 101 and the processor 102, etc.) when executing tasks, such as increasing or decreasing the operating frequency of the processor 101 during operation, so that the performance and energy consumption of the processor 101 are maintained at a relatively optimal level. In actual application, the operating frequency control device 200 can adjust the operating frequency for each processor individually, or for multiple processors in batches, and this is not limited.

[0034] In specific implementation, the operating frequency control device 200 first determines the periodic task that the processor 101 (and the processor 102) is currently preparing to execute or is executing, such as a model training task, and obtains the frequency modulation timing and frequency modulation method for the operating frequency of the processor 101. The frequency modulation timing is used to indicate the moment of adjusting the operating frequency of the processor 101; the frequency modulation method is used to indicate increasing or decreasing the operating frequency of the processor 101. Among them, the frequency modulation timing and frequency modulation method are determined based on the performance of the processor 101 in executing the task (such as the duration of the processor 101 executing the task, etc.) and the energy consumption (such as the power of the processor 101 executing the task, etc.). For example, when submitting a task, the user can define the frequency modulation timing and frequency modulation method in the task, so that the operating frequency control device 200 can parse the frequency modulation timing and frequency modulation method from the task; or, the operating frequency control device 200 can automatically determine the frequency modulation timing or frequency modulation method according to the load conditions when the processor 101 executes one or more tasks. Then, during the process of the processor 101 executing a task, the operating frequency control device 200 adjusts the operating frequency of the processor 101 at the frequency modulation timing corresponding to the frequency modulation method according to the acquired frequency modulation method, so that the energy consumption and performance of the processor 101 when executing the task based on the adjusted operating frequency can reach a better level.

[0035] Since the operating frequency control device 200 uses the performance and energy consumption of the processor 101 in executing tasks to determine the frequency modulation method and frequency modulation timing, and adjusts the operating frequency of the processor 101 accordingly, that is, the operating frequency control device 200 can adjust the operating frequency of the processor 101 in an appropriate manner at an appropriate time from the dimensions of performance and energy consumption. This makes it possible to take into account the performance of the processor 101 when managing the energy consumption of the processor 101, so that the performance of the processor 101 can also be maintained at a high level.

[0036] For example, the above Figure 1 The operating frequency control device 200 shown may be implemented by software or hardware.

[0037] In one example, when implemented by software, the operating frequency control device 200 may be a code running on a computing device including the processor 101 (and the processor 102). Furthermore, when the data processing system 10 includes multiple processors located on different computing devices, the operating frequency control device 200 may also run on different computing devices, and the operating frequency control device 200 on each computing device is used to separately adjust the operating frequency of the processor on the computing device.

[0038] In another example, when implemented by hardware, the operating frequency control device 200 may be hardware with data processing capability, etc. Exemplarily, the hardware with data processing capability may be a CPU, and an application-specific integrated circuit (ASIC), a programmable logic device (PLD), a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), a system on chip (SoC), a software-defined infrastructure (SDI) chip, an artificial intelligence (AI) chip, a data processing unit (DPU), etc., or any combination thereof. In addition, the number of hardware with data processing capability included in the operating frequency control device 200 may be one or more, and the type of hardware included may be one or more. Specifically, the number and type of the hardware may be set according to the business requirements of the actual application, and this embodiment does not limit this.

[0039] It is worth noting that the above Figure 1 The data processing system 10 shown is only used as an exemplary description. In other possible implementations, the data processing system 10 may also include more types of devices, such as a scheduler, etc., which is used to schedule the tasks sent by the client 103 to the corresponding processor for execution; and, for ease of description, Figure 1 The data processing system 10 shown in the figure only shows a plurality of processors. In actual application, the data processing system 10 may also include devices such as memory and power supply required for the plurality of processors to perform tasks. Alternatively, in other possible implementations, the processor 101, the processor 102 and the operating frequency control device 200 may be run on a terminal device on the user side, so that the user can directly submit tasks on the terminal device. In this case, the data processing system 10 may not need to include the client 103. The specific structure of the data processing system 10 is not limited in this application.

[0040] Next, various non-limiting specific implementations of the operating frequency control process are described in detail.

[0041] See also Figure 2, is a flow chart of a method for controlling a working frequency in an embodiment of the present application. The method can be applied to the above Figure 1 The data processing system 10 shown in FIG. 1 may also be applied to other possible data processing systems. Figure 1 The data processing system 10 shown is used to adjust the operating frequency of the processor 101 as an example for explanation. Figure 2 The working frequency control method shown may specifically include:

[0042] S201: The processor 101 obtains a periodically executed task submitted by a user.

[0043] Among them, the periodically executed task may be, for example, a model training task. After acquiring the task, the processor 101 may use the training sample to iteratively train the artificial intelligence (AI) model. Each time the processor 101 executes a task, the processor 101 executes a model training process.

[0044] Alternatively, a periodically executed task may be, for example, a model reasoning task. After acquiring the task, the processor 101 may use multiple sets of input data to perform the model reasoning process multiple times. Each time the processor 101 executes a task, the processor 101 uses the AI ​​model to perform a reasoning process based on a set of input data.

[0045] As an implementation example, a user can submit a task that needs to be executed periodically on the client 103, so that the client 103 can send the task to the processing system 10, and the data processing system 10 (the scheduler therein) schedules the task to the processor 101 so that the processor 101 can execute the task periodically.

[0046] S202: The operating frequency control device 200 obtains a frequency modulation timing and a frequency modulation method for the operating frequency of the processor 101, wherein the frequency modulation timing and the frequency modulation method are determined based on the performance and energy consumption of the processor 101 in executing the task.

[0047] S203: When the processor 101 is executing a task, the operating frequency control device 200 adjusts the operating frequency of the processor 101 at a frequency modulation opportunity according to the frequency modulation method.

[0048] In actual application, the processor 101 can perform tasks based on a standard operating frequency, such as 1800 MHZ (megahertz). However, a fixed standard operating frequency easily causes the processor 101 to have low performance or high energy consumption when performing tasks. Therefore, in this embodiment, the operating frequency control device 200 simultaneously considers the performance dimension and the energy consumption dimension (and other dimensions) to adjust the operating frequency of the processor 101, so that after adjusting the operating frequency of the processor 101, the processor 101 has high performance and low energy consumption when performing tasks.

[0049] In specific implementation, the operating frequency control device 200 may first determine the frequency modulation timing and frequency modulation method for adjusting the operating frequency of the processor 101 from the performance dimension and the energy consumption dimension. In this regard, this embodiment provides the following six implementation examples.

[0050] In the first implementation example, when submitting a task, the user can define at least one frequency modulation opportunity and the frequency modulation method used at the frequency modulation opportunity in the task. For example, the user can predict the performance and energy consumption of the processor 101 with the same specifications as other processors when performing the same or similar tasks based on the running load, performance and energy consumption of other processors when performing tasks in the past time period. When the performance and energy consumption do not meet the user's expectations, the user determines the frequency modulation strategy for the processor 101 based on the running load of other processors in the historical time period. The frequency modulation strategy includes the above-mentioned frequency modulation opportunity and frequency modulation method, and configures the frequency modulation strategy in the task to be submitted. In this way, after acquiring the task, the working frequency control device 200 can parse the task and obtain at least one frequency modulation opportunity and frequency modulation method defined in the task.

[0051] In the second implementation example, the working frequency control device 200 can perform code analysis on the task submitted by the user to obtain the amount of data that the processor 101 needs to read, write, and calculate at each stage of the task execution, so that the workflow frequency control device 200 can calculate the different performance and energy consumption of the processor 101 at each execution stage based on different working frequencies through theoretical deduction according to the amount of data that needs to be read, written, and calculated at each stage. In this way, for each stage, the working frequency control device 200 can determine the optimal working frequency that can achieve high performance and low energy consumption based on the performance and energy consumption corresponding to different working frequencies, such as determining the working frequency corresponding to the maximum ratio between performance and energy consumption as the optimal working frequency.

[0052] In this way, the operating frequency control device 200 can compare the optimal operating frequency applicable to each stage with the standard operating frequency. When the optimal operating frequency of some stages is less than the standard operating frequency, the operating frequency control device 200 can reduce the operating frequency of the processor 101 when the processor 101 executes to this stage. When the optimal operating frequency of some stages is greater than the standard operating frequency, the operating frequency control device 200 can increase the operating frequency of the processor 101 when the processor 101 executes to this stage, thereby determining the corresponding frequency modulation timing and frequency modulation method according to the changes in the operating frequency corresponding to each stage.

[0053] For example, assuming that the task submitted by the user is a model training task including multiple operators, the operating frequency control device 200 can determine the attribute characteristics of each operator according to the program code corresponding to each operator. The attribute characteristics can be, for example, the amount of data required to be read / output when the processor 101 executes each operator and the data processing operation of the operator. Thus, the operating frequency control device 200 can estimate the execution time (i.e., performance) required for the processor 101 to execute the operator and the power (i.e., energy consumption) of the processor 101 according to the specifications of the processor 101 and the amount of data read / output and data processing operations corresponding to the operator. By analogy, the operating frequency control device 200 can deduce the performance and energy consumption of each operator based on different operating frequencies according to the program code corresponding to each operator, and determine the optimal operating frequency corresponding to each operator. In this way, for each operator, the operating frequency control device 200 can compare the optimal operating frequency of the operator with the standard operating frequency, and when the difference between the optimal operating frequency of the operator and the standard operating frequency is greater than the preset range, the operating frequency control device 200 adjusts the operating frequency of the processor 101 when executing the operator to the optimal operating frequency, and the operating frequency of other operators is the standard operating frequency, and thereby determines the corresponding frequency modulation timing and frequency modulation method.

[0054] In the third implementation example, since the processor 101 will periodically execute tasks, the processor 101 can first execute one or more tasks based on the standard operating frequency, such as the processor 101 can iterate n (n is a positive integer) training models based on the standard operating frequency. Then, the operating frequency control device 200 can collect performance information and energy consumption information corresponding to the tasks executed by the processor 101, such as collecting the energy consumption and performance of each stage in which the processor 101 executes the task. Next, the operating frequency control device 200 can determine the frequency modulation timing and frequency modulation method for the operating frequency of the processor 101 based on the collected performance information and energy consumption information, such as the operating frequency control device 200 can reduce the operating frequency of the processor 101 in some stages of the tasks executed by the processor 101 that do not require high computing power.

[0055] Exemplarily, assuming that the task executed by the processor 101 is a task including multiple operators, such as a model training task, etc., then the operating frequency control device 200 can record the load information generated by the processor 101 during each task execution, and the load information is used to indicate the load characteristics of each operator, such as the number of calculation operations performed by the processor 101 when executing the operator, the number of read and write operations performed (which can be used to determine the calculation access memory ratio), data read hit rate, execution time, hardware parameters (including specifications of the processor 101 and other hardware, etc.), operating frequency, operating voltage, current and other characteristic data. In this way, the operating frequency control device 200 can use the recorded load information to model multiple operators, including performance models and energy consumption models. Among them, the established performance model is used to infer the performance of the operator under different operating environments, and specifically can be used to infer the execution time of the operator; the operating environment can refer to the environment in which the operator is executed, which can be used as the input of the performance model, including operating frequency, hardware specifications, computing access ratio, data read hit rate and other data, and the output of the performance model is the performance of the operator under the operating environment (such as the execution time of the operator). The energy consumption model established is used to infer the energy consumption of operators in different operating environments. Specifically, it can be used to infer the power of the processor used when the operator is executed. The input of the energy consumption model can include data such as the operating frequency, voltage, and current of the processor. In actual application, the performance model and energy consumption model can be constructed based on AI models (such as deep learning models) or algorithm formulas.

[0056] In this way, in the process of the processor 101 executing the task again (such as the n+1th execution of the task), for the target operator among the multiple operators, the processor 101 can infer the optimal operating frequency that the processor 101 should have when executing the target operator under the condition of high performance and low energy consumption based on the established performance model and energy consumption model. For example, the operating frequency control device 200 can determine the performance of the target operator at the standard operating frequency based on the recorded load information, and infer the performance and energy consumption of the target operator at different operating frequencies using the performance model and the energy consumption model. Then, the operating frequency control device 200 can calculate the difference between the performance corresponding to the standard operating frequency and the performance corresponding to each operating frequency, so as to determine the operating frequency whose performance difference is within the preset range. When the energy consumption corresponding to the operating frequency is less than the energy consumption corresponding to the standard operating frequency, the operating frequency control device 200 can determine the operating frequency as the above-mentioned optimal operating frequency, so as to subsequently adjust the operating frequency of the processor 101 executing the target operator to the optimal operating frequency (that is, determine the frequency modulation timing and frequency modulation method). Otherwise, the operating frequency control device 200 may not need to adjust the operating frequency of the processor 101 executing the target operator. It can be understood that when there is a difference between the performance corresponding to the operating frequency and the performance of the standard operating frequency within a preset range, the operating frequency control device 200 can determine the operating frequency corresponding to the minimum energy consumption as the above-mentioned optimal operating frequency, and adjust the operating frequency of the processor 101 executing the target operator to the optimal operating frequency. In this way, the processor 101 can use the above method to determine the operating frequency applicable to each operator when the processor 101 executes the operator, and determine the corresponding frequency modulation timing and frequency modulation method according to the changes in the operating frequency applicable to each operator, so as to achieve fine-grained and dynamic adjustment of the operating frequency of the processor 101, and ensure that the energy consumption and performance of the processor 101 in executing tasks are at a high level.

[0057] For example, the multiple operators that the processor 101 needs to execute in sequence are Figure 3 Operators 1 to 9 are shown, where the execution timing between operators can be obtained by compiling the model. Moreover, the operating frequency control device 200 can determine that the processor 101 executes operators 2 and 6 to 9 at a lower operating frequency based on the above method. Then, the operating frequency control device 200 can reduce the operating frequency of the processor 101 before executing operators 2 and 6, and increase the operating frequency of the processor 101 to the standard operating frequency before executing operator 3. Then, the frequency modulation timing and frequency modulation method determined by the operating frequency control device 200 are as follows: Figure 3 shown.

[0058] In the fourth implementation example, since the number of operators that the processor 101 needs to execute in the actual application scenario is large, the operating frequency control device 200 can obtain the performance and energy consumption information of the multiple operators at different operating frequencies by performing performance and energy consumption modeling on the multiple operators, and process the performance and energy consumption information at different operating frequencies by heuristic search, grid search, dynamic programming, etc. to obtain an optimization result, so as to determine at least one frequency modulation opportunity and the frequency modulation method corresponding to the frequency modulation opportunity. For example, when performing a heuristic search, the operating frequency control device 200 can randomly select multiple operators, and use the above-mentioned performance model and energy consumption model to determine whether to reduce the operating frequency when the processor 101 executes the multiple operators, until the number of operators that need to reduce the operating frequency adjustment is searched to meet the preset number, and then stop the search, and determine the corresponding frequency modulation opportunity and frequency modulation method according to the change of the operating frequency of the searched operators, and obtain an optimization result, which meets the constraints on the performance and energy consumption of the processor 101, such as when the performance degradation of the processor 101 executing the operator does not exceed the preset threshold, the energy consumption of the processor 101 executing the operator is the lowest. In this way, the operating frequency control device 200 can reduce the operating frequency of the processor 101 when the processor 101 executes the searched operator according to the optimization result, and increase the processor 101 to execute other operators based on the standard operating frequency when the processor 101 executes other operators, so as to determine the corresponding frequency modulation timing and frequency modulation method. In this way, while reducing the energy consumption generated by the processor 101 executing the task, it can also reduce the amount of calculation required to determine the frequency modulation timing and frequency modulation method.

[0059] In the fifth implementation example, since the requirements for the operating frequency of the processor 101 at each stage of the task executed by the processor 101 may be quite different, for example, when executing stage A of the task, the operating frequency of the processor 101 is required to be relatively high to ensure that the processor 101 can complete stage A in a short time, while when executing stage B of the task, the operating frequency of the processor 101 is required to be relatively low. Therefore, when the operating frequency control device 200 determines the frequency modulation timing and frequency modulation method for the operating frequency for the processor 101, it can first filter out the execution stages of the task that have relatively high requirements for the operating frequency of the processor 101, and determine the frequency modulation timing and frequency modulation method for adjusting the operating frequency of the processor 101 in the remaining execution stages.

[0060] Taking the task as a model training task as an example, the task may include multiple operators in the model. Among them, when the processor 101 executes part of the operators, the main operation performed is a data calculation operation, then, this part of the operators can be called a compute intensive operator; and when the processor 101 executes another part of the operators, the main operation performed is a data access operation, then, this part of the operators can be called an access intensive (memory intensive) operator. The operating frequency control device 200 can filter out memory intensive operators from multiple operators according to the type of operator in the process of determining the frequency modulation timing and frequency modulation method, and determine the frequency modulation timing and frequency modulation method for one or more memory intensive operators obtained by filtering, such as determining to reduce the operating frequency of the processor 101 before the processor 101 executes all or part of the memory intensive operators.

[0061] For example, the multiple operators that the processor 101 needs to execute in sequence are Figure 4 As shown in Figure 1, it is assumed that the operating frequency control device 200 can determine that operator 2, operators 6 to 8, and operators 10 to 11 are memory-intensive operators according to the type of the operator. Then, the operating frequency control device 200 can reduce the operating frequency of the processor 101 before executing operator 2, operator 6, and operator 10, and increase the operating frequency of the processor 101 to the standard operating frequency before executing operator 3, operator 9, and operator 12, as shown in Figure 1. Figure 4 shown.

[0062] In the sixth implementation example, the operating frequency control device 200 can also determine the frequency adjustment timing and frequency adjustment method for the operating frequency of the processor according to the frequency adjustment target indicated by the user. In specific implementation, the operating frequency control device 200 can output multiple frequency adjustment targets to the client 103 so that the client 103 presents the multiple frequency adjustment targets to the user, wherein the multiple frequency adjustment targets are used to indicate different requirements for the performance or energy consumption of the processor 101 in executing tasks.

[0063] Exemplarily, the frequency modulation targets presented by the client 103 may include four types of frequency modulation targets.

[0064] Frequency adjustment target 1: Minimize energy consumption while keeping the performance of processor 101 basically unchanged. The performance of processor 101 can be maintained at the performance of processor 101 when executing operators based on the above standard operating frequency (such as 1800 MHZ, etc.), which is hereinafter referred to as standard performance.

[0065] Frequency adjustment target 2: The performance and energy consumption of the processor 101 are in an optimal state, for example, the weighted sum of the performance score of the processor 101 and the energy consumption score of the processor 101 is maximized.

[0066] Frequency adjustment target 3: the operating frequency of the processor 101 is adjusted according to the energy consumption of the processor 101 in priority.

[0067] Frequency adjustment target 4: the operating frequency of the processor 101 is adjusted preferentially according to the performance of the processor 101 .

[0068] In this way, the user can select a variety of frequency modulation targets on the client 103, and the client 103 feeds back the frequency modulation target selected by the user to the working frequency control device 200. The working frequency control device 200 determines the frequency modulation timing and frequency modulation method for the working frequency of the processor 101 according to the received frequency modulation target and using the above performance model and energy consumption model.

[0069] For example, assuming that the user selects frequency modulation target 1, for each operator in the task, the operating frequency control device 200 can use the performance model to infer the performance of the processor 101 when executing the operator based on different operating frequencies according to the frequency modulation target 1, and compare the operator performance corresponding to each operating frequency with the standard performance, determine which (or which) operating frequency corresponding to the performance and the standard performance The difference is within the preset range, and use the energy consumption model to determine the energy consumption corresponding to these operating frequencies. Finally, the operating frequency control device 200 can calculate which operating frequency has the largest difference in energy consumption from the energy consumption generated when the processor 101 executes the operator based on the standard operating frequency, and use the operating frequency as the optimal operating frequency, and adjust the operating frequency when the processor 101 executes the operator to the optimal operating frequency, so as to obtain the corresponding frequency modulation timing and frequency modulation method. In this way, it is possible to reduce the energy consumption generated by the processor 101 executing the operator when the performance of the processor 101 executing the operator is high.

[0070] In actual application, when the frequency modulation target selected by the user is other frequency modulation targets, the operating frequency control device 200 can also adjust the operating frequency of the processor 101 according to the performance or energy consumption of the processor 101 executing the task indicated by the other frequency modulation targets. For example, when the user selects frequency modulation target 2, for each operator in the task, the operating frequency control device 200 can use the energy consumption model and the performance model to infer the performance and energy consumption of the processor 101 based on different operating frequencies, and score the performance and energy consumption corresponding to each operating frequency, thereby determining the weighted sum of the performance scores corresponding to each operating frequency and the energy consumption score of the processor 101, and determining the operating frequency corresponding to the maximum weighted sum as the operating frequency used by the processor 101 to execute the operator, etc. When the user selects frequency adjustment target 3 (or frequency adjustment target 4), the operating frequency control device 200 can use the energy consumption model (and performance model) to calculate the energy consumption (or performance) of each operator at each operating frequency, and determine the operating frequency corresponding to the minimum energy consumption (or the highest performance), so as to determine the operating frequency as the operating frequency used by the processor 101 to execute the operator. In actual application, during the process of the processor 101 executing some stages of the task, the operating frequency control device 200 can also control the operating frequency of the processor 101 to exceed the standard operating frequency (i.e., overclocking) to further improve the performance of the processor 101 executing the part of the stage.

[0071] In addition, the data processing system 10 can also support users to customize the frequency modulation target. For example, the user can provide a customized frequency modulation target to the client 103, and the customized frequency modulation target can, for example, indicate to adjust the operating frequency of the processor 101 according to information of multiple dimensions such as temperature, energy consumption and performance at the same time. In this way, the operating frequency control device 200 can determine the frequency modulation timing and frequency modulation method for the operating frequency of the processor 101 according to the customized frequency modulation target fed back by the client 103, as well as the above-mentioned performance model and energy consumption model. In this way, the flexibility of the user in adjusting the operating frequency of the processor 101 can be improved, and the user experience can be improved.

[0072] It should be noted that the above-mentioned various methods for determining the frequency modulation timing and the frequency modulation method are only some exemplary descriptions. In actual application, the working frequency control device 200 can also adopt other implementation methods to adjust the working frequency of the processor 101 during the execution of the task, and there is no limitation on this.

[0073] Furthermore, since the execution time required for some operators executed by the processor 101 is relatively short (i.e., the execution time required for some stages in the execution task is relatively short), the operating frequency control device 200 can limit the interval between two adjacent adjustments of the operating frequency of the processor 101 to be greater than or equal to a threshold value when adjusting the operating frequency of the processor 101. In this way, the operating frequency control device 200 can check whether the interval between two adjacent frequency modulation opportunities determined is less than the threshold value during the process of determining the frequency modulation opportunity. If so, the two adjacent frequency modulation opportunities are deleted. In this way, the operating frequency of the processor 101 can be prevented from being frequently switched.

[0074] For example, the multiple operators that the processor 101 needs to execute in sequence are Figure 5 As shown in Figure 1, it is assumed that the operating frequency control device 200 can determine that operators 2, 6 to 8, and 10 to 11 are memory-intensive operators according to the type of the operator. Then, the operating frequency control device 200 can first determine to reduce the operating frequency of the processor 101 before executing operators 2, 6, and 10, and increase the operating frequency of the processor 101 to the standard operating frequency before executing operators 3, 9, and 12. The frequency adjustment timing is as follows: Figure 5 As shown on the left. Then, the working frequency control device 200 compares the interval between two adjacent frequency modulation opportunities with the threshold value, and determines that the interval between frequency modulation opportunity 1 and frequency modulation opportunity 2, and the interval between frequency modulation opportunity 4 and frequency modulation opportunity 5 are all less than the threshold value. Then, the working frequency control device 200 can delete frequency modulation opportunities 1, 2, 4, and 5, and only retain frequency modulation opportunity 3 and frequency modulation opportunity 6, as shown in FIG. Figure 5 Shown on the right.

[0075] After determining the frequency modulation opportunity and the frequency modulation mode corresponding to the frequency modulation opportunity, the operating frequency control device 200 can adjust the operating frequency of the processor 101 at the time indicated by the frequency modulation opportunity according to the frequency modulation mode.

[0076] In specific implementation, the operating frequency control device 200 may monitor the task stage currently executed by the processor 101 (such as the operator currently executed, etc.), and generate an instruction including the frequency modulation opportunity and the frequency modulation opportunity according to the task execution progress of the processor 101 obtained by monitoring, such as generating the instruction through inter-process communication (IPC), and sending the instruction to a dynamic voltage and frequency scaling (dynamic voltage and frequency scaling, DVFS) interface for triggering the adjustment of the operating frequency of the processor 101, so that the operating frequency of the processor 101 can be adjusted by calling the DVFS interface. For example, after the operating frequency control device 200 determines through monitoring that the execution of the current operator A is completed, it can generate and issue an instruction for adjusting the operating frequency of the processor 101, so as to control the processor 101 to execute the next operator B based on the adjusted operating frequency. In actual applications, there is a delay between the operating frequency control device 200 calling the DVFS interface and the operating frequency of the processor 101 being adjusted, such as the delay may be 200 microseconds (us). Therefore, in the process of adjusting the operating frequency of the processor 101 when executing operator B, the operating frequency control device 200 can first determine the starting execution time of the processor 101 executing operator B, and determine the starting time of adjusting the operating frequency of the processor 101 200 microseconds before the starting execution time, and determine the starting time as the frequency adjustment opportunity corresponding to the operator B, that is, call the DVFS interface at the starting time. In this way, the operating frequency control device 200 adjusts the operating frequency of the processor 101 from the dimensions of performance and energy consumption at the same time, which makes it possible to take into account the performance of the processor 101 when managing the energy consumption of the processor 101, so that the performance of the processor 101 can also be continuously maintained at a high level.

[0077] Moreover, in the actual test scenario, the task performed by the processor 101 is the training task of the Resnet50 model. The Resnet50 model includes 100 operators, of which the first 50 operators are memory-intensive operators and the last 50 operators are computationally intensive operators. The performance and energy consumption of the processor 101 in executing the reasoning task based on the standard operating frequency of 1800MHZ are used as comparison objects. In the process of iterative training of the Resnet50 model by the processor 101, the operating frequency control device 200 can accelerate two frequency modulation operators (or issue two frequency modulation instructions, etc.) in each training cycle, so that the processor 101 uses a lower operating frequency when executing the first 50 operators and a higher operating frequency when executing the last 50 operators.

[0078] The performance loss and energy consumption gain of processor 101 when executing the model training task are shown in Table 1 below.

[0079] Table 1

[0080] Working frequency / MHZ Performance loss Processor energy benefits Equipment income 1800 0.0% 0.0% 0.0% 1600 -0.9% 15.5% 4.7% 1500 -9.1% 20.6% 2.9% 1100-1600 -5.6% 21.3% 4.2% 1200-1600 -1.4% 22.5% 6.1% 1100-1700 -2.2% 15.2% 3.5%

[0081] As shown in Table 1, when the operating frequency of the processor is in the range of 1200-1600, the performance of the processor in executing the model training task loses 1.4%, but the energy consumption of the processor in executing the task can be reduced by 22.5%, and the energy consumption of the computing device where the processor is located can be reduced by 6.1%. In this way, the energy consumption of the processor in executing the task can be effectively reduced while the performance remains basically unchanged or changes slightly.

[0082] It is worth noting that the above Figure 2 In the illustrated embodiment, the operating frequency control device 200 regulating the operating frequency of the processor 101 is taken as an example for illustrative description. In other embodiments, the processor 101 may also regulate its operating frequency.

[0083] Exemplarily, a user may define a frequency modulation operator in a task, and the frequency modulation operator is used to indicate the adjustment of the operating frequency of the processor. Then, when the processor 101 executes the frequency modulation operator during the execution of the multiple operators included in the task, the processor 101 may call the DVFS interface to increase or decrease its own operating frequency according to the frequency modulation method indicated by the frequency modulation operator. Among them, the input of the frequency modulation operator is the data in the tensor format output by the previous operator a, and the output of the frequency modulation operator may still be the data in the tensor format, so that the output of operator a can be passed to the next operator b of the frequency modulation operator through the frequency modulation operator. Alternatively, the data in the tensor format output by the previous operator a of the frequency modulation operator will be used as the input of the frequency modulation operator and the next operator b of the frequency modulation operator at the same time, and the output of the frequency modulation operator is 0, so that the input of operator b is the sum of the data in the tensor format output by operator a and 0, so as to avoid inserting the frequency modulation operator in the task and affecting the data transfer between operator a and operator b.

[0084] Alternatively, when the processor 101 compiles the task to obtain a stream, the user can insert an instruction including a frequency modulation method into the stream (the frequency modulation timing is the insertion position of the user in the stream). The stream includes multiple commands to be executed in sequence, and the processor 101 sequentially executes each command in the stream to execute the task. In this way, when the processor 101 executes the instruction including the frequency modulation method inserted by the user during the process of executing the commands in the stream, the operating frequency of the processor 101 can be increased or decreased according to the frequency modulation method indicated by the frequency modulation instruction.

[0085] In actual application, the user can define any other form of frequency modulation timing and frequency modulation method in the task, so that the processor 101 can parse the task and adjust the operating frequency of the processor 101 according to the parsed frequency modulation timing and frequency modulation method during the execution of the task.

[0086] Combination of the above Figures 1 to 5 The operating frequency control method provided in the embodiment of the present application is introduced. Next, the function of the operating frequency control device provided in the embodiment of the present application and the computing device for implementing the operating frequency control device are introduced in conjunction with the accompanying drawings.

[0087] See also Figure 6 , showing a schematic structural diagram of a working frequency control device. Figure 6 The operating frequency control device 600 shown may correspond to the above Figure 2 The operating frequency control device 200 is shown.

[0088] like Figure 6 As shown, the operating frequency control device 600 may include:

[0089] A determination module 601 is used to determine a task to be processed, and the task is periodically executed by the processor;

[0090] An acquisition module 602 is used to acquire a frequency modulation timing and a frequency modulation method for the operating frequency of the processor, where the frequency modulation timing and the frequency modulation method are determined based on the performance and energy consumption of the processor in executing a task;

[0091] The frequency modulation module 603 is used to adjust the operating frequency of the processor at a frequency modulation opportunity according to a frequency modulation method during the process of the processor executing a task.

[0092] In a possible implementation manner, when acquiring the frequency modulation opportunity and frequency modulation mode for the operating frequency of the processor, the acquisition module 602 is specifically used to:

[0093] Obtaining performance information and energy consumption information corresponding to the tasks executed by the processor;

[0094] According to the performance information and the energy consumption information, the frequency adjustment timing and frequency adjustment method for the operating frequency of the processor are determined.

[0095] In a possible implementation, a task includes multiple operators, and when acquiring the performance information and energy consumption information corresponding to the processor executing the task, the acquisition module 602 is specifically used to:

[0096] Record the load information generated during the iterative execution of at least one task by the processor, where the load information is used to indicate the load characteristics of multiple operators;

[0097] Based on the load information, performance models and energy consumption models are created for multiple operators. The performance model is used to infer the performance of operators in different operating environments, and the energy consumption model is used to infer the energy consumption of operators in different operating environments.

[0098] In a possible implementation, a task includes multiple operators, and when acquiring the performance information and energy consumption information corresponding to the processor executing the task, the acquisition module 602 is specifically used to:

[0099] According to the attribute characteristics of the multiple operators, the performance information and energy consumption information corresponding to the execution of the multiple operators by the processor are estimated.

[0100] In a possible implementation manner, when determining the frequency modulation timing and frequency modulation method for the operating frequency of the processor, the acquisition module 602 is specifically configured to:

[0101] By processing the modeling results, an optimization result is obtained, and the modeling result indicates the performance and energy consumption information of the multiple operators at different working frequencies. For example, an optimal frequency modulation position is determined by heuristic search, grid search, dynamic programming, etc., to determine at least one frequency modulation opportunity and the frequency modulation method corresponding to the frequency modulation opportunity. For example, when performing a heuristic search, the acquisition module 602 can randomly select multiple operators, and use the above-mentioned performance model and energy consumption model to determine whether to reduce the working frequency when the processor 101 executes the multiple operators, until the number of operators that need to reduce the working frequency adjustment is searched to meet the preset number, the search is stopped, and the corresponding frequency modulation opportunity and frequency modulation method are determined according to the change of the working frequency of the searched operators, and the optimization result is obtained. The optimization result includes at least one frequency modulation opportunity corresponding to multiple operators and the frequency modulation method corresponding to each frequency modulation opportunity, and the modeling result meets the constraints on the performance and energy consumption of the processor.

[0102] In a possible implementation, taking heuristic search as an example, when the acquisition module 602 performs heuristic search on multiple operators, it is specifically used to:

[0103] Filter multiple operators to obtain memory-intensive operators;

[0104] According to the performance information and energy consumption information of memory-intensive operators, a heuristic search is performed on memory-intensive operators at the operator granularity.

[0105] In a possible implementation, the search result includes multiple frequency modulation opportunities, and the interval duration between the multiple frequency modulation opportunities is greater than a threshold.

[0106] In a possible implementation manner, the operating frequency control device 600 further includes:

[0107] An output module 604, used to output a plurality of frequency modulation targets, where the plurality of frequency modulation targets are used to indicate different requirements for the performance or energy consumption of the processor in executing a task;

[0108] Then, when determining the frequency modulation timing and frequency modulation method for the operating frequency of the processor, the acquisition module 602 is specifically used to:

[0109] According to a frequency adjustment target selected by a user from a plurality of frequency adjustment targets, performance information, and energy consumption information, a frequency adjustment timing and a frequency adjustment method for an operating frequency of a processor are determined.

[0110] In a possible implementation manner, when determining the frequency modulation timing and frequency modulation method for the operating frequency of the processor, the acquisition module 602 is specifically configured to:

[0111] Gets the custom FM target provided by the user;

[0112] The frequency adjustment timing and frequency adjustment method for the operating frequency of the processor are determined according to the custom frequency adjustment target, performance information, and energy consumption information.

[0113] In a possible implementation manner, when acquiring the frequency modulation opportunity and frequency modulation mode for the operating frequency of the processor, the acquisition module 602 is specifically used to:

[0114] Analyze the frequency adjustment timing and frequency adjustment method for the processor's operating frequency from the task.

[0115] because Figure 6 The operating frequency control device 600 shown corresponds to Figure 2 The working frequency control device 200 in the method embodiment shown in FIG. Figure 6 The specific implementation method of the working frequency control device 600 shown and its technical effects can be found in the relevant descriptions of the aforementioned embodiments, and will not be elaborated here.

[0116] Figure 7 The schematic diagram of the structure of a computing device is shown. The operating frequency control device 200 can be deployed on the computing device. The computing device can be any computing device in a computing device cluster. Specifically, it can be used to implement the above Figure 2 The function of the operating frequency control device 200 in the illustrated embodiment.

[0117] like Figure 7As shown, computing device 700 includes processor 710, memory 720, communication interface 730 and bus 740. Processor 710, memory 720 and communication interface 730 communicate through bus 740. Bus 740 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 The communication interface 730 is used for external communication, for example, receiving tasks that need to be executed periodically and are submitted by users through the client.

[0118] Among them, the processor 710 can be a central processing unit (CPU), an application specific integrated circuit (ASIC), a graphics processing unit (GPU) or one or more integrated circuits. The processor 710 can also be an integrated circuit chip with signal processing capabilities. In the implementation process, the functions of the server 200 can be completed by the hardware integrated logic circuit or software instructions in the processor 710. The processor 710 can also be a general processor, a digital signal processor (DSP), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, and can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application. Among them, the general processor can be a microprocessor or the processor can also be any conventional processor, etc., and the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 720 , and the processor 710 reads the information in the memory 720 and completes part or all of the functions in the server 200 in combination with its hardware.

[0119] The memory 720 may include a volatile memory, such as a random access memory (RAM), or a non-volatile memory, such as a read-only memory (ROM), a flash memory, a HDD, or a SSD.

[0120] The memory 720 stores executable codes, and the processor 710 executes the executable codes to execute the method executed by the aforementioned operating frequency control device 200 .

[0121] Specifically, in implementing Figure 2 In the case of the embodiment shown, and Figure 2 In the case where the operating frequency control device 200 described in the illustrated embodiment is implemented by software, the execution Figure 2 The software or program code required for the functions of the operating frequency control device 200 is stored in the memory 720. The interaction between the operating frequency control device 200 and other devices is realized through the communication interface 730. The processor is used to execute the instructions in the memory 720 to implement the method executed by the operating frequency control device 200.

[0122] In addition, an embodiment of the present application also provides a computer-readable storage medium, which stores instructions. When the computer-readable storage medium is executed on one or more computing devices, the one or more computing devices execute the method executed by the working frequency control device 200 of the above embodiment.

[0123] In addition, an embodiment of the present application further provides a computer program product, and when the computer program product is executed by one or more computing devices, the one or more computing devices execute any of the aforementioned operating frequency control methods. The computer program product may be a software installation package, and when any of the aforementioned operating frequency control methods is required, the computer program product may be downloaded and executed on a computer.

[0124] It should also be noted that the embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment. In addition, in the embodiment drawings provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.

[0125] The terms "first", "second", etc. in the specification, claims and the above drawings of this application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances. This is just a way of distinguishing objects with the same attributes when describing the embodiments of this application.

[0126] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0127] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.

[0128] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a training device, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.

Claims

1. A method for controlling an operating frequency, characterized in that: The method comprises: determining a task to be processed, the task being periodically executed by a processor; Acquire a frequency modulation timing and a frequency modulation method for the operating frequency of the processor, wherein the frequency modulation timing and the frequency modulation method are determined based on the performance and energy consumption of the processor in executing the task; In the process of the processor executing the task, the operating frequency of the processor is adjusted at the frequency modulation timing according to the frequency modulation method.

2. The method according to claim 1, characterized in that The obtaining of a frequency modulation timing and a frequency modulation method for the operating frequency of the processor includes: Obtaining performance information and energy consumption information corresponding to the processor executing the task; According to the performance information and the energy consumption information, a frequency adjustment timing and a frequency adjustment method for the operating frequency of the processor are determined.

3. The method according to claim 2, characterized in that The task includes a plurality of operators, and the obtaining of performance information and energy consumption information corresponding to the processor executing the task includes: Recording load information generated during at least one iterative execution of the task by the processor, where the load information is used to indicate load characteristics of the multiple operators; According to the load information, a performance model and an energy consumption model are created for the multiple operators, wherein the performance model is used to infer the performance of the operators under different operating environments, and the energy consumption model is used to infer the energy consumption of the operators under different operating environments.

4. The method according to claim 2, characterized in that: The task includes a plurality of operators, and the obtaining of performance information and energy consumption information corresponding to the processor executing the task includes: According to the attribute characteristics of the multiple operators, performance information and energy consumption information corresponding to the processor executing the multiple operators are estimated.

5. The method according to claim 3 or 4, characterized in that: The determining, according to the performance information and the energy consumption information, a frequency modulation timing and a frequency modulation method for the operating frequency of the processor includes: By processing the modeling results, an optimization result is obtained, wherein the modeling results indicate the performance and energy consumption information of the multiple operators at different operating frequencies, the optimization result includes at least one frequency modulation opportunity corresponding to the multiple operators and the frequency modulation method corresponding to each frequency modulation opportunity, and the optimization result satisfies the constraints on the performance and energy consumption of the processor.

6. The method according to claim 5, characterized in that By processing the modeling results, the optimization results are obtained, including: Filtering the multiple operators to obtain memory-intensive operators; According to the performance information and energy consumption information of the memory-intensive operator, a heuristic search is performed on the memory-intensive operator with the operator as the granularity.

7. The method according to claim 5 or 6, characterized in that: The search result includes a plurality of frequency modulation opportunities, and the interval duration between the plurality of frequency modulation opportunities is greater than a threshold.

8. The method according to any one of claims 2 to 7, characterized in that: The method further comprises: The frequency modulation timing and frequency modulation method for the operating frequency of the processor are determined according to the frequency modulation target, the performance information and the energy consumption information, wherein the frequency modulation target indicates the performance or energy consumption requirement for the processor to execute the task.

9. The method according to claim 8, characterized in that The method further comprises: Outputting at least one frequency modulation target, determining the frequency modulation target from the at least one frequency modulation target, and determining a frequency modulation timing and a frequency modulation method for the operating frequency of the processor using the frequency modulation target selected from the at least one frequency modulation target; or Based on the user-defined frequency modulation target, a frequency modulation timing and a frequency modulation method for the operating frequency of the processor are determined.

10. The method according to claim 1, characterized in that The obtaining of a frequency modulation timing and a frequency modulation method for the operating frequency of the processor includes: The frequency modulation timing and frequency modulation method for the operating frequency of the processor are analyzed from the task.

11. A working frequency control device, characterized in that: The device comprises: A determination module, used for determining a task to be processed, wherein the task is periodically executed by the processor; An acquisition module, used to acquire a frequency modulation timing and a frequency modulation mode for the operating frequency of the processor, wherein the frequency modulation timing and the frequency modulation mode are determined based on the performance and energy consumption of the processor in executing the task; The frequency modulation module is used to adjust the operating frequency of the processor according to the frequency modulation method and at the frequency modulation opportunity during the process of the processor executing the task.

12. The device according to claim 11, characterized in that The acquisition module is used to: Obtaining performance information and energy consumption information corresponding to the processor executing the task; According to the performance information and the energy consumption information, a frequency adjustment timing and a frequency adjustment method for the operating frequency of the processor are determined.

13. The device according to claim 12, characterized in that The task includes multiple operators, and the acquisition module is used to: Recording load information generated during at least one iterative execution of the task by the processor, where the load information is used to indicate load characteristics of the multiple operators; According to the load information, a performance model and an energy consumption model are created for the multiple operators, wherein the performance model is used to infer the performance of the operators under different operating environments, and the energy consumption model is used to infer the energy consumption of the operators under different operating environments.

14. The device according to claim 12, characterized in that The task includes multiple operators, and the acquisition module is used to: According to the attribute characteristics of the multiple operators, performance information and energy consumption information corresponding to the processor executing the multiple operators are estimated.

15. The device according to claim 13 or 14, characterized in that The acquisition module is used to: By processing the modeling results, an optimization result is obtained, wherein the modeling results indicate the performance and energy consumption information of the multiple operators at different operating frequencies, the optimization result includes at least one frequency modulation opportunity corresponding to the multiple operators and the frequency modulation method corresponding to each frequency modulation opportunity, and the optimization result satisfies the constraints on the performance and energy consumption of the processor.

16. The device according to claim 15, characterized in that The acquisition module is used to: Filtering the multiple operators to obtain memory-intensive operators; According to the performance information and energy consumption information of the memory-intensive operator, a heuristic search is performed on the memory-intensive operator with the operator as the granularity.

17. The device according to claim 15 or 16, characterized in that The search result includes a plurality of frequency modulation opportunities, and the interval duration between the plurality of frequency modulation opportunities is greater than a threshold.

18. The device according to any one of claims 12 to 17, characterized in that The device also includes: Get modules for: The frequency modulation timing and frequency modulation method for the operating frequency of the processor are determined according to the frequency modulation target, the performance information and the energy consumption information, wherein the frequency modulation target indicates the performance or energy consumption requirement for the processor to execute the task.

19. The device according to claim 18, characterized in that The device also includes: An output module, used for outputting at least one frequency modulation target; The acquisition module determines a frequency modulation timing and a frequency modulation method for the operating frequency of the processor based on a frequency modulation target selected from the at least one frequency modulation target; or The acquisition module determines a frequency modulation timing and a frequency modulation method for the operating frequency of the processor based on a user-defined frequency modulation target.

20. The device according to claim 11, characterized in that The acquisition module is used to: The frequency modulation timing and frequency modulation method for the operating frequency of the processor are analyzed from the task.

21. A computing device, characterized in that The computing device comprises a processor and a memory, wherein the memory stores program instructions, and the processor runs the program instructions to execute the method according to any one of claims 1 to 10.