A graphics processor scheduling method, device, equipment and storage medium

By obtaining and managing the device information of the graphics processor in the server cluster and dynamically allocating resources, it solves the problems of GPU card overheating and uneven resource allocation, and achieves load balancing and efficient computing resource utilization.

CN118656228BActive Publication Date: 2024-10-22YUANQIXIN (SHANDONG) SEMICONDUCTOR TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411154885.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-22
Publication Date
2024-10-22
Estimated Expiration
2044-08-22

AI Technical Summary

Technical Problem

In a server cluster, overheating of GPU cards and uneven resource allocation lead to reduced computing power and unstable performance. How to achieve load balancing to effectively utilize computing resources?

Method used

By obtaining the graphics processor device information of each server during cluster initialization, creating associated containers to save core and memory usage information, and dynamically allocating resources according to user resource requests, ensuring reasonable resource allocation and load balancing.

Benefits of technology

It achieves a reasonable allocation of server cluster resources, avoids GPU card overload and heat generation, improves the stability and service life of the overall computing power, and ensures efficient utilization of computing resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118656228B_ABST
    Figure CN118656228B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device, equipment and storage medium for scheduling a graphics processor, which relates to the field of computer technology, and includes: obtaining device information of each graphics processor, creating a device information structure; saving device information and a coding ID of a server through the device information structure, creating and filling a first associated container based on the device information structure and the core usage of the graphics processor, creating and filling a second associated container using the device information structure and the memory usage of the graphics processor; uploading target information to a general scheduler using the first associated container and the second associated container, so that the general scheduler creates and fills a first total associated container and a second total associated container according to the integrated information; allocating cores and memory to users on the graphics processor based on a resource allocation method determined according to a user's resource request, and updating the total associated container to complete the scheduling of the graphics processor. The present application realizes the reasonable configuration of cluster resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a graphics processor scheduling method, device, equipment and storage medium. Background Art

[0002] With the rapid development of artificial intelligence, deep learning and high-performance computing, the demand for computing resources is growing exponentially. To meet these needs, data centers and scientific research institutions are building clusters consisting of many servers, each equipped with multiple GPU (Graphics Processing Unit) cards to provide huge parallel processing capabilities.

[0003] At the same time, the computing power of GPU cards is also constantly improving, through more cores, higher core frequencies, larger memory, and higher memory bandwidth. However, the space of server chassis and racks is limited, and the size of GPU cards is limited by the internal space of the chassis. In order to ensure that GPU cards are compatible with various servers, they usually need to follow certain standardized sizes. The increase in GPU card computing power will inevitably generate more heat. Under the existing size restrictions and heat dissipation process conditions, if the temperature rise of the GPU card cannot be well controlled, a series of problems will occur. High temperature will accelerate the aging of electronic components, shorten the service life of the GPU card, and may also cause hardware damage and even fire safety hazards. Overheating of the GPU card will also trigger automatic frequency reduction, causing a significant drop in computing power. If the frequency reduction is frequently triggered and released, the performance of the GPU card will also become unstable.

[0004] In the case of a server cluster, the overall computing power is sufficient. However, if the load balancing cannot be performed effectively, the problem of uneven resource allocation will occur. This will cause some GPU cards to be overloaded and overheated, while others will remain idle. Therefore, how to achieve reasonable allocation of server cluster resources and effective load balancing is a problem that needs to be solved urgently. Summary of the invention

[0005] In view of this, the purpose of the present invention is to provide a graphics processor scheduling method, device, equipment and storage medium, which can realize the reasonable allocation of server cluster resources and achieve effective load balancing. The specific scheme is as follows:

[0006] In a first aspect, the present application discloses a graphics processor scheduling method, comprising:

[0007] During the cluster power-on initialization process, the device information of the graphics processors corresponding to each server is obtained, and corresponding device information structures are created based on each of the graphics processors;

[0008] The device information and the encoding ID of the server corresponding to the graphics processor are saved through the device information structure, a first association container is created and filled based on the device information structure and the core usage of the graphics processor, and a second association container is created and filled using the device information structure and the memory usage of the graphics processor;

[0009] After the sub-schedulers are initialized, the target information of each graphics processor is uploaded to the general scheduler by using each first associated container and each second associated container, so that the general scheduler integrates each of the target information and creates and fills the first general associated container and the second general associated container according to the corresponding integrated information; the target information includes the device information, the encoding ID, the core usage rate and the memory usage rate;

