Frequency regulation and control method, system and equipment of central processing unit

By dividing critical paths and non-critical paths in communication applications, generating differentiated frequency regulation strategies, adjusting the central processor frequency, the communication efficiency reduction problem caused by dynamic voltage frequency adjustment is solved, and the dual improvement of power consumption optimization and communication performance is achieved.

CN120103957AActive Publication Date: 2025-06-06CETC ENTERPRISE SERVICE (CHENGDU) TECH GRP CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202510174687.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-18
Publication Date
2025-06-06
Estimated Expiration
2045-02-18

AI Technical Summary

Technical Problem

Dynamic voltage frequency adjustment causes the communication application calculation task execution time to be extended, affecting the efficiency of the communication mode.

Method used

By obtaining the basic data of the operation of the communication application, distinguishing critical paths and non-critical paths, and generating differentiated frequency regulation strategies based on different paths, adjusting the frequency of the central processor to optimize power consumption and communication performance.

Benefits of technology

While achieving dynamic power consumption optimization, it ensures the communication performance of communication applications and reduces the negative impact of dynamic voltage frequency adjustment on communication performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120103957A_ABST
    Figure CN120103957A_ABST
Patent Text Reader

Abstract

The invention discloses a frequency regulation and control method, system and equipment of a central processing unit. Relates to the technical field of electronic equipment. On the basis of the prior art, a central processing unit frequency adjustment method is improved, the adjustment amount and adjustment time of dynamic voltage frequency adjustment are determined from the angle of a communication application program, and the communication performance of the communication application program is guaranteed while power consumption dynamic optimization is achieved on the basis of dynamic voltage frequency adjustment. As the frequency change of the central processing unit mainly affects the execution time of a calculation task, the key path contains basic information of optimization and load balance of parallel codes, and the non-key path contains more communication intervals, the key path and the non-key path of the communication application program are divided based on the operation basic data, and the calculation efficiency is improved. And different frequency regulation strategies are generated according to the critical path and the non-critical path, so that differentiated frequency regulation is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electronic equipment, and in particular to a frequency control method, system and device for a central processing unit. Background Art

[0002] With the rapid development of information sciences such as artificial intelligence and big data, increasingly complex problems have put forward new and higher requirements for computing power. However, the high energy consumption brought by high performance restricts the further improvement of the performance of parallel computing systems. Improving the energy efficiency of the system has become a hot issue in the current research field of high-performance computing.

[0003] High energy consumption has a negative impact on the reliability and life of computer systems; the performance of computers depends largely on the performance of the processor. With the development of processor performance, the main frequency and transistor density continue to increase, and the power consumption density in the processor also increases accordingly. At the same time, as the scale of parallel computing systems expands, the huge energy consumption overhead of the entire system brings high operating costs. From the perspective of parallel system maintainers, the most widely used optimization technology is dynamic voltage and frequency adjustment, which dynamically adjusts the processor operating voltage and frequency according to the system workload to reduce power consumption; but dynamic voltage and frequency adjustment often increases program running time and reduces program performance, especially communication performance. The impact of processor core frequency changes on communication performance is easy to be ignored. With the development of dynamic voltage and frequency adjustment, the execution of computing tasks of communication applications is prolonged, which in turn affects the efficiency of the communication mode. Summary of the invention

[0004] The technical problem to be solved by the present invention is: as the dynamic voltage and frequency adjustment is carried out, the execution of the computing tasks of the communication application is lengthened, thereby affecting the efficiency of the communication mode; the purpose of the present invention is to provide a frequency control method, system and device for a central processing unit, which determines the adjustment amount and adjustment time of the dynamic voltage and frequency adjustment from the perspective of the communication application, and ensures the communication performance of the communication application while realizing dynamic optimization of power consumption based on dynamic voltage and frequency adjustment; since the frequency change of the central processing unit mainly affects the execution time of the computing task, the critical path contains basic information on parallel code optimization and load balancing, and the non-critical path contains more communication intervals, so this scheme divides the critical path and non-critical path of the communication application based on the basic running data, generates different frequency control strategies for the critical path and the non-critical path, and realizes differentiated frequency control.

[0005] The present invention is achieved through the following technical solutions:

