Computing resource allocation method and device, electronic equipment and storage medium
By applying the PID control algorithm to GPU resource allocation, the resource allocation is dynamically adjusted, solving the problems of low efficiency and imbalance in resource allocation in traditional methods, and achieving more efficient resource allocation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 中国联合网络通信有限公司广东省分公司
- Filing Date
- 2024-10-12
- Publication Date
- 2026-06-05
Smart Images

Figure CN119311415B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of resource scheduling technology, and in particular to a method, apparatus, electronic device and storage medium for allocating computing resources. Background Technology
[0002] Virtual Graphics Processing Unit (VGPU) computing resource scheduling is the process of effectively allocating the computing resources of the physical GPU 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, traditional GPU computing resource allocation typically employs static allocation or dynamic allocation based on simple rules. These methods may perform well in certain scenarios, but they present some technical challenges when faced with diverse and dynamically changing loads and tasks.
[0004] First, computing tasks and load conditions may change dynamically due to changes in time and application scenarios. Traditional static allocation is difficult to adapt to this dynamism, resulting in low resource allocation efficiency. Second, under unbalanced load conditions, it may be impossible to achieve balanced task distribution, resulting in some GPUs processing too many tasks and being overloaded, while other GPUs are relatively idle, affecting overall performance. Summary of the Invention
[0005] This invention provides a computing power resource allocation method, device, electronic device, and storage medium to achieve the effect of determining the feedback control coefficient at each moment based on the application of a PID control algorithm, determining the resource control quantity at the corresponding moment based on the feedback control coefficient at each moment, and then dynamically adjusting the resource allocation quantity at the next moment based on the resource control quantity.
[0006] According to one aspect of the present invention, a method for allocating computing resources is provided, the method comprising:
[0007] For multiple virtual graphics processing units associated with a graphics processor, the resource deviation at the current moment is determined based on the resource allocation and resource demand of the virtual graphics processing unit at the current moment. The resource allocation represents the computing power resources allocated to the virtual graphics processing unit at the current moment, and is determined based on the resource control parameters of the previous moment, which are based on the feedback control coefficient and resource deviation of the previous moment. The resource demand represents the computing power resources required by the virtual graphics processing unit for data processing at the current moment.
[0008] Based on the baseline resource deviation of the reference time associated with the current time, the baseline resource control amount of the previous time of the reference time, the resource deviation of the current time, and the resource control amount of the previous time, the resource control amount of the current time is determined, so as to determine the resource allocation amount corresponding to the next time of the current time based on the resource control amount; wherein the current time, the reference time, and the next time are times within the same data processing cycle.
[0009] According to another aspect of the present invention, a computing resource allocation device is provided, the device comprising:
[0010] The resource deviation determination module is used to determine the resource deviation at the current moment for multiple virtual graphics processing units associated with the graphics processor, based on the resource allocation and resource demand of the virtual graphics processing unit at the current moment. The resource allocation represents the computing power resources allocated to the virtual graphics processing unit at the current moment, and is determined based on the resource control parameters of the previous moment, which are determined based on the feedback control coefficient and resource deviation of the previous moment. The resource demand represents the computing power resources required by the virtual graphics processing unit for data processing at the current moment.
[0011] The resource control quantity determination module is used to determine the resource control quantity of the current time based on the reference resource deviation of the reference time associated with the current time, the reference resource control quantity of the previous time of the reference time, the resource deviation of the current time, and the resource control quantity of the previous time, so as to determine the resource allocation quantity corresponding to the next time of the current time based on the resource control quantity; wherein the current time, the reference time, and the next time are times within the same data processing cycle.
[0012] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0013] At least one processor; and
[0014] A memory communicatively connected to the at least one processor; wherein,
[0015] The memory stores a computer program that can be executed by the at least one processor, which is then executed by the at least one processor to enable the at least one processor to perform the computing resource allocation method according to any embodiment of the present invention.
[0016] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions, the computer instructions being configured to cause a processor to execute and implement the computing resource allocation method according to any embodiment of the present invention.
[0017] The technical solution of this invention determines the resource deviation at the current moment by targeting multiple virtual graphics processing units associated with a graphics processor, based on the resource allocation and resource demand of the virtual graphics processing units at the current moment; wherein, the resource allocation is determined based on the resource control amount at the previous moment; the resource control amount at the previous moment is determined based on the feedback control coefficient and resource deviation at the previous moment. Furthermore, based on the baseline resource deviation at the current time, the baseline resource control quantity at the previous time, the resource deviation at the current time, and the resource control quantity at the previous time, the resource control quantity at the current time is determined. This resource control quantity is then used to determine the resource allocation for the next time step. This addresses the problem in related technologies where the system struggles to adapt to dynamically changing computational tasks and loads, leading to low resource allocation efficiency and uneven resource distribution. It achieves the effect of determining the feedback control coefficient at each time step based on the PID control algorithm, determining the corresponding resource control quantity, and then dynamically adjusting the resource allocation for the next time step based on the resource control quantity. This improves the adaptability of the PID control algorithm in VGPU computing power resource allocation, enhancing resource allocation efficiency and balance.
[0018] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a flowchart of a computing resource allocation method provided in Embodiment 1 of the present invention;
[0021] Figure 2 This is a flowchart of a computing resource allocation method according to Embodiment 2 of the present invention;
[0022] Figure 3This is a schematic diagram of a computing resource allocation device according to Embodiment 3 of the present invention;
[0023] Figure 4 This is a schematic diagram of the structure of an electronic device that implements the computing power resource allocation method of the present invention. Detailed Implementation
[0024] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0025] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0026] Example 1
[0027] Figure 1 This is a flowchart of a computing resource allocation method provided in Embodiment 1 of the present invention. This embodiment is applicable to the allocation of computing resources for graphics processors. The method can be executed by a computing resource allocation device, which can be implemented in hardware and / or software and can be configured in a terminal and / or server. Figure 1 As shown, the method includes:
[0028] S110. For multiple virtual graphics processing units associated with the graphics processor, determine the resource deviation at the current moment based on the resource allocation and resource demand of the virtual graphics processing units at the current moment; wherein, the resource allocation is determined based on the resource control amount at the previous moment.
[0029] A Graphics Processing Unit (GPU) is a microprocessor specifically designed for image and graphics processing in personal computers, workstations, game consoles, and some mobile devices (such as tablets and smartphones). GPUs possess powerful parallel computing capabilities and high performance, enabling them to quickly complete tasks such as graphics rendering, image processing, and computer-aided design. Those skilled in the art will understand that virtualization technology can be used to encapsulate the rendering and computing resources of a physical GPU into multiple independent virtual slices. Each virtual slice is assigned to a different virtual machine, allowing it to independently access and utilize GPU resources. In this case, the virtual slice can be considered a Virtual Graphics Processing Unit (VGPU). The resource allocation amount represents the computing power resources currently allocated to the virtual GPU. The computing power resources can be any resource within the GPU capable of performing graphics processing tasks and / or parallel computing tasks. For example, computing power resources may include video memory, stream processors, texture units, frame rate, or latency. Generally, at each moment during the processing of a graphics task by a virtual graphics processing unit (VGPU), the corresponding graphics processing task can be handled based on the actual resource allocation at that moment. Resource requirement represents the computing power resources needed by the VGPU for data processing at the current moment. Resource deviation represents the computing power resources that the VGPU expects to obtain from the graphics processor at the current moment.
[0030] In this embodiment, the resource allocation is determined based on the resource control amount from the previous time step. The resource control amount characterizes the resource quantity used to adjust the resource allocation of the virtual graphics processing unit (VGPU) at a given time step. The resource control amount is determined based on the feedback control coefficient and resource deviation from the previous time step. It can be understood that the feedback control coefficient is the core of the PID control algorithm, determining how the VGPU adjusts its resource allocation according to the resource deviation to reduce the difference between the allocated and demanded resources. Optionally, the feedback control coefficient may include a proportional coefficient, an integral coefficient, and a derivative coefficient. The proportional coefficient reflects the sensitivity of the PID controller to system deviation. In the presence of resource deviation, the computing power allocated to the VGPU can be adjusted proportionally based on the deviation to reduce the difference between the allocated and demanded resources. The integral coefficient is used to adjust the integral action of the PID controller on the system deviation. Integrating the resource deviation to account for historical error accumulation helps eliminate long-standing issues of uneven resource allocation, ensuring that each VGPU receives fair computing power resources over a long period. The derivative coefficient reflects the sensitivity of the PID controller to the rate of change of system deviation. Derivative control can adjust resource allocation based on the rate of change of resource deviation.
[0031] In practical applications, PID control algorithms can be applied to VGPU computing resource allocation. First, the computing resource requirements of the virtual graphics processing unit (VGPU) need to be clearly defined, i.e., the resource demand (such as the desired frame rate and / or latency). Then, during VGPU operation, performance monitoring tools can be used to collect real-time or periodically information on the actual resource usage of the VGPU, i.e., the resource allocation (such as the actual frame rate and / or actual latency). Further, for each resource, the difference between the resource allocation and the resource demand can be calculated to obtain the resource difference. Then, the resource control amount can be determined based on the feedback control coefficient and the resource difference, allowing for adjustments to the resource allocation. For example, the determination process of the resource control amount can be represented by the following formula: C = K p *E p +K i *E i +K d *E d Where C represents the resource control quantity; K p E represents the proportionality coefficient. p K represents the resource deviation; i E represents the integral coefficient; i K represents the integral value of the resource deviation over a preset time period. d E represents the differential coefficient; dThis represents the derivative of the resource deviation over a preset time period. Generally, PID control algorithms can only guarantee the correctness and convergence of their control quantity under conditions of linear system performance and time invariance. Linear system performance means there should be a linear relationship between the resource control quantity and the resource allocation quantity. Time invariance means that at any given time, the same input resource control quantity should result in the same output resource allocation quantity, unaffected by time variations. However, these two characteristics are difficult to achieve in GPUs. First, the kernel functions and data volume called by the GPU often undergo large-scale changes, breaking the principles of linearity and time invariance. Second, the performance of large-scale parallel computing varies rapidly, limited by parameters such as video memory, computing cores, and data transmission, resulting in significant performance differences at different times, making linearity impossible. Consequently, when allocating computing resources based on PID control algorithms, uneven distribution of computing resources may occur, failing to meet the resource requirements of the corresponding virtual graphics processing units. Furthermore, in PID control algorithms, the proportional coefficient, integral coefficient, and derivative coefficient in the feedback control coefficients are obtained through empirical calculation or fitting, and are usually fixed values. When the performance of the virtual graphics processing unit varies greatly at different times, the resource control quantity determined based on the feedback control coefficients may be inaccurate, which in turn leads to inaccurate resource allocation quantity adjusted based on the resource control quantity, thus affecting the overall performance.
[0032] To address the above issues, in this embodiment, during the feedback control of the virtual graphics processing unit, the resource control quantity at each moment is determined based on the feedback control coefficient and resource deviation at the corresponding moment; that is, the feedback control coefficient changes dynamically at each moment. This allows the PID algorithm to be more adaptable to the VGPU computing power resource allocation process, improving the applicability of the PID algorithm and consequently increasing resource allocation efficiency and accuracy.
[0033] In this embodiment, the graphics processing unit (GPU) can be divided into multiple virtual graphics processing units (GPUs) based on computing resources using virtualization technology. Furthermore, for each of the multiple virtual GPUs associated with the GPU, the resource requirements and resource allocation of the virtual GPUs at the current moment can be obtained. Further, the difference between the obtained resource requirements and the actual resource allocation can be determined, and this difference can be used as the resource deviation of the virtual GPU at the current moment.
[0034] It should be noted that the methods for obtaining resource requirements can be varied. Optionally, this could involve using virtual machine management tools or software to collect the resource requirements of the virtual graphics processing unit (GPU) at various times in real time; or obtaining them from the storage space associated with the GPU, etc. Similarly, the methods for obtaining resource allocation can also be varied. Optionally, this could involve using virtual machine management tools or software to collect the resource allocation of the GPU at various times in real time; or obtaining them from the storage space associated with the GPU, etc.
[0035] S120. Based on the reference resource deviation of the reference time associated with the current time, the reference resource control amount of the previous time, the resource deviation of the current time, and the resource control amount of the previous time, determine the resource control amount of the current time, so as to determine the resource allocation amount corresponding to the next time based on the resource control amount.
[0036] The reference time can be any moment during the execution of a data processing task by the virtual graphics processing unit (VGPU). The reference time and the current time are within the same data processing cycle. For example, the reference time can be the initial moment within the same data processing cycle. For instance, assuming the current moment is the 8th moment in the data cycle, the reference time could be the 0th moment in that data cycle. The reference resource deviation can be the difference between the resource allocation and resource demand of the VGPU at the reference time. The reference resource control quantity can be the resource control quantity applied to the resource allocation at the reference time. It should be noted that if the data processing cycle containing the reference time is the first data processing cycle, the reference resource control quantity of the previous moment can be a preset value or a default value. For example, the reference resource control quantity of the previous moment can be 0. If the data processing cycle containing the reference time is not the first data processing cycle, the previous moment can be the last moment of the previous data processing cycle. Therefore, the reference resource control quantity of the previous moment can be the resource control quantity of that last moment. The next moment, the current moment, and the reference time are all within the same data processing cycle. It should be noted that the data processing period can be a time period whose duration does not exceed a preset threshold. Optionally, the preset threshold can be 10 seconds, 20 seconds, or 30 seconds, etc.
[0037] In this embodiment, the resource allocation amount at the current moment is determined based on the resource control amount at the previous moment. Having obtained the resource allocation amount at the current moment, the resource control amount at the previous moment can be determined based on this allocation amount. Furthermore, since the resource control amount at the previous moment is determined based on the feedback control coefficient and resource deviation at the previous moment, the feedback control coefficient at the current moment can be determined when determining the resource control amount at the current moment. Then, the resource control amount at the current moment can be determined based on this feedback control coefficient and the deviation at the current moment. Finally, the resource allocation amount for the next moment can be determined based on the resource control amount at the current moment.
[0038] Optionally, determining the resource allocation amount corresponding to the next moment based on the resource control amount includes: adjusting the resource allocation amount corresponding to the current moment according to the resource control amount, and using the adjusted resource allocation amount as the resource allocation amount corresponding to the next moment.
[0039] As an optional implementation of this disclosure, the reference resource deviation at a reference time associated with the current time and the reference resource control quantity at the previous time can be obtained. Furthermore, the resource control quantity at the previous time can be determined based on the resource allocation quantity at the current time. Further, a feedback control coefficient relative to the current time can be determined based on the reference resource control quantity, the reference resource deviation, the resource control quantity at the previous time, and the resource deviation at the current time. Subsequently, the resource control quantity at the current time can be determined based on the feedback control coefficient and the resource deviation at the current time. Further, the resource allocation quantity at the current time can be adjusted based on the resource control quantity at the current time, and the adjusted resource allocation quantity can be used as the resource allocation quantity corresponding to the next time step.
[0040] The technical solution of this invention determines the resource deviation at the current moment by targeting multiple virtual graphics processing units associated with a graphics processor, based on the resource allocation and resource demand of the virtual graphics processing units at the current moment; wherein, the resource allocation is determined based on the resource control amount at the previous moment; the resource control amount at the previous moment is determined based on the feedback control coefficient and resource deviation at the previous moment. Furthermore, based on the baseline resource deviation at the current time, the baseline resource control quantity at the previous time, the resource deviation at the current time, and the resource control quantity at the previous time, the resource control quantity at the current time is determined. This resource control quantity is then used to determine the resource allocation for the next time step. This addresses the problem in related technologies where the system struggles to adapt to dynamically changing computational tasks and loads, leading to low resource allocation efficiency and uneven resource distribution. It achieves the effect of determining the feedback control coefficient at each time step based on the PID control algorithm, determining the corresponding resource control quantity, and then dynamically adjusting the resource allocation for the next time step based on the resource control quantity. This improves the adaptability of the PID control algorithm in VGPU computing power resource allocation, enhancing resource allocation efficiency and balance.
[0041] Example 2
[0042] Figure 2 This is a flowchart of a computing resource allocation method provided in Embodiment 2 of the present invention. Based on the aforementioned embodiments, the feedback control coefficient corresponding to the current moment is determined according to the reference resource deviation at a reference time associated with the current moment, the reference resource deviation at the previous time, the resource deviation at the current moment, and the resource control amount at the previous time. The resource control amount of the virtual graphics processing unit at the current moment is determined according to the feedback control coefficient and the resource deviation at the current moment. Specific implementation details can be found in the technical solution of this embodiment. Technical terms that are the same as or similar to those in the above embodiments will not be repeated here.
[0043] like Figure 2 As shown, the method includes:
[0044] S210. For multiple virtual graphics processing units associated with the graphics processor, determine the resource deviation at the current moment based on the resource allocation and resource demand of the virtual graphics processing units at the current moment; wherein the resource allocation is determined based on the resource control amount at the previous moment.
[0045] S220. Based on the reference resource deviation of the reference time associated with the current time, the reference resource control quantity of the previous time, the resource deviation of the current time, and the resource control quantity of the previous time, determine the feedback control coefficient corresponding to the current time.
[0046] The feedback control coefficient at the current moment can be used to determine the resource control quantity at the current moment.
[0047] In this embodiment, by obtaining the reference resource deviation of the reference time associated with the current time and the reference resource control amount of the previous time, the feedback control coefficient of the current time can be determined based on the reference resource control amount, the reference resource deviation, the resource deviation of the current time, and the resource control amount of the previous time.
[0048] Optionally, the feedback control coefficient corresponding to the current time is determined based on the reference resource deviation at the reference time associated with the current time, the reference resource deviation at the previous time, the resource deviation at the current time, and the resource control quantity at the previous time. This includes: determining the coefficient adjustment parameter corresponding to the current time based on the reference resource control quantity, the reference resource deviation, the resource deviation at the current time, and the resource control quantity at the previous time; and determining the feedback control coefficient corresponding to the current time based on the reference feedback control coefficient and the coefficient adjustment parameter at the reference time.
[0049] The coefficient adjustment parameter can be a parameter used to adjust the feedback control coefficient. The reference feedback control coefficient can be the feedback control coefficient corresponding to the reference time.
[0050] In this embodiment, to better adapt to GPU computing devices, the feedback control coefficients change with varying computing resources, while the relative proportions of the proportional, integral, and derivative coefficients within the feedback control coefficients remain constant. Therefore, a change function corresponding to the feedback control coefficients can be constructed, where time is the dependent variable.
[0051] For example, the variation functions of the proportional coefficient, integral coefficient, and differential coefficient can be expressed based on the following formula:
[0052] K pt =K p0 *f(t);
[0053] K it =K i0 *f(t);
[0054] K dt =K d0 *f(t);
[0055] Among them, Kpt K represents the scaling factor at time t; p0 The reference scaling factor represents the reference time; f(t) represents the coefficient adjustment function with time t as the independent variable; K it K represents the integral coefficient at time t; i0 K represents the reference integral coefficient at the reference time. dt K represents the differential coefficient at time t; d0 The reference differential coefficients represent the reference time.
[0056] Substituting the formula for the feedback control coefficient above into the formula for the PID control algorithm, we can obtain the following formula:
[0057] C t =K p0 *(f(t)*E p )+K i0 *(f(t)*E i )+K d0 *(f(t)*E d (1)
[0058] Among them, C t This represents the resource control quantity that applies to the resource allocation at time t, which is the resource control quantity at the time before time t.
[0059] At the reference time, the formula for determining the base station resource control quantity can be:
[0060] C0 = K p0 *E p0 +K i0 *E i0 +K d0 *E d0 (2)
[0061] Furthermore, because there is a linear relationship between the control quantity and the deviation quantity in the PID control algorithm, i.e., E0 = F(C0), based on this formula, we can derive: C0 = F... -1 (E0). Where E0 is the total resource deviation at the reference time.
[0062] Combining formulas (1) and (2), we can derive: C t =F -1 (f(t)*E t ), where E t Let t be the total resource deviation at time t.
[0063] Assuming that within a data processing cycle with a time length not exceeding a preset threshold, f(t) and F -1 (·) is a fixed value. Based on the above formula, we can derive: f(t)≈(C)t / E t ) / (C0 / E0). Where f(t) can be represented as the coefficient adjustment parameter at time t.
[0064] In this embodiment, when determining the feedback control coefficient at the current moment, the coefficient adjustment parameter corresponding to the current moment can be determined first based on the baseline resource control quantity, the baseline resource deviation quantity, the resource deviation quantity at the current moment, and the resource control quantity at the previous moment.
[0065] Optionally, based on the baseline resource control quantity, the baseline resource deviation quantity, the resource deviation quantity at the current time, and the resource control quantity at the previous time, a coefficient adjustment parameter corresponding to the current time is determined, including: determining the ratio between the baseline resource control quantity and the baseline resource deviation quantity as a first resource ratio; and determining the ratio between the resource deviation quantity at the current time and the resource control quantity at the previous time as a second resource ratio; and determining the ratio between the second resource ratio and the first resource ratio as the coefficient adjustment parameter corresponding to the current time.
[0066] As an optional implementation of this embodiment, given the baseline resource control quantity, the baseline resource deviation quantity, the resource deviation quantity at the current time, and the resource control quantity at the previous time, the ratio between the baseline resource control quantity and the baseline resource deviation quantity can be determined, and this ratio can be used as the first resource ratio. Furthermore, the ratio between the resource deviation quantity at the current time and the resource control quantity at the previous time can be determined, and this ratio can be used as the second resource ratio. Further, the ratio between the second resource ratio and the first resource ratio can be determined, and this ratio can be used as the coefficient adjustment parameter corresponding to the current time.
[0067] For example, the coefficient adjustment parameter corresponding to the current moment can be determined based on the following formula:
[0068] f t =(C t / E t ) / (C0 / E0)
[0069] Among them, f t This represents the coefficient adjustment parameter corresponding to the current time; C t E represents the resource control quantity acting on the resource allocation at the current moment, i.e., the resource control quantity at the previous moment; t C0 represents the resource deviation at the current moment; E0 represents the baseline resource control quantity; and E0 represents the baseline resource deviation.
[0070] In this embodiment, given the coefficient adjustment parameter corresponding to the current time, the feedback control coefficient corresponding to the current time can be determined based on the reference feedback control coefficient at the reference time and the coefficient adjustment parameter.
[0071] Optionally, determining the feedback control coefficient corresponding to the current time based on the reference feedback control coefficient and coefficient adjustment parameter at the reference time includes: obtaining the reference feedback control coefficient corresponding to the reference time; and determining the product between the reference feedback control parameter and the coefficient adjustment parameter as the feedback control coefficient corresponding to the current time.
[0072] As an optional implementation of this embodiment, the reference feedback control coefficients corresponding to the reference time can be obtained. The obtained reference feedback control coefficients may include a reference proportional coefficient, a reference integral coefficient, and a reference derivative coefficient. Further, the product between the reference proportional coefficient and the coefficient adjustment parameter can be determined, and this product is used as the proportional coefficient at the current time. Furthermore, the product between the reference integral coefficient and the coefficient adjustment parameter is determined, and this product is used as the integral coefficient at the current time. Also, the product between the reference derivative coefficient and the coefficient adjustment parameter is determined, and this product is used as the derivative coefficient at the current time. Therefore, the obtained proportional coefficient, integral coefficient, and derivative coefficient can be used as the feedback control coefficients at the current time. The advantage of this setup is that, when using PID control algorithms for computing resource allocation, it determines the coefficient adjustment parameters corresponding to the current moment based on the baseline resource control quantity, the baseline resource deviation, the resource deviation at the current moment, and the resource control quantity at the previous moment. This enables the determination of the feedback control coefficient at each moment based on its corresponding coefficient adjustment parameters. Consequently, when the GPU's computing resources change dynamically, it quickly adjusts and converges the feedback control coefficient, eliminating large fluctuations and allowing for a corrective action when the feedback control coefficient changes drastically.
[0073] S230. Based on the feedback control coefficient and the resource deviation at the current moment, determine the resource control amount of the virtual graphics processing unit at the current moment, and determine the resource allocation amount for the next moment based on the resource control amount.
[0074] In this embodiment, given the feedback control coefficient at the current moment, the resource control amount of the virtual graphics processing unit at the current moment can be determined based on the feedback control coefficient and the resource deviation at the current moment.
[0075] Optionally, the feedback control parameters include a proportional coefficient, an integral coefficient, and a derivative coefficient. Based on the feedback control coefficients and the resource deviation at the current moment, the resource control quantity of the virtual graphics processing unit at the current moment is determined, including: determining the product between the proportional coefficient and the resource deviation at the current moment, and using the product as the proportional control quantity; determining the product between the integral coefficient and the integral value of the resource deviation at the current moment, and using the product as the integral control quantity; determining the product between the derivative coefficient and the derivative value of the resource deviation at the current moment, and using the product as the derivative control quantity; and adding the proportional control quantity, the integral control quantity, and the derivative control quantity to obtain the resource control quantity of the virtual graphics processing unit at the current moment.
[0076] As an optional implementation in this embodiment, the product between the proportional coefficient and the resource deviation at the current moment can be determined, and this product can be used as the proportional control quantity at the current moment. Furthermore, the integral value of the resource deviation over a preset time period can be determined, and the product between the integral coefficient and the integral value can be determined, and this product can be used as the integral control quantity. Additionally, the derivative value of the resource deviation over the preset time period can be determined, and the product between the derivative coefficient and the derivative value can be determined, and this product can be used as the derivative control quantity. Further, the proportional control quantity, integral control quantity, and derivative control quantity can be added together, and the resulting control quantity can be used as the resource control quantity of the virtual graphics processing unit at the current moment. The preset time period can be any length of time.
[0077] For example, the resource control quantity at the current moment can be determined based on the following formula:
[0078] C t =K pt *E p +K it *E i +K dt *E d
[0079] Among them, C t K represents the resource control quantity at the current moment; pt E represents the scaling factor at the current moment. p K represents the resource deviation at the current moment. it E represents the integral coefficient at the current moment. i K represents the integral value of the resource deviation. dt E represents the differential coefficient at the current moment. d This represents the differential value of the resource deviation.
[0080] The technical solution of this invention determines the resource deviation at the current moment for multiple virtual graphics processing units (VGPUs) associated with a graphics processor, based on the resource allocation and resource demand of each VGPU at the current moment; wherein the resource allocation is determined based on the resource control amount at the previous moment. Further, the feedback control coefficient corresponding to the current moment is determined based on the baseline resource deviation at a reference moment associated with the current moment, the baseline resource deviation at the previous moment, the resource deviation at the current moment, and the resource control amount at the previous moment. Further, the resource control amount of the VGPU at the current moment is determined based on the feedback control coefficient and the resource deviation, thus achieving the effect of determining the feedback control coefficient at each moment based on the PID control algorithm, determining the resource control amount at the corresponding moment based on the feedback control coefficient at each moment, and then dynamically adjusting the resource allocation at the next moment based on the resource control amount. This improves the adaptability of the PID control algorithm in VGPU computing power resource allocation, and enhances resource allocation efficiency and balance.
[0081] Example 3
[0082] Figure 3 This is a schematic diagram of a computing resource allocation device provided in Embodiment 3 of the present invention. Figure 3 As shown, the device includes a resource deviation determination module 310 and a resource control quantity determination module 320.
[0083] The resource deviation determination module 310 is used to determine the resource deviation at the current moment for multiple virtual graphics processing units associated with the graphics processor, based on the resource allocation and resource demand of the virtual graphics processing units at the current moment. The resource allocation represents the computing power resources allocated to the virtual graphics processing units at the current moment, and is determined based on the resource control value of the previous moment, which is determined based on the feedback control coefficient and resource deviation of the previous moment. The resource demand represents the computing power resources required by the virtual graphics processing units for data processing at the current moment. The resource control determination module 320 is used to determine the resource control value at the current moment based on the reference resource deviation value of a reference moment associated with the current moment, the reference resource control value of the previous moment, the resource deviation value of the current moment, and the resource control value of the previous moment, so as to determine the resource allocation value corresponding to the next moment based on the resource control value. The current moment, the reference moment, and the next moment are moments within the same data processing cycle.
[0084] The technical solution of this invention determines the resource deviation at the current moment by targeting multiple virtual graphics processing units associated with a graphics processor, based on the resource allocation and resource demand of the virtual graphics processing units at the current moment; wherein, the resource allocation is determined based on the resource control amount at the previous moment; the resource control amount at the previous moment is determined based on the feedback control coefficient and resource deviation at the previous moment. Furthermore, based on the baseline resource deviation at the current time, the baseline resource control quantity at the previous time, the resource deviation at the current time, and the resource control quantity at the previous time, the resource control quantity at the current time is determined. This resource control quantity is then used to determine the resource allocation for the next time step. This addresses the problem in related technologies where the system struggles to adapt to dynamically changing computational tasks and loads, leading to low resource allocation efficiency and uneven resource distribution. It achieves the effect of determining the feedback control coefficient at each time step based on the PID control algorithm, determining the corresponding resource control quantity, and then dynamically adjusting the resource allocation for the next time step based on the resource control quantity. This improves the adaptability of the PID control algorithm in VGPU computing power resource allocation, enhancing resource allocation efficiency and balance.
[0085] Optionally, the resource control quantity determination module 320 includes: a feedback control coefficient determination submodule and a resource control quantity determination submodule.
[0086] The feedback control coefficient determination submodule is used to determine the feedback control coefficient corresponding to the current time based on the reference resource deviation of the reference time associated with the current time, the reference resource control amount of the previous time of the reference time, the resource deviation of the current time, and the resource control amount of the previous time.
[0087] The resource control quantity determination submodule is used to determine the resource control quantity of the virtual graphics processing unit at the current moment based on the feedback control coefficient corresponding to the current moment and the resource deviation at the current moment.
[0088] Optionally, the feedback control coefficient determination submodule includes: a coefficient adjustment parameter determination unit and a feedback control coefficient determination unit.
[0089] The coefficient adjustment parameter determination unit is used to determine the coefficient adjustment parameter corresponding to the current time based on the benchmark resource control quantity, the benchmark resource deviation quantity, the resource deviation quantity at the current time, and the resource control quantity at the previous time.
[0090] The feedback control coefficient determination unit is used to determine the feedback control coefficient corresponding to the current time based on the reference feedback control coefficient at the reference time and the coefficient adjustment parameter.
[0091] Optionally, the coefficient adjustment parameter determination unit includes: a resource ratio determination subunit and a coefficient adjustment parameter determination subunit.
[0092] The resource ratio determination subunit is used to determine the ratio between the baseline resource control amount and the baseline resource deviation amount as a first resource ratio; and to determine the ratio between the resource deviation amount at the current time and the resource control amount at the previous time as a second resource ratio.
[0093] The coefficient adjustment parameter determination subunit is used to determine the ratio between the second resource ratio and the first resource ratio, so as to serve as the coefficient adjustment parameter corresponding to the current moment.
[0094] Optionally, the feedback control coefficient determination unit includes: a baseline control coefficient acquisition subunit and a feedback control coefficient determination subunit.
[0095] A reference control coefficient acquisition subunit is used to acquire the reference feedback control coefficients corresponding to the reference time.
[0096] The feedback control coefficient determination subunit is used to determine the product between the reference feedback control parameter and the coefficient adjustment parameter, so as to serve as the feedback control coefficient corresponding to the current moment.
[0097] Optionally, the feedback control parameters include proportional coefficient, integral coefficient, and derivative coefficient; the resource control quantity determination submodule includes: a proportional control quantity determination unit, an integral control quantity determination unit, a derivative control quantity determination unit, and a resource control quantity determination unit.
[0098] A proportional control quantity determination unit is used to determine the product between the proportional coefficient and the resource deviation at the current moment, and use the product as the proportional control quantity;
[0099] An integral control quantity determination unit is used to determine the product between the integral coefficient and the integral value of the resource deviation at the current moment, and to use the product as the integral control quantity.
[0100] A differential control quantity determination unit is used to determine the product between the differential coefficient and the differential value of the resource deviation at the current moment, and to use the product as the differential control quantity;
[0101] The resource control quantity determination unit is used to add the proportional control quantity, the integral control quantity, and the derivative control quantity to obtain the resource control quantity of the virtual graphics processing unit at the current moment.
[0102] Optionally, the resource control quantity determination module 320 includes: a resource allocation quantity adjustment submodule.
[0103] The resource allocation adjustment submodule is used to adjust the resource allocation corresponding to the current moment based on the resource control quantity, and use the adjusted resource allocation as the resource allocation corresponding to the next moment of the current moment.
[0104] The computing resource allocation device provided in the embodiments of the present invention can execute the computing resource allocation method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the method execution.
[0105] Example 4
[0106] Figure 4 A schematic diagram of an electronic device 10 that can be used to implement embodiments of the present invention is shown. 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 processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0107] like Figure 4 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0108] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0109] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as computing resource allocation methods.
[0110] In some embodiments, the computing resource allocation method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the computing resource allocation method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to execute the computing resource allocation method by any other suitable means (e.g., by means of firmware).
[0111] Various embodiments of the systems and techniques described above herein 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), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0112] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0113] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0114] 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 pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, 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 sound input, voice input, or tactile input).
[0115] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0116] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0117] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0118] The specific embodiments described above do not constitute a limitation on the scope of protection of this 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 this invention should be included within the scope of protection of this invention.
Claims
1. A method for allocating computing resources, characterized in that, include: For multiple virtual graphics processing units associated with a graphics processor, the resource deviation at the current moment is determined based on the resource allocation and resource demand of the virtual graphics processing unit at the current moment. The resource allocation represents the computing power resources allocated to the virtual graphics processing unit at the current moment, and is determined based on the resource control parameters of the previous moment, which are based on the feedback control coefficient and resource deviation of the previous moment. The resource demand represents the computing power resources required by the virtual graphics processing unit for data processing at the current moment. Based on the reference resource deviation of the reference time associated with the current time, the reference resource control amount of the previous time of the reference time, the resource deviation of the current time, and the resource control amount of the previous time, the resource control amount of the current time is determined, so as to determine the resource allocation amount corresponding to the next time of the current time based on the resource control amount of the current time. Wherein, the current time, the reference time, and the next time are times within the same data processing cycle; The step of determining the resource allocation amount corresponding to the next moment based on the resource control amount at the current moment includes: adjusting the resource allocation amount corresponding to the current moment according to the resource control amount at the current moment, and using the adjusted resource allocation amount as the resource allocation amount corresponding to the next moment. Determining the feedback control coefficient of the previous moment includes: determining the feedback control coefficient corresponding to the previous moment based on the reference resource deviation of the reference moment associated with the previous moment, the reference resource control amount of the previous moment of the reference moment, the resource deviation of the previous moment, and the resource control amount of the previous moment of the previous moment. Determining the resource deviation at the previous moment includes: determining the resource deviation at the previous moment based on the resource allocation and resource demand of the virtual graphics processing unit at the previous moment.
2. The computing power resource allocation method according to claim 1, characterized in that, The step of determining the resource control quantity at the current time based on the reference resource deviation at a reference time associated with the current time, the reference resource control quantity at the previous time of the reference time, the resource deviation at the current time, and the resource control quantity at the previous time includes: The feedback control coefficient corresponding to the current moment is determined based on the reference resource deviation of the reference moment associated with the current moment, the reference resource control amount of the previous moment of the reference moment, the resource deviation of the current moment, and the resource control amount of the previous moment. Based on the feedback control coefficient corresponding to the current moment and the resource deviation at the current moment, the resource control amount of the virtual graphics processing unit at the current moment is determined.
3. The computing power resource allocation method according to claim 2, characterized in that, The step of determining the feedback control coefficient corresponding to the current time based on the reference resource deviation of the reference time associated with the current time, the reference resource control quantity of the previous time of the reference time, the resource deviation of the current time, and the resource control quantity of the previous time includes: Based on the baseline resource control quantity, the baseline resource deviation quantity, the resource deviation quantity at the current moment, and the resource control quantity at the previous moment, determine the coefficient adjustment parameter corresponding to the current moment; The feedback control coefficient corresponding to the current time is determined based on the reference feedback control coefficient at the reference time and the coefficient adjustment parameter.
4. The computing power resource allocation method according to claim 3, characterized in that, The step of determining the coefficient adjustment parameter corresponding to the current moment based on the benchmark resource control quantity, the benchmark resource deviation quantity, the resource deviation quantity at the current moment, and the resource control quantity at the previous moment includes: Determine the ratio between the baseline resource control amount and the baseline resource deviation amount as the first resource ratio; and, The ratio between the current resource deviation and the previous resource control value is determined and used as the second resource ratio. The ratio between the second resource ratio and the first resource ratio is determined and used as the coefficient adjustment parameter corresponding to the current moment.
5. The computing power resource allocation method according to claim 3, characterized in that, The step of determining the feedback control coefficient corresponding to the current time based on the reference feedback control coefficient at the reference time and the coefficient adjustment parameter includes: Obtain the reference feedback control coefficients corresponding to the reference time; The product between the reference feedback control parameter and the coefficient adjustment parameter is determined as the feedback control coefficient corresponding to the current time.
6. The computing power resource allocation method according to claim 2, characterized in that, The feedback control coefficients include proportional coefficients, integral coefficients, and derivative coefficients; determining the resource control amount of the virtual graphics processing unit at the current moment based on the feedback control coefficients and the resource deviation at the current moment includes: Determine the product between the proportional coefficient and the resource deviation at the current moment, and use the product as the proportional control quantity; Determine the product between the integral coefficient and the integral value of the resource deviation at the current moment, and use the product as the integral control quantity; Determine the product between the differential coefficient and the differential value of the resource deviation at the current moment, and use the product as the differential control quantity; The proportional control quantity, the integral control quantity, and the derivative control quantity are added together to obtain the resource control quantity of the virtual graphics processing unit at the current moment.
7. A computing power resource allocation device, characterized in that, include: The resource deviation determination module is used to determine the resource deviation at the current moment for multiple virtual graphics processing units associated with the graphics processor, based on the resource allocation and resource demand of the virtual graphics processing unit at the current moment. The resource allocation represents the computing power resources allocated to the virtual graphics processing unit at the current moment, and is determined based on the resource control parameters of the previous moment, which are determined based on the feedback control coefficient and resource deviation of the previous moment. The resource demand represents the computing power resources required by the virtual graphics processing unit for data processing at the current moment. The resource control quantity determination module is used to determine the resource control quantity of the current time based on the reference resource deviation of the reference time associated with the current time, the reference resource control quantity of the previous time of the reference time, the resource deviation of the current time, and the resource control quantity of the previous time, so as to determine the resource allocation quantity corresponding to the next time of the current time based on the resource control quantity of the current time. Wherein, the current time, the reference time, and the next time are times within the same data processing cycle; The resource control quantity determination module includes a resource allocation quantity adjustment submodule, which is used to adjust the resource allocation quantity corresponding to the current time according to the resource control quantity at the current time, and use the adjusted resource allocation quantity as the resource allocation quantity corresponding to the next time at the current time; Determining the feedback control coefficient of the previous moment includes: determining the feedback control coefficient corresponding to the previous moment based on the reference resource deviation of the reference moment associated with the previous moment, the reference resource control amount of the previous moment of the reference moment, the resource deviation of the previous moment, and the resource control amount of the previous moment of the previous moment. Determining the resource deviation at the previous moment includes: determining the resource deviation at the previous moment based on the resource allocation and resource demand of the virtual graphics processing unit at the previous moment.
8. 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 that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the computing resource allocation method according to any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that are used to cause a processor to execute the computing resource allocation method according to any one of claims 1-6.