Method, system, device and medium for using GPU resources
By starting the container during the deep learning development process and calling GPU resources only when the user application actually uses the GPU, the waste problem caused by the exclusive use of GPU resources is solved, the pooling and efficient utilization of GPU resources is realized, and the GPU of the cluster is improved. Resource utilization.
Patent Information
- Application Number
- CN202210722305.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-24
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2042-06-24
AI Technical Summary
In the process of deep learning development, GPU resources are often used exclusively during containerization development, resulting in the inability of many applications to utilize GPU resources when resources are limited, resulting in a waste of resources.
By starting the container, the GPU resources are mounted with the client, and the GPU resources are called only when the user application actually uses the GPU. The built-in optimization strategy is used for secondary scheduling to achieve pooling and efficient utilization of GPU resources.
It solves the problem of long-term idleness caused by the exclusive use of GPU resources. It realizes that GPU resources are only called when the user application actually uses the GPU, and does not monopolize GPU resources in other cases, maximizing the utilization of available GPU resources in the cluster.
Smart Images

Figure CN115114022B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of server technology, and in particular to a method, system, device and medium for using GPU resources. Background Art
[0002] Artificial intelligence services have been widely implemented, and massive amounts of business data need to be analyzed and used as training materials for AI business updates. More and more deep learning services have been deployed on Kubernetes, and how to improve efficiency by optimizing Kubernetes components to improve hardware device utilization and efficient scheduling strategies has become one of the important research topics in the industry.
[0003] With the substantial increase in computing power and the widespread implementation of artificial intelligence services, different types of high-performance devices have appeared in data centers to meet the different computing needs of artificial intelligence services, such as using GPUs (Graphic Processing Units) to meet training requirements.
[0004] In the process of deep learning development, especially in the early stages of development, developers are more focused on code construction and model building. In this process, GPU resources are almost not needed. GPU resources are only used when executing user training and debugging codes. Especially on NVIDIA (a graphics card) GPU devices, CUDA (Compute Unified Device Architecture) calls are almost always used to complete the corresponding GPU computing resource usage. However, in the actual containerized development process and use, many GPU resources are used exclusively. Therefore, when resources are limited, many applications that actually need GPU resources cannot use GPU resources, resulting in a waste of GPU resources. Summary of the invention
[0005] In view of this, the present invention proposes a method, system, device and medium for using GPU resources, which realizes that GPU resources are called only when the user application actually uses GPU computing resources. In other cases, GPU resources are not monopolized, so that GPU resources can be pooled and reserved to the greatest extent. Once an application calls GPU resources, CUDA messages are acquired and forwarded for execution through a specific client, so that GPU resources can be used. By analyzing the call of the user application to the GPU, and then performing secondary scheduling of its GPU call process through a client with a built-in optimization strategy, the application can call GPU resources only when the GPU is actually used, thereby achieving the use of GPU resources on an as-needed basis, maximizing the available GPU resources of the cluster and reducing idle GPU resources.
[0006] Based on the above purpose, an embodiment of the present invention provides a method for using GPU resources, which specifically includes the following steps:
[0007] Start the container, mount the first resource, GPU resource and client to the container in sequence, and establish a training framework in the container;
[0008] Based on the client obtaining a CUDA call request from the training framework and forwarding the CUDA call request to the global server, the training framework is placed in a stopped state;
[0009] Based on the global server, the GPU resource usage information of the server cluster is obtained to forward the CUDA call request to the corresponding local server, and based on the client, the training framework is put into operation;
[0010] The training task is executed based on the corresponding GPU resource called by the local server, and the calculation result is returned to the global server and the training framework after the execution of the training task is completed.
[0011] In some implementations, mounting the first resource, the GPU resource, and the client in the container in sequence, and establishing a training framework in the container includes:
[0012] Mounting a first resource on the container and establishing a training framework in the container, wherein the first resource includes CPU resources, memory resources, and disk resources;
[0013] Acquire a user's usage mode of the GPU resource, and mount the GPU resource to the container based on the user's usage mode of the GPU resource;
[0014] Mount the client on the container.
[0015] In some implementations, obtaining a CUDA call request from the training framework based on the client and forwarding the CUDA call request to the global server includes:
[0016] In response to the user training process of the training framework needing to use GPU resources, the client obtains the CUDA call request from the user training process and forwards the CUDA call request to the global server.
[0017] In some implementations, after the training task is executed, returning the calculation result to the global server and the training framework includes:
[0018] After the training task is executed, the calculation result is returned to the global server, and the calculation result is sent to the training framework based on the global server.
[0019] In some embodiments, after sending the calculation result to the training framework, the method further comprises:
[0020] In response to the training framework receiving the calculation result, ending the user training process based on the training framework, and sending a GPU resource release message to the global server based on the client;
[0021] The global server receives the GPU resource release message, sends a GPU resource use end message to the local server, and updates the GPU use information.
[0022] In some implementations, mounting the GPU resource to the container based on the user's usage of the GPU resource includes:
[0023] In response to the user needing to use physical GPU resources, directly mounting the corresponding GPU resources to the container;
[0024] In response to the user not needing to use the physical GPU, the dynamic library file corresponding to the corresponding GPU resource is hijacked, and the corresponding GPU resource and the dynamic library file corresponding to the corresponding GPU resource are mounted to the container together.
[0025] In some implementations, acquiring GPU resource usage information of a server cluster based on the global server to forward the CUDA call request to a corresponding local server includes:
[0026] Obtaining GPU usage information of each server node in the server cluster based on the global server, and forwarding the CUDA call request to a corresponding local server based on the GPU usage information and a scheduling strategy;
[0027] The scheduling strategy includes: scheduling the training task to the corresponding GPU based on the matching of the GPU resources required for the training task and the remaining GPU resources of each server node;
[0028] The training framework includes: any one of TensorFlow and PyTorch.
[0029] Another aspect of the embodiment of the present invention further provides a system for using GPU resources, including:
[0030] A mounting module, wherein the mounting module is configured to start a container, mount the first resource, the GPU resource, and the client to the container in sequence, and establish a training framework in the container;
[0031] A first forwarding module, wherein the first forwarding module is configured to obtain a CUDA call request from the training framework based on the client and forward the CUDA call request to the global server, and put the training framework into a stopped state;
[0032] A second forwarding module, wherein the second forwarding module obtains GPU resource usage information of a server cluster based on the global server to forward the CUDA call request to a corresponding local server, and puts the training framework into a running state based on the client;
[0033] A calling module, wherein the calling module is configured to call the corresponding GPU resources based on the local server to execute the training task, and return the calculation result to the global server and the training framework after the execution of the training task is completed.
[0034] According to another aspect of an embodiment of the present invention, a computer device is provided, comprising: at least one processor; and a memory, wherein the memory stores a computer program executable on the processor, and the computer program implements the steps of the above method when executed by the processor.
[0035] According to another aspect of the embodiments of the present invention, a computer-readable storage medium is provided, which stores a computer program that implements the above method steps when executed by a processor.
[0036] The present invention has at least the following beneficial technical effects: by starting a container, the first resource, the GPU resource and the client are mounted in the container in sequence, and a training framework is established in the container; based on the client, a CUDA call request is obtained from the training framework and the CUDA call request is forwarded to the global server, and the training framework is placed in a stopped state; based on the global server, the GPU resource usage information of the server cluster is obtained to forward the CUDA call request to the corresponding local server, and the training framework is placed in a running state based on the client; based on the local server, the corresponding GPU resource is called to execute the training task, and after the execution of the training task, the calculation result is returned to the global server and the training framework, which solves the problem of long-term resource idleness during the exclusive use of the GPU by the server, and realizes that the GPU resources are called only when the user application actually uses the GPU computing resources, and in other cases, the GPU resources are not monopolized; and by placing all the GPU resources of the cluster in a unified resource pool for scheduling and use, the pooling and efficient utilization of GPU resources are realized. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other embodiments can be obtained based on these drawings without paying creative work.
[0038] Figure 1 A block diagram of an embodiment of a method for using GPU resources provided by the present invention;
[0039] Figure 2 A schematic diagram of an embodiment of using a GPU via CUDA in a Tensorflow training framework;
[0040] Figure 3 A schematic diagram of a flow chart of an embodiment of calling GPU resources and executing training tasks provided by the present invention;
[0041] Figure 4 A schematic diagram of a flow chart of an embodiment of information transmission based on a client, a global server and a local server provided by the present invention;
[0042] Figure 5 A schematic diagram of an embodiment of a system for using GPU resources provided by the present invention;
[0043] Figure 6 A schematic diagram of the structure of an embodiment of a computer device provided by the present invention;
[0044] Figure 7 A schematic diagram of the structure of an embodiment of a computer-readable storage medium provided by the present invention. DETAILED DESCRIPTION
[0045] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the embodiments of the present invention are further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0046] It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are for distinguishing two non-identical entities with the same name or non-identical parameters. It can be seen that "first" and "second" are only for the convenience of expression and should not be understood as limitations on the embodiments of the present invention. The subsequent embodiments will not explain this one by one.
[0047] Based on the above purpose, the first aspect of the embodiments of the present invention provides an embodiment of a method for using GPU resources. Figure 1 As shown, it includes the following steps:
[0048] S10, start the container, mount the first resource, GPU resource and client to the container in sequence, and establish a training framework in the container;
[0049] S20, based on the client obtaining a CUDA call request from the training framework and forwarding the CUDA call request to the global server, and putting the training framework into a stopped state;
[0050] S30, based on the global server, obtaining the GPU resource usage information of the server cluster to forward the CUDA call request to the corresponding local server, and based on the client, putting the training framework into a running state;
[0051] S40, calling the corresponding GPU resources based on the local server to execute the training task, and returning the calculation result to the global server and the training framework after the execution of the training task is completed.
[0052] First, CUDA and the execution process of CUDA calling GPU resources are explained.
[0053] CUDA is a general-purpose parallel computing architecture launched by NVIDIA. It is a parallel computing platform and programming model. The CUDA architecture consists of a host and a device; the host refers to the traditional CPU, while the device refers to a processor with a large number of arithmetic units, usually a GPU. Heterogeneous computing platforms based on CPU+GPU can complement each other's strengths. The CPU is responsible for processing logically complex serial programs, while the GPU is responsible for processing data-intensive parallel computing programs, thereby maximizing efficiency. When a kernel is loaded, the kernel will be executed simultaneously by a large number of threads of CUDA devices, a collection of which can be called a block of threads, and blocks can be aggregated into a grid.
[0054] A CUDA device has only one global memory space. The first prerequisite for loading kernels and generating a large number of device threads for calculation is to copy the required data from the host to the device memory. Once the calculation is completed, the results must be copied back in the opposite direction. The execution flow of a typical CUDA program is as follows:
[0055] 1) Allocate host memory and initialize data;
[0056] 2) Allocate device memory and copy data from the host to the device;
[0057] 3) Call the CUDA kernel function to complete the specified operation on the device;
[0058] 4) Copy the calculation results on the device to the host;
[0059] 5) Release the memory allocated on the device and host.
[0060] GPU has many CUDA cores. Making full use of CUDA cores can give full play to the parallel computing capabilities of GPU. A core component of GPU hardware is SM (Streaming Multiprocessor). Figure 2 As shown in the figure, how the Tensorflow training framework uses the GPU through CUDA. Figure 2 In the training framework, the Core API in CUDA is used through Kernel to call CUDA core functions and use the GPU to perform training tasks.
[0061] Based on this, this embodiment uses two modules, namely the server (service) end as a resident daemon process on the server and the client (client) end mounted in the container, to achieve pooled use of GPU resources based on the server and client, reduce GPU resource fragmentation in the server cluster, and maximize GPU resource utilization. The specific process of how the client and server call GPU resources to perform training tasks is as follows:
[0062] When the user's training task in the container uses the GPU, the CUDA kernel is called through the CUDA-runtime API to use the GPU. The Client is used to obtain the CUDA-runtime API call message (i.e., CUDA call request) and pause the training framework to ensure that the training is in a normal state and does not fail unexpectedly due to the call to the GPU. When the CUDA call request is obtained, the Client forwards the obtained CUDA call request to the Server to wait for the Server to issue further instructions. When the training is completed, it also receives the message released by the training framework to the GPU and forwards it to the Server to update the GPU usage. The Server is divided into two types, Global server and local server. The functions of the two are as follows:
[0063] The global server is responsible for collecting and recording the GPU usage on each server node in the entire server cluster, and updating it when new GPUs are occupied and released;
[0064] The global server receives the CUDA call request sent by the client and forwards the CUDA call request to the local server of the specified node based on the current GPU usage in the cluster;
[0065] The local server is responsible for the actual CUDA function call, executes the training task on the specified node and GPU, and transmits the training results back to the global server and training framework.
[0066] The embodiment of the present invention starts a container, mounts the first resource, the GPU resource and the client to the container in sequence, and establishes a training framework in the container; obtains a CUDA call request from the training framework based on the client and forwards the CUDA call request to the global server, and puts the training framework in a stopped state; obtains the GPU resource usage information of the server cluster based on the global server to forward the CUDA call request to the corresponding local server, and puts the training framework in a running state based on the client; calls the corresponding GPU resource based on the local server to execute the training task, and returns the calculation result to the global server and the training framework after the execution of the training task is completed, thereby solving the problem of long-term resource idleness during the server's exclusive use of the GPU, and realizing that the GPU resources are called only when the user application actually uses the GPU computing resources. In other cases, the GPU resources are not monopolized, and all the GPU resources of the cluster are placed in a unified resource pool for scheduling and use, thereby realizing the pooling of GPU resources and efficient utilization.
[0067] In some implementations, mounting the first resource, the GPU resource, and the client in the container in sequence, and establishing a training framework in the container includes:
[0068] Mounting a first resource on the container and establishing a training framework in the container, wherein the first resource includes CPU resources, memory resources, and disk resources;
[0069] Acquire a user's usage mode of the GPU resource, and mount the GPU resource to the container based on the user's usage mode of the GPU resource;
[0070] Mount the client on the container.
[0071] In some implementations, obtaining a CUDA call request from the training framework based on the client and forwarding the CUDA call request to the global server includes:
[0072] In response to the user training process of the training framework needing to use GPU resources, the client obtains the CUDA call request from the user training process and forwards the CUDA call request to the global server.
[0073] In some implementations, after the training task is executed, returning the calculation result to the global server and the training framework includes:
[0074] After the training task is executed, the calculation result is returned to the global server, and the calculation result is sent to the training framework based on the global server.
[0075] In some embodiments, after sending the calculation result to the training framework, the method further comprises:
[0076] In response to the training framework receiving the calculation result, ending the user training process based on the training framework, and sending a GPU resource release message to the global server based on the client;
[0077] The global server receives the GPU resource release message, sends a GPU resource use end message to the local server, and updates the GPU use information.
[0078] In some implementations, mounting the GPU resource to the container based on the user's usage of the GPU resource includes:
[0079] In response to the user needing to use physical GPU resources, directly mounting the corresponding GPU resources to the container;
[0080] In response to the user not needing to use the physical GPU, the dynamic library file corresponding to the corresponding GPU resource is hijacked, and the corresponding GPU resource and the dynamic library file corresponding to the corresponding GPU resource are mounted to the container together.
[0081] In some implementations, acquiring GPU resource usage information of a server cluster based on the global server to forward the CUDA call request to a corresponding local server includes:
[0082] Obtaining GPU usage information of each server node in the server cluster based on the global server, and forwarding the CUDA call request to a corresponding local server based on the GPU usage information and a scheduling strategy;
[0083] The scheduling strategy includes: scheduling the training task to the corresponding GPU based on the matching of the GPU resources required for the training task and the remaining GPU resources of each server node;
[0084] The training framework includes: any one of TensorFlow and PyTorch.
[0085] like Figure 3 As shown, it is a schematic diagram of an embodiment of calling GPU resources and executing training tasks provided by the present invention. Figure 4 As shown, it is a schematic diagram of information transmission among the client, the global server and the local server.
[0086] Combine the following Figure 3 and Figure 4 The specific implementation of the present invention is described by means of another specific embodiment.
[0087] 1) The user container is started, and then CPU, memory, disk and other resources are mounted;
[0088] 2) Perform different GPU resource mounting actions based on different ways of using GPU resources by users:
[0089] a) If physical GPU resources are used, directly mount the GPU resources to the container;
[0090] b) If a virtual GPU is used, the dynamic library file that queries the GPU resource usage is hijacked, and the dynamic library file and the GPU resources are mounted to the container together, so as to achieve the purpose of not monopolizing the use of GPU resources;
[0091] 3) When the user training process uses GPU resources, the client forwards the obtained CUDA call request to the Global Server, and at the same time stops the framework training state and waits for subsequent start instructions to start the training state again;
[0092] 4) The Global Server forwards the CUDA call request to the specific Local Server based on the current GPU usage and scheduling strategy of the cluster;
[0093] 5) The Local Server calls the real GPU to calculate the training task according to the received specific function, and returns the calculation results to the Global Server and the training framework;
[0094] 6) When the user's training process calculation is completed and a GPU release message is sent, the Global server sends a message indicating that the GPU resource usage has ended and updates the GPU usage information in the Global server.
[0095] Through the above embodiments, it is achieved that GPU resources are called only when user applications actually use GPU computing resources, and GPU resources are not monopolized in other cases; and by placing all GPU resources of the cluster in a unified resource pool for scheduling and use, the pooling and efficient utilization of GPU resources are achieved.
[0096] Based on the same inventive concept, according to another aspect of the present invention, Figure 5 As shown, an embodiment of the present invention further provides a system for using GPU resources, including:
[0097] A mounting module 110, wherein the mounting module 110 is configured to start a container, sequentially mount the first resource, the GPU resource, and the client to the container, and establish a training framework in the container;
[0098] A first forwarding module 120, wherein the first forwarding module 120 is configured to obtain a CUDA call request from the training framework based on the client and forward the CUDA call request to the global server, and put the training framework into a stopped state;
[0099] A second forwarding module 130, wherein the second forwarding module 130 obtains GPU resource usage information of a server cluster based on the global server to forward the CUDA call request to a corresponding local server, and puts the training framework into a running state based on the client;
[0100] The calling module 140 is configured to call the corresponding GPU resources based on the local server to execute the training task, and return the calculation results to the global server and the training framework after the training task is completed.
[0101] Based on the same inventive concept, according to another aspect of the present invention, Figure 6 As shown, an embodiment of the present invention further provides a computer device 30, which includes a processor 310 and a memory 320. The memory 320 stores a computer program 321 that can be run on the processor. When the processor 310 executes the program, the steps of the above method are performed.
[0102] The memory, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions / modules corresponding to the method for using GPU resources in the embodiment of the present application. The processor executes various functional applications and data processing of the device by running the non-volatile software programs, instructions and modules stored in the memory, that is, the method for using GPU resources in the above method embodiment is implemented.
[0103] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the device, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the local module via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0104] Based on the same inventive concept, according to another aspect of the present invention, Figure 7 As shown, an embodiment of the present invention further provides a computer-readable storage medium 40, which stores a computer program 410 for executing the above method when executed by a processor.
[0105] Finally, it should be noted that a person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium of the program can be a disk, an optical disk, a read-only storage memory (ROM) or a random access memory (RAM), etc. The above-mentioned computer program embodiments can achieve the same or similar effects as the corresponding above-mentioned arbitrary method embodiments.
[0106] It will also be appreciated by those skilled in the art that various exemplary logic blocks, modules, circuits and algorithm steps described in conjunction with the disclosure herein can be implemented as electronic hardware, computer software or a combination of the two. In order to clearly illustrate this interchangeability of hardware and software, a general description has been given to the functions of various schematic components, blocks, modules, circuits and steps. Whether this function is implemented as software or hardware depends on specific applications and the design constraints imposed on the entire system. Those skilled in the art can implement the function in various ways for each specific application, but this implementation decision should not be interpreted as causing a departure from the disclosed scope of the embodiments of the present invention.
[0107] The above are exemplary embodiments disclosed in the present invention, but it should be noted that various changes and modifications may be made without departing from the scope of the embodiments disclosed in the claims. The functions, steps and / or actions of the method claims according to the disclosed embodiments described herein do not need to be performed in any particular order. The serial numbers of the embodiments disclosed in the above embodiments of the present invention are for description only and do not represent the advantages and disadvantages of the embodiments. In addition, although the elements disclosed in the embodiments of the present invention may be described or required in individual form, they may also be understood as multiple unless explicitly limited to the singular.
[0108] It should be understood that, as used herein, the singular forms "a", "an" are intended to include the plural forms as well, unless the context clearly supports an exception. It should also be understood that, as used herein, "and / or" refers to any and all possible combinations including one or more of the associated listed items.
[0109] A person skilled in the art should understand that the discussion of any of the above embodiments is only exemplary and is not intended to imply that the scope of the disclosure of the embodiments of the present invention (including the claims) is limited to these examples; under the concept of the embodiments of the present invention, the technical features in the above embodiments or different embodiments can also be combined, and there are many other changes in different aspects of the embodiments of the present invention as above, which are not provided in detail for the sake of simplicity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present invention should be included in the protection scope of the embodiments of the present invention.
Claims
1. A method for using GPU resources, characterized in that: include: Start the container, mount the first resource, GPU resource and client to the container in sequence, and establish a training framework in the container; Based on the client obtaining a CUDA call request from the training framework and forwarding the CUDA call request to the global server, the training framework is placed in a stopped state; Based on the global server, the GPU resource usage information of the server cluster is obtained to forward the CUDA call request to the corresponding local server, and based on the client, the training framework is put into operation; Calling the corresponding GPU resources based on the local server to execute the training task, and returning the calculation results to the global server and the training framework after the training task is completed; Mounting the first resource, GPU resource and client to the container in sequence, and establishing a training framework in the container includes: mounting the first resource to the container, and establishing a training framework in the container, wherein the first resource includes CPU resources, memory resources, and disk resources; obtaining the user's usage of the GPU resource, and mounting the GPU resource to the container based on the user's usage of the GPU resource; mounting the client to the container; Acquiring a CUDA call request from the training framework based on the client and forwarding the CUDA call request to the global server includes: in response to the user training process of the training framework requiring the use of GPU resources, acquiring the CUDA call request from the user training process based on the client and forwarding the CUDA call request to the global server; Mounting the GPU resources on the container based on the way the user uses the GPU resources includes: in response to the user needing to use physical GPU resources, directly mounting the corresponding GPU resources on the container; in response to the user not needing to use the physical GPU, hijacking the dynamic library files corresponding to the corresponding GPU resources, and mounting the corresponding GPU resources and their corresponding dynamic library files on the container together.
2. The method according to claim 1, characterized in that: After the training task is executed, returning the calculation result to the global server and the training framework includes: After the training task is executed, the calculation result is returned to the global server, and the calculation result is sent to the training framework based on the global server.
3. The method according to claim 2, characterized in that After sending the calculation result to the training framework, the method further comprises: In response to the training framework receiving the calculation result, ending the user training process based on the training framework, and sending a GPU resource release message to the global server based on the client; The global server receives the GPU resource release message, sends a GPU resource use end message to the local server, and updates the GPU use information.
4. The method according to claim 1, characterized in that: Acquiring GPU resource usage information of a server cluster based on the global server to forward the CUDA call request to the corresponding local server includes: Obtaining GPU usage information of each server node in the server cluster based on the global server, and forwarding the CUDA call request to a corresponding local server based on the GPU usage information and a scheduling strategy; The scheduling strategy includes: scheduling the training task to the corresponding GPU based on the matching of the GPU resources required for the training task and the remaining GPU resources of each server node; The training framework includes: any one of TensorFlow and PyTorch.
5. A system for using GPU resources, characterized in that: include: A mounting module, wherein the mounting module is configured to start a container, mount the first resource, the GPU resource, and the client to the container in sequence, and establish a training framework in the container; A first forwarding module, wherein the first forwarding module is configured to obtain a CUDA call request from the training framework based on the client and forward the CUDA call request to the global server, and put the training framework into a stopped state; A second forwarding module, wherein the second forwarding module obtains GPU resource usage information of a server cluster based on the global server to forward the CUDA call request to a corresponding local server, and puts the training framework into a running state based on the client; A calling module, wherein the calling module is configured to call the corresponding GPU resources based on the local server to execute the training task, and return the calculation result to the global server and the training framework after the execution of the training task is completed; Among them, the mounting module is also configured to mount the first resource on the container and establish a training framework in the container, wherein the first resource includes CPU resources, memory resources, and disk resources; obtain the user's usage of GPU resources, and mount the GPU resources on the container based on the user's usage of the GPU resources; mount the client on the container; mounting the GPU resources on the container based on the user's usage of the GPU resources includes: in response to the user needing to use physical GPU resources, directly mounting the corresponding GPU resources to the container; in response to the user not needing to use the physical GPU, hijacking the dynamic library files corresponding to the corresponding GPU resources, and mounting the corresponding GPU resources and their corresponding dynamic library files to the container together. The first forwarding module is also configured to, in response to the user training process of the training framework needing to use GPU resources, obtain the CUDA call request from the user training process based on the client and forward the CUDA call request to the global server.
6. A computer device comprising: at least one processor; as well as A memory storing a computer program executable on the processor, wherein the processor executes the steps of the method according to any one of claims 1 to 4 when executing the program.
7. A computer-readable storage medium storing a computer program, 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 4 are performed.