[0006] The present invention provides a method for controlling the frequency of a central processing unit (CPU), wherein the CPU is used to run a communication application program, and the method comprises:

[0007] Obtain basic operational data of communication applications;

[0008] Based on the basic operation data, the critical path and non-critical path of the communication application are divided, and the communication intervals of the critical path and the non-critical path, as well as the basic parameters of each communication interval are determined; the basic parameters include: relaxation time, start time and duration;

[0009] For the communication interval of non-critical paths, a frequency control strategy is generated based on the slack duration; for the communication interval of critical paths, a frequency control strategy is generated based on the start time and duration.

[0010] How this solution works: With the dynamic voltage and frequency adjustment, the execution of the computing tasks of the communication application is lengthened, which in turn affects the efficiency of the communication mode; such as MPI communication performance and OpenMP communication performance; the frequency change of the CPU will affect the execution time of the computing tasks, which in turn affects the efficiency of the communication mode. For example, when the CPU frequency is reduced, the computing tasks may take longer to complete, which may lead to more waiting time during the MPI communication process, affecting the overall parallel efficiency. Similarly, for thread parallel computing in OpenMP, the change of processor frequency will also affect the execution speed of the threads, thereby affecting the efficiency of inter-thread communication and synchronization. The present solution provides a method for controlling the frequency of a central processing unit, which improves the method for adjusting the frequency of the central processing unit on the basis of the existing technology, determines the adjustment amount and adjustment time of the dynamic voltage and frequency adjustment from the perspective of the communication application, and ensures the communication performance of the communication application while realizing dynamic optimization of power consumption based on the dynamic voltage and frequency adjustment; since the frequency change of the central processing unit mainly affects the execution time of the computing task, the critical path contains the basic information of parallel code optimization and load balancing, while the non-critical path contains more communication intervals, the present solution divides the critical path and non-critical path of the communication application based on the basic running data, generates different frequency control strategies for the critical path and the non-critical path, and realizes differentiated frequency control.

[0011] A further optimization scheme is that the method of obtaining the basic operation data of the communication application program includes:

[0012] The communication application is tested multiple times in the actual operating environment of the communication application to obtain a trace file of the communication application, and basic operating data of the communication application is calculated based on the analysis of the trace file; the trace file includes: a Profile file, a debugger output file, a custom performance monitoring file or an application log file.

[0013] A further optimization scheme is that the critical path and non-critical path of the communication application are divided based on the basic operation data; including the method:

[0014] Acquire all computing tasks of the communication application program according to the operation basic data;

[0015] Sort all computing tasks to build a task queue; for any computing task v in the task queue i , the earliest calculation time factor is T1(v i ), the latest start time factor is T2(v i ); the calculation time is T(v i );

[0016] The first calculation task v in the task queue s The earliest start time factor of the task is set to 0, and the earliest start time factors of the remaining computing tasks are set to ∞; the latest start time factor of each computing task in the task queue is set to the computing time of the computing task;

[0017] Perform dynamic planning calculations on each computing task according to the task queue:

[0018] T1(v i )=max[T1(v i+q )+T(v i+q )+T(v i+q , v i )] / 2min[T1(v i+q )+T(v i+q )+T(v i+q , v i )];

[0019] T2(v i )=min[T2(v i+h )-T(v i , v i+h )-T(v i )] / 2max[T2(v i+h )-T(v i , v i+h )-T(v i )];

[0020] Among them, T1(v i+q ) represents the computing task v i+q The earliest start time factor of the calculation task v i+q For the calculation task v i The direct predecessor task; T(v i+q ) represents the computing task v i+q The calculation time of T(v i+q , v i ) represents the computing task v i With the computing task v i+qCommunication time between i+h ) represents the computing task v i+h The latest start time factor for computing task v i+h For the calculation task v i The direct successor task; T(v i , v i+h ) represents the computing task v i With the computing task v i+h Communication time between

[0021] Determine the computing task v in the task queue i Whether it satisfies: T1(v i )=T2(v i ); If so, determine the computing task v i is a critical task; otherwise, the calculation task v is determined i For non-critical tasks;