[0010] A corresponding resource allocation method is determined according to a resource request of the user, and a core and a memory are allocated to the user on the corresponding graphics processor by using the resource allocation method. When the resource quantity requirement of the resource request is met, the first total associated container and the second total associated container are updated to complete the scheduling of the graphics processor.

[0011] Optionally, obtaining device information of a graphics processor corresponding to each server includes:

[0012] Communicate with all the graphics processors through a driver or an application programming interface to obtain device information of the graphics processors corresponding to each server; the device information includes the total number of cores, the number of used cores, the total memory size, the used memory size, the type of the graphics processor and the ID of the corresponding PCIe device.

[0013] Optionally, the first associative container, the second associative container, the first total associative container and the second total associative container are all associative containers for storing key-value pairs; wherein the core usage of the graphics processor is the key of the elements in the first associative container and the first total associative container, the memory usage of the graphics processor is the key of the elements in the second associative container and the second total associative container, and the device information structure is the value associated with the key in the associative container.

[0014] Optionally, uploading the target information of each graphics processor to the overall scheduling program by using each first associated container and each second associated container includes:

[0015] Communicate with the overall scheduler through a network interface to upload target information of each graphics processor to the overall scheduler based on the key-value pairs in each first associated container and each second associated container.

[0016] Optionally, determining a corresponding resource allocation method according to a resource request of a user, and allocating a core and a memory to the user on a corresponding graphics processor by using the resource allocation method, includes:

[0017] If the resource request of the user specifies that resources are to be acquired according to memory occupancy rate, allocating resources based on the second total associated container;

[0018] Allocate a core and corresponding memory to the user on the graphics processor with the lowest memory occupancy in the second total associated container, update the second total associated container, and jump again to the step of allocating a core and corresponding memory to the user on the graphics processor with the lowest memory occupancy in the second total associated container until the resource quantity requirement corresponding to the resource request is met.

[0019] Optionally, determining a corresponding resource allocation method according to a resource request of a user, and allocating a core and a memory to the user on a corresponding graphics processor by using the resource allocation method, includes:

[0020] If there is no resource acquisition provision in the resource request of the user, allocating resources based on the first total associated container;

[0021] Allocate a core and corresponding memory to the user on the graphics processor with the lowest core occupancy in the first total associated container, update the first total associated container, and jump again to the step of allocating a core and corresponding memory to the user on the graphics processor with the lowest core occupancy in the first total associated container until the resource quantity requirement corresponding to the resource request is met.

[0022] Optionally, determining a corresponding resource allocation method according to a resource request of a user, and allocating a core and a memory to the user on a corresponding graphics processor by using the resource allocation method, includes:

[0023] If the type of the graphics processor is specified in the resource request of the user, allocating resources based on the first overall associated container;

[0024] Determining whether the type of the graphics processor with the lowest core occupancy in the first total associated container is consistent with the type specification;

[0025] If they are consistent, a core and corresponding memory are allocated to the user on the graphics processor with the lowest core occupancy rate in the first total associated container, the first total associated container is updated, and the process is jumped again to the step of allocating a core and corresponding memory to the user on the graphics processor with the lowest core occupancy rate in the first total associated container until the resource quantity requirement corresponding to the resource request is met;

[0026] If they are inconsistent, type consistency is judged in sequence according to the order of core occupancy in the first total associated container until a target graphics processor that is the same as the type specification is determined, and a core and corresponding memory are allocated to the user on the target graphics processor, the first total associated container is updated, and the process is jumped again to the step of judging whether the type of the graphics processor with the lowest core occupancy in the first total associated container is consistent with the type specification until the resource quantity requirement corresponding to the resource request is met.

[0027] In a second aspect, the present application discloses a graphics processor scheduling device, comprising:

[0028] A device information structure creation module is used to obtain device information of the graphics processors corresponding to each server during the cluster power-on initialization process, and to create corresponding device information structures based on each of the graphics processors;

[0029] an association container creation module, configured to save the device information and the encoding ID of the server corresponding to the graphics processor through the device information structure, create and fill a first association container based on the device information structure and the core usage of the graphics processor, and create and fill a second association container using the device information structure and the memory usage of the graphics processor;

[0030] A total associated container creation module, used for uploading target information of each graphics processor to the total scheduler by using each first associated container and each second associated container after the sub-scheduler is initialized, so that the total scheduler integrates each of the target information, and creates and fills the first total associated container and the second total associated container according to the corresponding integrated information; the target information includes the device information, the encoding ID, the core usage rate and the memory usage rate;

