Resource scheduling method and device, electronic device and storage medium
Through the cooperation between the master node and slave node of the Kubernetes cluster, the GPU resource identification list of each slave node is obtained, and the resource scheduling information is determined based on the target resource type and the resource type of slave node in the target GPU resource information, which solves the problems of GPU resource waste and computing resource competition, and realizes efficient GPU resource utilization.
Patent Information
- Application Number
- CN202111235890.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-22
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2041-10-22
AI Technical Summary
In the fields of image processing and machine learning, the GPU usage rate of a single computing task cannot reach 100%, resulting in wasted GPU resources, and the problems of unreasonable allocation of computing resources may arise between multiple computing tasks, affecting performance.
A resource scheduling method is proposed. Through the cooperation of the master node and slave node of the Kubernetes cluster, the GPU resource identification list of each slave node is obtained, and the resource scheduling information is determined based on the target resource type and the resource type of slave node in the target GPU resource information, including the target slave node and target GPU resource identification of the target container.
Resource scheduling is carried out through preset resource types, GPU resources are allocated flexibly and reasonably, and the utilization rate of GPU resources is improved, and the problems of unreasonable resource competition and unreasonable allocation are avoided.
Smart Images

Figure CN114035942B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a resource scheduling method and device, an electronic device, and a storage medium. Background Art
[0002] In fields such as image processing and machine learning, the Graphics Processing Unit (GPU) is a core computing resource. In many scenarios, the GPU utilization rate of a single computing task cannot reach 100%, resulting in a waste of GPU resources.
[0003] In some scenarios, in order to improve GPU utilization and reduce computing resource waste, multiple computing tasks can be run on the same GPU card. When multiple computing tasks are run on the same GPU card, computing resource competition may occur between the multiple computing tasks, affecting the performance of the computing tasks. In addition, unreasonable computing resource allocation may also occur, resulting in low GPU utilization. Summary of the invention
[0004] The present disclosure proposes a resource scheduling method and device, an electronic device, and a storage medium.
[0005] In a first aspect, the present disclosure provides a resource scheduling method, which is applied to a master node in a Kubernetes cluster, wherein the Kubernetes cluster further includes at least two slave nodes deployed with a graphics processing unit (GPU), wherein the GPU includes multiple GPU resources, and the method includes:
[0006] In response to receiving a resource scheduling request sent by a resource request end, obtaining a GPU resource identification list of each slave node, wherein the resource scheduling request includes target GPU resource information required for the computing task, the target GPU resource information includes a target resource type and a corresponding resource quantity, and the GPU resource identification includes a universal unique identification code UUID of a GPU physical card, a resource type, and index information of the GPU resource on the GPU physical card;
[0007] Based on the target resource type in the target GPU resource information and the resource type in the GPU resource identification list of each slave node, determine resource scheduling information, wherein the resource scheduling information includes a target slave node for creating a target container for running the computing task and a target GPU resource identification of the GPU resources used by the target container.
[0008] In some optional implementations, the resource types include elastic resources and fixed resources; and
[0009] The GPU includes multiple GPU resources, including:
[0010] The GPU includes a GPU elastic resource whose resource type is elastic resource and at most two GPU fixed resources whose resource type is fixed resources. The sum of the first preset resource limit values of all GPU fixed resources of each GPU is less than fifty percent, and the second preset resource limit value of the GPU elastic resource of each GPU is greater than fifty percent.
[0011] In some optional implementations, the GPU includes one GPU elastic resource and two GPU fixed resources, a first preset resource limit value of the GPU fixed resource is 25%, and a second preset resource limit value of the GPU elastic resource is 100%.
[0012] In some optional implementations, the GPU resource identifier is obtained in the following manner:
[0013] Use the Kubelet component of the slave node to call the ListAndWatch interface of the Device Plugin component to obtain the GPU resource identifier of the GPU resource.
[0014] In a second aspect, the present disclosure provides a resource scheduling method, which is applied to a slave node in a Kubernetes cluster, where a GPU is deployed on the slave node, and the method includes:
[0015] In response to receiving the resource scheduling information sent by the master node, determining the target resource limit value and the target GPU of the target container according to the target GPU resource identifier of the GPU resource used by the target container in the resource scheduling information;
[0016] Based on the target resource limit value, the target container is created on the target GPU, so that the target container runs the computing task in the resource scheduling information.
[0017] In some optional implementations, determining the target resource limit value and the target GPU of the target container according to the target GPU resource identifier of the GPU resource used by the target container in the resource scheduling information includes:
[0018] Determine a target resource limit value of the target container according to a resource type in a GPU resource identifier of a GPU resource used by the target container in the resource scheduling information;
[0019] The target GPU is determined according to the UUID of the GPU physical card in the GPU resource identifier of the GPU resource used by the target container in the resource scheduling information.
[0020] In some optional implementations, the resource types include elastic resources and fixed resources; and
[0021] The determining the target resource limit value of the target container according to the resource type in the GPU resource identifier of the GPU resource used by the target container in the resource scheduling information includes:
[0022] When the resource type in the GPU resource identifier required by the target container in the resource scheduling information is a fixed resource, the target resource limit value of the target container is determined to be a first preset resource limit value, and the first preset resource limit value is less than fifty percent.
[0023] In some optional implementations, determining the target resource limit value of the target container according to the resource type in the GPU resource identifier of the GPU resource used by the target container in the resource scheduling information includes:
[0024] When the resource type in the GPU resource identifier required by the target container in the resource scheduling information is an elastic resource, the target resource limit value of the target container is determined to be a second preset resource limit value, and the second preset resource limit value is greater than fifty percent.
[0025] In some optional implementations, the first preset resource limit value is 25 percent, and the second preset resource limit value is 100 percent.
[0026] In some optional implementations, an MPS Server service runs on each GPU; and
[0027] The step of creating the target container on the target GPU based on the target resource limit value so that the target container runs the computing task in the resource scheduling information includes:
[0028] Based on the target resource limit value and the MPS Server service running on the target GPU, the target container is created on the target GPU so that the target container runs the computing task in the resource scheduling information.
[0029] In some optional implementations, the creating the target container on the target GPU based on the target resource limit value and the MPS Server service running on the target GPU so that the target container runs the computing task in the resource scheduling information includes:
[0030] The Allocate interface of the Device Plugin component is called by the Kubelet component, and the MPS Server environment variable on the target GPU is set to the target resource limit value, so that the target container uses the resources in the target GPU corresponding to the target resource limit value to execute the computing tasks in the resource scheduling information.
[0031] In a third aspect, the present disclosure provides a resource scheduling system, which is applied to a Kubernetes cluster, wherein the Kubernetes cluster includes a master node and at least two slave nodes deployed with an image processing unit GPU, wherein the GPU includes multiple GPU resources, and the resource scheduling system includes:
[0032] The master node is configured to obtain a GPU resource identification list of each slave node in response to receiving a resource scheduling request sent by a resource request end, wherein the resource scheduling request includes target GPU resource information required for the computing task, the target GPU resource information includes a target resource type and a corresponding resource quantity, the GPU resource identification includes a universal unique identifier UUID of a GPU physical card, a resource type, and index information of the GPU resource on the GPU physical card, and based on the target resource type in the target GPU resource information and the resource type in the GPU resource identification list of each slave node, determine resource scheduling information, the resource scheduling information includes a target slave node for creating a target container for running the computing task and a target GPU resource identification of the GPU resource used by the target container;
[0033] The slave node is configured to, in response to receiving resource scheduling information sent by the master node, determine a target resource limit value and a target GPU of the target container according to a target GPU resource identifier of the GPU resource used by the target container in the resource scheduling information, and create the target container on the target GPU based on the target resource limit value so that the target container runs the computing task in the resource scheduling information.
[0034] In a fourth aspect, the present disclosure provides a resource scheduling device, which is applied to a master node in a Kubernetes cluster, wherein the Kubernetes cluster further includes at least two slave nodes deployed with an image processing unit GPU, wherein the GPU includes multiple GPU resources, and the device includes:
[0035] an acquisition unit, configured to acquire a GPU resource identification list of each slave node in response to receiving a resource scheduling request sent by a resource request end, wherein the resource scheduling request includes target GPU resource information required for the computing task, the target GPU resource information includes a target resource type and a corresponding resource quantity, and the GPU resource identification includes a universal unique identification code UUID of a GPU physical card, a resource type, and index information of the GPU resource on the GPU physical card;
[0036] The first determination unit is configured to determine resource scheduling information based on a target resource type in the target GPU resource information and a resource type in a GPU resource identification list of each slave node, wherein the resource scheduling information includes a target slave node for creating a target container for running the computing task and a target GPU resource identification of the GPU resources used by the target container.
[0037] In a fifth aspect, the present disclosure provides a resource scheduling device, which is applied to a slave node in a Kubernetes cluster, wherein the slave node is deployed with a GPU, and the device includes:
[0038] A second determining unit is configured to, in response to receiving resource scheduling information sent by the master node, determine a target resource limit value and a target GPU of the target container according to a target GPU resource identifier of the GPU resource used by the target container in the resource scheduling information;
[0039] A creating unit is configured to create the target container on the target GPU based on the target resource limit value, so that the target container runs the computing task in the resource scheduling information.
[0040] In a sixth aspect, the present disclosure provides an electronic device, comprising: one or more processors; a storage device on which one or more programs are stored, and when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation manner in the first aspect or the second aspect.
[0041] In a seventh aspect, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by one or more processors, implements the method described in any implementation manner in the first aspect or the second aspect.
[0042] The present disclosure provides a resource scheduling method and device, an electronic device and a storage medium, which, in response to receiving a resource scheduling request sent by a resource request end, determines resource scheduling information including a target slave node for creating a target container for running a computing task and a target GPU resource identifier of a GPU resource used by the target container based on the target resource type in the target GPU resource information and the resource type in the GPU resource identifier list of each slave node. That is, resource scheduling is performed through preset resource types, and since the resource usage corresponding to each resource type is different, GPU resources can be flexibly and reasonably allocated, thereby improving the utilization rate of GPU resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Other features, objects and advantages of the present disclosure will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:
[0044] Figure 1A is an exemplary system architecture diagram in which an embodiment of the present disclosure may be applied;
[0045] Figure 1B is a schematic diagram of elastic sharing of GPU resources to which an embodiment of the present disclosure can be applied;
[0046] Figure 2 is a timing diagram of an embodiment of a resource scheduling system according to the present disclosure;
[0047] Figure 3 is a flow chart of an embodiment of a resource scheduling method according to the present disclosure;
[0048] Figure 4 is a flow chart of another embodiment of the resource scheduling method according to the present disclosure;
[0049] Figure 5 is a structural diagram of an embodiment of a resource scheduling device according to the present disclosure;
[0050] Figure 6 is a structural diagram of another embodiment of a resource scheduling device according to the present disclosure;
[0051] Figure 7 It is a schematic diagram of the structure of a computer system suitable for implementing the electronic device of the present disclosure. DETAILED DESCRIPTION
[0052] The present disclosure is further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present disclosure, rather than to limit the present disclosure. It should also be noted that, for ease of description, only the parts related to the present disclosure are shown in the accompanying drawings.
[0053] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present disclosure may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0054] Figure 1A An exemplary system architecture of a resource scheduling system to which the present disclosure may be applied is shown.
[0055] like Figure 1A As shown in Figure 1, a Kubernetes (k8s) cluster includes a master node (Master) and at least two slave nodes (Node). The master node is responsible for the management and control of the entire cluster. The slave node is the working node of the k8s cluster. Each slave node contains the components required to run the container. For example, the Kubelet component is used to handle all communications between the master node and the slave nodes running it.
[0056] A GPU can be deployed on each slave node, and the GPU can provide computing resources for computing tasks. A multi-process service (MPS) is started on each GPU of the slave node. MPS is a GPU multi-process parallel execution technology officially provided by NVIDIA. MPS technology can load multiple GPU processes onto a GPU at the same time, and allocate different computing units (SM, streaming multiprocessor) to multiple GPU processes to achieve computing power isolation. It is a spatial multiplexing method. Specifically, deploy the MPS control daemon (nvidia-cuda-mps-control) on the slave node, and start a service process (nvidia-cuda-mps-server) on each GPU physical card.
[0057] Each GPU can be equipped with one GPU elastic resource and at most two GPU fixed resources. The sum of the first preset resource limit values of all GPU fixed resources on each GPU can be less than or equal to 50%, that is, the resource occupancy rate of containers using GPU fixed resources can be less than or equal to 50%. The second preset resource limit value of the GPU elastic resources on each GPU can be greater than 50%, that is, the resource occupancy rate of containers using GPU elastic resources can be greater than 50%. Since the sum of the preset resource limit values of containers using GPU fixed resources running on each GPU can be less than or equal to 50% (i.e., a maximum of fifty percent), it can be guaranteed that containers using GPU elastic resources on the same GPU can occupy at least 50% of the computing resources.
[0058] In a scenario, one GPU can be equipped with one GPU elastic resource and one GPU fixed resource. The preset resource limit value of the GPU elastic resource is 100%, and the preset resource limit value of the fixed resource can be 25%. Therefore, even when the container using the GPU fixed resource is fully loaded, it can be guaranteed that the container using the GPU elastic resource on the same GPU can use at least 75% of the computing resources. When the container using the GPU fixed resource is not fully loaded (the resource occupancy rate is less than 25%), the container using the GPU elastic resource can occupy its remaining resources. When the container using the GPU fixed resource is not running a computing task, the container using the GPU elastic resource can occupy its resources, that is, the container using the GPU elastic resource can occupy 100% of the resources.
[0059] In a scenario, such as Figure 1B, each GPU can have one GPU elastic resource and two GPU fixed resources. The preset resource limit value of the GPU elastic resource is 100%, and the preset resource limit value of the GPU fixed resource can be 25%. Therefore, even when the two GPU elastic resources are fully loaded, it can be guaranteed that the container using the GPU elastic resource on the same GPU can use at least 50% of the computing resources. When the container using the GPU fixed resource is not fully loaded (the resource occupancy rate is less than 25%), the container using the GPU elastic resource can occupy its remaining resources. When a container using a GPU fixed resource does not run a computing task, the container using the GPU elastic resource can occupy its resources, that is, the container using the GPU elastic resource can occupy 75% of the resources. When two containers using GPU fixed resources do not run computing tasks, the container using the GPU elastic resource can occupy its resources, that is, the container using the GPU elastic resource can occupy 100% of the resources.
[0060] In summary, it can be seen that the computing tasks running in the container using GPU elastic resources can obtain at least 50% of the resources and will not be occupied by the container using GPU fixed resources. Therefore, the service quality of the container using GPU elastic resources can be guaranteed. In other words, not only can the minimum resource usage of computing tasks running in the container using GPU elastic resources be guaranteed through resource isolation. In addition, elastic expansion is provided. When the resource usage of computing tasks using GPU fixed resources is not fully used, computing tasks running in the container using GPU elastic resources are allowed to use their idle resources to improve GPU resource utilization.
[0061] Continue to refer Figure 2 , which shows a process of an embodiment of a resource scheduling system according to the present disclosure. The Kubernetes cluster includes a master node and at least two slave nodes deployed with a graphics processing unit GPU, and the GPU includes multiple GPU resources.
[0062] Step 201: In response to receiving a resource scheduling request sent by a resource requesting end, the master node obtains a GPU resource identification list of each slave node.
[0063] In this embodiment, the master node can detect in real time whether there is a resource scheduling request sent by the resource request end, and when a resource scheduling request is detected, obtain the GPU resource identification list of each slave node.
[0064] Specifically, the resource request end can be a terminal device for sending a resource scheduling request, which can be any slave node in the k8s cluster, or other terminal devices other than the master node and the slave node. The resource request end can generate a resource scheduling request in response to detecting that a user triggers a resource scheduling operation.
[0065] Specifically, the GPU resource identification list may include the GPU resource identification and the corresponding status information. The GPU resource identification may include the universal unique identification code UUID of the GPU physical card, the resource type, and the index information of the GPU resource on the GPU physical card. The resource type can be used to characterize the degree of computing power required for the task run by the container using the GPU resource. For example, the resource type may be a GPU elastic resource (for example, it can be represented by "elastic-half") and a GPU fixed resource (for example, it can be represented by "quarter"). GPU fixed resources are suitable for tasks that are not sensitive to quality of service (QoS) and latency and have low resource requirements. GPU elastic resources are suitable for tasks with higher resource requirements, such as reasoning tasks, machine learning tasks, etc. The resource identification in the GPU resource identification list can be:
[0066] GPU-04c17c2c-b4db-ca60-8005-4cb6f83339ea-SLICE-elastic-half-0;
[0067] GPU-04c17c2c-b4db-ca60-8005-4cb6f83339ea-SLICE-quarter-1;
[0068] GPU-04c17c2c-b4db-ca60-8005-4cb6f83339ea-SLICE-quarter-2;
[0069] Among them, the UUID of the GPU physical card can be, for example, "04c17c2c-b4db-ca60-8005-4cb6f83339ea", the resource type can be, for example, "elastic-half", "quarter", and the index information of the GPU resource on the GPU physical card can start from 0, for example, it can be "0", "1", "2".
[0070] Specifically, the resource scheduling request may include target GPU resource information required for the task to be calculated. The target GPU resource information may include a target resource type and a corresponding resource quantity. For example, the target resource scheduling request may be: "elastic-half: 1", where the target resource type may be "elastic-half" and the corresponding resource quantity may be "1".
[0071] The master node can use the Kubelet component of the slave node where the GPU resource is located to call the ListAndWatch interface of the Device Plugin component to obtain the GPU resource identifier. Specifically, the Kubelet of the slave node calls the ListAndWatch interface of the Device Plugin component through the gRPC protocol to obtain the GPU resource identifier provided by the Device Plugin component, and then reports it to the master node. Specifically, the name and number of GPU resources exposed by each GPU card can be controlled through commands and parameters. As an example, the elastic-gpu-config parameter can be provided when starting the Device Plugin component:
[0072] "usage:
[0073] --elastic-gpu-config=resource name:number
[0074] For example:
[0075] command:
[0076] -nvidia-device-plugin
[0077] -'--mig-strategy=none'
[0078] -'--elastic-gpu-config=nvidia.com / elastic-half:1'
[0079] -'--elastic-gpu-config=nvidia.com / quarter:2'
[0080] Step 202: The master node determines resource scheduling information based on the target resource type in the target GPU resource information and the resource type in the GPU resource identification list of each slave node.
[0081] In this embodiment, the master node can select a GPU resource identifier that matches the target resource type from the GPU resource identifier list according to the target resource type required for the computing task in the target GPU resource information, and determine the resource scheduling information.
[0082] Specifically, the resource scheduling information may include a target slave node for creating a target container for running a computing task and a target GPU resource identifier of a GPU resource used by the target container.
[0083] Step 203 , in response to receiving the resource scheduling information sent by the master node, the slave node determines the target resource limit value and the target GPU of the target container according to the target GPU resource identifier of the GPU resource used by the target container in the resource scheduling information.
[0084] In this embodiment, the slave node can detect in real time whether there is resource scheduling information sent by the master node. When resource scheduling information is detected, the target resource limit value and target GPU of the target container are determined according to the target GPU resource identifier of the GPU resource used by the target container in the resource scheduling information.
[0085] In some optional implementations, step 203 may be performed as follows: in response to receiving the resource scheduling information sent by the master node, the slave node may determine the target resource limit value of the target container according to the resource type in the GPU resource identifier of the GPU resource used by the target container in the resource scheduling information. The slave node may determine the target GPU according to the UUID of the GPU physical card in the GPU resource identifier of the GPU resource used by the target container in the resource scheduling information.
[0086] As an example, when the resource type in the GPU resource identifier required by the target container in the resource scheduling information is a fixed resource, the target resource limit value of the target container can be determined to be a first preset resource limit value. The first preset resource limit value can be less than fifty percent. When the resource type in the GPU resource identifier required by the target container in the resource scheduling information is an elastic resource, the target resource limit value of the target container can be determined to be a second preset resource limit value. The second preset resource limit value can be greater than fifty percent.
[0087] Step 204: Create a target container on the target GPU based on the target resource limit value, so that the target container runs the computing task in the resource scheduling information.
[0088] In this embodiment, the slave node may create a target container on the target GPU, and allocate the amount of resources in the target GPU corresponding to the target resource limit value to the target container, so that the target container runs the computing task in the resource scheduling information.
[0089] In some optional implementations, an MPS Server service runs on each GPU, and step 301 can be performed as follows: based on the target resource limit value and the MPS Server service running on the target GPU, a target container is created on the target GPU so that the target container runs the computing task in the resource scheduling information.
[0090] Furthermore, the Kubelet component can be used to call the Allocate interface of the Device Plugin component to set the MPS Server environment variable on the target GPU to the target resource limit value, so that the target container uses the resources corresponding to the target resource limit value in the target GPU to execute the computing tasks in the resource scheduling information.
[0091] In practice, deploy the MPS control daemon (nvidia-cuda-mps-control) on the slave node where MPS is enabled in advance, and start an MPS service process (nvidia-cuda-mps-server) on each GPU physical card. Set the MPS Server environment variable to the target resource limit value through the Allocate interface to limit the amount of computing resources used by the container.
[0092] As an example:
[0093] Allocate GPU-04c17c2c-b4db-ca60-8005-4cb6f83339ea-SLICE-half-0, set resource limit value:
[0094] CUDA_MPS_ACTIVE_THREAD_PERCENTAGE=100;
[0095] Allocate GPU-04c17c2c-b4db-ca60-8005-4cb6f83339ea-SLICE-quarter-1, set resource limit value:
[0096] CUDA_MPS_ACTIVE_THREAD_PERCENTAGE=25;
[0097] The resource scheduling system provided by the present disclosure, after responding to receiving the resource scheduling request sent by the resource request end, the master node determines the resource scheduling information including the target slave node for creating the target container for running the computing task and the target GPU resource identifier of the GPU resource used by the target container based on the target resource type in the target GPU resource information and the resource type in the GPU resource identifier list of each slave node, and the slave node responds to receiving the resource scheduling information sent by the master node, determines the target resource limit value and the target GPU of the target container according to the target GPU resource identifier of the GPU resource used by the target container in the resource scheduling information, and creates the target container on the target GPU based on the target resource limit value, so that the target container runs the computing task in the resource scheduling information. That is, the master node performs resource scheduling through the preset resource type, and since the resource usage corresponding to each resource type is different, the GPU resources can be flexibly and reasonably allocated, thereby improving the utilization rate of the GPU resources. The slave node determines the target resource limit value according to the resource type, and then creates the target container on the target GPU based on the resource scheduling value. In addition, the deployment and control of the resource scheduling service on the GPU cluster are realized by using the Device Plugin component of k8s.
[0098] Continue to refer Figure 3 , which shows a flow chart of an embodiment of a resource scheduling method according to the present disclosure. The resource scheduling method can be applied to a master node in a Kubernetes cluster, and the Kubernetes cluster can also include at least two slave nodes deployed with a graphics processing unit GPU, and the GPU includes multiple GPU resources, including the following steps:
[0099] Step 301: In response to receiving a resource scheduling request sent by a resource requesting end, a GPU resource identification list of each slave node is obtained.
[0100] In this embodiment, the specific operation of step 301 and the technical effect produced are similar to Figure 2 The operation and effect of step 201 in the illustrated embodiment are substantially the same and will not be described in detail herein.
[0101] Step 302 : Determine resource scheduling information based on the target resource type in the target GPU resource information and the resource type in the GPU resource identification list of each slave node.
[0102] In this embodiment, the specific operation of step 302 and the technical effect produced are similar to Figure 2 The operation and effect of step 202 in the illustrated embodiment are substantially the same and will not be described in detail herein.
[0103] Continue to refer Figure 4, which shows a flow chart of another embodiment of the resource scheduling method according to the present disclosure. The resource scheduling method can be applied to a slave node in a Kubernetes cluster, where a GPU is deployed on the slave node, and includes the following steps:
[0104] Step 401, in response to receiving resource scheduling information sent by the master node, determining a target resource limit value and a target GPU of a target container according to a target GPU resource identifier of a GPU resource used by a target container in the resource scheduling information.
[0105] In this embodiment, the specific operation of step 401 and the technical effect produced are similar to Figure 2 The operation and effect of step 203 in the illustrated embodiment are substantially the same and will not be described in detail herein.
[0106] Step 402: Create a target container on the target GPU based on the target resource limit value, so that the target container runs the computing task in the resource scheduling information.
[0107] In this embodiment, the specific operation of step 402 and the technical effect produced are similar to Figure 2 The operation and effect of step 204 in the illustrated embodiment are substantially the same and will not be described in detail herein.
[0108] Further references Figure 5 As an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a resource scheduling device. Figure 3 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0109] like Figure 5 As shown, the resource scheduling device of this embodiment includes: an acquisition unit 501 and a first determination unit 502. The acquisition unit 501 can be configured to obtain the GPU resource identification list of each slave node in response to receiving a resource scheduling request sent by the resource request end, wherein the resource scheduling request includes the target GPU resource information required for the computing task, the target GPU resource information includes the target resource type and the corresponding resource quantity, and the GPU resource identification includes the universal unique identification code UUID of the GPU physical card, the resource type, and the index information of the GPU resource on the GPU physical card. The first determination unit 502 can be configured to determine the resource scheduling information based on the target resource type in the target GPU resource information and the resource type in the GPU resource identification list of each slave node, and the resource scheduling information includes the target slave node for creating a target container for running the computing task and the target GPU resource identification of the GPU resource used by the target container.
[0110] In some optional implementations, the resource type may include elastic resources and fixed resources. The GPU includes multiple GPU resources, which may include: the GPU includes a GPU elastic resource whose resource type is an elastic resource and at most two GPU fixed resources whose resource type is fixed resources, the sum of the first preset resource limit values of all GPU fixed resources of each GPU is less than fifty percent, and the second preset resource limit value of the GPU elastic resource of each GPU is greater than fifty percent.
[0111] In some optional implementations, the GPU may include one GPU elastic resource and two GPU fixed resources, the first preset resource limit value of the GPU fixed resource is 25%, and the second preset resource limit value of the GPU elastic resource is 100%.
[0112] In some optional implementations, the GPU resource identifier may be obtained in the following manner: the Kubelet component of the slave node calls the ListAndWatch interface of the Device Plugin component to obtain the GPU resource identifier of the GPU resource.
[0113] In this embodiment, the specific processing of the acquisition unit 501 and the first determination unit 502 of the resource scheduling device and the technical effects thereof can be referred to respectively. Figure 3 The relevant descriptions of step 301 and step 302 in the corresponding embodiment are not repeated here.
[0114] It should be noted that the implementation details and technical effects of each unit in the resource scheduling device provided in the present disclosure can be referred to the description of other embodiments in the present disclosure, and will not be repeated here.
[0115] Further references Figure 6 As an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a resource scheduling device. Figure 4 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0116] like Figure 6 As shown, the resource scheduling device of this embodiment includes: a second determination unit 601 and a creation unit 602. The second determination unit 601 can be configured to determine the target resource limit value and the target GPU of the target container according to the target GPU resource identifier of the GPU resource used by the target container in the resource scheduling information in response to receiving the resource scheduling information sent by the master node. The creation unit 602 can be configured to create a target container on the target GPU based on the target resource limit value so that the target container runs the computing task in the resource scheduling information.
[0117] In some optional implementations, the second determination unit 601 may include a first determination subunit (not shown in the figure) and a second determination subunit (not shown in the figure). The first determination subunit may be configured to determine the target resource limit value of the target container according to the resource type in the GPU resource identifier of the GPU resource used by the target container in the resource scheduling information. The second determination subunit may be configured to determine the target GPU according to the UUID of the GPU physical card in the GPU resource identifier of the GPU resource used by the target container in the resource scheduling information.
[0118] In some optional implementations, the resource type may include elastic resources and fixed resources. And the first determination subunit may also be configured to determine that the target resource limit value of the target container is a first preset resource limit value when the resource type in the GPU resource identifier required by the target container in the resource scheduling information is a fixed resource, and the first preset resource limit value is less than fifty percent.
[0119] In some optional embodiments, the first determination subunit can also be configured to determine that the target resource limit value of the target container is a second preset resource limit value when the resource type in the GPU resource identifier required by the target container in the resource scheduling information is an elastic resource, and the second preset resource limit value is greater than fifty percent.
[0120] In some optional implementations, the first preset resource limit value may be 25 percent, and the second preset resource limit value may be 100 percent.
[0121] In some optional implementations, an MPS Server service may be running on each GPU. The creation unit 602 may also be configured to create a target container on the target GPU based on the target resource limit value and the MPS Server service running on the target GPU, so that the target container runs the computing task in the resource scheduling information.
[0122] In some optional embodiments, the creation unit 602 can also be configured to use the Kubelet component to call the Allocate interface of the Device Plugin component, set the MPS Server environment variable on the target GPU to the target resource limit value, so that the target container uses the resources in the target GPU corresponding to the target resource limit value to execute the computing tasks in the resource scheduling information.
[0123] In this embodiment, the specific processing of the second determining unit 601 and the creating unit 602 of the resource scheduling device and the technical effects thereof can be referred to respectively. Figure 4 The relevant descriptions of step 401 and step 402 in the corresponding embodiment are not repeated here.
[0124] It should be noted that the implementation details and technical effects of each unit in the resource scheduling device provided in the present disclosure can be referred to the description of other embodiments in the present disclosure, and will not be repeated here.
[0125] Reference below Figure 7 , which shows a schematic diagram of the structure of a computer system suitable for implementing the electronic device of the present disclosure. Figure 7 The electronic device shown is only an example and should not bring any limitation to the function and scope of use of the present disclosure.
[0126] like Figure 7 As shown, the computer system includes a processing part (such as a central processing unit (CPU, Central Processing Unit), a graphics processing unit (Graphics Processing Unit, GPU)) 701, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM, Read Only Memory) 702 or the program loaded from the storage part 708 to the random access memory (RAM, Random Access Memory) 703. In RAM703, various programs and data required for system operation are also stored. The processing part 701, ROM 702 and RAM 703 are connected to each other through a bus 704. An input / output (I / O, Input / Output) interface 705 is also connected to the bus 704.
[0127] The following components are connected to the I / O interface 705: an input section 706 including a touch screen, a handwriting tablet, a keyboard, or a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet.
[0128] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709. When the computer program is executed by the processing part 701, the above functions defined in the method of the present disclosure are executed. It should be noted that the computer-readable medium of the present disclosure can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0129] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, Python, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0130] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0131] The units described in the present disclosure may be implemented in software or in hardware. The units described may also be provided in a processor, for example, may be described as: a processor including an acquisition unit and a first determination unit. The names of these units do not, in some cases, constitute limitations on the units themselves, for example, the acquisition unit may also be described as "a unit for acquiring a list of GPU resource identifiers of each slave node". For example, it may also be described as: a processor including a second determination unit and a first creation unit. The names of these units do not, in some cases, constitute limitations on the units themselves, for example, the second determination unit may also be described as "a unit for determining a target resource limit value of a target container and a target GPU".
[0132] As another aspect, the present disclosure further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by the device, the device implements Figure 2 and / or Figure 3 The resource scheduling method is shown.
[0133] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the present disclosure is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the concept of the present disclosure. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) to form a technical solution.
Claims
1. A resource scheduling method, applied to a master node in a Kubernetes cluster, wherein the Kubernetes cluster further comprises at least two slave nodes deployed with a graphics processing unit (GPU), wherein the GPU comprises a plurality of GPU resources, and the method comprises: In response to receiving a resource scheduling request sent by a resource request end, obtaining a GPU resource identification list of each slave node, The resource scheduling request includes target GPU resource information required for the computing task, the target GPU resource information includes the target resource type and the corresponding resource quantity, the GPU resource identification list includes the GPU resource identification, the GPU resource identification includes the universal unique identification code UUID of the GPU physical card, the resource type and the index information of the GPU resource on the GPU physical card, and the resource type is used to characterize the computing power requirement of the task run by the container using the GPU resource. The resource type includes elastic resources and fixed resources, the multiple GPU resources include GPU elastic resources whose resource type is elastic resources and GPU fixed resources whose resource type is fixed resources, the GPU fixed resources have a first preset resource limit, the first preset resource limit limits the resource occupancy rate of the GPU by the container using the GPU fixed resources, the GPU elastic resources have a second preset resource limit, the second preset resource limit limits the resource occupancy rate of the GPU by the container using the GPU elastic resources, and the GPU elastic resources are configured to allow the use of idle resources of the GPU fixed resources when the GPU fixed resources are not fully loaded; Based on the target resource type required for the computing task in the target GPU resource information, a GPU resource identifier matching the target resource type is selected from the GPU resource identifier list of each slave node, and resource scheduling information is determined, wherein the resource scheduling information includes a target slave node for creating a target container for running the computing task and a target GPU resource identifier for the GPU resources used by the target container.
2. The method according to claim 1, wherein: The GPU includes a GPU elastic resource whose resource type is elastic resource and at most two GPU fixed resources whose resource type is fixed resources. The sum of the first preset resource limit values of all GPU fixed resources of each GPU is less than fifty percent, and the second preset resource limit value of the GPU elastic resource of each GPU is greater than fifty percent.
3. The method according to claim 2, wherein: The GPU includes one GPU elastic resource and two GPU fixed resources, the first preset resource limit value of the GPU fixed resource is 25%, and the second preset resource limit value of the GPU elastic resource is 100%.
4. The method according to claim 1, wherein: The GPU resource identifier is obtained in the following manner: Use the Kubelet component of the slave node to call the ListAndWatch interface of the Device Plugin component to obtain the GPU resource identifier of the GPU resource.
5. A resource scheduling method, applied to a slave node in a Kubernetes cluster, wherein the slave node is deployed with a GPU, wherein the GPU includes a plurality of GPU resources, wherein the plurality of GPU resources include a GPU elastic resource whose resource type is an elastic resource and a GPU fixed resource whose resource type is a fixed resource, wherein the GPU elastic resource is configured to allow the use of idle resources of the GPU fixed resource when the GPU fixed resource is not fully loaded, wherein the method includes: In response to receiving the resource scheduling information sent by the master node, determining the target resource limit value and the target GPU of the target container according to the target GPU resource identifier of the GPU resource used by the target container in the resource scheduling information; Based on the target resource limit value, create the target container on the target GPU so that the target container runs the computing task in the resource scheduling information, The step of determining the target resource limit value and the target GPU of the target container according to the target GPU resource identifier of the GPU resource used by the target container in the resource scheduling information includes: Determine the target resource limit value of the target container according to the resource type in the GPU resource identifier of the GPU resource used by the target container in the resource scheduling information, wherein the resource type is used to characterize the computing power requirement of the task run by the container using the GPU resource, The target resource limit value of the target container is determined according to the resource type in the GPU resource identifier of the GPU resource used by the target container in the resource scheduling information, including: When the resource type in the GPU resource identifier required by the target container in the resource scheduling information is a fixed resource, determining that the target resource limit value of the target container is a first preset resource limit value, wherein the first preset resource limit value is configured to limit the resource occupancy rate of the target container on the target GPU, When the resource type in the GPU resource identifier required by the target container in the resource scheduling information is an elastic resource, determine that the target resource limit value of the target container is a second preset resource limit value, and the second preset resource limit value is configured to limit the resource occupancy of the GPU by the target container.
6. The method according to claim 5, wherein: The determining the target resource limit value and the target GPU of the target container according to the target GPU resource identifier of the GPU resource used by the target container in the resource scheduling information includes: The target GPU is determined according to the UUID of the GPU physical card in the GPU resource identifier of the GPU resource used by the target container in the resource scheduling information. The method according to claim 5 , wherein the first preset resource limit value is less than fifty percent. The method according to claim 7 , wherein the second preset resource limit value is greater than fifty percent.
9. The method according to claim 8, wherein: The first preset resource limit value is 25%, and the second preset resource limit value is 100%.
10. The method according to claim 5, wherein: MPS Server service runs on each GPU; as well as The step of creating the target container on the target GPU based on the target resource limit value so that the target container runs the computing task in the resource scheduling information includes: Based on the target resource limit value and the MPS Server service running on the target GPU, the target container is created on the target GPU so that the target container runs the computing task in the resource scheduling information.
11. The method according to claim 10, wherein: The step of creating the target container on the target GPU based on the target resource limit value and the MPS Server service running on the target GPU so that the target container runs the computing task in the resource scheduling information includes: The Allocate interface of the Device Plugin component is called by the Kubelet component, and the MPSServer environment variable on the target GPU is set to the target resource limit value, so that the target container uses the resources in the target GPU corresponding to the target resource limit value to execute the computing tasks in the resource scheduling information.
12. A resource scheduling system, applied to a Kubernetes cluster, wherein the Kubernetes cluster includes a master node and at least two slave nodes deployed with a graphics processing unit (GPU), wherein the GPU includes multiple GPU resources, and the resource scheduling system includes: The master node is configured to obtain a GPU resource identifier list of each slave node in response to receiving a resource scheduling request sent by the resource request end, The resource scheduling request includes target GPU resource information required for the computing task, the target GPU resource information includes a target resource type and a corresponding resource quantity, the GPU resource identifier list includes a GPU resource identifier, the GPU resource identifier includes a universal unique identifier UUID of a GPU physical card, a resource type, and index information of the GPU resource on the GPU physical card, based on the target resource type in the target GPU resource information, a GPU resource identifier matching the target resource type is selected from the GPU resource identifier list of each slave node to determine resource scheduling information, the resource scheduling information includes a target slave node for creating a target container for running the computing task and a target GPU resource identifier of the GPU resource used by the target container, the resource type is used to characterize the computing power requirement of the task run by the container using the GPU resource, The resource type includes elastic resources and fixed resources, the multiple GPU resources include GPU elastic resources whose resource type is elastic resources and GPU fixed resources whose resource type is fixed resources, the GPU fixed resources have a first preset resource limit, the first preset resource limit limits the resource occupancy rate of the GPU by the container using the GPU fixed resources, the GPU elastic resources have a second preset resource limit, the second preset resource limit limits the resource occupancy rate of the GPU by the container using the GPU elastic resources, and the GPU elastic resources are configured to allow the use of idle resources of the GPU fixed resources when the GPU fixed resources are not fully loaded; The slave node is configured to, in response to receiving resource scheduling information sent by the master node, determine a target resource limit value and a target GPU of the target container according to a target GPU resource identifier of the GPU resource used by the target container in the resource scheduling information, and create the target container on the target GPU based on the target resource limit value so that the target container runs the computing task in the resource scheduling information.
13. A resource scheduling device, applied to a master node in a Kubernetes cluster, wherein the Kubernetes cluster further comprises at least two slave nodes deployed with a graphics processing unit (GPU), wherein the GPU comprises a plurality of GPU resources, and wherein the device comprises: The acquisition unit is configured to acquire the GPU resource identification list of each slave node in response to receiving the resource scheduling request sent by the resource request end, The resource scheduling request includes target GPU resource information required for the computing task, the target GPU resource information includes the target resource type and the corresponding resource quantity, the GPU resource identification list includes the GPU resource identification, the GPU resource identification includes the universal unique identification code UUID of the GPU physical card, the resource type and the index information of the GPU resource on the GPU physical card, and the resource type is used to characterize the computing power requirement of the task run by the container using the GPU resource. The resource type includes elastic resources and fixed resources, the multiple GPU resources include GPU elastic resources whose resource type is elastic resources and GPU fixed resources whose resource type is fixed resources, the GPU fixed resources have a first preset resource limit, the first preset resource limit limits the resource occupancy rate of the GPU by the container using the GPU fixed resources, the GPU elastic resources have a second preset resource limit, the second preset resource limit limits the resource occupancy rate of the GPU by the container using the GPU elastic resources, and the GPU elastic resources are configured to allow the use of idle resources of the GPU fixed resources when the GPU fixed resources are not fully loaded; The first determination unit is configured to select a GPU resource identifier that matches the target resource type from the GPU resource identifier list of each slave node based on the target resource type required for the computing task in the target GPU resource information, and determine resource scheduling information, wherein the resource scheduling information includes a target slave node for creating a target container for running the computing task and a target GPU resource identifier for the GPU resources used by the target container.
14. A resource scheduling device, applied to a slave node in a Kubernetes cluster, wherein the slave node is deployed with a GPU, wherein the GPU includes a plurality of GPU resources, wherein the plurality of GPU resources include a GPU elastic resource whose resource type is an elastic resource and a GPU fixed resource whose resource type is a fixed resource, wherein the GPU elastic resource is configured to allow the use of idle resources of the GPU fixed resource when the GPU fixed resource is not fully loaded, wherein the device includes: A second determining unit is configured to, in response to receiving resource scheduling information sent by the master node, determine a target resource limit value and a target GPU of the target container according to a target GPU resource identifier of the GPU resource used by the target container in the resource scheduling information; a creating unit configured to create the target container on the target GPU based on the target resource limit value, so that the target container runs the computing task in the resource scheduling information, The second determining unit includes a first determining subunit, configured to determine a target resource limit value of the target container according to a resource type in a GPU resource identifier of a GPU resource used by the target container in the resource scheduling information, wherein the resource type is used to characterize a computing power requirement of a task run by a container using the GPU resource, Wherein the first determining subunit is further configured as follows: When the resource type in the GPU resource identifier required by the target container in the resource scheduling information is a fixed resource, determining that the target resource limit value of the target container is a first preset resource limit value, wherein the first preset resource limit value is configured to limit the resource occupancy rate of the target container on the target GPU, When the resource type in the GPU resource identifier required by the target container in the resource scheduling information is an elastic resource, determine that the target resource limit value of the target container is a second preset resource limit value, and the second preset resource limit value is configured to limit the resource occupancy of the GPU by the target container.
15. An electronic device, comprising: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors are enabled to implement the method according to any one of claims 1 to 11.
16. A computer readable medium having a computer program stored thereon, wherein: When the program is executed by a processor, the method according to any one of claims 1 to 11 is implemented.
Citation Information
Patent Citations
Resource sharing method and device
CN112559164A
Resource scheduling method and device, electronic equipment and computer readable storage medium
CN113204428A