[0022] The task queue is traversed, and the node set consisting of all critical tasks in the task queue is used as the critical path set of the communication parallel application; the node set consisting of all non-critical tasks in the task queue is used as the non-critical path set of the communication parallel application.

[0023] A further optimization scheme is that the method for obtaining the calculation time includes:

[0024] For the computation task v i The calculation time T(v i ) is obtained according to the following formula:

[0025] T(v i )=c 0 +A 1 / c 1 +A 2 ×c 2 +A 3 ×c 3 +NOL i +MD i ;

[0026] Among them, c 0 Indicates the time parameter; c 1 Indicates task parameters; A 1 Indicates the total number of computing tasks in the critical path or non-critical path; c 2 Indicates the calculation amount parameter; A 2 represents the average amount of computation between computational tasks in the critical path or non-critical path; c 3 Indicates the communication volume parameter; A 3 Represents the computational task v iThe average communication volume between tasks in the critical path or non-critical path; NOL i Represents the computational task v i The number of layers of the mapping area corresponding to the critical path or non-critical path; MD i Represents the computational task v i The minimum distance from the critical path or non-critical path corresponding to the mapping area to the heat sink.

[0027] A further optimization scheme is that, for each non-critical path communication interval, a frequency control strategy is generated based on the relaxation duration; including the method:

[0028] Get the relaxation time of the current communication interval;

[0029] When the relaxation duration is greater than the preset duration threshold TE1, the frequency control strategy is: when the calculation interval a is opened, the central processor is adjusted to work at the first frequency, and when the calculation interval a ends, the central processor is adjusted to work at the default frequency; wherein the first frequency is less than the default frequency; the calculation interval a represents a calculation interval that is located before the current communication interval and is closest to the current communication interval;

[0030] When the relaxation duration is less than or equal to the preset duration threshold TE1, the frequency control strategy is: in the entire current communication interval and calculation interval a, the central processor is kept operating at the default frequency.

[0031] A further optimization scheme is that the method for obtaining the first frequency includes:

[0032] The first frequency f is calculated according to the following formula:

[0033]

[0034] Wherein, ta(f) represents the function of the first frequency f with respect to time ta, and time ta represents the calculation time of the calculation interval a; t1 represents the calculation time of the calculation interval a when the central processing unit works at the default frequency; t2 represents the relaxation time when the central processing unit works at the default frequency; P(c) represents the power of the core of the central processing unit working at the first frequency f; P M (c) represents the maximum power of the core when the CPU operates at the first frequency f and meets the temperature constraint conditions; ET represents the total running time of the non-critical path; ET2 represents the end time of the latest computing task in the non-critical path; ET1 represents the start time of the earliest computing task in the non-critical path; t i represents the computing time of computing task i; n represents the total number of computing tasks in the non-critical path; t ic represents the communication time associated with computation task i.

[0035] A further optimization scheme is that, for the communication interval of each critical path, a frequency control strategy is generated based on the start time and duration; including the method:

[0036] Get the occurrence time and duration of the current communication interval;

[0037] Determine whether the current communication interval meets the frequency modulation condition based on the time of occurrence and duration. If so, the central processing unit is operated at the second frequency when the current communication interval is opened, and is switched to the default frequency when the current communication interval ends; otherwise, the central processing unit is kept operating at the default frequency; the second frequency is less than the default frequency.

[0038] A further optimization scheme is that the method of determining whether the current communication interval meets the frequency modulation condition according to the occurrence time and duration is as follows:

[0039] T1, determine whether the duration of the current communication interval is greater than the preset duration threshold, if so, enter T2; otherwise, determine that the current communication interval does not meet the frequency modulation condition;

[0040] T2, for single-task communication applications, directly determine whether the current communication interval meets the frequency modulation conditions; for parallel task communication applications, determine whether the occurrence time of the current communication interval is the latest start time of the same parallel task. If so, determine that the current communication interval does not meet the frequency modulation conditions, otherwise determine that the current communication interval meets the frequency modulation conditions.

[0041] The present solution also provides a central processing unit frequency control system, which is used to implement the above-mentioned central processing unit frequency control method; the system comprises:

[0042] A collection module is used to obtain basic operation data of the communication application program;