[0031] The graphics processor scheduling module is used to determine a corresponding resource allocation method according to a user's resource request, allocate cores and memory to the user on the corresponding graphics processor according to the resource allocation method, and update the first total associated container and the second total associated container when the resource quantity requirement of the resource request is met to complete the scheduling of the graphics processor.

[0032] In a third aspect, the present application discloses an electronic device, comprising:

[0033] Memory, used to store computer programs;

[0034] The processor is used to execute the computer program to implement the aforementioned graphics processor scheduling method.

[0035] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program, wherein the computer program implements the aforementioned graphics processor scheduling method when executed by a processor.

[0036] When scheduling a graphics processor, the present application first obtains device information of the graphics processors corresponding to each server during the cluster power-on initialization process, and creates a corresponding device information structure based on each of the graphics processors; then, the device information and the coding ID of the server corresponding to the graphics processor are saved through the device information structure, a first association container is created and filled based on the device information structure and the core usage of the graphics processor, and a second association container is created and filled using the device information structure and the memory usage of the graphics processor; after the sub-scheduling program is initialized, the target information of each graphics processor is uploaded to the general scheduling program using the first association containers and the second association containers, so that the general scheduling program integrates the target information, and creates and fills the first general association container and the second general association container according to the corresponding integrated information; the target information includes the device information, the coding ID, the core usage and the memory usage; finally, the corresponding resource allocation method is determined according to the user's resource request, and the core and memory are allocated to the user on the corresponding graphics processor through the resource allocation method, and when the resource quantity requirement of the resource request is met, the first general association container and the second general association container are updated to complete the scheduling of the graphics processor. It can be seen that this application saves the core usage and memory usage information of the graphics processor through the associated container, and selects different usage rates for allocation when facing different resource requests, thereby realizing the reasonable allocation of server cluster resources and achieving effective load balancing. Under the premise of sufficient cluster computing power, a series of problems caused by overload and heating of some graphics processors can be effectively avoided. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0038] Figure 1 A flowchart of a graphics processor scheduling method disclosed in this application;

[0039] Figure 2 A schematic diagram of a server cluster structure disclosed in this application;

[0040] Figure 3 A flowchart of a specific graphics processor scheduling method disclosed in this application;

[0041] Figure 4 A schematic diagram of the structure of a graphics processor scheduling device disclosed in this application;

[0042] Figure 5 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION

[0043] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only 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.

[0044] At present, due to the limited space of server chassis and racks, the size of GPU cards is limited by the internal space of the chassis. In order to ensure that GPU cards are compatible with various servers, they usually need to follow certain standardized sizes. The increase in GPU card computing power will inevitably generate more heat. Under the existing size restrictions and heat dissipation process conditions, if the temperature rise of the GPU card cannot be well controlled, a series of problems will arise. High temperature will accelerate the aging of electronic components, shorten the service life of the GPU card, and may also cause hardware damage and even pose a safety hazard of causing a fire. Overheating of the GPU card will also trigger automatic frequency reduction, causing a significant drop in computing power. If the frequency reduction is frequently triggered and released, the performance of the GPU card will also become unstable. In order to solve the above-mentioned technical problems, the present application discloses a graphics processor scheduling method to achieve reasonable allocation of server cluster resources and achieve effective load balancing.

[0045] See also Figure 1 As shown, an embodiment of the present invention discloses a graphics processor scheduling method, including:

[0046] Step S11: during the cluster power-on initialization process, the device information of the graphics processors corresponding to the servers is obtained, and corresponding device information structures are created based on the graphics processors.

[0047] In this embodiment, Figure 2As shown in the figure, there can be multiple servers in this server cluster, and these servers can be of the same model or different models. Each server can have multiple GPU cards, and these GPU cards can be of the same model or different models. For each model of GPU card, the manufacturer provides corresponding GPU virtualization technology. GPU virtualization allows multiple users to share the resources of a single physical GPU card, that is, multiple virtual GPU instances can be created on a single physical GPU card. In addition, the virtual GPU provides advanced isolation and security features to ensure data security and isolation between different GPU instances, realize centralized management and efficient use of resources, and avoid idleness and waste of resources.

[0048] During the cluster power-on initialization process, the sub-scheduler on each server communicates with all GPU cards through the driver interface provided by the manufacturer to obtain the device information of all GPU cards, including the total number of cores, the number of used cores, the total memory size, the used memory size, the GPU type and the corresponding PCIe (Peripheral Component Interconnect Express, a high-speed serial computer expansion bus standard) device ID (Identity), etc. The sub-scheduler then creates a gpu_cfg_t device information structure for each GPU card, which saves the device information of the GPU card and the unique coded ID of the server where it is located.

