Virtual resource allocation method and device
By calculating the probability density function and the probability of complete use of GPU virtualization resources of each server, the allocation of GPU virtualization resources is optimized, and the problem of resource waste in the existing technology is solved and more efficient resource utilization is achieved.
Patent Information
- Application Number
- CN202411388160.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-07
AI Technical Summary
In the prior art, GPU virtualization resource allocation leads to waste of resources and cannot meet the needs of different users, resulting in some virtualization resources being unable to be utilized.
By determining the virtualization resource requirements to be allocated, a probability density function of the GPU virtualization resource usage of each server is generated, the full usage probability of each server is calculated, and the target server is determined based on this probability to allocate resources, and the resource allocation is optimized. Reduce waste.
It improves the utilization rate of GPU virtual resources, rationally allocates resources, reduces resource waste, and ensures that the server has a higher probability of being fully used after allocating resources.
Smart Images

Figure CN119271410A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a virtualized resource allocation method and device. Background Art
[0002] Virtualization is a resource management technology that abstracts various physical resources in a computer and recombines them into a "new computer" with multiple configuration environments, thus realizing the segmentation of physical devices. GPU virtualization technology, that is, by segmenting the physical GPU, each GPU in the computer is decomposed into one or more "sub-GPUs", which greatly improves the efficiency of GPU resource utilization while meeting the different sizes of GPU resource requirements of different users. It is widely used in the fields of cloud computing, edge computing, cloud gaming, etc. in the intelligent computing center.
[0003] GPU virtualization solutions in related technologies include: GPU pass-through, GPU SRIOV, GPU semi-virtualization and GPU full virtualization, etc. The corresponding practical applications include cloud desktops, cloud games, engineering applications, etc. Different terminal applications have different requirements for GPU resources. Some only require smaller GPU resources (a few tenths of a single physical GPU resource), while others require larger GPU resources (greater than or equal to an entire physical GPU resource). Conventional allocation methods will cause the remaining virtualized resources in the server to be too small to match the needs of any user, and they will be shelved and never be used, resulting in a waste of resources.
[0004] Therefore, how to reasonably allocate GPU resources and reduce resource waste has become an urgent problem to be solved. Summary of the invention
[0005] The present invention provides a virtualized resource allocation method and device, which are used to solve the defect that virtualized resource allocation in the prior art may lead to resource waste, realize reasonable allocation of GPU resources, and reduce resource waste.
[0006] The present invention provides a virtualization resource allocation method, comprising: Determine the virtualization resource requirements to be allocated, the virtualization resource requirements include GPU virtualization resources; Based on the virtualization resource demand, the GPU virtualization resource usage of each server in the multiple servers, and the probability density function of the GPU virtualization resource usage of a single server, the full utilization probabilities corresponding to the multiple servers are determined, wherein the full utilization probabilities corresponding to the servers are used to characterize: the allocation of the server to the The probability that a GPU virtualized resource will be fully utilized in the future; Based on the full utilization probabilities corresponding to the multiple servers, the target server is assigned the GPU virtualization resources.
[0007] According to a virtualization resource allocation method provided by the present invention, the probability density function of the GPU virtualization resource usage of the single server is generated based on the following steps: Generate sample data The sample data includes the number of users on each of the multiple servers. and the GPU virtualization resource usage in each server, where the GPU virtualization resources in each server are used to the maximum extent; Based on the sample data ,Determine the probability density function of GPU virtualization resource usage of a single server.
[0008] According to a virtualized resource allocation method provided by the present invention, generating sample data includes: Collect historical data from multiple servers, including the number of users on each server and GPU virtualization resource usage in each server; Adjusting the usage of GPU virtualization resources in each server so that the GPU virtualization resources in each server in the historical data are used to the maximum extent; Generate sample data based on adjusted historical data ,in, is the number of the multiple servers.
[0009] According to a virtualized resource allocation method provided by the present invention, the sample data , determine the probability density function of GPU virtualization resource usage of a single server, including: Based on the sample data ,Sure The number of users corresponding to GPU virtualization resources The obedience parameters are Poisson distribution, where GPU virtualization resources are already available on a single server GPU virtualization resources used by users, , is the number of the multiple servers, ; Based on the The number of users corresponding to GPU virtualization resources The obedience parameters are Poisson distribution, determine The GPU virtualization resource usage of each user follows the gamma distribution ; Based on the The GPU virtualization resource usage of each user follows the gamma distribution , the probability density function for determining the GPU virtualization resource usage of a single server is: ; in, .
[0010] According to a virtualized resource allocation method provided by the present invention, the method further includes: The sample data is updated periodically, and based on the updated sample data, a probability density function of the GPU virtualization resource usage of the single server is updated.
[0011] According to a virtualized resource allocation method provided by the present invention, the allocation of the resource to the target server is determined based on the full utilization probabilities corresponding to the multiple servers. GPU virtualization resources, including: Determine at least one candidate server from the plurality of servers, wherein the full utilization probability corresponding to the candidate server is greater than a probability threshold; A server with the least remaining GPU virtualization resources is determined from the at least one candidate server as the target server.
[0012] According to a virtualized resource allocation method provided by the present invention, the probability threshold is determined based on a preset setting; or
[0013] The probability threshold is determined based on full utilization probabilities respectively corresponding to the multiple servers.
[0014] The present invention also provides a virtualized resource allocation device, comprising: The first determining module is used to determine the virtualization resource requirements to be allocated, and the virtualization resource requirements include GPU virtualization resources; The second determination module is used to determine the full utilization probabilities corresponding to the multiple servers respectively based on the virtualization resource demand and the probability density function of the GPU virtualization resource usage of a single server, wherein the full utilization probabilities corresponding to the servers are used to characterize: the server allocates the The probability that a GPU resource will be fully used in the future after virtualization. % represents the modulus operation, which is used to obtain the remainder. The maximum number of GPUs each server has; The third determining module is used to determine the allocation of the target server to the server based on the full utilization probabilities corresponding to the multiple servers. GPU virtualization resources.
[0015] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any of the virtualized resource allocation methods described above is implemented.
[0016] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the virtualization resource allocation method described in any one of the above is implemented.
[0017] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned virtualized resource allocation methods.
[0018] The virtualization resource allocation method and device provided by the present invention calculates the full utilization probability corresponding to each server by introducing the probability density of the GPU virtualization resource usage of a single server, and determines the probability of full utilization of each server if the server allocates the The probability that a GPU virtualization resource will be fully used in the future is calculated, and based on the full utilization probability, the GPU virtualization resource is allocated to the target server, which can increase the probability that the GPU virtual resources of each server are fully utilized, reasonably allocate GPU resources, and reduce resource waste. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0020] Figure 1 It is a flowchart of resource allocation in related technologies; Figure 2 This is one of the flow charts of the virtualized resource allocation method provided by the present invention; Figure 3 This is the second flow chart of the virtualization resource allocation method provided by the present invention; Figure 4 It is a structural schematic diagram of the virtualized resource allocation device provided by the present invention; Figure 5 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0021] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0022] First, the following contents are introduced: GPU: Graphics processing unit (GPU), also known as display core, visual processor, display chip, is a microprocessor that performs image and graphics related operations on personal computers, workstations, game consoles and some mobile devices (such as tablets, smartphones, etc.). The GPU in the intelligent computing center server also includes data center-level GPU, which is mainly used for computing, training, reasoning and other application scenarios.
[0023] Probability distribution: Probability distribution refers to the probability law used to describe the values of random variables. The probability of an event indicates the likelihood of a certain result occurring in an experiment. To fully understand the experiment, you must know all possible results of the experiment and the probability of each possible result occurring, that is, the probability distribution of the random experiment. If the test results are expressed by the value of the variable X, then the probability distribution of the random experiment is the probability distribution of the random variable, that is, the possible values of the random variable and the probability of obtaining the corresponding value. Depending on the type of random variable, the probability distribution takes different forms.
[0024] Probability density function: In mathematics, the probability density function of a continuous random variable (or simply the density function if there is no confusion) is a function that describes the probability of the output value of this random variable near a certain value point. The probability that the value of the random variable falls within a certain region is the integral of the probability density function over this region. When the probability density function exists, the cumulative distribution function is the integral of the probability density function. The probability density function is usually marked in lowercase.
[0025] Figure 1 It is a flowchart of resource allocation in related technologies, such as Figure 1 As shown in the figure, mainstream resource allocation in the intelligent computing center virtualization scenario includes the following steps: 1. Demand acquisition: Users submit hardware resource requirements, such as CPU resources, GPU virtualization resources, memory resources, hard disk resources, etc.
[0026] 2. Hardware resource query: Clarify the distribution of GPU virtualization resources in the current intelligent computing center, such as how much GPU virtualization resources each server has used and how much GPU virtualization resources are left.
[0027] 3. Virtualized GPU resources: If the current GPU virtualization resources in the intelligent computing center meet user needs, there is no need to virtualize additional GPU resources; otherwise, it is necessary to virtualize the non-virtualized physical GPU.
[0028] 4. Hardware resource allocation: Based on the distribution of GPU virtualization resources in the intelligent computing center, GPU virtualization resources and other required hardware resources are allocated to users in servers that meet their needs.
[0029] 5. Hardware resource release: After the user has finished using it, the allocated GPU virtualization resources and other hardware resources will be released.
[0030] However, in the process of "hardware resource allocation" in related technologies, only the actual needs of users for hardware resources are used to find servers with sufficient remaining hardware resources for virtualization and allocation. However, users have different needs for virtual GPUs. Some only need smaller GPU resources (a few tenths of a single physical GPU resource), while others need larger GPU resources (greater than or equal to an entire physical GPU resource). If the degree of virtualization segmentation of each server GPU is not planned in advance (for example, how many copies of the GPU resources in a single server are virtualized), some GPU virtualization resources will be wasted (for example, a server uses a total of (n-1) / n GPU virtualization resources to meet the needs of multiple users. The remaining 1 / n GPU virtualization resources are too small to meet the needs of any user and are shelved and can never be used, resulting in resource waste).
[0031] Therefore, the present invention provides a virtualization resource allocation method and device, which can optimize the allocation method of GPU virtualization resources in the intelligent computing center, and solve the problem that GPU virtualization resources cannot be fully utilized and cause GPU resource waste.
[0032] The virtualized resource allocation method and device of the present invention are described below with reference to the accompanying drawings.
[0033] Figure 2 It is one of the flow charts of the virtualization resource allocation method provided by the present invention, such as Figure 2 As shown, the virtualized resource allocation method includes the following steps: Step 210: Determine the virtualization resource requirements to be allocated, the virtualization resource requirements include: GPU virtualization resources; Specifically, the virtualization resource allocation method can be applied to a system including multiple servers, each server including at least one GPU. For example, the method can be applied in the intelligent computing center virtualization scenario, and the execution subject may include the intelligent computing center. The various embodiments of the present application take the execution subject as the intelligent computing center as an example, but are not limited to this, nor are they intended to be a limitation on the virtualization resource allocation method.
[0034] Optionally, after the user submits the hardware resource requirements, the intelligent computing center can determine the virtualization resource requirements to be allocated, such as determining that the virtualization resource requirements include GPU virtualization resources.
[0035] Step 220, based on the virtualization resource demand, the GPU virtualization resource usage of each server in the multiple servers, and the probability density function of the GPU virtualization resource usage of a single server, determine the full utilization probability corresponding to the multiple servers respectively, wherein the full utilization probability corresponding to the server is used to characterize: the server allocates the The probability that a GPU virtualized resource will be fully utilized in the future; Specifically, the intelligent computing center can predetermine the probability density function of the GPU virtualization resource usage of a single server; After the GPU virtualization resources are configured, the real-time GPU virtualization resource usage of each server in multiple servers can be displayed. Plus Input the probability density function and calculate the distribution of each server. The probability that a GPU virtualized resource will be fully utilized in the future; In the embodiment of the present application, the input of the probability density function is: +m, where is the maximum number of GPUs on each server, and m is the number of GPUs used by x users on a single server. The reason is that this application only focuses on the virtualized resources to be allocated that are not fully occupied by other servers. For example, if there are 9 GPU resources to be allocated, but the server When the number is 8, the actual resource allocation processing required in this application is 9%8=1 GPU resources.
[0036] Step 230, based on the full utilization probabilities corresponding to the multiple servers, determine the i% allocated to the target server. GPU virtualization resources.
[0037] Specifically, in order to save resources and improve resource utilization, when allocating GPU virtual resources, as many servers as possible can be fully utilized, that is, When virtualizing a GPU resource, you can try to allocate the corresponding server with a higher probability of full use to ensure that the server has a higher probability of being fully used in the future compared to other servers. Similarly, for each resource to be allocated, if the target server to be allocated is determined based on the full use probabilities corresponding to multiple servers, you can optimize the resource allocation plan and reduce resource waste.
[0038] The virtualization resource allocation method provided by the present invention calculates the full utilization probability corresponding to each server by introducing the probability density of the GPU virtualization resource usage of a single server, and determines the probability of full utilization of each server if the server allocates the The probability that a GPU virtualization resource will be fully used in the future is calculated, and based on the full utilization probability, the GPU virtualization resource is allocated to the target server, which can increase the probability that the GPU virtual resources of each server are fully utilized, reasonably allocate GPU resources, and reduce resource waste.
[0039] In some optional embodiments, the probability density function of the GPU virtualization resource usage of the single server is generated based on the following steps: Generate sample data The sample data includes the number of users on each of the multiple servers. and the GPU virtualization resource usage in each server, where the GPU virtualization resources in each server are used to the maximum extent; Based on the sample data ,Determine the probability density function of GPU virtualization resource usage of a single server.
[0040] Specifically, in order to generate a probability density function that can calculate the probability that the GPU virtual resources of each server are fully utilized, we can first obtain the data on the maximum utilization of the GPU virtualization resources in each server and use it as sample data. , the data regularity of the sample data in which the GPU virtualization resources are used to the greatest extent is determined, expressed as a probability density function, and an optimization basis is provided for maximizing the allocation of GPU virtualization resources utilization as much as possible.
[0041] In some optional embodiments, generating sample data includes: Collect historical data from multiple servers, including the number of users on each server and GPU virtualization resource usage in each server; Adjusting the usage of GPU virtualization resources in each server so that the GPU virtualization resources in each server in the historical data are used to the maximum extent; Generate sample data based on adjusted historical data ,in, is the number of the multiple servers.
[0042] Specifically, in order to make the calculation result of the probability density function more accurate and more suitable for the current scenario, sample data can be generated directly based on the historical data of multiple servers in the intelligent computing center. The historical data is composed of the number of users on each server. and the composition of GPU virtualization resource usage in each server; Optionally, since the GPU resource allocation in the historical data is not perfect, before generating samples, the GPU resource usage on each server in the historical data can be adjusted according to the actual needs of historical users to ensure that the GPU resources of each used server are occupied to the maximum extent without any surplus, that is, the historical data is artificially adjusted to the optimal GPU resource allocation; then the adjusted historical data in the intelligent computing center virtualization scenario is organized into samples: ; Where x is the number of users on a single server and k is the server number.
[0043] The present invention collects historical data of the intelligent computing center, introduces probability distribution, and calculates the probability density function of the GPU usage M in a single server. , and through this probability density function Provides optimization basis for allocation of GPU virtualization resources.
[0044] In some optional embodiments, the sample data , determine the probability density function of GPU virtualization resource usage of a single server, including: Based on the sample data ,Sure The number of users corresponding to GPU virtualization resources The obedience parameters are Poisson distribution, where GPU virtualization resources are already available on a single server GPU virtualization resources used by users, , is the number of the multiple servers, ; Based on the The number of users corresponding to GPU virtualization resources The obedience parameters are Poisson distribution, determine The GPU virtualization resource usage of each user follows the gamma distribution ; Based on the The GPU virtualization resource usage of each user follows the gamma distribution , the probability density function for determining the GPU virtualization resource usage of a single server is: ; in, .
[0045] Specifically, suppose that on a single server Users used GPUs ( ), then on this server The number of users that can use the GPU The obedience parameters are Poisson distribution. Since the expectation E(X)= = ,so .
[0046] It can be concluded that The GPU virtualization resource usage M of each user follows the gamma distribution ,Right now , and then the probability density function of GPU virtualization resource usage in a single server is obtained as: ; in, .
[0047] In the present invention, based on sample data , determine the data pattern of the sample data where GPU virtualization resources are used to the greatest extent, the number of users The obedience parameters are Poisson distribution, GPU virtualization resource usage M follows the gamma distribution ,Right now , and then we can get the expression of the probability density function of the GPU virtualization resource usage in a single server, and use this expression to provide an optimization basis for maximizing the allocation of GPU virtualization resource utilization.
[0048] In some optional embodiments, the method further includes: The sample data is updated periodically, and based on the updated sample data, a probability density function of the GPU virtualization resource usage of the single server is updated.
[0049] Due to the increasing demand for new virtualization in intelligent computing centers, the probability density function of GPU usage M in a single server can be calculated. Iterate on a monthly basis to optimize the latest market demands in real time. For example, each time an update iteration is performed, the newly added data in the most recent cycle can be used as new historical data, combined with all or part of the original historical data to generate sample data. For example, only historical data from the past year or six months is used to generate samples each time, and then the probability density function of the aforementioned method of generating the probability density function of GPU virtualization resource usage is reused based on the newly generated sample data to regenerate or update the probability density function. This can be guaranteed.
[0050] The present invention uses the latest real-time data from the intelligent computing center to calculate the probability density function of the GPU usage M in a single server based on historical data. Iterate to optimize for the latest market needs in real time.
[0051] In some optional embodiments, the determination of the allocation of the target server to the server based on the full utilization probabilities corresponding to the multiple servers respectively. GPU virtualization resources, including: Determine at least one candidate server from the plurality of servers, wherein the full utilization probability corresponding to the candidate server is greater than a probability threshold; A server with the least remaining GPU virtualization resources is determined from the at least one candidate server as the target server.
[0052] Specifically, when a new user's GPU virtualization resource demand is obtained, assuming that the GPU virtualization resource required by the new GPU virtualization resource demand is GPU virtualization resources can be used to calculate the full utilization probability of each server in the intelligent computing center after allocating the new required resources: ; For a single server The number of GPUs that the user has used.
[0053] The larger the value, the greater the probability that the remaining GPU resources in this single server will be fully used in the future. Set a threshold (For example, 0.8, which can be set according to actual data conditions), or a reasonable value can be pre-set or pre-determined based on user needs. When allocating GPU resources for new users' GPU virtualization resource needs, you can choose and The largest server; among them, The maximum indicates that the remaining GPU virtualization resources in this server are the least. The server with the least remaining GPU virtualization resources is preferentially used as the target server for GPU resource virtualization cutting and allocation.
[0054] In some optional embodiments, the probability threshold is determined based on a preset setting; or
[0055] The probability threshold is determined based on full utilization probabilities respectively corresponding to the multiple servers.
[0056] Specifically, the probability threshold can be pre-set or flexibly set. During each application process, a reasonable value can be set based on the full utilization probabilities corresponding to multiple servers calculated in the current process, so as to ensure that at least some servers can be selected as candidate servers, or it can be ensured that the servers selected as candidate servers each time are the top few or the front part of the full utilization probability.
[0057] The present invention collects historical data of the intelligent computing center, introduces probability distribution for data analysis, obtains a recommended method for GPU virtualization resource allocation, and iterates the recommended method using the latest real-time data of the intelligent computing center. In this way, the allocation method of GPU virtualization resources in the intelligent computing center is optimized, solving the problem that GPU virtualization resources cannot be fully utilized and causes GPU resource waste.
[0058] Figure 3 This is a second flow chart of the virtualization resource allocation method provided by the present invention, such as Figure 3 As shown, the virtualization resource allocation method is Figure 1 In the mainstream resource allocation process in the intelligent computing center virtualization scenario shown in the figure, a "hardware resource analysis" step is further added; The specific implementation of hardware resource analysis is as follows: Assume that there are servers, each with GPUs.
[0059] First, preprocess the historical data: the historical data consists of the number of users on each server and the usage of GPU virtualization resources. Since the GPU resource allocation in the historical data is not perfect, before generating samples, the GPU resource usage on each server in the historical data can be adjusted according to the actual needs of historical users to ensure that the GPU resources of each server used are occupied to the maximum extent without any surplus, that is, the historical data is artificially adjusted to the optimal GPU resource allocation; then the adjusted historical data in the intelligent computing center virtualization scenario is organized into samples: ; Where x is the number of users on a single server and k is the server number.
[0060] Assume that on a single server Users used GPUs ( ), then on this server The number of users that can use the GPU The obedience parameters are Poisson distribution. Since the expectation E(X)= = ,so .
[0061] It can be concluded that The GPU virtualization resource usage M of each user follows the gamma distribution ,Right now , and then the probability density function of GPU virtualization resource usage in a single server is obtained as: ; in, .
[0062] When a new user's GPU virtualization resource demand is obtained, assuming that the GPU virtualization resource required by the new GPU virtualization resource demand is GPU virtualization resources can be used to calculate the full utilization probability of each server in the intelligent computing center after allocating the new required resources: ; For a single server The number of GPUs that the user has used.
[0063] The larger the value, the greater the probability that the remaining GPU resources in this single server will be fully used in the future. Set a threshold (For example, 0.8, which can be set according to actual data conditions), or a reasonable value can be pre-set or pre-determined based on user needs. When allocating GPU resources for new users' GPU virtualization resource needs, you can choose and The largest server; among them, The maximum indicates that the remaining GPU virtualization resources in this server are the least. The server with the least remaining GPU virtualization resources is preferentially used as the target server for GPU resource virtualization cutting and allocation.
[0064] Optionally, due to the increasing demand for new virtualization in the intelligent computing center, it is necessary to calculate the probability density function of the GPU usage M in a single server: Iterate on a monthly basis to optimize in real time to the latest market demands.
[0065] The present invention collects historical data of the intelligent computing center, introduces probability distribution, and calculates the probability density function of the GPU usage M in a single server. , and through this probability density function Provide optimization basis for the allocation of GPU virtualization resources; at the same time, use the latest real-time data from the intelligent computing center to analyze the probability density function Through the above methods, the allocation method of GPU virtualization resources in the intelligent computing center is optimized, solving the problem that GPU virtualization resources cannot be fully utilized and cause GPU resource waste.
[0066] The virtualized resource allocation device provided by the present invention is described below. The virtualized resource allocation device described below and the virtualized resource allocation method described above can be referred to each other.
[0067] Figure 4 is a schematic diagram of the structure of the virtualized resource allocation device provided by the present invention, such as Figure 4 As shown, the virtualized resource allocation device includes: The first determining module 410 is used to determine the virtualization resource requirements to be allocated, and the virtualization resource requirements include GPU virtualization resources; The second determination module 420 is used to determine the full utilization probabilities corresponding to the multiple servers respectively based on the virtualization resource demand and the probability density function of the GPU virtualization resource usage of a single server, wherein the full utilization probabilities corresponding to the servers are used to characterize: the server allocates the The probability that a GPU resource will be fully used in the future after virtualization. % represents the modulus operation, which is used to obtain the remainder. The maximum number of GPUs each server has; The third determining module 430 is used to determine the allocation of the target server to the server based on the full utilization probabilities corresponding to the multiple servers. GPU virtualization resources.
[0068] The virtualization resource allocation device provided by the present invention calculates the full utilization probability corresponding to each server by introducing the probability density of the GPU virtualization resource usage of a single server, and determines the probability of full utilization of each server if the server allocates the The probability that a GPU virtualization resource will be fully used in the future is calculated, and based on the full utilization probability, the GPU virtualization resource is allocated to the target server, which can increase the probability that the GPU virtual resources of each server are fully utilized, reasonably allocate GPU resources, and reduce resource waste.
[0069] Optionally, the virtualization resource allocation device further includes a probability density function generation module, which is used to generate a probability density function of the GPU virtualization resource usage of the single server, specifically for: Generate sample data The sample data includes the number of users on each of the multiple servers. and the GPU virtualization resource usage in each server, where the GPU virtualization resources in each server are used to the maximum extent; Based on the sample data ,Determine the probability density function of GPU virtualization resource usage of a single server.
[0070] Optionally, the probability density function generating module is specifically used for: Collect historical data from multiple servers, including the number of users on each server and GPU virtualization resource usage in each server; Adjusting the usage of GPU virtualization resources in each server so that the GPU virtualization resources in each server in the historical data are used to the maximum extent; Generate sample data based on adjusted historical data ,in, is the number of the multiple servers.
[0071] Optionally, the probability density function generating module is specifically used for: Based on the sample data ,Sure The number of users corresponding to GPU virtualization resources The obedience parameters are Poisson distribution, where GPU virtualization resources are already available on a single server GPU virtualization resources used by users, , is the number of the multiple servers, ; Based on the The number of users corresponding to GPU virtualization resources The obedience parameters are Poisson distribution, determine The GPU virtualization resource usage of each user follows the gamma distribution ; Based on the The GPU virtualization resource usage of each user follows the gamma distribution , the probability density function for determining the GPU virtualization resource usage of a single server is: ; in, .
[0072] Optionally, the virtualized resource allocation device further includes an updating module, which is used to: The sample data is updated periodically, and based on the updated sample data, a probability density function of the GPU virtualization resource usage of the single server is updated.
[0073] Optionally, the first determining module 410 is specifically configured to: Determine at least one candidate server from the plurality of servers, wherein the full utilization probability corresponding to the candidate server is greater than a probability threshold; A server with the least remaining GPU virtualization resources is determined from the at least one candidate server as the target server.
[0074] Optionally, the probability threshold is determined based on a pre-setting; or, the probability threshold is determined based on full utilization probabilities corresponding to the multiple servers respectively.
[0075] Figure 5 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 5 As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530 and a communication bus 540, wherein the processor 510, the communication interface 520 and the memory 530 communicate with each other through the communication bus 540. The processor 510 may call the logic instructions in the memory 530 to execute the virtualization resource allocation method, which includes: Determine the virtualization resource requirements to be allocated, the virtualization resource requirements include GPU virtualization resources; Based on the virtualization resource demand, the GPU virtualization resource usage of each server in the multiple servers, and the probability density function of the GPU virtualization resource usage of a single server, the full utilization probabilities corresponding to the multiple servers are determined, wherein the full utilization probabilities corresponding to the servers are used to characterize: the allocation of the server to the The probability that a GPU resource will be fully used in the future after virtualization. % represents the modulus operation, which is used to obtain the remainder. The maximum number of GPUs each server has; Based on the full utilization probabilities corresponding to the multiple servers, the target server is assigned the GPU virtualization resources.
[0076] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0077] On the other hand, the present invention further provides a computer program product, the computer program product comprising a computer program, the computer program can be stored on a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the virtualization resource allocation method provided by the above methods, the method comprising: Determine the virtualization resource requirements to be allocated, the virtualization resource requirements include GPU virtualization resources; Based on the virtualization resource demand, the GPU virtualization resource usage of each server in the multiple servers, and the probability density function of the GPU virtualization resource usage of a single server, the full utilization probabilities corresponding to the multiple servers are determined, wherein the full utilization probabilities corresponding to the servers are used to characterize: the allocation of the server to the The probability that a GPU resource will be fully used in the future after virtualization. % represents the modulus operation, which is used to obtain the remainder. The maximum number of GPUs each server has; Based on the full utilization probabilities corresponding to the multiple servers, the target server is assigned the GPU virtualization resources.
[0078] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for allocating virtualized resources provided by the above methods is implemented, and the method includes: Determine the virtualization resource requirements to be allocated, the virtualization resource requirements include GPU virtualization resources; Based on the virtualization resource demand, the GPU virtualization resource usage of each server in the multiple servers, and the probability density function of the GPU virtualization resource usage of a single server, the full utilization probabilities corresponding to the multiple servers are determined, wherein the full utilization probabilities corresponding to the servers are used to characterize: the allocation of the server to the The probability that a GPU virtualized resource will be fully utilized in the future; Based on the full utilization probabilities corresponding to the multiple servers, the target server is assigned the GPU virtualization resources.
[0079] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0080] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0081] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A virtualized resource allocation method, characterized in that: include: Determine the virtualization resource requirements to be allocated, the virtualization resource requirements include GPU virtualization resources; Based on the virtualization resource demand, the GPU virtualization resource usage of each server in the multiple servers, and the probability density function of the GPU virtualization resource usage of a single server, the full utilization probabilities corresponding to the multiple servers are determined, wherein the full utilization probabilities corresponding to the servers are used to characterize: the allocation of the server to the The probability that a GPU resource will be fully used in the future after virtualization. % represents the modulus operation, which is used to obtain the remainder. Based on the full utilization probabilities corresponding to the multiple servers, the target server is assigned the GPU virtualization resources.
2. The virtualization resource allocation method according to claim 1, characterized in that: The probability density function of the GPU virtualization resource usage of the single server is generated based on the following steps: Generate sample data The sample data includes the number of users on each of the multiple servers. and the GPU virtualization resource usage in each server, where the GPU virtualization resources in each server are used to the maximum extent; Based on the sample data ,Determine the probability density function of GPU virtualization resource usage of a single server.
3. The virtualization resource allocation method according to claim 2, characterized in that: The generating of sample data comprises: Collect historical data from multiple servers, including the number of users on each server and GPU virtualization resource usage in each server; Adjusting the usage of GPU virtualization resources in each server so that the GPU virtualization resources in each server in the historical data are used to the maximum extent; Generate sample data based on adjusted historical data ,in, is the number of the multiple servers.
4. The virtualization resource allocation method according to claim 2, characterized in that: Based on the sample data , determine the probability density function of GPU virtualization resource usage of a single server, including: Based on the sample data ,Sure The number of users corresponding to GPU virtualization resources The obedience parameters are Poisson distribution, where GPU virtualization resources are already available on a single server GPU virtualization resources used by users, , is the number of the multiple servers, ; Based on the The number of users corresponding to GPU virtualization resources The obedience parameters are Poisson distribution, determine The GPU virtualization resource usage of each user follows the gamma distribution ; Based on the The GPU virtualization resource usage of each user follows the gamma distribution , the probability density function for determining the GPU virtualization resource usage of a single server is: ; in, .
5. The virtualization resource allocation method according to any one of claims 2 to 4, characterized in that: The method further comprises: The sample data is updated periodically, and based on the updated sample data, a probability density function of the GPU virtualization resource usage of the single server is updated.
6. The virtualization resource allocation method according to any one of claims 1 to 4, characterized in that: The method of determining the allocation of the target server to the server based on the full utilization probabilities corresponding to the multiple servers respectively. GPU virtualization resources, including: Determine at least one candidate server from the plurality of servers, wherein the full utilization probability corresponding to the candidate server is greater than a probability threshold; A server with the least remaining GPU virtualization resources is determined from the at least one candidate server as the target server.
7. The virtualization resource allocation method according to claim 6, characterized in that: The probability threshold is determined based on a preset setting; or The probability threshold is determined based on full utilization probabilities respectively corresponding to the multiple servers.
8. A virtualized resource allocation device, characterized in that: include: The first determining module is used to determine the virtualization resource requirements to be allocated, and the virtualization resource requirements include GPU virtualization resources; The second determination module is used to determine the full utilization probabilities corresponding to the multiple servers respectively based on the virtualization resource demand and the probability density function of the GPU virtualization resource usage of a single server, wherein the full utilization probabilities corresponding to the servers are used to characterize: the server allocates the The probability that a GPU resource will be fully used in the future after virtualization. % represents the modulus operation, which is used to obtain the remainder. The third determining module is used to determine the allocation of the target server to the server based on the full utilization probabilities corresponding to the multiple servers. GPU virtualization resources.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the virtualization resource allocation method according to any one of claims 1 to 7 is implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the virtualization resource allocation method according to any one of claims 1 to 7 is implemented.