Computing Power Resource Allocation Control Method, Device, Electronic Device and Storage Medium
Through the neural network model, the PID control algorithm is optimized and the GPU resource allocation is dynamically adjusted, which solves the problems of inefficiency and imbalance under the traditional allocation method, and achieves more efficient and balanced resource allocation.
Patent Information
- Application Number
- CN202411424947.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-12
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2044-10-12
AI Technical Summary
When traditional GPU computing resource allocation methods face diversified and dynamically changing loads and tasks, it is difficult to adapt to dynamics, resulting in low efficiency and unbalanced resource allocation, affecting overall performance.
The PID control algorithm optimized based on neural network model is adopted to dynamically adjust the resource allocation control amount by monitoring the resource utilization deviation and kernel function accumulation of the graphics processing process in real time to achieve more accurate and flexible resource allocation.
It improves the accuracy and efficiency of computing resource allocation control, realizes the balance of resource allocation, and improves the adaptability of PID control algorithm in dynamic changing environments.
Smart Images

Figure CN119440808B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of resource scheduling, and particularly to a computing power resource allocation control method, device, electronic device and storage medium. Background Art
[0002] Virtual Graphics Processing Unit (VGPU) computing power resource scheduling is to effectively allocate the computing power resources of physical GPUs to different virtual machines or container instances in a virtualized environment to ensure that each instance can obtain appropriate GPU performance.
[0003] In related technologies, in traditional GPU computing power resource allocation, static allocation or dynamic allocation based on simple rules is usually adopted. These methods may perform well in certain scenarios, but there are some technical problems when facing diverse and dynamically changing loads and tasks.
[0004] First, the computing tasks and load conditions of GPU computing power resources may change dynamically with time and application scenarios. Traditional static allocation is difficult to adapt to this dynamicity, resulting in low resource allocation efficiency. Second, in the case of unbalanced load, it may not be possible to achieve balanced task allocation, resulting in some GPUs having too many processing tasks and being overloaded, while other GPUs are relatively idle, affecting the overall performance. Summary of the Invention
[0005] The present invention provides a computing power resource allocation control method, device, electronic device and storage medium to optimize the PID control algorithm based on a neural network model, so as to dynamically control the computing power resource allocation process of the graphics processor based on the optimized PID algorithm, thereby improving the accuracy and efficiency of computing power resource allocation control.
[0006] According to an aspect of the present invention, there is provided a computing power resource allocation control method, the method comprising:
[0007] For at least one graphics processing process associated with a graphics processor, determine the resource utilization deviation corresponding to the graphics processing process at the current moment according to the actual resource utilization and the set resource utilization corresponding to the graphics processing process at the current moment; wherein, the actual resource utilization is used to indicate the amount of computing power resources applied by the graphics processing process at the current moment; the set resource utilization is used to indicate the amount of computing power resources expected to be applied by the graphics processing process.
[0008] Obtain the resource allocation control amount corresponding to the previous moment of the current moment of the graphics processing process and the kernel function accumulation amount corresponding to the current moment; wherein, the kernel function accumulation amount is determined based on the resource allocation control amount and the kernel function operation amount of the previous moment; the kernel function operation amount is used to indicate the amount of resources required to execute the to-be-executed kernel function; the to-be-executed kernel function is used to execute the graphics processing process based on the graphics processor.
[0009] According to the pre-trained control parameter prediction model, the actual resource utilization rate, the set resource utilization rate, the resource utilization rate deviation, the resource allocation control amount, and the kernel function accumulation amount, determine the resource allocation control amount of the graphics processing process at the current moment, so as to determine the kernel function execution decision of the graphics processing process at the next moment of the current moment based on the resource allocation control amount.
[0010] According to another aspect of the present invention, there is provided a computing power resource allocation control device, and the device includes:
[0011] A deviation determination module, configured to determine the resource utilization rate deviation corresponding to the graphics processing process at the current moment according to the actual resource utilization rate and the set resource utilization rate corresponding to the at least one graphics processing process associated with the graphics processor at the current moment; wherein, the actual resource utilization rate is used to indicate the amount of computing power resources applied by the graphics processing process at the current moment; the set resource utilization rate is used to indicate the amount of computing power resources expected to be applied by the graphics processing process.
[0012] An accumulation amount acquisition module, configured to obtain the resource allocation control amount corresponding to the previous moment of the current moment of the graphics processing process and the kernel function accumulation amount corresponding to the current moment; wherein, the kernel function accumulation amount is determined based on the resource allocation control amount and the kernel function operation amount of the previous moment; the kernel function operation amount is used to indicate the amount of resources required to execute the to-be-executed kernel function; the to-be-executed kernel function is used to execute the graphics processing process based on the graphics processor.
[0013] An allocation control amount determination module, configured to determine the resource allocation control amount of the graphics processing process at the current moment according to the pre-trained control parameter prediction model, the actual resource utilization rate, the set resource utilization rate, the resource utilization rate deviation, the resource allocation control amount, and the kernel function accumulation amount, so as to determine the kernel function execution decision of the graphics processing process at the next moment of the current moment based on the resource allocation control amount.
[0014] According to another aspect of the present invention, there is provided an electronic device, and the electronic device includes:
[0015] At least one processor; and
[0016] a memory communicatively connected to the at least one processor; wherein
[0017] the memory stores a computer program executable by the at least one processor, and when the computer program is executed by the at least one processor, the at least one processor is enabled to execute the computing power resource allocation control method according to any embodiment of the present invention.
[0018] According to another aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions for causing a processor to implement the computing power resource allocation control method according to any embodiment of the present invention when executed.
[0019] The technical solution of the embodiment of the present invention is directed to at least one graphics processing process associated with a graphics processor. According to the actual resource utilization rate and the set resource utilization rate corresponding to the graphics processing process at the current moment, the resource utilization rate deviation corresponding to the graphics processing process at the current moment is determined, and the resource allocation control amount corresponding to the previous moment and the kernel function accumulation amount corresponding to the current moment of the graphics processing process at the current moment are obtained. According to the pre-trained control parameter prediction model, the actual resource utilization rate, the set resource utilization rate, the resource utilization rate deviation, the resource allocation control amount, and the kernel function accumulation amount, the resource allocation control amount of the graphics processing process at the current moment is determined, so as to determine the execution decision corresponding to the kernel function to be executed at the next moment of the graphics processing process at the current moment based on the resource allocation control amount, solving the problem that the resource allocation control method in the related art is difficult to adapt to dynamic calculation tasks and load conditions, resulting in low resource allocation efficiency and uneven resource allocation. The effect of optimizing the PID control algorithm based on the neural network model and dynamically controlling the computing power resource allocation process of the graphics processor based on the optimized PID algorithm is achieved. Furthermore, the accuracy and efficiency of the computing power resource allocation control are improved, the flexibility of the computing power resource allocation control process is improved, the balance of the computing power resource allocation is improved, and the universality of the PID control algorithm in the computing power resource allocation control process is enhanced.
[0020] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present invention, nor is it used to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the accompanying drawings required for the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can be obtained based on these drawings.
[0022] Figure 1 It is a flowchart of a computing power resource allocation control method provided according to Embodiment 1 of the present invention;
[0023] Figure 2 It is a flowchart of a computing power resource allocation control method provided according to Embodiment 2 of the present invention;
[0024] Figure 3 It is a flowchart of a computing power resource allocation control method provided according to Embodiment 3 of the present invention;
[0025] Figure 4 It is a schematic structural diagram of a computing power resource allocation control device provided according to Embodiment 4 of the present invention;
[0026] Figure 5 It is a schematic structural diagram of an electronic device for implementing the computing power resource allocation control method of the embodiments of the present invention. Specific Embodiments
[0027] In order to enable those skilled in the art to better understand the solutions of the present invention, the following clearly and completely describes the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above accompanying drawings are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention described here can be implemented in an order different from those illustrated or described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily need to be limited to those clearly listed steps or units, but may include other steps or units that are not clearly listed or are inherent to these processes, methods, products, or devices.
[0029] Embodiment 1
[0030] Figure 1 It is a flowchart of a computing power resource allocation control method provided in the first embodiment of the present invention. This embodiment is applicable to the situation of allocating and controlling the computing power resources of a graphics processing unit. This method can be executed by a computing power resource allocation control device, which can be implemented in the form of hardware and / or software, and can be configured in a terminal and / or a server. As Figure 1 shown, the method includes:
[0031] S110. For at least one graphics processing process associated with the graphics processing unit, determine the resource utilization deviation corresponding to the graphics processing process at the current moment according to the actual resource utilization and the set resource utilization corresponding to the graphics processing process at the current moment.
[0032] Among them, a Graphics Processing Unit (GPU) is a microprocessor dedicated to performing image and graphics-related processing work on personal computers, workstations, game consoles, and some mobile devices (tablet computers, smart phones, etc.). Generally, at least one process (or task) associated with graphics processing can be executed based on the resources included in the GPU. When determining at least one graphics processing process, at least part of the resources included in the GPU can be allocated to the corresponding graphics processing process so that the graphics processing process performs graphics processing operations based on the allocated GPU resources. A graphics processing process can be a process of performing a series of operations and processing on graphics data. In this embodiment, the graphics processing process can be to execute corresponding graphics processing tasks on the corresponding virtual graphics processing unit in the graphics processing unit. It can be understood that through virtualization technology, the rendering resources and computing resources of the physical entity GPU can be encapsulated into multiple independent virtual slices. Each virtual slice is allocated to a different virtual machine so that it can independently access and utilize GPU resources. At this time, the virtual slice can be used as a Virtual Graphics Processing Unit (VGPU). The actual resource utilization is used to indicate the amount of computing power resources applied by the graphics processing process at the current moment. The actual resource utilization can be understood as the ratio between the amount of resources actually applied by the graphics processing process for graphics processing operations within a specific time and the total amount of resources. It should be noted that for different graphics cards, the method of determining the actual resource utilization of the graphics processing process is different. Exemplarily, assuming that the graphics card set on the GPU is an NVIDIA graphics card, the actual resource utilization is usually determined by calculating the percentage of active streaming multiprocessors in the total number of streaming multiprocessors. The set resource utilization is used to indicate the amount of computing power resources expected to be applied by the graphics processing process. The set resource utilization can be understood as the ratio between the amount of resources expected to be applied by the graphics processing process for graphics processing operations within a specific time and the total amount of resources.
[0033] In this embodiment, the set resource utilization rate may be a resource utilization rate pre-determined and allocated to the corresponding graphics processing process, so that the corresponding graphics processing process can execute the corresponding graphics processing task on the graphics processor based on the corresponding set resource utilization rate. Further, during the execution of the corresponding graphics processing task by the graphics processing process, there is a certain deviation between the actual resource utilization rate actually applied for the execution of the task and the corresponding set resource utilization rate. Furthermore, in order to determine the resource utilization rate deviation corresponding to the graphics processing process at each moment, the actual resource utilization rate and the set resource utilization rate corresponding to the graphics processing process at the current moment can be obtained. Further, the difference between the set resource utilization rate and the actual resource utilization rate can be determined, and this difference is used as the resource utilization rate deviation corresponding to the graphics processing process at the current moment. Among them, the actual resource utilization rate can be obtained in various ways. Optionally, a performance detection tool is used to collect the resource utilization rate of the graphics processing process in real time or regularly, and the collected resource utilization rate is used as the actual resource utilization rate.
[0034] S120. Obtain the resource allocation control amount corresponding to the previous moment of the current moment of the graphics processing process and the kernel function accumulation amount corresponding to the current moment.
[0035] Among them, the resource allocation control quantity can be used to characterize the control quantity based on which the resource utilization rate of the graphics processing process at the corresponding moment is adjusted. In the case of determining the actual resource utilization rate and the set resource utilization rate, the actual resource utilization rate can be adjusted according to the resource allocation control quantity, so that the adjusted actual resource utilization rate approaches the set resource utilization rate. Thus, the effect of effectively allocating graphics processing resources and improving resource utilization rate can be achieved. In this embodiment, the resource allocation control quantity can be understood as the computing power resources allocated to the graphics processing process. The kernel function accumulation quantity can be the resource quantity obtained after at least one resource allocation control quantity is superimposed, and this resource quantity can be used to execute the corresponding kernel function. The kernel function accumulation quantity at the current moment is determined based on the resource allocation control quantity at the previous moment and the kernel function operation quantity at the previous moment. The kernel function operation quantity can be used to indicate the resource quantity required to execute the kernel function to be executed. The kernel function to be executed can be used to execute the graphics processing process based on the graphics processor. Generally, when executing the graphics processing process based on the graphics processor, the kernel function to be executed corresponding to the graphics processing process can be sent to the graphics processor to execute the corresponding graphics processing process. The kernel function operation quantity can be determined according to the number of thread blocks carried when the kernel function to be executed is sent and the number of threads in each thread block. In this embodiment, in the case of determining the resource allocation control quantity at the previous moment, the resource allocation control quantity can be input into the kernel function execution unit to superimpose the resource allocation control quantity with the kernel function accumulation quantity included in the kernel function execution unit. Further, the superimposed kernel function accumulation quantity can be compared with the kernel function operation quantity. In the case where the superimposed kernel function accumulation quantity is greater than the kernel function operation quantity, the difference between the superimposed kernel function accumulation quantity and the kernel function operation quantity can be determined, and this difference can be used as the kernel function accumulation quantity at the current moment.
[0036] In this embodiment, in order to determine the resource allocation control quantity corresponding to the current moment, the resource allocation control quantity corresponding to the previous moment of the current moment and the kernel function accumulation quantity corresponding to the current moment can be obtained. Furthermore, the resource allocation control quantity corresponding to the current moment can be determined based on the obtained resource allocation control quantity, kernel function accumulation quantity, and the determined resource utilization rate deviation.
[0037] S130. According to the pre-trained control parameter prediction model, actual resource utilization rate, set resource utilization rate, resource utilization rate deviation, resource allocation control quantity, and kernel function accumulation quantity, determine the resource allocation control quantity of the graphics processing process at the current moment, so as to determine the execution decision corresponding to the kernel function to be executed at the next moment of the current moment of the graphics processing process based on the resource allocation control quantity.
[0038] Among them, the control parameter prediction model can be a neural network model for predicting feedback control parameters. In this embodiment, the control parameter prediction model can be a neural network model that takes the actual resource utilization rate, the set resource utilization rate, the resource utilization rate deviation, the resource allocation control amount, and the kernel function cumulative amount as input objects to determine the feedback control parameters based on the input objects. The control parameter prediction model can be obtained by training a pre-constructed neural network model based on the actual resource utilization rate, the set resource utilization rate, the resource utilization rate deviation, and the kernel function cumulative amount corresponding to a historical moment, the resource allocation control amount at the previous moment of the historical moment, and the actual feedback control parameters corresponding to the historical moment. It can be understood that the feedback control coefficient can be the core of the PID control algorithm, which can determine how the graphics processing process adjusts the actual resource utilization rate according to the resource utilization rate deviation to reduce the difference between the actual resource utilization rate and the set resource utilization rate. Optionally, the feedback control coefficient can include a proportional coefficient, an integral coefficient, and a differential coefficient. The execution decision can be used to represent whether the corresponding kernel function is executed at the corresponding moment. Optionally, the execution decision can include issuing for execution or delaying execution.
[0039] In practical applications, the PID control algorithm can be applied to the allocation control process of VGPU computing power resources. Generally, the PID control algorithm can only ensure the correctness and convergence of its control amount under the conditions of system performance linearity and time invariance. System performance linearity means that there should be a linear relationship between the resource allocation control amount and the resource allocation amount. Time invariance means that when the same resource allocation control amount is input at any time, the resource allocation amount output by the system should also be the same and not affected by time changes. However, it is very difficult to achieve these two characteristics in the GPU. One is that the kernel functions and data volumes called by the running GPU often change greatly, breaking the principles of linearity and time invariance. The other is that the large-scale parallel computing performance changes rapidly. Limited by parameters such as video memory, computing cores, and data transmission, the running performance varies greatly at different times and cannot be linear. Furthermore, when allocating and controlling GPU computing power resources based on the PID control algorithm, it may be impossible to accurately control the resource utilization rate of each graphics processing process, and thus affect the execution efficiency and execution effect of the graphics processing process.
[0040] In view of the above situation, in this embodiment, a control parameter prediction model can be used to predict the feedback control parameters at the current moment. Furthermore, the resource allocation control amount at the current moment can be determined according to the predicted feedback control parameters, so as to adjust the actual resource utilization rate based on the resource allocation control amount.
[0041] It should be noted that the control parameter prediction model can be a neural network model with any model structure. Optionally, it is a Recursive Neural Network (RNN). The advantage of applying an RNN is that it can learn temporal variation patterns and the time dependence of attributes, which is particularly important for non-stationary data systems where attributes change over time, making it suitable for controlling dynamic systems with time-varying behavior.
[0042] In this embodiment, given the actual resource utilization rate, set resource utilization rate, resource utilization rate deviation, resource allocation control amount, and kernel function accumulation amount corresponding to the graphics processing process at the current moment, the control parameter prediction model pre-trained can be used to process the actual resource utilization rate, set resource utilization rate, resource utilization rate deviation, resource allocation control amount, and kernel function accumulation amount to obtain the feedback control parameter corresponding to the graphics processing process at the current moment. Further, the resource allocation control amount for the next moment of the graphics processing process at the current moment can be determined based on the feedback control parameter. Furthermore, an execution decision corresponding to the kernel function to be executed can be determined based on the resource allocation control amount.
[0043] The technical solution of the embodiment of the present invention, for at least one graphics processing process associated with a graphics processor, determines the resource utilization rate deviation corresponding to the graphics processing process at the current moment according to the actual resource utilization rate and the set resource utilization rate corresponding to the graphics processing process at the current moment, obtains the resource allocation control amount corresponding to the previous moment of the graphics processing process at the current moment and the kernel function accumulation amount corresponding to the current moment, and determines the resource allocation control amount of the graphics processing process at the current moment according to the pre-trained control parameter prediction model, actual resource utilization rate, set resource utilization rate, resource utilization rate deviation, resource allocation control amount, and kernel function accumulation amount, so as to determine the execution decision corresponding to the kernel function to be executed at the next moment of the graphics processing process at the current moment based on the resource allocation control amount, solves the problem that the resource allocation control method in the related technology is difficult to adapt to dynamic calculation tasks and load conditions, resulting in low resource allocation efficiency and unbalanced resource allocation, realizes optimizing the PID control algorithm based on a neural network model, and achieves the effect of dynamically controlling the computing power resource allocation process of the graphics processor based on the optimized PID algorithm. Furthermore, it improves the accuracy and efficiency of the computing power resource allocation control, increases the flexibility of the computing power resource allocation control process, improves the balance of the computing power resource allocation, and enhances the universality of the PID control algorithm in the computing power resource allocation control process.
[0044] Embodiment 2
[0045] Figure 2It is a flowchart of a computing power resource allocation control method provided in the second embodiment of the present invention. On the basis of the foregoing embodiment, the actual resource utilization rate, the set resource utilization rate, the resource utilization rate deviation, the resource allocation control amount, and the kernel function accumulation amount are input into a pre-trained control parameter prediction model to obtain the feedback control parameter corresponding to the graphics processing process at the current moment; based on the resource utilization rate deviation and the feedback control parameter, the resource allocation control amount of the graphics processing process at the current moment is determined. The specific implementation manner can refer to the technical solution of this embodiment. Among them, the same or similar technical terms as those in the above embodiment will not be elaborated here.
[0046] As Figure 2 shown, the method includes:
[0047] S210. For at least one graphics processing process associated with the graphics processor, determine the resource utilization rate deviation corresponding to the graphics processing process at the current moment according to the actual resource utilization rate and the set resource utilization rate corresponding to the graphics processing process at the current moment.
[0048] S220. Obtain the resource allocation control amount corresponding to the previous moment of the graphics processing process at the current moment and the kernel function accumulation amount corresponding to the current moment.
[0049] S230. Input the actual resource utilization rate, the set resource utilization rate, the resource utilization rate deviation, the resource allocation control amount, and the kernel function accumulation amount into a pre-trained control parameter prediction model to obtain the feedback control parameter corresponding to the graphics processing process at the current moment.
[0050] Among them, the feedback control parameter refers to various parameters used to adjust the system performance and control accuracy in the feedback control system. In this embodiment, the feedback control parameter can be used to adjust the deviation between the actual resource utilization rate and the set resource utilization rate so that the actual resource utilization rate approaches the set resource utilization rate.
[0051] In this embodiment, the control parameter prediction model can be trained based on the actual resource utilization rate, the set resource utilization rate, the resource utilization rate deviation, the kernel function cumulative amount corresponding to the sample graphics processing process at historical moments, the resource allocation control amount at the previous moment of the historical moment, and the actual feedback control parameter corresponding to the historical moment. Before applying the control parameter prediction model provided in this embodiment, the pre-constructed neural network model can be trained in a supervised or unsupervised manner. Before training the neural network model, multiple training samples can be constructed to train the model based on the training samples. To improve the accuracy of the control parameter prediction model, as many and as rich training samples as possible can be constructed. Optionally, the training process of the control parameter prediction model can be: obtaining multiple training sample data; training the model to be trained based on the multiple training sample data to obtain the control parameter prediction model.
[0052] Among them, the training sample data includes the actual resource utilization rate, the set resource utilization rate, the resource utilization rate deviation, the kernel function cumulative amount corresponding to the sample graphics processing process at historical moments, the resource allocation control amount at the previous moment of the historical moment, and the actual feedback control parameter corresponding to the historical moment. The sample graphics processing process can be any graphics processing process that has been executed and completed. The actual feedback control parameter can be the feedback control parameter determined according to the preset control parameter determination method. Generally, the actual feedback control parameter can be the feedback control parameter that enables the graphics processor to achieve a better resource allocation control effect for the sample graphics processing process when performing resource allocation control based on the feedback control algorithm. The model to be trained can be a neural network model with initial or default model parameters.
[0053] In this embodiment, for multiple historical moments associated with the sample graphics processing process, the actual resource utilization rate, the set resource utilization rate, the resource utilization rate deviation, the kernel function cumulative amount, the resource allocation control amount at the previous moment of the historical moment, and the actual feedback control parameter corresponding to the historical moment of the sample graphics processing process are obtained. Further, training sample data can be constructed according to the actual resource utilization rate, the set resource utilization rate, the resource utilization rate deviation, the kernel function cumulative amount, the resource allocation control amount at the previous moment of the historical moment, and the actual feedback control parameter corresponding to the historical moment. Furthermore, multiple training sample data corresponding to the sample graphics processing process can be obtained. Further, the model to be trained can be trained based on the multiple training sample data to obtain the control parameter prediction model.
[0054] Optionally, the model to be trained is trained based on multiple training sample data to obtain a control parameter prediction model, including: for multiple training sample data, the actual resource utilization rate, the set resource utilization rate, the resource utilization rate deviation, the kernel function cumulative amount, and the resource allocation control amount in the training sample data are input into the model to be trained, and the predicted control parameter corresponding to the sample graphics processing process at the historical moment is obtained; based on the predicted control parameter and the actual feedback control parameter included in the training sample data, the loss value is determined; based on the loss value, the model parameters in the model to be trained are corrected, and the convergence of the loss function in the model to be trained is taken as the training target to obtain the control parameter prediction model.
[0055] Among them, the loss value can be a numerical value representing the degree of difference between the predicted output and the actual output. The loss function can be determined based on the loss value and is used to represent the function of the degree of difference between the predicted output and the actual output. The loss function can be any loss function, and optionally, it is the mean square error loss function.
[0056] As an optional implementation manner of this Embodiment 1, for multiple training sample data, the actual resource utilization rate, the set resource utilization rate, the resource utilization rate deviation, the kernel function cumulative amount, and the resource allocation control amount in the training sample data can be input into the model to be trained, so as to process the actual resource utilization rate, the set resource utilization rate, the resource utilization rate deviation, the kernel function cumulative amount, and the resource allocation control amount based on the model to be trained and obtain the predicted control parameter corresponding to the historical moment. Further, the predicted control parameter can be compared with the actual feedback control parameter in the training sample data to determine the loss value. Further, the model parameters in the model to be trained can be corrected based on the loss value. After that, the training error of the loss function in the model to be trained, that is, the loss parameter, can be used as the condition for detecting whether the current loss function reaches convergence. For example, the training error is less than the preset error, or whether the error change trend tends to be stable, or whether the current model iteration times is equal to the preset times, etc. If the convergence condition is detected, for example, the training error of the loss function is less than the preset error or the error change tends to be stable, it indicates that the training of the model to be trained is completed. At this time, the iterative training can be stopped. If it is detected that the current does not reach the convergence condition, other sample data can be further obtained to train the model to be trained until the training error of the loss function is within the preset range. When the training error of the loss function reaches convergence, the trained model to be trained can be used as the control parameter prediction model.
[0057] Further, in the case of obtaining a trained control parameter prediction model, the actual resource utilization rate, set resource utilization rate, resource utilization rate deviation, resource allocation control amount, and kernel function accumulation amount corresponding to the obtained graphics processing process at the current moment can be input into the pre-trained control parameter prediction model. Furthermore, based on the control parameter prediction model, the actual resource utilization rate, set resource utilization rate, resource utilization rate deviation, resource allocation control amount, and kernel function accumulation amount can be processed, and the feedback control parameter corresponding to the graphics processing process at the current moment can be obtained.
[0058] S240. Based on the resource utilization rate deviation and the feedback control parameter, determine the resource allocation control amount of the graphics processing process at the current moment, so as to determine the execution decision corresponding to the next moment and the kernel function to be executed of the graphics processing process at the current moment based on the resource allocation control amount.
[0059] In this embodiment, in the case of obtaining the feedback control parameter corresponding to the current moment, the resource allocation control amount of the graphics processing process at the current moment can be determined based on the resource utilization rate deviation and the feedback control parameter corresponding to the current moment.
[0060] Optionally, the feedback control parameter includes a proportionality coefficient, an integral coefficient, and a differential coefficient; determining the resource allocation control amount of the graphics processing process at the current moment based on the resource utilization rate deviation and the feedback control parameter includes: determining the product of the resource utilization rate deviation and the total number of computing cores corresponding to the graphics processor, and using the product as the resource utilization amount deviation; determining the product of the proportionality coefficient and the resource utilization amount deviation, and using the product as the proportional control amount; determining the product of the integral coefficient and the integral value of the resource utilization amount deviation, and using the product as the integral control amount; determining the product of the differential coefficient and the differential value of the resource utilization amount deviation, and using the product as the differential control amount; adding the proportional control amount, the integral control amount, and the differential control amount to obtain the resource allocation control amount of the graphics processing process at the current moment.
[0061] Among them, the computing core refers to the core unit in a computer processor (such as a CPU or GPU) responsible for executing computing tasks. The total number of computing cores can refer to the total number of independent processor cores integrated in the computer processor.
[0062] As an alternative implementation of the first embodiment, the product of the resource utilization deviation and the total number of computing cores corresponding to the graphics processor can be determined, and this product can be used as the resource utilization deviation corresponding to the current moment. Further, the product of the proportionality coefficient and the resource utilization deviation at the current moment can be determined, and this product can be used as the proportional control quantity at the current moment. Also, the integral value of the resource utilization deviation corresponding to a preset time period can be determined, and the product of the integral coefficient and this integral value can be determined and used as the integral control quantity. Also, the differential value of the resource utilization deviation corresponding to a preset time period can be determined, and the product of the differential coefficient and this differential value can be determined and used as the differential control quantity. Further, the proportional control quantity, the integral control quantity, and the differential control quantity can be added together, and the resulting control quantity can be used as the resource allocation control quantity of the graphics processing process at the current moment. Here, the preset time period can be a time period of any length.
[0063] In the technical solution of the embodiment of the present invention, by inputting the actual resource utilization rate, the set resource utilization rate, the resource utilization deviation, the resource allocation control quantity, and the kernel function cumulative quantity into a pre-trained control parameter prediction model, the feedback control parameter corresponding to the graphics processing process at the current moment can be obtained; based on the resource utilization deviation and the feedback control parameter, the resource allocation control quantity of the graphics processing process at the current moment is determined, achieving the effect of dynamically adjusting the feedback control parameter based on the neural network model to improve the allocation control accuracy of computing power resources. Moreover, by optimizing the PID control algorithm based on the neural network model, the effect of quickly regulating and converging the feedback control coefficient is achieved in the case of dynamic changes in the computing power resources of the GPU, eliminating large fluctuations and being able to quickly callback to the position when the feedback control coefficient changes sharply.
[0064] Embodiment III
[0065] Figure 3 It is a flowchart of a computing power resource allocation control method provided by the third embodiment of the present invention. On the basis of the foregoing embodiments, the actual resource utilization rate, the set resource utilization rate, the resource utilization deviation, the resource allocation control quantity, and the kernel function cumulative quantity are input into a pre-trained control parameter prediction model to obtain the feedback control parameter corresponding to the graphics processing process at the current moment; based on the resource utilization deviation and the feedback control parameter, the resource allocation control quantity of the graphics processing process at the current moment is determined. The specific implementation manner can refer to the technical solution of this embodiment. Among them, the same or similar technical terms as those in the above embodiments will not be elaborated here.
[0066] As Figure 3 shown, the method includes:
[0067] S310. For at least one graphics processing process associated with a graphics processor, determine the resource utilization deviation corresponding to the graphics processing process at the current moment according to the actual resource utilization and the set resource utilization corresponding to the graphics processing process at the current moment.
[0068] S320. Obtain the resource allocation control amount corresponding to the previous moment of the current moment and the kernel function accumulation amount corresponding to the current moment of the graphics processing process.
[0069] S330. Determine the resource allocation control amount corresponding to the current moment of the graphics processing process according to the pre-trained control parameter prediction model, the actual resource utilization, the set resource utilization, the resource utilization deviation, the resource allocation control amount and the kernel function accumulation amount, so as to add the resource allocation control amount to the kernel function accumulation amount corresponding to the current moment to obtain the kernel function accumulation amount of the next moment of the current moment.
[0070] In this embodiment, when the resource allocation control amount corresponding to the current moment is obtained, the resource allocation control amount can be input into the kernel function execution unit, and the kernel function execution unit can include the kernel function accumulation amount corresponding to the current moment. Further, the resource allocation control amount corresponding to the current moment can be added to the kernel function accumulation amount corresponding to the current moment, and the obtained resource amount after addition can be used as the kernel function accumulation amount of the next moment of the current moment.
[0071] S340. Compare the kernel function accumulation amount of the next moment with the kernel function operation amount of the next moment corresponding to the function to be executed determined in advance, and determine the execution decision corresponding to the kernel function to be executed at the next moment based on the comparison result.
[0072] In this embodiment, after the kernel function accumulation amount of the next moment is obtained, the kernel function accumulation amount can be compared with the kernel function operation amount of the next moment to determine whether the kernel function accumulation amount can support the operation process of the kernel function to be executed at the next moment.
[0073] Optionally, determining the execution decision corresponding to the kernel function to be executed at the next moment based on the comparison result includes: when the kernel function accumulation amount is greater than the kernel function operation amount, determining that the execution decision corresponding to the kernel function to be executed is to issue for execution, and determining the difference between the kernel function accumulation amount and the kernel function operation amount, and updating the kernel function accumulation amount based on the difference; when the kernel function accumulation amount is not greater than the kernel function operation amount, determining that the kernel function to be executed is to be delayed for execution.
[0074] As an alternative implementation of the first embodiment of the present invention, when the accumulated amount of the kernel function is greater than the amount of the kernel function operation, it can be determined that the execution decision corresponding to the kernel function to be executed is to issue for execution, and the kernel function to be executed is issued to the graphics processing unit to execute the graphics processing process based on the graphics processing unit. Moreover, when the kernel function to be executed is issued for execution, the required amount of resources is the amount of resources corresponding to the amount of the kernel function operation. Furthermore, the difference between the accumulated amount of the kernel function and the amount of the kernel function operation can be determined, and the accumulated amount of the kernel function is updated based on this difference, that is, this difference is used as the accumulated amount of the kernel function at the next moment. Alternatively, when the accumulated amount of the kernel function is not greater than the amount of the kernel function operation, it can be determined that the execution decision corresponding to the kernel function to be executed is to delay execution, and the accumulated amount of the kernel function at the next moment remains unchanged.
[0075] In this embodiment, before comparing the accumulated amount of the kernel function with the amount of the kernel function operation, the amount of the kernel function operation corresponding to the kernel function to be executed can be determined first. Optionally, the method for determining the amount of the kernel function operation can be: obtaining the number of thread blocks corresponding to the kernel function to be executed and the number of threads in each thread block; determining the product between the number of thread blocks and the number of threads to obtain the amount of the kernel function operation corresponding to the kernel function to be executed.
[0076] Among them, a thread block is a group composed of multiple threads, that is to say, a thread block is a set containing multiple threads. The threads in a thread block can cooperate during execution. A thread block can be used to organize and manage threads to achieve efficient parallel computing. A thread is an execution unit in a process and is the smallest unit that the operating system can perform operation scheduling on. It should be noted that the number of thread blocks and the number of threads in each thread block are parameters in the execution parameters associated with the kernel function to be executed, and can be directly obtained based on this execution parameter.
[0077] As an alternative implementation of the first embodiment of the present invention, the number of thread blocks corresponding to the kernel function to be executed and the number of threads included in each thread block can be obtained. Further, the product between the number of thread blocks and the number of threads can be determined, and this product is used as the amount of the kernel function operation corresponding to the kernel function to be executed.
[0078] The technical solution of the embodiment of the present invention determines the resource allocation control amount of the graphics processing process at the current moment by using the pre-trained control parameter prediction model, the actual resource utilization rate, the set resource utilization rate, the resource utilization rate deviation, the resource allocation control amount, and the kernel function cumulative amount, adds the resource allocation control amount to the kernel function cumulative amount corresponding to the current moment to obtain the kernel function cumulative amount of the next moment of the current moment. Further, the kernel function cumulative amount of the next moment is compared with the kernel function operation amount of the next moment corresponding to the function to be executed that is pre-determined, and an execution decision corresponding to the kernel function to be executed at the next moment is determined based on the comparison result, realizing the optimization of the PID control algorithm based on the neural network model, so as to achieve the effect of dynamically controlling the computing power resource allocation process of the graphics processor based on the optimized PID algorithm. Furthermore, the accuracy and efficiency of the computing power resource allocation control are improved, the flexibility of the computing power resource allocation control process is improved, the balance of the computing power resource allocation is improved, and the universality of the PID control algorithm in the computing power resource allocation control process is enhanced.
[0079] Embodiment 4
[0080] Figure 4 It is a schematic structural diagram of a computing power resource allocation control device provided by Embodiment 4 of the present invention. As Figure 4 shown, the device includes: a deviation determination module 410, a cumulative amount acquisition module 420, and an allocation control amount determination module 430.
[0081] Among them, a deviation determination module 410 is configured to determine a resource utilization deviation corresponding to the graphics processing process at the current moment for at least one graphics processing process associated with a graphics processor according to the actual resource utilization rate and the set resource utilization rate corresponding to the graphics processing process at the current moment; wherein, the actual resource utilization rate is used to indicate the amount of computing power resources applied by the graphics processing process at the current moment; the set resource utilization rate is used to indicate the amount of computing power resources expected to be applied by the graphics processing process; an accumulation amount acquisition module 420 is configured to acquire a resource allocation control amount corresponding to the previous moment of the current moment of the graphics processing process and a kernel function accumulation amount corresponding to the current moment; wherein, the kernel function accumulation amount is determined based on the resource allocation control amount and the kernel function operation amount of the previous moment; the kernel function operation amount is used to indicate the amount of resources required to execute the kernel function to be executed; the kernel function to be executed is used to execute the graphics processing process based on the graphics processor; a distribution control amount determination module 430 is configured to determine a resource allocation control amount corresponding to the graphics processing process at the current moment according to a control parameter prediction model obtained by pre-training, the actual resource utilization rate, the set resource utilization rate, the resource utilization deviation, the resource allocation control amount, and the kernel function accumulation amount, so as to determine an execution decision corresponding to the kernel function to be executed at the next moment of the current moment of the graphics processing process based on the resource allocation control amount.
[0082] The technical solution of the embodiment of the present invention, by aiming at at least one graphics processing process associated with a graphics processor, determines the resource utilization deviation corresponding to the graphics processing process at the current moment according to the actual resource utilization rate and the set resource utilization rate corresponding to the graphics processing process at the current moment, acquires the resource allocation control amount corresponding to the previous moment of the current moment of the graphics processing process and the kernel function accumulation amount corresponding to the current moment, and determines the resource allocation control amount corresponding to the graphics processing process at the current moment according to the control parameter prediction model obtained by pre-training, the actual resource utilization rate, the set resource utilization rate, the resource utilization deviation, the resource allocation control amount, and the kernel function accumulation amount, so as to determine the execution decision corresponding to the kernel function to be executed at the next moment of the current moment of the graphics processing process based on the resource allocation control amount, solves the problem that the resource allocation control method in the related technology is difficult to adapt to dynamic calculation tasks and load conditions, resulting in low resource allocation efficiency and uneven resource allocation, realizes optimizing the PID control algorithm based on a neural network model, so as to dynamically control the computing power resource allocation process of the graphics processor based on the optimized PID algorithm. Furthermore, it improves the accuracy and efficiency of the computing power resource allocation control, improves the flexibility of the computing power resource allocation control process, improves the balance of the computing power resource allocation, and enhances the universality of the PID control algorithm in the computing power resource allocation control process.
[0083] Optionally, the allocation control amount determination module 430 includes: a control parameter determination unit and a control amount determination unit.
[0084] The control parameter determination unit is configured to input the actual resource utilization rate, the set resource utilization rate, the resource utilization rate deviation, the resource allocation control amount, and the kernel function cumulative amount into a pre-trained control parameter prediction model to obtain the feedback control parameter corresponding to the graphics processing process at the current moment.
[0085] The control amount determination unit is configured to determine the resource allocation control amount of the graphics processing process at the current moment based on the resource utilization rate deviation and the feedback control parameter.
[0086] Optionally, the allocation control amount determination module 430 includes: a cumulative amount determination unit and an execution decision determination unit.
[0087] The cumulative amount determination unit is configured to add the resource allocation control amount to the kernel function cumulative amount corresponding to the current moment to obtain the kernel function cumulative amount at the next moment of the current moment.
[0088] The execution decision determination unit is configured to compare the kernel function cumulative amount at the next moment with the kernel function operation amount at the next moment corresponding to the to-be-executed function that is pre-determined, and determine the kernel function execution decision at the next moment based on the comparison result.
[0089] Optionally, the execution decision determination unit includes: a send execution decision determination subunit and a delay execution decision determination subunit.
[0090] The send execution decision determination subunit is configured to, when the kernel function cumulative amount is greater than the kernel function operation amount, determine that the execution decision corresponding to the to-be-executed kernel function is to send for execution, determine the difference between the kernel function cumulative amount and the kernel function operation amount, and update the kernel function cumulative amount based on the difference.
[0091] The delay execution decision determination subunit is configured to, when the kernel function cumulative amount is not greater than the kernel function operation amount, determine that the to-be-executed kernel function is for delayed execution.
[0092] Optionally, the device further includes: a thread number acquisition module and a kernel function operation amount determination module.
[0093] The thread number acquisition module is configured to acquire the number of thread blocks corresponding to the to-be-executed kernel function and the number of threads in each thread block.
[0094] The kernel function operation amount determination module is configured to determine the product of the number of thread blocks and the number of threads to obtain the kernel function operation amount corresponding to the to-be-executed kernel function.
[0095] Optionally, the device further includes: a model training module.
[0096] The model training module is used to train and obtain a control parameter prediction model;
[0097] The model training module includes: a sample data acquisition unit and a model training unit.
[0098] The sample data acquisition unit is used to acquire a plurality of training sample data; wherein, the training sample data includes the actual resource utilization rate, the set resource utilization rate, the resource utilization rate deviation, and the kernel function cumulative amount corresponding to the sample graphics processing process at a historical moment, the resource allocation control amount at the previous moment of the historical moment, and the actual feedback control parameter corresponding to the historical moment;
[0099] The model training unit is used to train the model to be trained based on the plurality of training sample data to obtain a control parameter prediction model.
[0100] Optionally, the model training unit includes: a predicted control parameter determination subunit, a loss value determination subunit, and a model parameter correction subunit.
[0101] The predicted control parameter determination subunit is used to input the actual resource utilization rate, the set resource utilization rate, the resource utilization rate deviation, the kernel function cumulative amount, and the resource allocation control amount in the training sample data into the model to be trained for a plurality of the training sample data, and obtain the predicted control parameter corresponding to the sample graphics processing process at the historical moment;
[0102] The loss value determination subunit is used to determine a loss value based on the predicted control parameter and the actual feedback control parameter included in the training sample data;
[0103] The model parameter correction subunit is used to correct the model parameters in the model to be trained based on the loss value, and use the convergence of the loss function in the model to be trained as the training target to obtain a control parameter prediction model.
[0104] Optionally, the feedback control parameter includes a proportional coefficient, an integral coefficient, and a differential coefficient; the control amount determination unit includes: a deviation amount determination subunit, a proportional control amount determination subunit, an integral control amount determination subunit, a differential control amount determination subunit, and a control amount determination subunit.
[0105] The deviation amount determination subunit is used to determine the product of the resource utilization rate deviation and the total number of computing cores corresponding to the graphics processor, and use the product as the resource utilization deviation amount;
[0106] A proportional control quantity determination subunit, configured to determine the product between the proportional coefficient and the resource utilization deviation quantity, and use the product as the proportional control quantity;
[0107] An integral control quantity determination subunit, configured to determine the product between the integral coefficient and the integral value of the resource utilization deviation quantity, and use the product as the integral control quantity;
[0108] A differential control quantity determination subunit, configured to determine the product between the differential coefficient and the differential value of the resource utilization deviation quantity, and use the product as the differential control quantity;
[0109] A control quantity determination subunit, configured to add the proportional control quantity, the integral control quantity, and the differential control quantity to obtain the resource allocation control quantity of the graphics processing process at the current moment.
[0110] The computing power resource allocation control device provided by the embodiments of the present invention can execute the computing power resource allocation control method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the method.
[0111] Embodiment Five
[0112] Figure 5 FIG. shows a schematic structural diagram of an electronic device 10 that can be used to implement the embodiments of the present invention. The electronic device is intended to represent various forms of digital computers, such as, laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0113] As Figure 5 shown, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc. Among them, the memory stores a computer program executable by at least one processor. The processor 11 can execute various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. The input / output (I / O) interface 15 is also connected to the bus 14.
[0114] Multiple components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disc, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0115] The processor 11 can be various general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include but are not limited to a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the computing power resource allocation control method.
[0116] In some embodiments, the computing power resource allocation control method can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the computing power resource allocation control method described above can be executed. Alternatively, in other embodiments, the processor 11 can be configured to execute the computing power resource allocation control method by any other suitable means (e.g., by means of firmware).
[0117] The various embodiments of the systems and technologies described above in this article can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on a chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs, which can be executed and / or interpreted on a programmable system including at least one programmable processor, the programmable processor can be a special or general programmable processor, can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit the data and instructions to the storage system, the at least one input device, and the at least one output device.
[0118] A computer program for implementing the method of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, a special purpose computer, or other programmable data processing device, such that the computer programs, when executed by the processor, cause the functions / operations specified in the flowchart and / or block diagram to be implemented. The computer programs can be executed entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine, or entirely on the remote machine or server.
[0119] In the context of the present invention, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer-readable storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, the computer-readable storage medium can be a machine-readable signal medium. More specific examples of the machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0120] In order to provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0121] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected with each other by digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), blockchain network, and the Internet.
[0122] A computing system can include a client and a server. The client and the server are generally remote from each other and typically interact through a communication network. The client-server relationship is created by computer programs that run on respective computers and have a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system, and solves the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS services.
[0123] It should be understood that various forms of the processes shown above can be used, with steps reordered, added, or deleted. For example, the steps recited in the present invention can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved, and no limitation is made herein.
[0124] The above specific embodiments do not constitute a limitation on the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.
Claims
1. A computing power resource allocation control method, characterized in that, Including: For at least one graphics processing process associated with a graphics processor, determining a resource utilization deviation corresponding to the graphics processing process at the current moment according to the actual resource utilization and the set resource utilization corresponding to the graphics processing process at the current moment; wherein, the actual resource utilization is used to indicate the amount of computing power resources applied by the graphics processing process at the current moment; the set resource utilization is used to indicate the amount of computing power resources expected to be applied by the graphics processing process. Obtaining a resource allocation control amount corresponding to the previous moment of the current moment and a kernel function accumulation amount corresponding to the current moment of the graphics processing process; wherein, the kernel function accumulation amount is determined based on the resource allocation control amount and the kernel function operation amount of the previous moment; the kernel function operation amount is used to indicate the amount of resources required to execute a to-be-executed kernel function; the to-be-executed kernel function is used to execute the graphics processing process based on the graphics processor. According to a pre-trained control parameter prediction model, the actual resource utilization, the set resource utilization, the resource utilization deviation, the resource allocation control amount, and the kernel function accumulation amount, determining the resource allocation control amount of the graphics processing process at the current moment, so as to determine an execution decision corresponding to the to-be-executed kernel function at the next moment of the current moment based on the resource allocation control amount. The determining the resource allocation control amount of the graphics processing process at the current moment according to a pre-trained control parameter prediction model, the actual resource utilization, the set resource utilization, the resource utilization deviation, the resource allocation control amount, and the kernel function accumulation amount includes: Inputting the actual resource utilization, the set resource utilization, the resource utilization deviation, the resource allocation control amount, and the kernel function accumulation amount into a pre-trained control parameter prediction model to obtain a feedback control parameter corresponding to the graphics processing process at the current moment. Based on the resource utilization deviation and the feedback control parameter, determining the resource allocation control amount of the graphics processing process at the current moment.
2. The computing power resource allocation control method according to claim 1, characterized in that The determining the execution decision corresponding to the to-be-executed kernel function at the next moment of the current moment based on the resource allocation control amount includes: Adding the resource allocation control amount to the kernel function accumulation amount corresponding to the current moment to obtain a kernel function accumulation amount at the next moment of the current moment. Comparing the kernel function accumulation amount at the next moment with the kernel function operation amount corresponding to the to-be-executed kernel function at the next moment determined in advance, and determining an execution decision corresponding to the to-be-executed kernel function at the next moment based on the comparison result.
3. The computing power resource allocation control method according to claim 2, wherein The determining an execution decision corresponding to the to-be-executed kernel function at the next moment based on the comparison result includes: When the cumulant of the kernel function is greater than the computational amount of the kernel function, determine that the execution decision corresponding to the kernel function to be executed is to issue for execution, determine the difference between the cumulant of the kernel function and the computational amount of the kernel function, and update the cumulant of the kernel function based on the difference; When the cumulant of the kernel function is not greater than the computational amount of the kernel function, determine that the corresponding execution of the kernel function to be executed is delayed execution.
4. The computing power resource allocation control method according to claim 2, characterized in that, Further includes: Obtain the number of thread blocks corresponding to the kernel function to be executed and the number of threads in each thread block; Determine the product between the number of thread blocks and the number of threads to obtain the computational amount of the kernel function corresponding to the kernel function to be executed.
5. The computing power resource allocation control method according to claim 1, wherein Further includes: Train a control parameter prediction model; The training of the control parameter prediction model includes: Obtain a plurality of training sample data; wherein, the training sample data includes the actual resource utilization rate, the set resource utilization rate, the resource utilization rate deviation, and the cumulant of the kernel function corresponding to the sample graphics processing process at a historical moment, the resource allocation control amount at the previous moment of the historical moment, and the actual feedback control parameter corresponding to the historical moment; Train the model to be trained based on the plurality of training sample data to obtain a control parameter prediction model.
6. The computing power resource allocation control method according to claim 5, wherein The training of the model to be trained based on the plurality of training sample data to obtain a control parameter prediction model includes: For the plurality of training sample data, input the actual resource utilization rate, the set resource utilization rate, the resource utilization rate deviation, the cumulant of the kernel function, and the resource allocation control amount in the training sample data into the model to be trained to obtain the predicted control parameter corresponding to the sample graphics processing process at the historical moment; Determine a loss value based on the predicted control parameter and the actual feedback control parameter included in the training sample data; Correct the model parameters in the model to be trained based on the loss value, and take the convergence of the loss function in the model to be trained as the training target to obtain a control parameter prediction model.
7. The computing power resource allocation control method according to claim 1, wherein The feedback control parameter includes a proportional coefficient, an integral coefficient, and a differential coefficient; the determination of the resource allocation control amount of the graphics processing process at the current moment based on the resource utilization rate deviation and the feedback control parameter includes: Determine the product between the resource utilization rate deviation and the total number of computing cores corresponding to the graphics processor, and use the product as the resource utilization amount deviation; Determine the product between the proportional coefficient and the resource utilization amount deviation, and use the product as the proportional control amount; Determine the product between the integral coefficient and the integral value of the resource utilization amount deviation, and use the product as the integral control amount; Determine the product between the differential coefficient and the differential value of the resource utilization amount deviation, and use the product as the differential control amount; Add the proportional control amount, the integral control amount, and the differential control amount to obtain the resource allocation control amount of the graphics processing process at the current moment.
8. A computing power resource allocation control device, characterized in that, Includes: A deviation determination module, configured to determine, for at least one graphics processing process associated with a graphics processor, a resource utilization deviation corresponding to the graphics processing process at the current moment according to the actual resource utilization rate and the set resource utilization rate corresponding to the graphics processing process at the current moment; wherein, the actual resource utilization rate is used to indicate the amount of computing power resources applied by the graphics processing process at the current moment; the set resource utilization rate is used to indicate the amount of computing power resources expected to be applied by the graphics processing process. An accumulation amount acquisition module, configured to acquire a resource allocation control amount corresponding to the previous moment of the current moment of the graphics processing process and a kernel function accumulation amount corresponding to the current moment of the graphics processing process; wherein, the kernel function accumulation amount is determined based on the resource allocation control amount and the kernel function operation amount of the previous moment; the kernel function operation amount is used to indicate the amount of resources required to execute a to-be-executed kernel function; the to-be-executed kernel function is used to execute the graphics processing process based on the graphics processor. A allocation control amount determination module, configured to determine the resource allocation control amount of the graphics processing process at the current moment according to a pre-trained control parameter prediction model, the actual resource utilization rate, the set resource utilization rate, the resource utilization deviation, the resource allocation control amount, and the kernel function accumulation amount, so as to determine a kernel function execution decision of the graphics processing process at the next moment of the current moment based on the resource allocation control amount. Wherein, the allocation control amount determination module includes: a control parameter determination unit and a control amount determination unit. The control parameter determination unit is configured to input the actual resource utilization rate, the set resource utilization rate, the resource utilization deviation, the resource allocation control amount, and the kernel function accumulation amount into a pre-trained control parameter prediction model to obtain a feedback control parameter corresponding to the graphics processing process at the current moment. The control amount determination unit is configured to determine the resource allocation control amount of the graphics processing process at the current moment based on the resource utilization deviation and the feedback control parameter.
9. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the computing power resource allocation control method according to any one of claims 1-7.
Citation Information
Patent Citations
Particle flow simulation system and method
CN103324780A
GPU (Graphics Processing Unit) resource allocation method, device and equipment and readable storage medium
CN114168344A