[0049] Step S12: Save the device information and the coding ID of the server corresponding to the graphics processor through the device information structure, create and fill a first associated container based on the device information structure and the core usage of the graphics processor, and create and fill a second associated container using the device information structure and the memory usage of the graphics processor.

[0050] In this embodiment, the present application saves the device information and the encoding ID of the server where the graphics processor is located through the created device information structure. Then a multimap association container mmap_gpu_core (i.e., the first association container) is created to store key-value pairs, wherein the core usage rate of the GPU card is used as the key of the element in mmap_gpu_core, and the gpu_cfg_t device information structure of the GPU card is used as the value associated with the key. Then another association container mmap_gpu_mem (i.e., the second association container) is created, and the memory usage rate of the GPU card is used as the key of the element in mmap_gpu_mem, and the gpu_cfg_t device information structure of the GPU card is used as the value associated with the key. In other words, the first association container and the second association container are both association containers for storing key-value pairs; wherein the core usage rate of the graphics processor is the key of the element in the first association container, the memory usage rate of the graphics processor is the key of the element in the second association container, and the device information structure is the value associated with the key in the first association container and the second association container.

[0051] Step S13: After the sub-schedulers are initialized, the target information of each graphics processor is uploaded to the general scheduler by using each first associated container and each second associated container, so that the general scheduler integrates each of the target information and creates and fills the first general associated container and the second general associated container according to the corresponding integrated information; the target information includes the device information, the encoding ID, the core usage rate and the memory usage rate.

[0052] In this embodiment, the general scheduling server is connected to other servers in the cluster via Ethernet, and the general scheduling program on the general scheduling server communicates with the sub-scheduling programs on the remaining servers via the network interface. After each sub-scheduling program is initialized, it actively reports the information of all GPU cards under its jurisdiction to the general scheduling program. The reported information here includes the device information of the GPU, the unique coding ID of the server where it is located, the core utilization rate and the memory utilization rate. Then the general scheduling program integrates the received information, and creates and fills the first general association container mmap_gpu_core_all and the second general association container mmap_gpu_mem_all according to the corresponding integrated information. Like the first association container and the second association container, the first general association container and the second general association container are both association containers for storing key-value pairs; wherein, the core utilization rate of the graphics processor is the key of the element in the first general association container, the memory utilization rate of the graphics processor is the key of the element in the second general association container, and the device information structure is the value associated with the key in the first general association container and the second general association container. That is, the contents of the associated containers corresponding to the servers are integrated into the total associated container, and the total associated container contains the information of all GPUs. After the total associated container collects all the information, the associated containers are released, and only the total associated container is retained.

[0053] Step S14: determining a corresponding resource allocation method according to the user's resource request, and allocating cores and memory to the user on the corresponding graphics processor according to the resource allocation method, and updating the first total associated container and the second total associated container when the resource quantity requirement of the resource request is met to complete the scheduling of the graphics processor.

[0054] In this embodiment, so far, the general scheduler has saved the information of all GPUs. Then, when the user requests resources, if there is no resource acquisition provision in the user's resource request, the GPU type is not distinguished by default, and the resource allocation is performed based on mmap_gpu_core_all by default, that is, the resource allocation is performed based on the first general association container. A core and corresponding memory are allocated to the user on the graphics processor with the lowest core occupancy in the first general association container, the first general association container is updated, and the step of allocating a core and corresponding memory to the user on the graphics processor with the lowest core occupancy in the first general association container is jumped again until the resource quantity requirement corresponding to the resource request is met. In layman's terms, within the entire cluster, 1 core and corresponding memory are allocated to the user on the GPU card with the lowest core occupancy, the content of mmap_gpu_core_all is updated, and then 1 core and corresponding memory are allocated to the user on the GPU card with the lowest core occupancy, until the number of resources requested by the user is reached. At this time, the contents of mmap_gpu_core_all and mmap_gpu_mem_all are updated to complete the scheduling of the graphics processor.

