GPU resource allocation method and device, computer equipment, storage medium and computer program product
By allocating tasks and generation processes based on the available resources of the GPU card, the problem of low efficiency of GPU resource allocation in the existing technology is solved, and efficient GPU resource utilization and meeting the requirements of artificial intelligence computing power are achieved.
Patent Information
- Application Number
- CN202411127224.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-16
- Publication Date
- 2024-12-06
AI Technical Summary
Existing virtualization or container cloud platforms cannot effectively improve the utilization rate of GPU resources, resulting in low efficiency of GPU resource allocation and cannot be allocated according to the actual performance requirements of the application.
By receiving pending tasks, the target GPU card is determined based on the available resources of each GPU card, and the target process is generated, the task is allocated to the target process, the available resources are updated, and multiple vGPUs share a physical GPU, and multiple process services are used. Multitasking to avoid the inability of a single process to use CPU multi-core effectively.
It improves the overall GPU resource utilization rate, meets the computing resource requirements of artificial intelligence algorithms, maximizes the efficiency of GPU resource in the data center, and increases the utilization rate of physical GPU by 3 to 5 times.
Smart Images

Figure CN119088549A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of power grid technology, and in particular to a GPU resource allocation method, apparatus, computer equipment, storage medium and computer program product. Background Art
[0002] The current mainstream virtualization or container cloud platform management technology cannot effectively improve the convenience and utilization of GPU resources. In terms of GPU resource allocation, GPU resources can only be allocated to business systems in an exclusive manner based on GPU cards, or simply divided and allocated to business systems in proportion according to preset ratios. It is impossible to allocate GPU resources in accordance with the actual performance requirements of applications. This GPU resource allocation method leads to low GPU resource utilization. Summary of the invention
[0003] Based on this, it is necessary to provide a GPU resource allocation method, apparatus, computer equipment, computer-readable storage medium and computer program product that can improve the utilization rate of GPU resources in response to the above technical problems.
[0004] In a first aspect, the present application provides a GPU resource allocation method, the method comprising:
[0005] Receive a task to be processed, wherein the task to be processed carries an amount of GPU resources to be consumed;
[0006] Based on the available resources of each GPU card, determining a target GPU card corresponding to the amount of GPU resources to be consumed;
[0007] Generate a target process corresponding to the target GPU card, and assign the task to be processed to the target process;
[0008] Update the available GPU resource amount corresponding to the target GPU card.
[0009] In one of the embodiments, determining the target GPU card corresponding to the amount of GPU resources to be consumed based on the available resources of each GPU card includes:
[0010] Determine an available initial GPU card based on the type of task to be processed;
[0011] According to the order of the available GPU resources of each of the initial GPU cards from small to large, traverse in sequence to obtain the target GPU cards, wherein the available GPU resources of the target GPU card are greater than or equal to the GPU resources to be consumed;
[0012] The generating a target process corresponding to the target GPU card includes:
[0013] When an existing process exists on the target GPU card, a target process is generated in parallel with the existing process, and the existing process is a process for processing other tasks.
[0014] In one embodiment, the method further comprises:
[0015] receiving performance monitoring instructions;
[0016] Obtaining the available GPU resource amount corresponding to each of the GPU cards based on the performance monitoring instruction, and calculating the resource utilization rate corresponding to each of the GPU cards based on the available GPU resource amount;
[0017] Output the resource utilization of each GPU card.
[0018] In one of the embodiments, the GPU card is any one of GPU cards in a single-machine single-card mode, GPU cards in a single-machine multi-card mode, or GPU cards in a multi-machine multi-card mode.
[0019] In one embodiment, receiving the task to be processed includes:
[0020] Receive at least one of a power grid task, a safety inspection task and an AI processing task; wherein the power grid task includes at least one of a power output-related task, a substation task and a power distribution task, and the safety inspection task includes at least one of an intelligent equipment inspection task and an operation safety real-time analysis task; the AI processing task includes at least one of an AI training task and an AI reasoning task, and each of the tasks to be processed is a parallel task.
[0021] In one embodiment, the power output related tasks include at least one of a first pole tower collapse recognition task, a mechanical engineering vehicle recognition task, a transmission line fault recognition task, a smoke and flame recognition task, a safety helmet recognition task, and a work clothes recognition task; the substation task includes at least one of a high-voltage disconnector status recognition task, a nameplate recognition task, a personnel intrusion recognition task, an intelligent switch cabinet task, a meter hand recognition task, and a seat belt recognition task; the power distribution task includes at least one of a second pole tower collapse recognition task, a smoking recognition task, a safety helmet recognition task, a safety fence recognition task, a phone call recognition task, and a personnel fall recognition task.
[0022] In a second aspect, the present application further provides a GPU resource allocation device, the device comprising:
[0023] A receiving module, used for receiving a task to be processed, wherein the task to be processed carries an amount of GPU resources to be consumed;
[0024] A target GPU card determination module is used to determine a target GPU card corresponding to the amount of GPU resources to be consumed based on the available resources of each GPU card;
[0025] A process generation module, used to generate a target process corresponding to the target GPU card, and assign the to-be-processed task to the target process;
[0026] The update module is used to update the available GPU resource amount corresponding to the target GPU card.
[0027] In a third aspect, the present application further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method in any one of the above-mentioned embodiments when executing the computer program.
[0028] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method in any one of the above-mentioned embodiments.
[0029] In a fifth aspect, the present application also provides a computer program product, including a computer program, which implements the steps of the method in any one of the above-mentioned embodiments when executed by a processor.
[0030] The above-mentioned GPU resource allocation method, device, computer equipment, storage medium and computer program product manage tasks and resources separately. After receiving the task to be processed, the target GPU card corresponding to the GPU resource amount to be consumed of the task to be processed is determined based on the available resource amount of each GPU card, so that a target process corresponding to the target GPU card is generated, and after the task to be processed is allocated to the target process, the available GPU resource amount of the GPU card is updated, so that tasks and GPU resources are allocated only according to the available GPU resource amount. It is not limited to one GPU card that can only process one task. It can realize that multiple concurrent businesses to be processed share one physical GPU through multiple vGPUs. By using multiple processes to serve multiple tasks, it is avoided that a single process cannot effectively use CPU multi-cores, thereby improving the overall GPU resource utilization, which not only meets the computing power resource requirements of the artificial intelligence algorithm end, but also maximizes the GPU resource efficiency in the data center. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0032] Figure 1 A diagram of an application environment of a GPU resource allocation method in an embodiment;
[0033] Figure 2 A flowchart of a method for allocating GPU resources in one embodiment;
[0034] Figure 3 FIG. 4 is a block diagram of a power grid module in an embodiment.
[0035] Figure 4 FIG. 4 is a block diagram of a power transmission module in one embodiment.
[0036] Figure 5 FIG. 4 is a block diagram of a power transformation module in an embodiment.
[0037] Figure 6 FIG. 4 is a block diagram of a power distribution module in one embodiment.
[0038] Figure 7 The figure is a block diagram of a safety inspection module in one embodiment.
[0039] Figure 8 A block diagram of an AI processing module in one embodiment.
[0040] Fig. 9 A resource module block diagram in one embodiment;
[0041] Fig.10 A structural block diagram of a GPU resource allocation device in one embodiment;
[0042] Fig.11 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0044] The GPU resource allocation method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown, the artificial intelligence service provider 102 communicates with the GPU virtualization computing power enabling platform 104 through the network.
[0045] Among them, the artificial intelligence service provider 102 sends a task to be processed to the GPU virtualized computing power enabling platform 104. The GPU virtualized computing power enabling platform 104 receives the task to be processed, and then determines a target GPU card corresponding to the GPU resources to be consumed based on the available resource amounts of each GPU card; generates a target process corresponding to the target GPU card, and allocates the task to be processed to the target process; and updates the available GPU resource amount corresponding to the target GPU card. Thus, the allocation of tasks and GPU resources is performed only based on the available GPU resource amounts, without being limited to one GPU card being able to process only one task. It is possible to achieve multiple concurrent tasks to be processed sharing one physical GPU through multiple vGPUs, and use multiple processes to serve multiple tasks, thereby avoiding the situation where a single process cannot effectively utilize the multi-cores of the CPU, and improving the overall GPU resource utilization rate. This not only meets the requirements of the artificial intelligence algorithm side for computing power resources but also maximizes the effectiveness of GPU resources in the data center.
[0046] Among them, the artificial intelligence service provider 102 may include, but is not limited to, a power grid module end, a security inspection module end, and an AI processing module end. The GPU virtualized computing power enabling platform 104 may include a GPU card allocation end and a resource module, where the resource module includes at least one GPU card.
[0047] Among them, the GPU virtualized computing power enabling platform constructs a software-defined GPU resource pool, enabling the artificial intelligence service provider 102 to use elastic and scalable GPU resources. The GPU virtualized computing power enabling platform supports the separate deployment of AI loads and GPU resources. By using the setting method that combines the GPU virtualized computing power enabling platform and the resource module, the GPU utilization rate is improved. It supports slicing the GPU into vGPUs of any size, thereby allowing multiple AI load tasks to run in parallel and improving the utilization rate of the physical GPU; the comprehensive GPU utilization rate is increased by up to 3 to 5 times, and one card is equivalent to the effect of n cards; it supports the more efficient and reasonable use of GPU resources by separating the deployment of AI loads and GPU resources; the CPU and GPU resources are decoupled, and can be upgraded on demand and flexibly scheduled, which helps to maximize the value of the data center infrastructure; the GPU resources are uniformly managed, and a GPU resource management and scheduling strategy is provided; the performance of the GPU global resource pool is monitored, providing intuitive information such as resource utilization rate for operation and maintenance personnel; the GPU resources are elastically expandable, supporting the unified management of different GPU server types from a single unit to the entire data center, and easily achieving the horizontal expansion of the GPU resource pool.
[0048] In an exemplary embodiment, as Figure 2 shown, a GPU resource allocation method is provided. Taking the method being applied to the Figure 1 server as an example for illustration, it includes the following steps 202 to 208. Among them:
[0049] S202: Receive a task to be processed, where the task to be processed carries an amount of GPU resources to be consumed.
[0050] Among them, the pending tasks are pending AI tasks, and the pending tasks in the power grid may include but are not limited to pending tasks sent by the power grid module end, the safety inspection module end, and the AI processing module end.
[0051] In one of the optional embodiments, receiving tasks to be processed includes: receiving at least one of a power grid task, a safety inspection task and an AI processing task; wherein the power grid task includes at least one of a power output-related task, a substation task and a power distribution task, and the safety inspection task includes at least one of an intelligent equipment inspection task and an operation safety real-time analysis task; the AI processing task includes at least one of an AI training task and an AI reasoning task, and each task to be processed is a parallel task.
[0052] In one of the optional embodiments, the power output-related tasks include at least one of a first pole tower collapse recognition task, a mechanical engineering vehicle recognition task, a transmission line fault recognition task, a smoke and flame recognition task, a safety helmet recognition task, and a work clothes recognition task; the substation task includes at least one of a high-voltage disconnector status recognition task, a nameplate recognition task, a personnel intrusion recognition task, an intelligent switch cabinet task, a meter hand recognition task, and a seat belt recognition task; the power distribution task includes at least one of a second pole tower collapse recognition task, a smoking recognition task, a safety helmet recognition task, a safety fence recognition task, a phone call recognition task, and a personnel fall recognition task.
[0053] Among them, the power grid task is sent by the power grid module, the safety inspection task is sent by the safety inspection module, and the AI processing task is sent by the AI module.
[0054] Among them combined Figure 3 As shown, the power grid module end includes a transmission module, a transformation module and a distribution module; the transmission module is used to output electric power; the transformation module is used to change and unify the voltage; and the distribution module is used to distribute electricity to each user.
[0055] In one of the optional embodiments, in combination Figure 4As shown, the power transmission module includes a tower collapse recognition module, a mechanical engineering vehicle recognition module, a power transmission line fault recognition module, a smoke and flame recognition module, a safety helmet recognition module and a work clothes recognition module; the tower collapse recognition module is used to recognize the collapsed shape of the collapsed tower; the mechanical engineering vehicle recognition module is used to recognize the mechanical engineering vehicle; the power transmission line fault recognition module is used to recognize the part of the transmission line fault; the smoke and flame recognition module is used to recognize the smoke and flame at the transmission line fault; the safety helmet recognition module is used to recognize the worker's safety helmet; the work clothes recognition module is used to recognize the worker's work clothes.
[0056] In one of the optional embodiments, in combination Figure 5 As shown, the substation module includes a high-voltage isolating switch state identification module, a nameplate identification module, a personnel intrusion identification module, an intelligent switch cabinet module, a meter needle identification module and a seat belt identification module; the high-voltage isolating switch state identification module is used to identify the state of the high-voltage isolating switch; the nameplate identification module is used to identify the nameplates of various components; the personnel intrusion identification module is used to identify personnel intrusion; the intelligent switch cabinet module is used to control the switch of the power grid; the meter needle identification module is used to identify the meter needles used in the power grid; the seat belt identification module is used to identify the seat belt.
[0057] In one of the optional embodiments, in combination Figure 6 As shown, the power distribution module includes a tower collapse recognition module, a smoking recognition module, a helmet recognition module, a safety fence recognition module, a phone call recognition module and a person fall recognition module; the tower collapse recognition module is used to recognize the collapsed shape of the tower; the smoking recognition module is used to recognize the smoking heating; the helmet recognition module is used to recognize the worker's helmet; the safety fence recognition module is used to recognize the state and position of the safety fence; the phone call recognition module is used to identify the person making the phone call; the person fall recognition module is used to identify the fallen staff and alarm.
[0058] In one of the optional embodiments, in combination Figure 7 As shown, the safety inspection module includes an equipment intelligent inspection module and an operation safety real-time analysis module; the equipment intelligent inspection module is used to perform intelligent inspections and alarms on various power grid equipment; the operation safety real-time analysis module is used to perform real-time analysis on whether the power grid is safe.
[0059] In one of the optional embodiments, in combination Figure 8 As shown, the AI processing module includes an AI training module and an AI reasoning module; the AI training module is used for AI training; the AI reasoning module is used for AI reasoning.
[0060] Each of the above modules can generate corresponding tasks to be processed, and these tasks to be processed are executed by calling GPU resources. In this way, the generation modules of the tasks to be processed and the GPU resources are set separately and independently, so that the sharing of GPU resources can be realized.
[0061] S204: Based on the available resources of each GPU card, determine a target GPU card corresponding to the amount of GPU resources to be consumed.
[0062] Among them combined Fig. 9 As shown, the resource module includes a GPU resource module and a network resource module; the GPU resource module is used to store, process, and integrate GPU resources; the network resource module is used to store, process, and integrate network resources. This embodiment mainly focuses on the use of GPU resources.
[0063] In one of the optional embodiments, the GPU card is any one of GPU cards in a single-machine single-card mode, GPU cards in a single-machine multi-card mode, or GPU cards in a multi-machine multi-card mode.
[0064] In this embodiment, in the power grid artificial intelligence training scenario, the setting of GPU resources is mainly divided into two categories and three modes, namely: single-machine single card and single-machine multi-card application in single-machine scenario, and multi-machine multi-card application in multi-machine scenario. The GPU virtualization computing power empowerment platform can well meet the needs of different types and modes of AI applications for GPU computing power, allocate computing power resources on demand, and realize efficient use, scheduling and management of GPU resources.
[0065] In this embodiment, each GPU card can be managed independently in each mode, and the available resources of the GPU card can be obtained, where the available resources of the GPU card can be equal to the total resources of the GPU card minus the allocated resources, where the total resources corresponding to each GPU card can be the same or different, and no specific restrictions are made here.
[0066] In this embodiment, determining the target GPU card corresponding to the amount of GPU resources to be consumed may be determining a GPU card whose available resources are greater than or equal to the amount of GPU resources to be consumed as the target GPU card.
[0067] Optionally, the GPU virtualization computing power enabling platform can sort each GPU card based on the amount of available resources, so that the amount of available resources can be compared with the amount of GPU resources to be consumed in order from small to large, until a GPU card with an available resource amount greater than or equal to the amount of GPU resources to be consumed is obtained as the target GPU card.
[0068] S206: Generate a target process corresponding to the target GPU card, and assign the task to be processed to the target process.
[0069] Among them, the target GPU card can include multiple processes, each process corresponds to different tasks to be processed. After the target GPU card is determined, the target process is generated to assign the tasks to be processed to the target process, thereby realizing the superposition of multiple artificial intelligence application scenarios of the power grid on a GPU resource to run, verifying the virtualization efficiency and parallel computing effect. After on-demand allocation and calling, it can realize the sharing of limited GPU resources by multiple people, reduce GPU monopoly, and achieve a 3-5 times increase in the overall utilization of GPU resources, reduce resource monopoly, and allow AI algorithm engineers to have cards available to improve overall efficiency; and use the setting method of GPU virtualization computing power empowerment platform and resource module to verify the reasoning scenarios of various artificial intelligence applications in the power grid, including cotter pin recognition, six types of electricity business, meter counting recognition and other directional algorithms, through GPU computing power virtualization, resource pooling, on-demand calling, elastic segmentation and other technologies, to achieve reasoning performance improvement.
[0070] In this way, the GPU can be sliced into vGPUs of any size, allowing multiple AI tasks to run in parallel and improving the utilization of the physical GPU; the overall utilization of the GPU can be increased by up to 3 to 5 times, and one card is equivalent to the effect of n cards.
[0071] S208: Update the available GPU resource amount corresponding to the target GPU card.
[0072] After the task allocation is completed, the available GPU resources are updated. Specifically, the available GPU resources corresponding to the target GPU card are subtracted from the GPU resources to be consumed to obtain a new available GPU resource corresponding to the target GPU card.
[0073] The above-mentioned GPU resource allocation method manages tasks and resources separately. After receiving the task to be processed, the target GPU card corresponding to the GPU resource amount to be consumed of the task to be processed is determined based on the available resource amount of each GPU card, so as to generate a target process corresponding to the target GPU card, and after the task to be processed is allocated to the target process, the available GPU resource amount of the GPU card is updated, so that tasks and GPU resources are allocated only according to the available GPU resource amount. It is not limited to one GPU card that can only process one task, and multiple concurrent businesses to be processed can share one physical GPU through multiple vGPUs. By using multiple processes to serve multiple tasks, it is avoided that a single process cannot effectively use CPU multi-cores, thereby improving the overall GPU resource utilization, which not only meets the computing power resource requirements of the artificial intelligence algorithm end, but also maximizes the GPU resource efficiency in the data center.
[0074] In one of the optional embodiments, based on the available resource amount of each GPU card, determining the target GPU card corresponding to the GPU resource amount to be consumed includes: determining an available initial GPU card based on the type of task to be processed; traversing the available GPU resource amount of each initial GPU card in ascending order to obtain the target GPU card, wherein the available GPU resource amount of the target GPU card is greater than or equal to the GPU resource amount to be consumed; generating a target process corresponding to the target GPU card, including: when an existing process exists on the target GPU card, generating a target process in parallel with the existing process, the existing process being a process for processing other tasks.
[0075] Among them, each GPU card has a corresponding processing type, such as the power grid type, AI type, and security inspection type mentioned above, or it can be divided into more detailed types, such as transmission type, substation type, distribution type, etc. The definitions of various types can be found above. Figures 3 to 8 Modules in, no specific restrictions are made here. In this way, GPU cards are classified based on type, so that a task can be prevented from occupying a large amount of GPU card resources, resulting in other tasks being unable to be processed. In addition, it should be noted that the number of GPU cards corresponding to each task type can be determined based on the ratio of the historical processing volume of each type of task, so as to achieve balanced allocation of GPU cards, and the number of GPU cards corresponding to each task type can also be periodically dynamically modified so that the number of GPU cards corresponding to each task type meets the requirements. In addition, the redistribution of the number of GPU cards corresponding to each task type can also be passively triggered. For example, when there are no available GPU card resources for multiple allocations of a certain type of task, the redistribution of the number of GPU cards corresponding to each task type is triggered. The process of redistribution can be to obtain the number of GPU cards corresponding to each task type and the total remaining available resources of the GPU cards corresponding to each task type, obtain the ratio of the total remaining available resources to the total resources of the initial GPU card of the task type, and then obtain the task type with the largest ratio, and then allocate a certain number of GPU cards corresponding to the task type with the largest ratio to the task type that triggers the redistribution.
[0076] In this application, the initial GPU card is first determined based on the type of task to be processed, that is, the GPU card corresponding to the type of task to be processed is selected. The GPU cards can be sorted based on the available resource amount, so that the available resource amount can be compared with the GPU resource amount to be consumed in order from small to large, until a GPU card with an available resource amount greater than or equal to the GPU resource amount to be consumed is obtained as the target GPU card.
[0077] In one of the optional embodiments, the method also includes: receiving performance monitoring instructions; obtaining the available GPU resource amount corresponding to each GPU card based on the performance monitoring instructions, and calculating the resource utilization corresponding to each GPU card based on the available GPU resource amount; and outputting the resource utilization of each GPU card.
[0078] In this embodiment, GPU global resource pool performance monitoring provides intuitive resource utilization information for operation and maintenance personnel; GPU resource elastic expansion supports unified management of different GPU server types from a single unit to the entire data center, and easily realizes horizontal expansion of the GPU resource pool. CPU and GPU resources are decoupled, upgraded on demand, and flexibly scheduled, which helps to maximize the value of data center infrastructure; GPU resources are uniformly managed and GPU resource management scheduling strategies are provided.
[0079] This application uses a high-efficiency AI virtualization computing power empowerment platform to achieve GPU computing for each GPU resource call, and uses an independent Linux process for management. When multiple tasks share the GPU, for example, multiple concurrent AI services share a physical GPU through multiple vGPUs, multiple processes are used to serve multiple tasks, thereby avoiding the inability to effectively use CPU multi-cores using a single process, thereby improving the overall GPU resource utilization, which not only meets the computing power resource requirements of the artificial intelligence algorithm end, but also maximizes the efficiency of GPU resources in the data center; elastic scaling and expansion of computing resources, virtual machines and containers achieve good cloud-based elastic scaling and expansion functions in CPU, storage, etc.; a software-defined GPU resource pool is built through the GPU virtualization computing power empowerment platform, so that artificial intelligence business parties can use elastically scalable GPU resources efficiently, conveniently and safely, support the separate deployment of AI loads and GPU resources, use GPU resources more efficiently and reasonably, decouple CPU and GPU resources, upgrade on demand, and flexibly schedule, which helps to maximize the value of data center infrastructure.
[0080] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0081] Based on the same inventive concept, the embodiment of the present application also provides a GPU resource allocation device for implementing the GPU resource allocation method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more GPU resource allocation device embodiments provided below can refer to the limitations of the GPU resource allocation method above, and will not be repeated here.
[0082] In an exemplary embodiment, Fig.10 As shown, a GPU resource allocation device is provided, comprising: a receiving module 1001, a target GPU card determination module 1002, a process generation module 1003 and an update module 1004, wherein:
[0083] A receiving module 1001 is used to receive a task to be processed, where the task to be processed carries the amount of GPU resources to be consumed;
[0084] The target GPU card determination module 1002 is used to determine the target GPU card corresponding to the amount of GPU resources to be consumed based on the available resources of each GPU card;
[0085] The process generation module 1003 is used to generate a target process corresponding to the target GPU card and assign the task to be processed to the target process;
[0086] The updating module 1004 is used to update the available GPU resource amount corresponding to the target GPU card.
[0087] In one of the optional embodiments, the target GPU card determination module 1002 is specifically used to determine an available initial GPU card based on the type of task to be processed; the target GPU cards are traversed in order from small to large according to the available GPU resource amount of each initial GPU card, wherein the available GPU resource amount of the target GPU card is greater than or equal to the GPU resource amount to be consumed; the process generation module 1003 is specifically used to generate a target process in parallel with the existing process when an existing process exists on the target GPU card, and the existing process is a process for processing other tasks.
[0088] In one of the optional embodiments, the above-mentioned device also includes: a performance monitoring module, which is specifically used to receive performance monitoring instructions; obtain the available GPU resource amount corresponding to each GPU card based on the performance monitoring instructions, and calculate the resource utilization rate corresponding to each GPU card based on the available GPU resource amount; and output the resource utilization rate of each GPU card.
[0089] In one of the optional embodiments, the GPU card is any one of GPU cards in a single-machine single-card mode, GPU cards in a single-machine multi-card mode, or GPU cards in a multi-machine multi-card mode.
[0090] In one of the optional embodiments, the above-mentioned receiving module 1001 is specifically used to receive at least one of a power grid task, a safety inspection task and an AI processing task; wherein the power grid task includes at least one of a power output-related task, a substation task and a power distribution task, and the safety inspection task includes at least one of an intelligent equipment inspection task and an operation safety real-time analysis task; the AI processing task includes at least one of an AI training task and an AI reasoning task, and each task to be processed is a parallel task.
[0091] In one of the optional embodiments, the power output-related tasks include at least one of a first pole tower collapse recognition task, a mechanical engineering vehicle recognition task, a transmission line fault recognition task, a smoke and flame recognition task, a safety helmet recognition task, and a work clothes recognition task; the substation task includes at least one of a high-voltage disconnector status recognition task, a nameplate recognition task, a personnel intrusion recognition task, an intelligent switch cabinet task, a meter hand recognition task, and a seat belt recognition task; the power distribution task includes at least one of a second pole tower collapse recognition task, a smoking recognition task, a safety helmet recognition task, a safety fence recognition task, a phone call recognition task, and a personnel fall recognition task.
[0092] Each module in the above GPU resource allocation device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0093] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Fig.11 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a GPU resource allocation method is implemented.
[0094] Those skilled in the art will understand that Fig.11The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0095] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the following steps when executing the computer program: receiving a task to be processed, wherein the task to be processed carries an amount of GPU resources to be consumed; determining a target GPU card corresponding to the amount of GPU resources to be consumed based on the available resources of each GPU card; generating a target process corresponding to the target GPU card, and assigning the task to be processed to the target process; and updating the amount of available GPU resources corresponding to the target GPU card.
[0096] In one embodiment, the method implemented by the processor when executing a computer program to determine a target GPU card corresponding to the amount of GPU resources to be consumed based on the amount of available resources of each GPU card includes: determining an available initial GPU card based on the type of task to be processed; traversing the available GPU resources of each initial GPU card in ascending order to obtain the target GPU card, wherein the available GPU resources of the target GPU card are greater than or equal to the amount of GPU resources to be consumed;
[0097] The generation of a target process corresponding to a target GPU card implemented by the processor when executing a computer program includes: when an existing process exists on the target GPU card, generating a target process in parallel with the existing process, where the existing process is a process for processing other tasks.
[0098] In one embodiment, when the processor executes the computer program, the following steps are also implemented: receiving a performance monitoring instruction; obtaining the available GPU resource amount corresponding to each GPU card based on the performance monitoring instruction, and calculating the resource utilization rate corresponding to each GPU card based on each available GPU resource amount; and outputting the resource utilization rate of each GPU card.
[0099] In one embodiment, the GPU cards involved when the processor executes the computer program are any one of GPU cards in a single-machine single-card mode, GPU cards in a single-machine multi-card mode, or GPU cards in a multi-machine multi-card mode.
[0100] In one embodiment, the receiving of tasks to be processed implemented when the processor executes a computer program includes: receiving at least one of a power grid task, a safety inspection task, and an AI processing task; wherein the power grid task includes at least one of a power output-related task, a substation task, and a power distribution task, and the safety inspection task includes at least one of an intelligent equipment inspection task and an operation safety real-time analysis task; the AI processing task includes at least one of an AI training task and an AI reasoning task, and each task to be processed is a parallel task.
[0101] In one embodiment, the power output-related tasks involved when the processor executes the computer program include at least one of the first pole tower collapse recognition task, the mechanical engineering vehicle recognition task, the transmission line fault recognition task, the smoke and flame recognition task, the safety helmet recognition task and the work clothes recognition task; the substation task includes at least one of the high-voltage disconnector status recognition task, the nameplate recognition task, the personnel intrusion recognition task, the intelligent switch cabinet task, the meter hand recognition task and the safety belt recognition task; the power distribution task includes at least one of the second pole tower collapse recognition task, the smoking recognition task, the safety helmet recognition task, the safety fence recognition task, the phone call recognition task and the personnel fall recognition task.
[0102] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: receiving a task to be processed, the task to be processed carrying an amount of GPU resources to be consumed; determining a target GPU card corresponding to the amount of GPU resources to be consumed based on the available resources of each GPU card; generating a target process corresponding to the target GPU card, and assigning the task to be processed to the target process; and updating the available GPU resources corresponding to the target GPU card.
[0103] In one embodiment, the method implemented when a computer program is executed by a processor is to determine a target GPU card corresponding to the amount of GPU resources to be consumed based on the amount of available resources of each GPU card, including: determining an available initial GPU card based on a type of task to be processed; traversing the available GPU resources of each initial GPU card in order from small to large to obtain a target GPU card, wherein the amount of available GPU resources of the target GPU card is greater than or equal to the amount of GPU resources to be consumed; the method implemented when the computer program is executed by the processor is to generate a target process corresponding to the target GPU card, including: when an existing process exists on the target GPU card, generating a target process in parallel with the existing process, wherein the existing process is a process for processing other tasks.
[0104] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: receiving performance monitoring instructions; obtaining the available GPU resource amount corresponding to each GPU card based on the performance monitoring instructions, and calculating the resource utilization rate corresponding to each GPU card based on each available GPU resource amount; and outputting the resource utilization rate of each GPU card.
[0105] In one embodiment, the GPU cards involved when the computer program is executed by the processor are any one of GPU cards in a single-machine single-card mode, GPU cards in a single-machine multi-card mode, or GPU cards in a multi-machine multi-card mode.
[0106] In one embodiment, the receiving of tasks to be processed implemented when the computer program is executed by the processor includes: receiving at least one of a power grid task, a safety inspection task and an AI processing task; wherein the power grid task includes at least one of a power output-related task, a substation task and a distribution task, and the safety inspection task includes at least one of an intelligent equipment inspection task and an operation safety real-time analysis task; the AI processing task includes at least one of an AI training task and an AI reasoning task, and each task to be processed is a parallel task.
[0107] In one embodiment, the power output-related tasks involved when the computer program is executed by the processor include at least one of a first pole tower collapse recognition task, a mechanical engineering vehicle recognition task, a transmission line fault recognition task, a smoke and flame recognition task, a safety helmet recognition task, and a work clothes recognition task; the substation task includes at least one of a high-voltage disconnector status recognition task, a nameplate recognition task, a personnel intrusion recognition task, an intelligent switch cabinet task, a meter needle recognition task, and a seat belt recognition task; the power distribution task includes at least one of a second pole tower collapse recognition task, a smoking recognition task, a safety helmet recognition task, a safety fence recognition task, a phone call recognition task, and a personnel fall recognition task.
[0108] In one embodiment, a computer program product is provided, including a computer program, which, when executed by a processor, implements the following steps: receiving a task to be processed, the task to be processed carrying an amount of GPU resources to be consumed; determining a target GPU card corresponding to the amount of GPU resources to be consumed based on the available resources of each GPU card; generating a target process corresponding to the target GPU card, and assigning the task to be processed to the target process; and updating the available GPU resources corresponding to the target GPU card.
[0109] In one embodiment, the method implemented when a computer program is executed by a processor is to determine a target GPU card corresponding to the amount of GPU resources to be consumed based on the amount of available resources of each GPU card, including: determining an available initial GPU card based on a type of task to be processed; traversing the available GPU resources of each initial GPU card in order from small to large to obtain a target GPU card, wherein the amount of available GPU resources of the target GPU card is greater than or equal to the amount of GPU resources to be consumed; the method implemented when the computer program is executed by the processor is to generate a target process corresponding to the target GPU card, including: when an existing process exists on the target GPU card, generating a target process in parallel with the existing process, wherein the existing process is a process for processing other tasks.
[0110] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: receiving performance monitoring instructions; obtaining the available GPU resource amount corresponding to each GPU card based on the performance monitoring instructions, and calculating the resource utilization rate corresponding to each GPU card based on each available GPU resource amount; and outputting the resource utilization rate of each GPU card.
[0111] In one embodiment, the GPU cards involved when the computer program is executed by the processor are any one of GPU cards in a single-machine single-card mode, GPU cards in a single-machine multi-card mode, or GPU cards in a multi-machine multi-card mode.
[0112] In one embodiment, the receiving of tasks to be processed implemented when the computer program is executed by the processor includes: receiving at least one of a power grid task, a safety inspection task and an AI processing task; wherein the power grid task includes at least one of a power output-related task, a substation task and a distribution task, and the safety inspection task includes at least one of an intelligent equipment inspection task and an operation safety real-time analysis task; the AI processing task includes at least one of an AI training task and an AI reasoning task, and each task to be processed is a parallel task.
[0113] In one embodiment, the power output-related tasks involved when the computer program is executed by the processor include at least one of a first pole tower collapse recognition task, a mechanical engineering vehicle recognition task, a transmission line fault recognition task, a smoke and flame recognition task, a safety helmet recognition task, and a work clothes recognition task; the substation task includes at least one of a high-voltage disconnector status recognition task, a nameplate recognition task, a personnel intrusion recognition task, an intelligent switch cabinet task, a meter needle recognition task, and a seat belt recognition task; the power distribution task includes at least one of a second pole tower collapse recognition task, a smoking recognition task, a safety helmet recognition task, a safety fence recognition task, a phone call recognition task, and a personnel fall recognition task.
[0114] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0115] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0116] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A GPU resource allocation method, It is characterized in that The method comprises: Receive a task to be processed, wherein the task to be processed carries an amount of GPU resources to be consumed; Based on the available resources of each GPU card, determining a target GPU card corresponding to the amount of GPU resources to be consumed; Generate a target process corresponding to the target GPU card, and assign the task to be processed to the target process; Update the available GPU resource amount corresponding to the target GPU card.
2. The method according to claim 1, It is characterized in that The step of determining a target GPU card corresponding to the amount of GPU resources to be consumed based on the available resources of each GPU card includes: Determine an available initial GPU card based on the type of task to be processed; According to the order of the available GPU resources of each of the initial GPU cards from small to large, traverse in sequence to obtain the target GPU cards, wherein the available GPU resources of the target GPU card are greater than or equal to the GPU resources to be consumed; The generating a target process corresponding to the target GPU card includes: When an existing process exists on the target GPU card, a target process is generated in parallel with the existing process, and the existing process is a process for processing other tasks.
3. The method according to claim 1, It is characterized in that The method further comprises: receiving performance monitoring instructions; Obtaining the available GPU resource amount corresponding to each of the GPU cards based on the performance monitoring instruction, and calculating the resource utilization rate corresponding to each of the GPU cards based on the available GPU resource amount; Output the resource utilization of each GPU card.
4. The method according to any one of claims 1 to 3, It is characterized in that The GPU card is any one of each GPU card in a single-machine single-card mode, each GPU card in a single-machine multi-card mode, or each GPU card in a multi-machine multi-card mode.
5. The method according to any one of claims 1 to 3, It is characterized in that The receiving of tasks to be processed comprises: Receive at least one of a power grid task, a safety inspection task and an AI processing task; wherein the power grid task includes at least one of a power output-related task, a substation task and a power distribution task, and the safety inspection task includes at least one of an intelligent equipment inspection task and an operation safety real-time analysis task; the AI processing task includes at least one of an AI training task and an AI reasoning task, and each of the tasks to be processed is a parallel task.
6. The method according to claim 5, It is characterized in that The power output-related tasks include at least one of the first pole tower collapse recognition task, the mechanical engineering vehicle recognition task, the transmission line fault recognition task, the smoke and flame recognition task, the safety helmet recognition task and the work clothes recognition task; the substation tasks include at least one of the high-voltage disconnector status recognition task, the nameplate recognition task, the personnel intrusion recognition task, the intelligent switch cabinet task, the meter hand recognition task and the seat belt recognition task; the power distribution tasks include at least one of the second pole tower collapse recognition task, the smoking recognition task, the safety helmet recognition task, the safety fence recognition task, the phone call recognition task and the personnel fall recognition task.
7. A GPU resource allocation device, It is characterized in that The device comprises: A receiving module, used for receiving a task to be processed, wherein the task to be processed carries an amount of GPU resources to be consumed; A target GPU card determination module is used to determine a target GPU card corresponding to the amount of GPU resources to be consumed based on the available resources of each GPU card; A process generation module, used to generate a target process corresponding to the target GPU card, and assign the to-be-processed task to the target process; The update module is used to update the available GPU resource amount corresponding to the target GPU card.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Cited By
Performance optimization method and system, and computer program product and storage medium
WO2026166200A1