[0043] A calculation module, for dividing the critical path and non-critical path of the communication application program based on the basic operation data, and determining the communication intervals of the critical path and the non-critical path, and basic parameters of each communication interval; the basic parameters include: relaxation time, start time and duration;

[0044] The strategy generation module is used to generate a frequency control strategy for each communication interval of a non-critical path based on the relaxation duration; and to generate a frequency control strategy for each communication interval of a critical path based on the start time and duration.

[0045] The present solution also provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and wherein the processor implements the steps of the above method when executing the computer program.

[0046] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0047] The present invention provides a method, system and device for controlling the frequency of a central processing unit. Based on the prior art, the method for adjusting the frequency of the central processing unit is improved, and the adjustment amount and adjustment time of the dynamic voltage and frequency adjustment are determined from the perspective of the communication application program, so as to achieve dynamic optimization of power consumption based on the dynamic voltage and frequency adjustment while ensuring the communication performance of the communication application program. Since the frequency change of the central processing unit mainly affects the execution time of the computing task, the critical path contains the basic information of the optimization and load balancing of the parallel code, while the non-critical path contains more communication intervals. Therefore, the present scheme divides the critical path and non-critical path of the communication application program based on the basic operation data, generates different frequency control strategies for the critical path and the non-critical path, and realizes differentiated frequency control. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and should not be regarded as limiting the scope. For those of ordinary skill in the art, other relevant drawings can be obtained based on these drawings without creative work. In the drawings:

[0049] Figure 1 A flow chart of a method for controlling the frequency of a central processing unit;

[0050] Figure 2 It is a schematic diagram of the critical path of the parallel program;

[0051] Figure 3 A frequency control system structure for the central processing unit;

[0052] Figure 4 Schematic diagram of communication performance analyzed for this solution and the traditional solution. DETAILED DESCRIPTION

[0053] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with embodiments and drawings. The exemplary embodiments of the present invention and their description are only used to explain the present invention and are not intended to limit the present invention.

[0054] Dynamic voltage and frequency adjustment often increases program running time and reduces program performance, especially communication performance. The impact of processor core frequency changes on communication performance is easily overlooked. As dynamic voltage and frequency adjustment is carried out, the execution of computing tasks of communication applications is lengthened, thereby affecting the efficiency of the communication mode. In view of this, the present solution provides the following embodiments to solve the above technical problems.

[0055] Embodiment 1: This embodiment provides a method for controlling the frequency of a central processing unit, such as Figure 1 As shown, the central processing unit is used to run a communication application, and the method includes:

[0056] Step 1: Obtain the basic operation data of the communication application; Step 1 specifically includes the following methods:

[0057] The communication application is tested multiple times in the actual operating environment of the communication application to obtain a trace file of the communication application, and basic operating data of the communication application is calculated based on the analysis of the trace file; the trace file includes: a Profile file, a debugger output file, a custom performance monitoring file or an application log file.

[0058] Step 2: Based on the basic operation data, the critical path and non-critical path of the communication application are divided, and the communication intervals of the critical path and the non-critical path, as well as the basic parameters of each communication interval are determined; the basic parameters include: relaxation time, start time and duration;

[0059] The method of dividing the critical path and non-critical path of the communication application based on the basic operation data includes:

[0060] S21, acquiring all computing tasks of the communication application according to the basic operation data;

[0061] S22, sort all computing tasks to build a task queue; for any computing task v in the task queue i , the earliest calculation time factor is T1(v i ), the latest start time factor is T2(v i ); the calculation time is T(v i );

[0062] For the computation task v i The calculation time T(v i ) is obtained according to the following formula:

[0063] T(v i )=c 0 +A 1 / c 1 +A 2 ×c 2 +A 3 ×c 3 +NOL i +MD i ;

[0064] Among them, c 0 Indicates the time parameter; c 1Indicates task parameters; A 1 Indicates the total number of computing tasks in the critical path or non-critical path; c 2 Indicates the calculation amount parameter; A 2 represents the average amount of computation between computational tasks in the critical path or non-critical path; c 3 Indicates the communication volume parameter; A 3 Represents the computational task v i The average communication volume between tasks in the critical path or non-critical path; NOL i Represents the computational task v i The number of layers of the mapping area corresponding to the critical path or non-critical path; MD i Represents the computational task v i The minimum distance from the critical path or non-critical path corresponding to the mapping area to the heat sink.