[0055] If the user's resource request stipulates that resources are obtained based on memory occupancy, resource allocation is performed based on the second total associated container. That is, if the user requests to obtain resources based on memory occupancy, resource allocation is performed based on mmap_gpu_mem_all. Then, a core and corresponding memory are allocated to the user on the graphics processor with the lowest memory occupancy in the second total associated container, the second total associated container is updated, and the step of allocating a core and corresponding memory to the user on the graphics processor with the lowest memory occupancy in the second total associated container is jumped again until the resource quantity requirement corresponding to the resource request is met. In other words, within the entire cluster, 1 core and corresponding memory are allocated to the user on the GPU card with the lowest memory occupancy. The content of mmap_gpu_mem_all is updated, and then 1 core and corresponding memory are allocated to the user on the GPU card with the lowest memory occupancy until the number of resources requested by the user is reached. At this time, the contents of mmap_gpu_core_all and mmap_gpu_mem_all are updated to complete the scheduling of the graphics processor.

[0056] In addition, if the user specifies the GPU type when requesting resources, the default resource allocation is based on mmap_gpu_core_all, that is, the resource allocation is based on the first total associated container. In the entire cluster, find the GPU card with the lowest core occupancy. If the GPU type is consistent with the request, allocate 1 core and corresponding memory to the user. If the GPU type does not match the request, find the GPU card with the second lowest core occupancy to make a judgment, allocate, and update the content of mmap_gpu_core_all until the number of resources requested by the user is reached. At this time, the contents of mmap_gpu_core_all and mmap_gpu_mem_all are updated to complete the scheduling of the graphics processor.

[0057] In summary, when scheduling a graphics processor, the present application first obtains the device information of the graphics processors corresponding to each server during the cluster power-on initialization process, and creates a corresponding device information structure based on each of the graphics processors; then, the device information and the coding ID of the server corresponding to the graphics processor are saved through the device information structure, a first associated container is created and filled based on the device information structure and the core usage of the graphics processor, and a second associated container is created and filled using the device information structure and the memory usage of the graphics processor; after the sub-scheduling program is initialized, each first associated container and each second associated container are used to create and fill the second associated container; The container uploads the target information of each graphics processor to the general scheduler so that the general scheduler integrates the target information and creates and fills the first general association container and the second general association container according to the corresponding integrated information; the target information includes the device information, the coding ID, the core usage rate and the memory usage rate; finally, the corresponding resource allocation method is determined according to the user's resource request, and the core and memory are allocated to the user on the corresponding graphics processor through the resource allocation method, and when the resource quantity requirements of the resource request are met, the first general association container and the second general association container are updated to complete the scheduling of the graphics processor. It can be seen that the present application saves the information of the core usage rate and memory usage rate corresponding to the graphics processor respectively through the associated container, and selects different usage rate basis for allocation when facing different resource requests, thereby realizing the reasonable allocation of server cluster resources and achieving effective load balancing. Under the premise of sufficient cluster computing power, a series of problems caused by overload and heating of some graphics processors can be effectively avoided.

[0058] Based on the previous embodiment, it can be known that the present application will determine the corresponding resource allocation method according to the user's resource request, and allocate cores and memory to the user on the corresponding graphics processor through the resource allocation method. Next, when there is a graphics processor type specification in the user's resource request, allocating cores and memory to the user on the corresponding graphics processor will be described in detail.

[0059] like Figure 3 As shown, when a user initiates a resource request, if there is a type specification of a graphics processor in the user's resource request, resource allocation is performed based on the first total associated container; by default, resource allocation is performed based on mmap_gpu_core_all, and GPU cards whose GPU types do not match the request are skipped, that is, within the entire cluster, the GPU card with the lowest core occupancy is found, and then it is determined whether the type of the graphics processor with the lowest core occupancy in the first total associated container is consistent with the type specification in the user's resource request; if consistent, a core and corresponding memory are allocated to the user on the graphics processor with the lowest core occupancy in the first total associated container, the first total associated container is updated, and the step of allocating a core and corresponding memory to the user on the graphics processor with the lowest core occupancy in the first total associated container is jumped again, until the resource quantity requirement corresponding to the resource request is met. That is, if the GPU type is consistent with the request, 1 core and corresponding memory are allocated to the user, and the first total associated container is updated, and then it is determined whether the allocation is completed, that is, whether the user's resource request quantity has been reached. If the allocation is completed, the contents of the first total associative container mmap_gpu_core_all and the second total associative container mmap_gpu_mem_all are updated, thereby terminating the entire process.

