Methods, apparatus and storage media for handling resource consumption of GPUs
By monitoring and comparing GPU resource operation paths with preset strategies, invalid task occupation is released in real time, solving the problem of ineffective GPU resource utilization and improving GPU processing efficiency.
Patent Information
- Application Number
- CN202111492786.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-08
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2041-12-08
AI Technical Summary
GPU resources are used up quickly and efficiently, especially when errors occur during task processing, resources are not used effectively, resulting in a decrease in overall processing efficiency.
By monitoring the creation, invocation, and deletion of GPU resources, real-time monitoring data is generated to determine the differences between the resource processing path and the preset strategy, and to release resources occupied by invalid tasks.
Accurately identifying and releasing invalid resource usage improves GPU resource utilization and processing efficiency.
Smart Images

Figure CN114153700B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data analysis technology, and in particular to a method, apparatus and storage medium for handling resource usage in GPUs. Background Technology
[0002] A graphics processing unit (GPU), also known as a display core, visual processor, or display chip, is a microprocessor specifically designed for performing image and graphics-related calculations on personal computers, workstations, game consoles, and some mobile devices (such as tablets and smartphones).
[0003] When a GPU is working, the more tasks it processes, the higher its resource utilization will be. The higher the resource utilization of the GPU, the slower it will be when processing tasks. Therefore, it is necessary to adjust the GPU's resource utilization in a timely manner according to the GPU's working conditions so that the GPU can work normally and quickly.
[0004] When a GPU is working, its resources are occupied in two ways. One is normal resource utilization, which means that when processing a large number of tasks, the GPU's resource utilization will be high. The other is that when the GPU is working, due to task processing errors, some tasks cannot be processed normally, but these tasks that cannot be processed normally still occupy the GPU's resources, making the GPU's resource utilization artificially high. In other words, the GPU's resources are not fully used for the correct task processing level, which reduces the overall processing efficiency of the GPU. Summary of the Invention
[0005] This invention provides a method, apparatus, and storage medium for handling GPU resource usage. It can determine whether there is inefficient or meaningless resource usage in the GPU based on the user's operation on the GPU, thereby saving GPU resource usage and improving the processing efficiency of GPU-based processing flows.
[0006] A first aspect of this invention provides a resource usage handling method suitable for GPUs, comprising:
[0007] A monitoring strategy for GPU resources is pre-configured, and the resource processing path of the monitoring strategy is sequentially: creating resources, calling resources, and deleting resources.
[0008] Real-time monitoring of the control channel between the user and the GPU generates monitoring data;
[0009] If the processing path of any resource in the monitoring data is different from the resource processing path of the monitoring strategy, then the target task corresponding to that resource is selected.
[0010] Release the GPU resources occupied by the target task.
[0011] Optionally, in one possible implementation of the first aspect, real-time monitoring of the control channel between the user and the GPU to generate monitoring data includes:
[0012] A resource occupancy record table is pre-set, which contains a unique resource identifier for each occupied resource;
[0013] The control information in the control channel between the user and the GPU is monitored in real time. The control information is any operation performed on the GPU, such as creating resources, calling resources, or deleting resources.
[0014] The resource usage record table is updated in real time based on user operations such as creating, retrieving, and deleting resources on the GPU.
[0015] Optionally, in one possible implementation of the first aspect, determining that the processing path of any resource in the monitoring data is different from the resource processing path of the monitoring strategy, and then selecting the target task corresponding to that resource, includes:
[0016] Get the previous operation corresponding to each resource in the resource occupancy record table. The previous operation is any one of the operations of creating a resource, calling a resource, or deleting a resource.
[0017] Obtain the current operation corresponding to any resource in the monitoring data. If the current operation and previous operation of the same resource do not meet the resource processing path, then select the target task corresponding to that resource.
[0018] Optionally, in one possible implementation of the first aspect, obtaining the current operation corresponding to any resource in the monitoring data, determining that the current operation and previous operation of the same resource do not satisfy the resource processing path, and then selecting the target task corresponding to that resource includes:
[0019] The current operation corresponding to the first resource in the monitoring data is to create a resource;
[0020] If the previous operation corresponding to the first resource in the resource occupancy record table is any one of creating a resource, calling a resource, or deleting a resource, then it is determined that the current operation and the previous operation of the first resource do not satisfy the resource processing path, and the target task corresponding to the first resource is selected.
[0021] Releasing GPU resources occupied by the target task includes:
[0022] The first resource corresponding to the target task is released.
[0023] Optionally, in one possible implementation of the first aspect, it also includes:
[0024] The current operation corresponding to the first resource in the monitoring data is to create a resource;
[0025] If the previous operation corresponding to the first resource in the resource occupancy record table is not any of the following: create resource, call resource, or delete resource, then it is determined that the current operation and the previous operation of the first resource satisfy the resource processing path, and the GPU executes the operation of calling the resource.
[0026] Update the previous operation of the first resource in the resource occupancy record table at the current moment, so that the current operation creates the resource as the previous operation.
[0027] Optionally, in one possible implementation of the first aspect, obtaining the current operation corresponding to any resource in the monitoring data, determining that the current operation and previous operation of the same resource do not satisfy the resource processing path, and then selecting the target task corresponding to that resource includes:
[0028] The current operation corresponding to the first resource in the monitoring data is to call the resource;
[0029] If the previous operation corresponding to the first resource in the resource occupancy record table is either calling the resource or deleting the resource, then it is determined that the current operation and the previous operation of the first resource do not satisfy the resource processing path, and the target task corresponding to the first resource is selected.
[0030] Releasing GPU resources occupied by the target task includes:
[0031] The first resource corresponding to the target task is released.
[0032] Optionally, in one possible implementation of the first aspect, it also includes:
[0033] The current operation corresponding to the first resource in the monitoring data is to call the resource;
[0034] If the previous operation corresponding to the first resource in the resource occupancy record table is not either calling or deleting the resource, then it is determined that the current operation and the previous operation of the first resource satisfy the resource processing path, and the GPU executes the operation of calling the resource.
[0035] Update the previous operation of the first resource in the resource occupancy record table at the current moment, so that the resource called by the current operation becomes the previous operation.
[0036] Optionally, in one possible implementation of the first aspect, it also includes:
[0037] If the current operation corresponding to the first resource in the monitoring data is to delete the resource, then the first resource corresponding to the target task will be released.
[0038] A second aspect of the present invention provides a resource utilization processing apparatus suitable for GPUs, comprising:
[0039] The configuration module is used to pre-configure the monitoring strategy for resources at the GPU. The resource processing path of the monitoring strategy is, in sequence, to create resources, call resources, and delete resources.
[0040] The monitoring module is used to monitor the control channel between the user and the GPU in real time and generate monitoring data.
[0041] The judgment module is used to determine if the processing path of any resource in the monitoring data is different from the resource processing path of the monitoring strategy, and then select the target task corresponding to that resource.
[0042] The processing module is used to release the GPU resources occupied by the target task.
[0043] A third aspect of the present invention provides a readable storage medium storing a computer program, which, when executed by a processor, is used to implement the methods of the first aspect of the present invention and various possible designs of the first aspect.
[0044] This invention provides a method, apparatus, and storage medium for handling GPU resource usage. It can acquire real-time monitoring data of user operations on the GPU, determine whether inefficient or meaningless resource usage occurs based on this data, and monitor according to a preset resource processing path during the judgment process. This method accurately detects inefficient and meaningless resource usage, enabling the invention to precisely pinpoint such usage, thereby effectively saving GPU resource utilization, improving the processing efficiency of GPU-based processing flows, and optimizing the GPU. Attached Figure Description
[0045] Figure 1 A flowchart illustrating a first implementation of a resource occupancy handling method applicable to GPUs;
[0046] Figure 2 A flowchart illustrating a second implementation of a resource occupancy handling method applicable to GPUs;
[0047] Figure 3 This is a structural diagram of a first embodiment of a resource utilization processing device suitable for GPUs. Detailed Implementation
[0048] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0049] The terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in sequences other than those illustrated or described herein.
[0050] It should be understood that in the various embodiments of the present invention, the sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0051] It should be understood that in this invention, "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, for example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to such process, method, product, or device.
[0052] It should be understood that in this invention, "multiple" refers to two or more. "And / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "Contains A, B, and C", "Contains A, B, and C" means that all three A, B, and C are contained; "Contains A, B, or C" means that one of A, B, and C is contained; "Contains A, B, and / or C" means that any one, two, or three of A, B, and C are contained.
[0053] It should be understood that in this invention, "B corresponding to A", "B corresponding to A", "A and B correspond", or "B and A correspond" means that B is associated with A, and B can be determined based on A. Determining B based on A does not mean determining B solely based on A; B can also be determined based on A and / or other information. Matching A and B is defined as a similarity between A and B that is greater than or equal to a preset threshold.
[0054] Depending on the context, "if" as used here can be interpreted as "when," "when," "in response to determination," or "in response to detection."
[0055] The technical solution of the present invention will be described in detail below with reference to specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0056] When performing image processing using a GPU, the user sends operation commands to the GPU. These commands can include creating, retrieving, and deleting resources. The scope of resource creation is determined by the size of the task to be processed; for example, a user needing to process a large amount of data will require more resources to create on the GPU. Generally, the user first creates resources on the GPU as needed, then retrieves those resources for task processing, and finally deletes the created resources after processing. This process of creating, retrieving, and deleting resources constitutes the normal GPU resource utilization process. Therefore, when the GPU resource utilization path involves creating, retrieving, and deleting resources, the resource usage is correct, and the task being processed by the occupied resources is normal. Based on this scenario, this invention provides a resource usage handling method suitable for GPUs.
[0057] This invention provides a method for handling resource consumption in GPUs, such as... Figure 1 As shown, it includes:
[0058] Step S110: Pre-configure a monitoring strategy for GPU resources. The resource processing paths of the monitoring strategy are, in sequence, creating resources, calling resources, and deleting resources. This invention pre-sets a monitoring strategy, which corresponds to a resource processing path. The resource processing path is the path for creating resources, calling resources, and deleting resources; that is, the GPU resources under this path are resources for processing normal, effective tasks.
[0059] Step S120: Real-time monitoring of the control channel between the user and the GPU to generate monitoring data. This invention performs real-time monitoring of the control channel between the user and the GPU. The user outputs different operations to the GPU through the control channel, and the different operations output by the user are monitored in real-time to generate monitoring data.
[0060] The technical solution provided by this invention, such as Figure 2 As shown, step S120 specifically includes:
[0061] Step S1201: Pre-set a resource occupancy record table, wherein the resource occupancy record table contains a unique resource identifier for each occupied resource. This invention pre-sets a resource occupancy record table to record the resource occupancy and usage of the GPU. The unique resource identifier can be a resource ID, such as 001, 002, etc., where each resource identifier corresponds to a unique resource. For the same resource, the user may perform three operations: the first operation is to create a resource, i.e., create a corresponding resource based on the existing resources of the GPU; the second operation is to call a resource, i.e., call a corresponding resource according to the task; the third operation is to delete a resource, i.e., release the corresponding resource after the created resource has completed its task. This invention pre-sets a resource occupancy record table, the purpose of which is to record the operation status of each resource.
[0062] Step S1202: Real-time monitoring of control information in the control channel between the user and the GPU. This control information includes any one of the following operations on the GPU: creating resources, retrieving resources, or deleting resources. This invention monitors the control information in the control channel between the user and the GPU in real time, determining the user's operation behavior based on the different user actions. The operation behavior and control information are any one of the following operations on the GPU: creating resources, retrieving resources, or deleting resources. Generally, at any given time, a user will only perform one type of operation.
[0063] Step S1203: Update the resource usage record table in real time based on the user's operations of creating, accessing, and deleting resources on the GPU. The technical solution provided by this invention monitors user operations in real time and updates the record table accordingly. This ensures that the operations corresponding to each resource are up-to-date at any given moment, leading to more accurate subsequent assessments of whether user operations have encountered problems.
[0064] Step S130: If the processing path of any resource in the monitoring data is different from the resource processing path of the monitoring strategy, then the target task corresponding to that resource is selected. This invention compares the processing path of any resource in the monitoring data with the resource processing path of the monitoring strategy. If the processing path of the resource is different from the resource processing path of the monitoring strategy, then the target task corresponding to that resource is selected. At this time, it is considered that the resource corresponding to the target task may be subject to invalid processing or invalid usage.
[0065] Step S140: Release the GPU resources occupied by the target task. After determining the resources corresponding to the target task, this invention releases the GPU resources occupied by the target task, allowing invalid resource usage to be locked and released, thereby improving the resource utilization rate of GPU resources.
[0066] The technical solution provided by this invention includes step S130, which specifically includes:
[0067] The system retrieves the previous operation corresponding to each resource in the resource occupancy record table. The previous operation can be any one of the following: creating a resource, accessing a resource, or deleting a resource. If no previous operation corresponding to a resource in the resource occupancy record table can be retrieved, the current operation is considered to be creating a resource. This invention retrieves the previous operation corresponding to each resource in the resource occupancy record table.
[0068] The system retrieves the current operation corresponding to any resource from the monitoring data. If the current operation and previous operations for the same resource do not satisfy the resource processing path, then the target task corresponding to that resource is selected. There can be multiple current operations, such as creating a resource, accessing a resource, and deleting a resource.
[0069] In one possible implementation, the current operation corresponding to any resource in the monitoring data is obtained. If it is determined that the current operation and previous operation of the same resource do not satisfy the resource processing path, then the target task corresponding to that resource is selected, including:
[0070] The current operation corresponding to the first resource in the monitoring data is "create resource". When the current operation corresponding to the first resource is "create resource", it proves that this operation is the user's first creation of a resource in the GPU. At this time, the processing path corresponding to the first resource is "create resource".
[0071] If the previous operation corresponding to the first resource in the resource occupancy record table is any one of creating a resource, calling a resource, or deleting a resource, then it is determined that the current operation and the previous operation of the first resource do not satisfy the resource processing path, and the target task corresponding to the first resource is selected. This invention determines the previous operation corresponding to the first resource based on the resource occupancy record table. When the previous operation is any one of creating a resource, calling a resource, or deleting a resource, it proves that the processing path of the first resource may be one of creating a resource-creating a resource, calling a resource-creating a resource, deleting a resource-creating a resource, etc. Therefore, the processing path of the first resource is different from the resource processing path, and it is considered that the processing path of the first resource does not satisfy the resource processing path.
[0072] Releasing GPU resources occupied by the target task includes:
[0073] The first resource corresponding to the target task is released. When the processing path of the first resource does not meet the resource processing path, the present invention will release the first resource corresponding to the target task. The above method can achieve the purpose of releasing the first resource when the current operation is to create a resource and the processing path does not meet the resource processing path.
[0074] In one possible implementation, it also includes:
[0075] The current operation corresponding to the first resource in the monitoring data is "create resource". When the current operation corresponding to the first resource is "create resource", it proves that this operation is the user's first creation of a resource in the GPU. At this time, the processing path corresponding to the first resource is "create resource".
[0076] If the previous operation corresponding to the first resource in the resource occupancy record table is not any of the following (creating, calling, or deleting resources), then the current operation and the previous operation of the first resource satisfy the resource processing path, and the GPU executes the operation of calling the resource. If the previous operation is not any of the following (creating, calling, or deleting resources), then the previous operation is considered to be no operation.
[0077] At the current moment, the previous operation of the first resource in the resource occupancy record table is updated so that the current operation of creating the resource becomes the previous operation. At this time, if the processing path is to create the resource and satisfy the resource processing path, then the resource occupancy record table needs to be updated, that is, the previous operation corresponding to the first resource needs to be updated, so that when the first resource is operated on next time, the corresponding previous operation can be retrieved.
[0078] In one possible implementation, the current operation corresponding to any resource in the monitoring data is obtained. If it is determined that the current operation and previous operation of the same resource do not satisfy the resource processing path, then the target task corresponding to that resource is selected, including:
[0079] The current operation corresponding to the first resource in the monitoring data is resource invocation. When the current operation corresponding to the first resource is resource invocation, it proves that the operation is the user invoking a resource created in the GPU. In this case, the processing path corresponding to the first resource is resource creation - resource invocation.
[0080] If the previous operation corresponding to the first resource in the resource occupancy record table is either "resource call" or "resource deletion," then it is determined that the current operation and the previous operation of the first resource do not satisfy the resource processing path, and the target task corresponding to the first resource is selected. This invention determines the previous operation corresponding to the first resource based on the resource occupancy record table. When the previous operation is either "resource call" or "resource deletion," it proves that the processing path of the first resource may be "resource call-resource call," "resource deletion-resource call," etc. Therefore, the processing path of the first resource is different from the resource processing path, and it is considered that the processing path of the first resource does not satisfy the resource processing path.
[0081] It should be noted that the resource call in this invention will have a time limit, that is, each resource call may be 1 hour, 2 hours, etc. When the preset time is exceeded and the resource call operation is continued, it is considered that a new resource call operation has been performed. At this time, the resource processing path is not satisfied, and it can be considered that the resource call has exceeded the time limit.
[0082] Releasing GPU resources occupied by the target task includes:
[0083] The first resource corresponding to the target task is released. When the processing path of the first resource does not meet the resource processing path, the present invention will release the first resource corresponding to the target task. The above method can achieve the purpose of releasing the first resource when the processing path does not meet the resource processing path when the current operation is to call the resource.
[0084] In one possible implementation, it also includes:
[0085] The current operation corresponding to the first resource in the monitoring data is resource invocation. When the current operation corresponding to the first resource is resource invocation, it proves that the operation is the user invoking a resource initially created in the GPU. In this case, the processing path corresponding to the first resource is resource creation - resource invocation.
[0086] If the previous operation corresponding to the first resource in the resource occupancy record table is not either calling or deleting a resource, then the current operation and the previous operation of the first resource satisfy the resource processing path, and the GPU executes the operation of calling the resource. When the previous operation is not either calling or deleting a resource, it is considered that the previous operation is creating a resource. Since there is a resource calling operation, there will be no situation where there is no operation. Therefore, this invention will assume that when the previous operation of calling a resource is not either calling or deleting a resource, its previous operation is creating a resource.
[0087] At the current moment, the previous operation of the first resource in the resource occupancy record table is updated so that the resource called by the current operation becomes the previous operation. At this time, the processing path is resource creation - resource call, which satisfies the resource processing path. Therefore, the resource occupancy record table needs to be updated, that is, the previous operation corresponding to the first resource needs to be updated, so that when the first resource is operated on next time, the corresponding previous operation can be called.
[0088] In one possible implementation, it also includes:
[0089] If the current operation corresponding to the first resource in the monitoring data is "delete resource," then the first resource corresponding to the target task is released. The technical solution of this invention, when the current operation corresponding to the first resource in the monitoring data is "delete resource," does not retrieve previous operations from the resource occupancy record table, directly determining to release the first resource. This method effectively improves the efficiency of resource release, enabling efficient utilization of GPU resources.
[0090] To better implement the method provided by the technical solution of the present invention, the present invention also provides a resource usage processing device suitable for GPUs.
[0091] The technical solution of the present invention also provides a resource consumption processing device suitable for GPUs, such as... Figure 3 As shown, it includes:
[0092] The configuration module is used to pre-configure the monitoring strategy for resources at the GPU. The resource processing path of the monitoring strategy is, in sequence, to create resources, call resources, and delete resources.
[0093] The monitoring module is used to monitor the control channel between the user and the GPU in real time and generate monitoring data.
[0094] The judgment module is used to determine if the processing path of any resource in the monitoring data is different from the resource processing path of the monitoring strategy, and then select the target task corresponding to that resource.
[0095] The processing module is used to release the GPU resources occupied by the target task.
[0096] The readable storage medium can be a computer storage medium or a communication medium. A communication medium includes any medium that facilitates the transfer of computer programs from one location to another. A computer storage medium can be any available medium accessible to a general-purpose or special-purpose computer. For example, a readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application-Specific Integrated Circuit (ASIC). Alternatively, the ASIC can be located in a user equipment. Of course, the processor and the readable storage medium can also exist as discrete components in a communication device. The readable storage medium can be a read-only memory (ROM), random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0097] The present invention also provides a program product including executable instructions stored in a readable storage medium. At least one processor of the device can read the executable instructions from the readable storage medium, and the at least one processor executes the executable instructions to cause the device to implement the methods provided in the various embodiments described above.
[0098] In the above-described terminal or server embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly manifested as execution by a hardware processor, or execution by a combination of hardware and software modules within the processor.
[0099] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for handling resource consumption in GPUs, characterized in that, include: A monitoring strategy for GPU resources is pre-configured, and the resource processing path of the monitoring strategy is sequentially: creating resources, calling resources, and deleting resources. Real-time monitoring of the control channel between the user and the GPU generates monitoring data; If the processing path of any resource in the monitoring data differs from the resource processing path of the monitoring strategy, then the target task corresponding to that resource is selected, including: Get the previous operation corresponding to each resource in the resource occupancy record table. The previous operation is any one of the operations of creating a resource, calling a resource, or deleting a resource. Get the current operation corresponding to any resource in the monitoring data. If the current operation and the previous operation of the same resource do not meet the resource processing path, then select the target task corresponding to the resource. Release the GPU resources occupied by the target task.
2. The resource usage handling method for GPUs according to claim 1, characterized in that, Real-time monitoring of the control channel between the user and the GPU generates monitoring data, including: A resource occupancy record table is pre-set, which contains a unique resource identifier for each occupied resource; The control information in the control channel between the user and the GPU is monitored in real time. The control information is any operation performed on the GPU, such as creating resources, calling resources, or deleting resources. The resource usage record table is updated in real time based on user operations such as creating, retrieving, and deleting resources on the GPU.
3. The resource usage handling method for GPUs according to claim 1, characterized in that, Retrieve the current operation corresponding to any resource in the monitoring data. Determine if the current operation and previous operation of the same resource do not satisfy the resource processing path. Then select the target task corresponding to that resource, including: The current operation corresponding to the first resource in the monitoring data is to create a resource; If the previous operation corresponding to the first resource in the resource occupancy record table is any one of creating a resource, calling a resource, or deleting a resource, then it is determined that the current operation and the previous operation of the first resource do not satisfy the resource processing path, and the target task corresponding to the first resource is selected. Releasing GPU resources occupied by the target task includes: The first resource corresponding to the target task is released.
4. The resource usage handling method for GPUs according to claim 1, characterized in that, Also includes: The current operation corresponding to the first resource in the monitoring data is to create a resource; If the previous operation corresponding to the first resource in the resource occupancy record table is not any of the following: create resource, call resource, or delete resource, then it is determined that the current operation and the previous operation of the first resource satisfy the resource processing path, and the GPU executes the operation of calling the resource. Update the previous operation of the first resource in the resource occupancy record table at the current moment, so that the current operation creates the resource as the previous operation.
5. The resource usage handling method for GPUs according to claim 1, characterized in that, Retrieve the current operation corresponding to any resource in the monitoring data. Determine if the current operation and previous operation of the same resource do not satisfy the resource processing path. Then select the target task corresponding to that resource, including: The current operation corresponding to the first resource in the monitoring data is to call the resource; If the previous operation corresponding to the first resource in the resource occupancy record table is either calling the resource or deleting the resource, then it is determined that the current operation and the previous operation of the first resource do not satisfy the resource processing path, and the target task corresponding to the first resource is selected. Releasing GPU resources occupied by the target task includes: The first resource corresponding to the target task is released.
6. The resource usage handling method for GPUs according to claim 1, characterized in that, Also includes: The current operation corresponding to the first resource in the monitoring data is to call the resource; If the previous operation corresponding to the first resource in the resource occupancy record table is not either calling or deleting the resource, then it is determined that the current operation and the previous operation of the first resource satisfy the resource processing path, and the GPU executes the operation of calling the resource. Update the previous operation of the first resource in the resource occupancy record table at the current moment, so that the resource called by the current operation becomes the previous operation.
7. The resource usage handling method for GPUs according to claim 1, characterized in that, Also includes: If the current operation corresponding to the first resource in the monitoring data is to delete the resource, then the first resource corresponding to the target task will be released.
8. A resource utilization processing device suitable for GPUs, characterized in that, include: The configuration module is used to pre-configure the monitoring strategy for resources at the GPU. The resource processing path of the monitoring strategy is, in sequence, to create resources, call resources, and delete resources. The monitoring module is used to monitor the control channel between the user and the GPU in real time and generate monitoring data. The judgment module is used to determine if the processing path of any resource in the monitoring data differs from the resource processing path of the monitoring strategy, and then select the target task corresponding to that resource. Get the previous operation corresponding to each resource in the resource occupancy record table. The previous operation is any one of the operations of creating a resource, calling a resource, or deleting a resource. Get the current operation corresponding to any resource in the monitoring data. If the current operation and the previous operation of the same resource do not meet the resource processing path, then select the target task corresponding to the resource. The processing module is used to release the GPU resources occupied by the target task.
9. A readable storage medium, characterized in that, The readable storage medium stores a computer program, which, when executed by a processor, is used to implement the method described in any one of claims 1 to 7.
Citation Information
Patent Citations
Resource management method and device
CN110162407A
Container resource adjustment method and device in container cluster
CN112783608A