[0065] S23, the first computing task v in the task queue s The earliest start time factor of the task is set to 0, and the earliest start time of the remaining tasks is set to ∞; the latest start time factor of each task in the task queue is set to the calculation time of the task;

[0066] S24, dynamically plan and calculate each computing task according to the task queue:

[0067] T1(v i )=max[T1(v i+q )+T(v i+q )+T(v i+q , v i )];

[0068] T2(v i )=min[T2(v i+h )-T(v i , v i+h )-T(v i )];

[0069] Among them, T1(v i+q ) represents the computing task v i+q The earliest start time factor of the calculation task v i+q For the calculation task v i The direct predecessor task; T(v i+q ) represents the computing task v i+q The calculation time of T(v i+q , v i ) represents the computing task v i With the computing task v i+q Communication time between i+h ) represents the computing task v i+hThe latest start time factor for computing task v i+h For the calculation task v i The direct successor task; T(v i , v i+h ) represents the computing task v i With the computing task v i+h Communication time between

[0070] S25, determine the computing task v in the task queue i Whether it satisfies: T1(v i )=T2(v i ); If so, then determine the computing task v i is a critical task; otherwise, the calculation task v i For non-critical tasks;

[0071] S26, traverse the task queue, and use the node set composed of all critical tasks in the task queue as the critical path set of the communication parallel application; use the node set composed of all non-critical tasks in the task queue as the non-critical path set of the communication parallel application.

[0072] Step 3: For the communication interval of the non-critical path, a frequency control strategy is generated based on the slack duration; for the communication interval of the critical path, a frequency control strategy is generated based on the start time and duration.

[0073] The method of generating a frequency control strategy based on the relaxation duration for each communication interval of the non-critical path includes:

[0074] S31, obtaining the relaxation time of the current communication interval;

[0075] S32, when the relaxation duration is greater than the preset duration threshold TE1, the frequency control strategy is: when the calculation interval a is opened, the central processor is adjusted to work at the first frequency, and when the calculation interval a ends, the central processor is adjusted to work at the default frequency; wherein the first frequency is less than the default frequency; the calculation interval a represents a calculation interval that is located before the current communication interval and is closest to the current communication interval;

[0076] When the relaxation duration is less than or equal to the preset duration threshold TE1, the frequency control strategy is: in the entire current communication interval and calculation interval a, the central processor is kept operating at the default frequency.

[0077] The method for acquiring the first frequency includes:

[0078] The first frequency f is calculated according to the following formula:

[0079]

[0080] Wherein, ta(f) represents the function of the first frequency f with respect to time ta, and time ta represents the calculation time of the calculation interval a; t1 represents the calculation time of the calculation interval a when the central processing unit works at the default frequency; t2 represents the relaxation time when the central processing unit works at the default frequency; P(c) represents the power of the core of the central processing unit working at the first frequency f; P M (c) represents the maximum power of the core when the CPU operates at the first frequency f and meets the temperature constraint conditions; ET represents the total running time of the non-critical path; ET2 represents the end time of the latest computing task in the non-critical path; ET1 represents the start time of the earliest computing task in the non-critical path; t i represents the computing time of computing task i; n represents the total number of computing tasks in the non-critical path; t ic represents the communication time associated with computation task i.

[0081] Since there are many communication intervals on the non-critical path, and the implementation of parallel programs requires computing task synchronization, in order to maintain computing task synchronization, the computing task that is completed first needs to wait for other parallel tasks. Therefore, in addition to the actual communication time, the communication interval contains a lot of slack time. Therefore, this solution starts with the computing interval on the non-critical path to adjust the frequency, and achieves interval stretching by reducing the frequency of the corresponding computing interval. The computing interval after interval stretching is used to fill the slack time, reduce the power consumption of the computing interval, and reduce the slack time. When stretching the corresponding computing interval, it is necessary to ensure that the stretching interval is less than or equal to the slack time, and at the same time ensure the stability of the computing interval after frequency conversion.