[0060] If the type of the graphics processor with the lowest core occupancy rate in the first total associated container is inconsistent with the type specification in the user's resource request, then type consistency judgment is performed in sequence according to the order of core occupancy rates in the first total associated container, until a target graphics processor with the same type specification is determined, and a core and corresponding memory are allocated to the user on the target graphics processor, the first total associated container is updated, and the step of judging whether the type of the graphics processor with the lowest core occupancy rate in the first total associated container is consistent with the type specification is jumped again, until the resource quantity requirement corresponding to the resource request is met. In other words, if the GPU type does not match the request, the GPU card with the second lowest core occupancy rate is found for judgment. If the GPU type with the second lowest core occupancy rate is consistent with the type specification, a core and corresponding memory are allocated to the user according to the GPU with the second lowest core occupancy rate, and the content of mmap_gpu_core_all is updated until the resource quantity requested by the user is reached. If the GPU type with the second lowest core occupancy rate is also inconsistent with the type specification, the GPU with the second lowest core occupancy rate is found again, and so on, until the GPU type consistent with the type specification is found for allocation and the content of mmap_gpu_core_all is updated. Finally, when the number of resources requested by the user is reached, the contents of mmap_gpu_core_all and mmap_gpu_mem_all are updated and the entire process ends.

[0061] It can be seen that this application uses different usage rates to allocate resources when facing different resource requests, thereby achieving reasonable allocation of server cluster resources and effective load balancing. Under the premise of sufficient cluster computing power, a series of problems caused by overload and heating of some graphics processors can be effectively avoided.

[0062] See also Figure 4 As shown, an embodiment of the present invention discloses a graphics processor scheduling device, including:

[0063] The device information structure creation module 11 is used to obtain the device information of the graphics processor corresponding to each server during the cluster power-on initialization process, and create a corresponding device information structure based on each graphics processor;

[0064] an association container creation module 12, configured to save the device information and the encoding ID of the server corresponding to the graphics processor through the device information structure, create and fill a first association container based on the device information structure and the core usage of the graphics processor, and create and fill a second association container using the device information structure and the memory usage of the graphics processor;

[0065] The total associated container creation module 13 is used to upload the target information of each graphics processor to the total scheduler by using each first associated container and each second associated container after the sub-scheduler is initialized, so that the total scheduler integrates each of the target information and creates and fills the first total associated container and the second total associated container according to the corresponding integrated information; the target information includes the device information, the encoding ID, the core usage rate and the memory usage rate;

[0066] The graphics processor scheduling module 14 is used to determine a corresponding resource allocation method according to a user's resource request, and allocate cores and memory to the user on the corresponding graphics processor according to the resource allocation method, and when the resource quantity requirement of the resource request is met, update the first total associated container and the second total associated container to complete the scheduling of the graphics processor.

[0067] When scheduling a graphics processor, the present application first obtains device information of the graphics processors corresponding to each server during the cluster power-on initialization process, and creates a corresponding device information structure based on each of the graphics processors; then, the device information and the coding ID of the server corresponding to the graphics processor are saved through the device information structure, a first association container is created and filled based on the device information structure and the core usage of the graphics processor, and a second association container is created and filled using the device information structure and the memory usage of the graphics processor; after the sub-scheduling program is initialized, the target information of each graphics processor is uploaded to the general scheduling program using the first association containers and the second association containers, so that the general scheduling program integrates the target information, and creates and fills the first general association container and the second general association container according to the corresponding integrated information; the target information includes the device information, the coding ID, the core usage and the memory usage; finally, the corresponding resource allocation method is determined according to the user's resource request, and the core and memory are allocated to the user on the corresponding graphics processor through the resource allocation method, and when the resource quantity requirement of the resource request is met, the first general association container and the second general association container are updated to complete the scheduling of the graphics processor. It can be seen that this application saves the core usage and memory usage information of the graphics processor through the associated container, and selects different usage rates for allocation when facing different resource requests, thereby realizing the reasonable allocation of server cluster resources and achieving effective load balancing. Under the premise of sufficient cluster computing power, a series of problems caused by overload and heating of some graphics processors can be effectively avoided.

[0068] In some specific embodiments, the device information structure creation module 11 may specifically include:

[0069] A device information acquisition unit is used to communicate with all the graphics processors through a driver or an application programming interface to obtain device information of the graphics processors corresponding to each server; the device information includes the total number of cores, the number of used cores, the total memory size, the used memory size, the type of the graphics processor and the ID of the corresponding PCIe device.

[0070] In some specific embodiments, the total association container creation module 13 may specifically include:

[0071] The target information uploading unit is used to communicate with the overall scheduler through a network interface, so as to upload the target information of each graphics processor to the overall scheduler based on the key-value pairs in each first associated container and each second associated container.

[0072] In some specific embodiments, the graphics processor scheduling module 14 may specifically include:

[0073] A first resource allocation unit, configured to allocate resources based on the second total associated container if the resource request of the user specifies that resources are acquired based on memory occupancy;