[0082] For each critical path communication interval, a frequency control strategy is generated based on the start time and duration; including the method:

[0083] Get the occurrence time and duration of the current communication interval;

[0084] Determine whether the current communication interval meets the frequency modulation condition based on the time of occurrence and duration. If so, the central processing unit is operated at the second frequency when the current communication interval is opened, and is switched to the default frequency when the current communication interval ends; otherwise, the central processing unit is kept operating at the default frequency; the second frequency is less than the default frequency.

[0085] The method of determining whether the current communication interval meets the frequency modulation condition according to the occurrence time and the duration is as follows:

[0086] T1, determine whether the duration of the current communication interval is greater than the preset duration threshold, if so, enter T2; otherwise, determine that the current communication interval does not meet the frequency modulation condition;

[0087] T2, for single-task communication applications, directly determine whether the current communication interval meets the frequency modulation conditions; for parallel task communication applications, determine whether the occurrence time of the current communication interval is the latest start time of the same parallel task. If so, determine that the current communication interval does not meet the frequency modulation conditions, otherwise determine that the current communication interval meets the frequency modulation conditions.

[0088] The critical path contains basic information about parallel code optimization and load balancing. Therefore, the frequency modulation of the critical path is mainly aimed at its communication interval. If all communication intervals on the critical path are dynamically modulated, the frequent conversion of dynamic frequency modulation will bring additional overhead. If dynamic frequency modulation is performed on shorter communication intervals, the performance of the program will be significantly reduced, which will extend the critical path time of the program and cause performance loss. Therefore, this solution screens the communication intervals and only dynamically modulates the communication intervals that meet the preset time threshold. The communication intervals that do not meet the preset time threshold are not dynamically modulated, which reduces the performance loss caused by dynamic frequency modulation to a certain extent. At the same time, considering the different end times of the calculation intervals caused by the different loads of the various calculation tasks of the parallel program, such as Figure 2 As shown, in order to maintain the synchronization of computing tasks, the computing task that is completed first (computing task 3) needs to wait for the completion of other parallel computing tasks (computing task 1 and computing task 2) before the next interval of tasks can be carried out; therefore, the communication interval corresponding to the computing task that ends last has less slack time. In order to ensure communication performance, this scheme does not dynamically adjust the frequency of the communication interval corresponding to the computing task that ends last, and reduces the frequency of the remaining communication intervals, which reduces the communication performance loss caused by dynamic frequency modulation to a certain extent.

[0089] Since the implementation of parallel programs requires the synchronization of computing tasks, in order to maintain the synchronization of computing tasks, the computing task that is completed first needs to wait for other parallel computing tasks before proceeding to the next task. Therefore, the communication interval also contains slack time. This scheme achieves interval stretching by adjusting the frequency of the corresponding computing interval, and fills the slack time with the computing interval after interval stretching, thereby reducing the power consumption of the computing interval and reducing relaxation.

[0090] Embodiment 2: This embodiment provides a frequency control system of a central processing unit, which is used to implement a frequency control method of a central processing unit described in Embodiment 1; Figure 3 As shown, the system comprises:

[0091] A collection module is used to obtain basic operation data of the communication application program;

[0092] A calculation module, for dividing the critical path and non-critical path of the communication application program based on the basic operation data, and determining the communication intervals of the critical path and the non-critical path, and basic parameters of each communication interval; the basic parameters include: relaxation time, start time and duration;

[0093] The strategy generation module is used to generate a frequency control strategy for each communication interval of a non-critical path based on the relaxation duration; and to generate a frequency control strategy for each communication interval of a critical path based on the start time and duration.

[0094] Embodiment 3: This embodiment provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and is characterized in that when the processor executes the computer program, the steps of the method described in Embodiment 1 are implemented; specifically, the following steps are performed:

[0095] Step 1: Obtain basic operation data of the communication application;

[0096] Step 2: Based on the basic operation data, the critical path and non-critical path of the communication application are divided, and the communication intervals of the critical path and the non-critical path, as well as the basic parameters of each communication interval are determined; the basic parameters include: relaxation time, start time and duration;