[0074] The first core and memory allocation unit is used to allocate a core and corresponding memory to the user on the graphics processor with the lowest memory occupancy rate in the second total associated container, update the second total associated container, and jump again to the step of allocating a core and corresponding memory to the user on the graphics processor with the lowest memory occupancy rate in the second total associated container until the resource quantity requirement corresponding to the resource request is met.

[0075] In some specific embodiments, the graphics processor scheduling module 14 may specifically include:

[0076] a second resource allocation unit, configured to allocate resources based on the first overall associated container if there is no resource acquisition provision in the resource request of the user;

[0077] The second core and memory allocation unit is used to allocate a core and corresponding memory to the user on the graphics processor with the lowest core occupancy in the first total associated container, update the first total associated container, and jump again to the step of allocating a core and corresponding memory to the user on the graphics processor with the lowest core occupancy in the first total associated container until the resource quantity requirement corresponding to the resource request is met.

[0078] In some specific embodiments, the graphics processor scheduling module 14 may specifically include:

[0079] a third resource allocation unit, configured to allocate resources based on the first overall associated container if the type specification of the graphics processor exists in the resource request of the user;

[0080] A determination unit, configured to determine whether the type of the graphics processor with the lowest core occupancy in the first total associated container is consistent with the type specification;

[0081] a first judgment result execution unit, configured to, if the two are consistent, allocate a core and corresponding memory to the user on the graphics processor with the lowest core occupancy rate in the first total associated container, update the first total associated container, and jump again to the step of allocating a core and corresponding memory to the user on the graphics processor with the lowest core occupancy rate in the first total associated container, until the resource quantity requirement corresponding to the resource request is met;

[0082] The second judgment result execution unit is configured to, if inconsistent, judge the type consistency in sequence according to the order of the core occupancy rates in the first total associated container until a target graphics processor that is the same as the type specification is determined, and a core and corresponding memory are allocated to the user on the target graphics processor, and the first total associated container is updated, and the step of judging whether the type of the graphics processor with the lowest core occupancy rate in the first total associated container is consistent with the type specification is jumped again, until the resource quantity requirement corresponding to the resource request is met.

[0083] Furthermore, the present application also discloses an electronic device. Figure 5 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.

[0084] Figure 5 The present invention provides a schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the graphics processor scheduling method disclosed in any of the above embodiments. In addition, the electronic device 20 in this embodiment may be specifically an electronic computer.

[0085] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0086] In addition, the memory 22 as a carrier for resource storage may be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon may include an operating system 221, a computer program 222, etc., and the storage method may be temporary storage or permanent storage.

[0087] The operating system 221 is used to manage and control the hardware devices on the electronic device 20 and the computer program 222, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the graphics processor scheduling method executed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.

[0088] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the aforementioned disclosed graphics processor scheduling method. For the specific steps of the method, reference may be made to the corresponding contents disclosed in the aforementioned embodiments, and no further description will be given here.

[0089] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0090] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0091] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0092] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0093] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of ​​the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A graphics processor scheduling method, It is characterized in that include: During the cluster power-on initialization process, the device information of the graphics processors corresponding to each server is obtained, and corresponding device information structures are created based on each of the graphics processors; The device information and the encoding ID of the server corresponding to the graphics processor are saved through the device information structure, a first association container is created and filled based on the device information structure and the core usage of the graphics processor, and a second association container is created and filled using the device information structure and the memory usage of the graphics processor; After the sub-schedulers are initialized, the target information of each graphics processor is uploaded to the main scheduler by using each first associated container and each second associated container, so that the main scheduler integrates each of the target information and creates and fills the first main associated container and the second main associated container according to the corresponding integrated information; The target information includes the device information, the encoding ID, core usage and memory usage; A corresponding resource allocation method is determined according to a resource request of the user, and a core and a memory are allocated to the user on the corresponding graphics processor by using the resource allocation method. When the resource quantity requirement of the resource request is met, the first total associated container and the second total associated container are updated to complete the scheduling of the graphics processor.

2. The graphics processor scheduling method according to claim 1, It is characterized in that The obtaining of device information of the graphics processors corresponding to the servers includes: Communicate with all the graphics processors through a driver or an application programming interface to obtain device information of the graphics processors corresponding to each server; the device information includes the total number of cores, the number of used cores, the total memory size, the used memory size, the type of the graphics processor and the ID of the corresponding PCIe device.