[0097] Step 3: For the communication interval of the non-critical path, a frequency control strategy is generated based on the slack duration; for the communication interval of the critical path, a frequency control strategy is generated based on the start time and duration.

[0098] like Figure 4 As shown, this embodiment runs an MPI communication application in the same network environment. The traditional solution is to directly dynamically modulate the communication application, and this solution is to divide the critical path and non-critical path of the communication application and perform dynamic frequency modulation respectively. The communication performance obtained by analyzing the two solutions is shown in the figure. It can be seen from the figure that during the communication process of this solution, the transmission delay is significantly smaller than the transmission delay of the traditional solution. This shows that this solution reduces the communication performance loss caused by dynamic frequency modulation to a certain extent.

[0099] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for controlling the frequency of a central processing unit, characterized in that: The central processing unit is used to run a communication application program, and the method includes: Obtain basic operational data of communication applications; Based on the basic operation data, the critical path and non-critical path of the communication application are divided, and the communication intervals of the critical path and the non-critical path, as well as the basic parameters of each communication interval are determined; the basic parameters include: relaxation time, start time and duration; For the communication interval of non-critical paths, a frequency control strategy is generated based on the relaxation duration; for the communication interval of critical paths, a frequency control strategy is generated based on the start time and duration.

2. The method for controlling the frequency of a CPU according to claim 1, characterized in that: The obtaining of the basic operation data of the communication application program includes: method: Test-run the communication application program multiple times in the actual operation environment of the communication application program to obtain a tracking file of the communication application program, and analyze and calculate basic operation data of the communication application program based on the tracking file; The tracking files include: Profile files, debugger output files, custom performance monitoring files or application log files.

3. The method for controlling the frequency of a CPU according to claim 1, characterized in that: The step of dividing the critical path and non-critical path of the communication application program based on the basic operation data; Included methods: Acquire all computing tasks of the communication application program according to the operation basic data; Sort all computing tasks to build a task queue; for any computing task v in the task queue i , the earliest calculation time factor is T1(v i ), the latest start time factor is T2(v i ); the calculation time is T(v i ); The first calculation task v in the task queue s The earliest start time factor of the task is set to 0, and the earliest start time factors of the remaining computing tasks are set to ∞; the latest start time factor of each computing task in the task queue is set to the computing time of the computing task; Perform dynamic planning calculations on each computing task according to the task queue: T1(v i )=max[T1(v i+q )+T(v i+q )+T(v i+q ,v i )] / 2min[T1(v i+q )+T(v i+q )+T(v i+q ,v i )]; T2(v i )=min[T2(v i+h )-T(v i ,v i+h )-T(v i )] / 2max[T2(v i+h )-T(v i ,v i+h )-T(v i )]; Among them, T1(v i+q ) represents the computing task v i+q The earliest start time factor of the calculation task v i+q For the calculation task v i The direct predecessor task; T(v i+q ) represents the computing task v i+q The calculation time of T(v i+q , v i ) represents the computing task v i With the computing task v i+q Communication time between i+h ) represents the computing task v i+h The latest start time factor for computing task v i+h For the calculation task v i The direct successor task; T(v i , v i+h ) represents the computing task v i With the computing task v i+h Communication time between Determine the computing task v in the task queue i Whether it satisfies: T1(v i )=T2(v i ); If so, determine the computing task v i is a critical task; otherwise, the calculation task v is determined i For non-critical tasks; The task queue is traversed, and the node set consisting of all critical tasks in the task queue is used as the critical path set of the communication parallel application; the node set consisting of all non-critical tasks in the task queue is used as the non-critical path set of the communication parallel application.

4. The method for controlling the frequency of a CPU according to claim 3, characterized in that: The method for obtaining the calculation time includes: For the computation task v i The calculation time T(v i ) is obtained according to the following formula: T(v i )=c0+A1 / c1+A2×c2+A3×c3+NOL i +MD i ; Among them, c0 represents the time parameter; c1 represents the task parameter; A1 represents the total number of computing tasks in the critical path or non-critical path; c2 represents the computing amount parameter; A2 represents the average computing amount between computing tasks in the critical path or non-critical path; c3 represents the communication amount parameter; A3 represents the computing task v i The average communication volume between tasks in the critical path or non-critical path; NOL i Represents the computational task v i The number of layers of the mapping area corresponding to the critical path or non-critical path; MD i Represents the computational task v i The minimum distance from the critical path or non-critical path corresponding to the mapping area to the heat sink.

5. The method for controlling the frequency of a CPU according to claim 1, characterized in that: For each communication interval of the non-critical path, a frequency control strategy is generated based on the relaxation time; Included methods: Get the relaxation time of the current communication interval; When the relaxation duration is greater than the preset duration threshold TE1, the frequency control strategy is: when the calculation interval a is opened, the central processor is adjusted to work at the first frequency, and when the calculation interval a ends, the central processor is adjusted to work at the default frequency; wherein the first frequency is less than the default frequency; the calculation interval a represents a calculation interval that is located before the current communication interval and is closest to the current communication interval; When the relaxation duration is less than or equal to the preset duration threshold TE1, the frequency control strategy is: in the entire current communication interval and calculation interval a, the central processor is kept operating at the default frequency.

6. A method for controlling the frequency of a central processing unit according to claim 5, characterized in that: The method for acquiring the first frequency includes: The first frequency f is calculated according to the following formula: Wherein, ta(f) represents the function of the first frequency f with respect to time ta, and time ta represents the calculation time of the calculation interval a; t1 represents the calculation time of the calculation interval a when the central processing unit works at the default frequency; t2 represents the relaxation time when the central processing unit works at the default frequency; P(c) represents the power of the core of the central processing unit working at the first frequency f; P M (c) represents the maximum power of the core when the CPU operates at the first frequency f and meets the temperature constraint conditions; ET represents the total running time of the non-critical path; ET2 represents the end time of the latest computing task in the non-critical path; ET1 represents the start time of the earliest computing task in the non-critical path; t i represents the computing time of computing task i; n represents the total number of computing tasks in the non-critical path; t ic represents the communication time associated with computation task i.

7. The method for controlling the frequency of a CPU according to claim 1, characterized in that: For each critical path communication interval, a frequency control strategy is generated based on the start time and duration; Included methods: Get the occurrence time and duration of the current communication interval; Determine whether the current communication interval meets the frequency modulation condition based on the time of occurrence and duration. If so, the central processing unit is operated at the second frequency when the current communication interval is opened, and is switched to the default frequency when the current communication interval ends; otherwise, the central processing unit is kept operating at the default frequency; the second frequency is less than the default frequency.

8. A method for controlling the frequency of a central processing unit according to claim 7, characterized in that: The determining whether the current communication interval meets the frequency modulation condition according to the occurrence time and duration; Included methods: T1, determine whether the duration of the current communication interval is greater than the preset duration threshold, if so, enter T2; otherwise, determine that the current communication interval does not meet the frequency modulation condition; T2, for single-task communication applications, directly determine whether the current communication interval meets the frequency modulation conditions; for parallel task communication applications, determine whether the occurrence time of the current communication interval is the latest start time of the same parallel task. If so, determine that the current communication interval does not meet the frequency modulation conditions, otherwise determine that the current communication interval meets the frequency modulation conditions.

9. A frequency control system for a central processing unit, characterized in that: A method for controlling the frequency of a central processing unit according to any one of claims 1 to 8; the system comprises: A collection module is used to obtain basic operation data of the communication application program; A calculation module, for dividing the critical path and non-critical path of the communication application program based on the basic operation data, and determining the communication intervals of the critical path and the non-critical path, and basic parameters of each communication interval; the basic parameters include: relaxation time, start time and duration; The strategy generation module is used to generate a frequency control strategy for each communication interval of a non-critical path based on the relaxation duration; and to generate a frequency control strategy for each communication interval of a critical path based on the start time and duration.

10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Dependent task scheduling method of heterogeneous multi-core processor

    CN103473134A

  • AOV gateway key path query-based optimization method for dynamic power consumption of heterogeneous system

    CN106896895A

  • Frequency modulation method and frequency modulation device

    CN116414215A

  • Processor frequency modulation method and device, chip system, storage medium and program product

    CN117666753A

  • Dynamic scheduling method based on longest path task insertion

    CN118295781A