3. The graphics processor scheduling method according to claim 1, It is characterized in that The first associative container, the second associative container, the first total associative container and the second total associative container are all associative containers for storing key-value pairs; wherein the core usage of the graphics processor is the key of the elements in the first associative container and the first total associative container, the memory usage of the graphics processor is the key of the elements in the second associative container and the second total associative container, and the device information structure is the value associated with the key in the associative container.

4. The graphics processor scheduling method according to claim 3, It is characterized in that The method of uploading the target information of each graphics processor to the overall scheduling program by using each first associated container and each second associated container includes: Communicate with the overall scheduler through a network interface to upload target information of each graphics processor to the overall scheduler based on the key-value pairs in each first associated container and each second associated container.

5. The graphics processor scheduling method according to any one of claims 1 to 4, It is characterized in that The determining a corresponding resource allocation method according to a resource request of a user, and allocating a core and a memory to the user on a corresponding graphics processor by using the resource allocation method, comprises: If the resource request of the user specifies that resources are to be acquired according to memory occupancy rate, allocating resources based on the second total associated container; Allocate a core and corresponding memory to the user on the graphics processor with the lowest memory occupancy in the second total associated container, update the second total associated container, and jump again to the step of allocating a core and corresponding memory to the user on the graphics processor with the lowest memory occupancy in the second total associated container until the resource quantity requirement corresponding to the resource request is met.

6. The graphics processor scheduling method according to any one of claims 1 to 4, It is characterized in that The determining a corresponding resource allocation method according to a resource request of a user, and allocating a core and a memory to the user on a corresponding graphics processor by using the resource allocation method, comprises: If there is no resource acquisition provision in the resource request of the user, allocating resources based on the first total associated container; Allocate a core and corresponding memory to the user on the graphics processor with the lowest core occupancy in the first total associated container, update the first total associated container, and jump again to the step of allocating a core and corresponding memory to the user on the graphics processor with the lowest core occupancy in the first total associated container until the resource quantity requirement corresponding to the resource request is met.

7. The graphics processor scheduling method according to any one of claims 1 to 4, It is characterized in that The determining a corresponding resource allocation method according to a resource request of a user, and allocating a core and a memory to the user on a corresponding graphics processor by using the resource allocation method, comprises: If the type of the graphics processor is specified in the resource request of the user, allocating resources based on the first overall associated container; Determining whether the type of the graphics processor with the lowest core occupancy in the first total associated container is consistent with the type specification; If they are consistent, a core and corresponding memory are allocated to the user on the graphics processor with the lowest core occupancy rate in the first total associated container, the first total associated container is updated, and the process is jumped again to the step of allocating a core and corresponding memory to the user on the graphics processor with the lowest core occupancy rate in the first total associated container until the resource quantity requirement corresponding to the resource request is met; If they are inconsistent, type consistency is judged in sequence according to the order of core occupancy in the first total associated container until a target graphics processor that is the same as the type specification is determined, and a core and corresponding memory are allocated to the user on the target graphics processor, the first total associated container is updated, and the process is jumped again to the step of judging whether the type of the graphics processor with the lowest core occupancy in the first total associated container is consistent with the type specification until the resource quantity requirement corresponding to the resource request is met.

8. A graphics processor scheduling device, It is characterized in that include: A device information structure creation module is used to obtain device information of the graphics processors corresponding to each server during the cluster power-on initialization process, and to create corresponding device information structures based on each of the graphics processors; an association container creation module, configured to save the device information and the encoding ID of the server corresponding to the graphics processor through the device information structure, create and fill a first association container based on the device information structure and the core usage of the graphics processor, and create and fill a second association container using the device information structure and the memory usage of the graphics processor; A total associated container creation module, used to upload the target information of each graphics processor to the total scheduler by using each first associated container and each second associated container after the sub-scheduler is initialized, so that the total scheduler integrates each of the target information, and creates and fills the first total associated container and the second total associated container according to the corresponding integrated information; The target information includes the device information, the encoding ID, core usage and memory usage; The graphics processor scheduling module is used to determine a corresponding resource allocation method according to a user's resource request, allocate cores and memory to the user on the corresponding graphics processor according to the resource allocation method, and update the first total associated container and the second total associated container when the resource quantity requirement of the resource request is met to complete the scheduling of the graphics processor.

9. An electronic device, It is characterized in that include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the graphics processor scheduling method according to any one of claims 1 to 7.

10. A computer-readable storage medium, It is characterized in that Used to store a computer program, which, when executed by a processor, implements the graphics processor scheduling method according to any one of claims 1 to 7.