GPU resource scheduling method and system for large model service
By dividing the GPU resource status and using Redis commands to achieve atomic locking and unlocking, the problem of insufficient GPU resources is solved, the deployment efficiency and success rate of large model services are improved, and the robustness and availability of the system are enhanced.
Patent Information
- Application Number
- CN202410962916.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-18
- Publication Date
- 2024-10-18
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When multiple large model services are deployed at the same time, GPU resources may be insufficient, resulting in model startup failure, affecting deployment efficiency and user experience.
By dividing the GPU resource status into three states: idle, locked, and execution, Redis's SET and DEL commands are used to realize atomic locking and unlocking of GPU resources, set the expiration time to prevent deadlock, and ensure the correctness and efficiency of resource allocation.
It improves the deployment efficiency and success rate of large model services, avoids waste of resources, and enhances the robustness and availability of the system.
Smart Images

Figure CN118796473A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a GPU resource scheduling method and system for large model services. Background Art
[0002] With the rapid development of artificial intelligence technology, large model services have been widely used in many fields such as medicine, finance, education, etc. These large model services usually need to be fine-tuned for specific application scenarios to meet specific needs in the field.
[0003] Therefore, users need to deploy multiple fine-tuned large model services to provide more accurate and effective solutions. However, in actual applications, when multiple large model services are deployed at the same time, the same GPU resources may be selected, resulting in insufficient GPU resources, which in turn causes the model to fail to start. This not only affects the deployment efficiency of the service, but may also lead to resource waste and a decline in user experience. Summary of the invention
[0004] The purpose of the present invention is to provide a GPU resource scheduling method and system for large model services to solve the problems raised in the above background technology.
[0005] To achieve the above object, the present invention provides the following technical solution: a GPU resource scheduling method for a large model service, the method comprising the following steps:
[0006] GPU resource state transition;
[0007] GPU resource locking: users create large model services that lock GPU resources;
[0008] GPU resources are unlocked, the startup service successfully locks part of the GPU resources, or the startup of the large model service is completed;
[0009] GPU resources are released. In the scenario where the large model service is automatically stopped after being successfully started, GPU resources are automatically released in the scenario where the large model service fails to start.
[0010] Preferably, the specific operations of GPU resource state conversion include:
[0011] The GPU resource status is divided into three states: idle, locked and executing;
[0012] To locked state: When the system receives the GPU resource selection result from the user to start the large model service, the idle GPU resources are marked with a lock and enter the locked state;
[0013] To the execution state: When all GPU resources required by the large model service are successfully locked, the system will allocate the locked GPU resources to start the large model service. After the service is started, the GPU resource lock mark will be released, and the GPU resources will be transferred to the execution state;
[0014] To idle state: When the large model service fails to start or stops, the GPU resources are released, and the GPU resources in the execution state will be directly converted to the idle state.
[0015] Preferably, the specific operations of GPU resource locking include:
[0016] Step 1: The user visits the large model service startup service page;
[0017] Step 2: Start the service to call the Agent interface of the machine where the GPU resources are located, query and obtain the list of GPU resources currently idle on the machine. This list is a list of GPU resources that are not occupied by other services, including the number, name, model, and video memory information;
[0018] Step 3: After obtaining the list of free GPU resources, the startup service queries the GPU resource lock status table through Redis. The status table contains the number of locked GPU resources, the locking time, and the validity period. The startup service filters out the locked GPU resources according to the GPU resource lock status table to obtain the list of available GPU resources. This list is a list of GPU resources that are not occupied by other services and are not locked, including the number, name, model, and video memory information;
[0019] Step 4: The startup service page displays a list of available GPU resources. The user selects a suitable resource from the list of available GPU resources, and the startup service obtains a list of GPU resource numbers selected by the user.
[0020] Step 5: Start the service to traverse the list of GPU resource numbers selected by the user, and use the Redis atomic operation SET command to lock the GPU resources specified by the user one by one, using the GPU resource number as the key, the time of executing the locking operation as the value, and setting the expiration time to 1 hour. When the SET command operation is successful, it indicates that the GPU resource is locked successfully. When all GPU resources are locked successfully, execute step 6; when a GPU resource fails to be locked, execute step 7;
[0021] Step 6: GPU resources are locked successfully, and the service is started. The large model service startup process is executed to start allocating GPU resources and start the large model service. If the large model service is successfully started, execute step 7. If the large model service fails to start, execute step 7.
[0022] Step 7: Call the GPU resource unlocking process;
[0023] Step 8: The large model service was started successfully, and the Start Service page shows that the startup was successful. The lock failed and the Enable Service page shows that the startup failed. Some GPU resources have been occupied. The Start Service failed to start, and the Enable Service page shows that the startup failed. Please check the large model service configuration.
[0024] Preferably, the specific operations of unlocking GPU resources include:
[0025] Step 1: Receive the GPU resource release call and parse the GPU number list parameter, which is the GPU resource to be unlocked;
[0026] Step 2: Traverse the list of GPU resources to be unlocked. The unlocking operation involves deleting the corresponding lock key in Redis to release the GPU resources. Use the Redis atomic operation DEL command to delete the lock mark of the specified GPU resources and unlock them one by one.
[0027] Preferably, the specific operations of releasing GPU resources include:
[0028] Step 1: When the user chooses to actively stop the large model service, the system obtains the UUID of the large model service;
[0029] Step 2: Based on the large model service UUID, call the Agent interface of the machine where the GPU resources are located, stop the related processes of the large model service, and release the related GPU resources;
[0030] Step 3: Return the Agent interface return value.
[0031] A GPU resource scheduling system for large model services, the system comprising a resource state conversion module, a resource locking module, a resource unlocking module and a resource releasing module;
[0032] Resource state conversion module, used for GPU resource state conversion;
[0033] Resource locking module, used for GPU resource locking. Users can create large model services to lock GPU resources.
[0034] Resource unlocking module, used for GPU resource unlocking, starting the service to successfully lock part of the GPU resources or the large model service startup is completed;
[0035] The resource release module is used to release GPU resources. The large model service is automatically stopped after it is successfully started. For the scenario where the large model service fails to start, GPU resources are automatically released.
[0036] Preferably, the resource state conversion module divides the GPU resource state into three states: idle, locked and executing;
[0037] To locked state: When the system receives the GPU resource selection result from the user to start the large model service, the idle GPU resources are marked with a lock and enter the locked state;
[0038] To the execution state: When all GPU resources required by the large model service are successfully locked, the system will allocate the locked GPU resources to start the large model service. After the service is started, the GPU resource lock mark will be released, and the GPU resources will be transferred to the execution state;
[0039] To idle state: When the large model service fails to start or stops, the GPU resources are released, and the GPU resources in the execution state will be directly converted to the idle state.
[0040] Preferably, the specific operations of the resource locking module include:
[0041] Step 1: The user visits the large model service startup service page;
[0042] Step 2: Start the service to call the Agent interface of the machine where the GPU resources are located, query and obtain the list of GPU resources currently idle on the machine. This list is a list of GPU resources that are not occupied by other services, including the number, name, model, and video memory information;
[0043] Step 3: After obtaining the list of free GPU resources, the startup service queries the GPU resource lock status table through Redis. The status table contains the number of locked GPU resources, the locking time, and the validity period. The startup service filters out the locked GPU resources according to the GPU resource lock status table to obtain the list of available GPU resources. This list is a list of GPU resources that are not occupied by other services and are not locked, including the number, name, model, and video memory information;
[0044] Step 4: The startup service page displays a list of available GPU resources. The user selects a suitable resource from the list of available GPU resources, and the startup service obtains a list of GPU resource numbers selected by the user.
[0045] Step 5: Start the service to traverse the list of GPU resource numbers selected by the user, and use the Redis atomic operation SET command to lock the GPU resources specified by the user one by one, using the GPU resource number as the key, the time of executing the locking operation as the value, and setting the expiration time to 1 hour. When the SET command operation is successful, it indicates that the GPU resource is locked successfully. When all GPU resources are locked successfully, execute step 6; when a GPU resource fails to be locked, execute step 7;
[0046] Step 6: GPU resources are locked successfully, and the service is started. The large model service startup process is executed to start allocating GPU resources and start the large model service. If the large model service is successfully started, execute step 7. If the large model service fails to start, execute step 7.
[0047] Step 7: Call the GPU resource unlocking process;
[0048] Step 8: The large model service was started successfully, and the Start Service page shows that the startup was successful. The lock failed and the Enable Service page shows that the startup failed. Some GPU resources have been occupied. The Start Service failed to start, and the Enable Service page shows that the startup failed. Please check the large model service configuration.
[0049] Preferably, the specific operations of the resource unlocking module include:
[0050] Step 1: Receive the GPU resource release call and parse the GPU number list parameter, which is the GPU resource to be unlocked;
[0051] Step 2: Traverse the list of GPU resources to be unlocked. The unlocking operation involves deleting the corresponding lock key in Redis to release the GPU resources. Use the Redis atomic operation DEL command to delete the lock mark of the specified GPU resources and unlock them one by one.
[0052] Preferably, the specific operations of the resource release module include:
[0053] Step 1: When the user chooses to actively stop the large model service, the system obtains the UUID of the large model service;
[0054] Step 2: Based on the large model service UUID, call the Agent interface of the machine where the GPU resources are located, stop the related processes of the large model service, and release the related GPU resources;
[0055] Step 3: Return the Agent interface return value.
[0056] Compared with the prior art, the present invention has the following beneficial effects:
[0057] The GPU resource scheduling method and system for large model services proposed in the present invention realize an efficient and reliable GPU resource locking mechanism by combining Redis's SET, DEL commands and expiration time settings. The SET command ensures the atomicity of resource locking and avoids concurrency conflicts; while the setting of the expiration time effectively prevents deadlock problems caused by service anomalies, and improves the robustness and availability of the system. At the same time, by querying the resource locking status table and filtering the locked GPUs, the correctness and efficiency of resource allocation are ensured. On the whole, this technical solution improves the deployment efficiency and success rate of fine-tuning large model services, and provides strong support for the development of artificial intelligence applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 is a flow chart of the method of the present invention;
[0059] Figure 2 This is a flow chart of GPU resource state conversion in the present invention;
[0060] Figure 3 This is a flowchart of GPU resource locking in the present invention;
[0061] Figure 4 The flowchart of GPU resource unlocking of the present invention;
[0062] Figure 5 This is a flowchart of GPU resource release according to the present invention. DETAILED DESCRIPTION
[0063] In order to make the purpose and technical solution of the present invention clearly and completely described, and the advantages more clearly understood, the embodiments of the present invention are further described in detail with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are part of the embodiments of the present invention, rather than all of the embodiments, and are only used to explain the embodiments of the present invention, and are not used to limit the embodiments of the present invention. All other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0064] Embodiment 1
[0065] See also Figures 1 to 5 The present invention provides a technical solution: a GPU resource scheduling method for a large model service, the method comprising the following steps:
[0066] 1. GPU resource state transition
[0067] The present invention divides the GPU resource status into three states: idle, locked and executed.
[0068] Idle state:
[0069] Definition: The GPU resource is not currently used by any large model service; and is not selected by the user to start a large model service.
[0070] Conversion relationship:
[0071] To locked state: When the system receives the GPU resource selection result from the user to start the large model service, the idle GPU resources are marked with a lock and enter the locked state.
[0072] Lock status:
[0073] Definition: GPU resources are not currently used by any large model service, but have been selected by the user to start a large model service. GPU resource allocation or GPU resource unlocking is performed based on the results of all GPU resource locking of the large model service.
[0074] Conversion relationship:
[0075] To the execution state: When all the GPU resources required by the large model service are successfully locked, the system will allocate the locked GPU resources to start the large model service. After startup, the GPU resource lock mark will be released, and the GPU resources will be transferred to the execution state.
[0076] Return to idle state: When all GPU resources required by the large model service are not fully locked, the system will unlock some of the successfully locked GPU resources, remove the lock mark, and wait for the next allocation.
[0077] Execution status:
[0078] Definition: GPU resources are being used to serve a large model and perform related tasks.
[0079] Conversion relationship:
[0080] To idle state: When the large model service fails to start or stops, the GPU resources will be released, and the GPU resources in the execution state will be directly converted to the idle state.
[0081] 2. GPU resource locking process
[0082] The present invention provides a complete GPU resource locking and large model service startup process, which is used for users to create large model services to lock GPU resources and avoid GPU resource conflicts. The process includes the following steps:
[0083] Step 1: The user visits the large model service startup service page
[0084] Step 2: Start the service to call the Agent interface of the machine where the GPU resources are located, query and obtain the list of GPU resources currently idle on the machine. This list is a list of GPU resources that are not occupied by other services, including number, name, model, video memory and other information.
[0085] Step 3: After obtaining the list of free GPU resources, the startup service queries the GPU resource lock status table through Redis. The status table contains the number of locked GPU resources, the locking time, the validity period, and other information. The startup service filters out the locked GPU resources according to the GPU resource lock status table to obtain a list of available GPU resources. This list is a list of GPU resources that are not occupied by other services and are not locked, including information such as number, name, model, and video memory.
[0086] Step 4: The startup service page displays a list of available GPU resources. The user selects a suitable resource from the list of available GPU resources, and the startup service obtains a list of GPU resource numbers selected by the user.
[0087] Step 5: Start the service to traverse the list of GPU resource numbers selected by the user, and use the Redis atomic operation SET command to lock the GPU resources specified by the user one by one, using the GPU resource number as the key, the time of the lock operation as the value, and setting the expiration time to 1 hour. When the SET command operation is successful, it indicates that the GPU resource is locked successfully. When all GPU resources are locked successfully, execute step 6. When a GPU resource fails to be locked, execute step 7.
[0088] Step 6: GPU resources are locked successfully, and the service is started. Execute the large model service startup process. Start allocating GPU resources and start the large model service. If the large model service is successfully started, proceed to step 7. If the large model service fails to start, proceed to step 7.
[0089] Step 7: Call the GPU resource unlocking process.
[0090] Step 8: The large model service is started successfully, and the Start Service page shows that the startup is successful. Locking failed. The Enable Service page shows that the startup failed. Some GPU resources are occupied. Start Service failed. The Enable Service page shows that the startup failed. Please check the large model service configuration.
[0091] 3. GPU resource unlocking process
[0092] The present invention provides a complete GPU resource unlocking process, which is used for the scenario where the startup service successfully locks part of the GPU resources or the startup of the large model service ends. The process includes the following steps:
[0093] Step 1: Receive the GPU resource release call and parse the GPU number list parameter, which is the GPU resource to be unlocked.
[0094] Step 2: Traverse the list of GPU resources to be unlocked. The unlocking operation involves deleting the corresponding lock key in Redis to release the GPU resources.
[0095] Use the Redis atomic operation DEL command to delete the lock mark of the specified GPU resources and unlock them one by one.
[0096] 4. GPU resource release process
[0097] The present invention provides a process for releasing GPU resources, which is used in the scenario where a large model service is automatically stopped after being successfully started. For the scenario where the large model service fails to start, the GPU resources are automatically released. The GPU resource release process includes the following steps:
[0098] Step 1: When the user chooses to actively stop the large model service, the system obtains the UUID of the large model service.
[0099] Step 2: Based on the large model service UUID, call the Agent interface of the machine where the GPU resources are located, stop the related processes of the large model service, and release the related GPU resources.
[0100] Step 3: Return the Agent interface return value.
[0101] Embodiment 2
[0102] Based on the first embodiment, a GPU resource scheduling system for large model services is proposed, the system consists of a resource state conversion module, a resource locking module, a resource unlocking module and a resource releasing module; the GPU resource state is divided into three states: idle, locked and executing;
[0103] To locked state: When the system receives the GPU resource selection result from the user to start the large model service, the idle GPU resources are marked with a lock and enter the locked state;
[0104] To the execution state: When all GPU resources required by the large model service are successfully locked, the system will allocate the locked GPU resources to start the large model service. After the service is started, the GPU resource lock mark will be released, and the GPU resources will be transferred to the execution state;
[0105] To idle state: When the large model service fails to start or stops, the GPU resources are released, and the GPU resources in the execution state will be directly converted to the idle state.
[0106] Resource state conversion module, used for GPU resource state conversion;
[0107] The resource locking module is used to lock GPU resources. Users can create large model services to lock GPU resources. Specific operations include:
[0108] Step 1: The user visits the large model service startup service page;
[0109] Step 2: Start the service to call the Agent interface of the machine where the GPU resources are located, query and obtain the list of GPU resources currently idle on the machine. This list is a list of GPU resources that are not occupied by other services, including the number, name, model, and video memory information;
[0110] Step 3: After obtaining the list of free GPU resources, the startup service queries the GPU resource lock status table through Redis. The status table contains the number of locked GPU resources, the locking time, and the validity period. The startup service filters out the locked GPU resources according to the GPU resource lock status table to obtain the list of available GPU resources. This list is a list of GPU resources that are not occupied by other services and are not locked, including the number, name, model, and video memory information;
[0111] Step 4: The startup service page displays a list of available GPU resources. The user selects a suitable resource from the list of available GPU resources, and the startup service obtains a list of GPU resource numbers selected by the user.
[0112] Step 5: Start the service to traverse the list of GPU resource numbers selected by the user, and use the Redis atomic operation SET command to lock the GPU resources specified by the user one by one, using the GPU resource number as the key, the time of executing the locking operation as the value, and setting the expiration time to 1 hour. When the SET command operation is successful, it indicates that the GPU resource is locked successfully. When all GPU resources are locked successfully, execute step 6; when a GPU resource fails to be locked, execute step 7;
[0113] Step 6: GPU resources are locked successfully, and the service is started. The large model service startup process is executed to start allocating GPU resources and start the large model service. If the large model service is successfully started, execute step 7. If the large model service fails to start, execute step 7.
[0114] Step 7: Call the GPU resource unlocking process;
[0115] Step 8: The large model service was started successfully, and the Start Service page shows that the startup was successful. The lock failed and the Enable Service page shows that the startup failed. Some GPU resources have been occupied. The Start Service failed to start, and the Enable Service page shows that the startup failed. Please check the large model service configuration.
[0116] The resource unlocking module is used to unlock GPU resources and start the service to lock some GPU resources successfully or when the large model service startup is completed. The specific operations include:
[0117] Step 1: Receive the GPU resource release call and parse the GPU number list parameter, which is the GPU resource to be unlocked;
[0118] Step 2: Traverse the list of GPU resources to be unlocked. The unlocking operation involves deleting the corresponding lock key in Redis to release the GPU resources. Use the Redis atomic operation DEL command to delete the lock mark of the specified GPU resources and unlock them one by one.
[0119] The resource release module is used to release GPU resources. In the scenario where the large model service is automatically stopped after being successfully started, the GPU resources are automatically released in the scenario where the large model service fails to start. The specific operations include:
[0120] Step 1: When the user chooses to actively stop the large model service, the system obtains the UUID of the large model service;
[0121] Step 2: Based on the large model service UUID, call the Agent interface of the machine where the GPU resources are located, stop the related processes of the large model service, and release the related GPU resources;
[0122] Step 3: Return the Agent interface return value.
[0123] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A GPU resource scheduling method for large model services, characterized in that: The method comprises the following steps: GPU resource state transition; GPU resource locking: users create large model services that lock GPU resources; GPU resources are unlocked, the startup service successfully locks part of the GPU resources, or the startup of the large model service is completed; GPU resources are released. In the scenario where the large model service is automatically stopped after being successfully started, GPU resources are automatically released in the scenario where the large model service fails to start.
2. The GPU resource scheduling method for a large model service according to claim 1, characterized in that: The specific operations of GPU resource state conversion include: The GPU resource status is divided into three states: idle, locked and executing; To locked state: When the system receives the GPU resource selection result from the user to start the large model service, the idle GPU resources are marked with a lock and enter the locked state; To the execution state: When all GPU resources required by the large model service are successfully locked, the system will allocate the locked GPU resources to start the large model service. After the service is started, the GPU resource lock mark will be released, and the GPU resources will be transferred to the execution state; To idle state: When the large model service fails to start or stops, the GPU resources are released, and the GPU resources in the execution state will be directly converted to the idle state.
3. The GPU resource scheduling method for a large model service according to claim 1, characterized in that: The specific operations of GPU resource locking include: Step 1: The user visits the large model service startup service page; Step 2: Start the service to call the Agent interface of the machine where the GPU resources are located, query and obtain the list of GPU resources currently idle on the machine. This list is a list of GPU resources that are not occupied by other services, including the number, name, model, and video memory information; Step 3: After obtaining the list of free GPU resources, the startup service queries the GPU resource lock status table through Redis. The status table contains the number of locked GPU resources, the locking time, and the validity period. The startup service filters out the locked GPU resources according to the GPU resource lock status table to obtain the list of available GPU resources. This list is a list of GPU resources that are not occupied by other services and are not locked, including the number, name, model, and video memory information; Step 4: The startup service page displays a list of available GPU resources. The user selects a suitable resource from the list of available GPU resources, and the startup service obtains a list of GPU resource numbers selected by the user. Step 5: Start the service to traverse the list of GPU resource numbers selected by the user, and use the Redis atomic operation SET command to lock the GPU resources specified by the user one by one, using the GPU resource number as the key, the time of executing the locking operation as the value, and setting the expiration time to 1 hour. When the SET command operation is successful, it indicates that the GPU resource is locked successfully. When all GPU resources are locked successfully, execute step 6; when a GPU resource fails to be locked, execute step 7; Step 6: GPU resources are locked successfully, and the service is started. The large model service startup process is executed to start allocating GPU resources and start the large model service. If the large model service is successfully started, execute step 7. If the large model service fails to start, execute step 7. Step 7: Call the GPU resource unlocking process; Step 8: The large model service was started successfully, and the Start Service page shows that the startup was successful. The lock failed and the Enable Service page shows that the startup failed. Some GPU resources have been occupied. The Start Service failed to start, and the Enable Service page shows that the startup failed. Please check the large model service configuration.
4. The GPU resource scheduling method for a large model service according to claim 1, characterized in that: The specific operations for unlocking GPU resources include: Step 1: Receive the GPU resource release call and parse the GPU number list parameter, which is the GPU resource to be unlocked; Step 2: Traverse the list of GPU resources to be unlocked. The unlocking operation involves deleting the corresponding lock key in Redis to release the GPU resources. Use the Redis atomic operation DEL command to delete the lock mark of the specified GPU resources and unlock them one by one.
5. The GPU resource scheduling method for a large model service according to claim 1, characterized in that: The specific operations for releasing GPU resources include: Step 1: When the user chooses to actively stop the large model service, the system obtains the UUID of the large model service; Step 2: Based on the large model service UUID, call the Agent interface of the machine where the GPU resources are located, stop the related processes of the large model service, and release the related GPU resources; Step 3: Return the Agent interface return value.
6. A GPU resource scheduling system for a large model service according to the GPU resource scheduling method for a large model service according to any one of claims 1 to 5, characterized in that: The system consists of a resource state conversion module, a resource locking module, a resource unlocking module and a resource releasing module; Resource state conversion module, used for GPU resource state conversion; Resource locking module, used for GPU resource locking. Users can create large model services to lock GPU resources. Resource unlocking module, used for GPU resource unlocking, starting the service to successfully lock part of the GPU resources or the large model service startup is completed; The resource release module is used to release GPU resources. The large model service is automatically stopped after it is successfully started. For the scenario where the large model service fails to start, GPU resources are automatically released.
7. The GPU resource scheduling system for large model services according to claim 6, characterized in that: The resource state conversion module divides the GPU resource state into three states: idle, locked and executing; To locked state: When the system receives the GPU resource selection result from the user to start the large model service, the idle GPU resources are marked with a lock and enter the locked state; To the execution state: When all GPU resources required by the large model service are successfully locked, the system will allocate the locked GPU resources to start the large model service. After the service is started, the GPU resource lock mark will be released, and the GPU resources will be transferred to the execution state; To idle state: When the large model service fails to start or stops, the GPU resources are released, and the GPU resources in the execution state will be directly converted to the idle state.
8. The GPU resource scheduling system for large model services according to claim 6, characterized in that: The specific operations of the resource locking module include: Step 1: The user visits the large model service startup service page; Step 2: Start the service to call the Agent interface of the machine where the GPU resources are located, query and obtain the list of GPU resources currently idle on the machine. This list is a list of GPU resources that are not occupied by other services, including the number, name, model, and video memory information; Step 3: After obtaining the list of free GPU resources, the startup service queries the GPU resource lock status table through Redis. The status table contains the number of locked GPU resources, the locking time, and the validity period. The startup service filters out the locked GPU resources according to the GPU resource lock status table to obtain the list of available GPU resources. This list is a list of GPU resources that are not occupied by other services and are not locked, including the number, name, model, and video memory information; Step 4: The startup service page displays a list of available GPU resources. The user selects a suitable resource from the list of available GPU resources, and the startup service obtains a list of GPU resource numbers selected by the user. Step 5: Start the service to traverse the list of GPU resource numbers selected by the user, and use the Redis atomic operation SET command to lock the GPU resources specified by the user one by one, using the GPU resource number as the key, the time of executing the locking operation as the value, and setting the expiration time to 1 hour. When the SET command operation is successful, it indicates that the GPU resource is locked successfully. When all GPU resources are locked successfully, execute step 6; when a GPU resource fails to be locked, execute step 7; Step 6: GPU resources are locked successfully, and the service is started. The large model service startup process is executed to start allocating GPU resources and start the large model service. If the large model service is successfully started, execute step 7. If the large model service fails to start, execute step 7. Step 7: Call the GPU resource unlocking process; Step 8: The large model service was started successfully, and the Start Service page shows that the startup was successful. The lock failed and the Enable Service page shows that the startup failed. Some GPU resources have been occupied. The Start Service failed to start, and the Enable Service page shows that the startup failed. Please check the large model service configuration.
9. The GPU resource scheduling system for large model services according to claim 6, characterized in that: The specific operations of the resource unlocking module include: Step 1: Receive the GPU resource release call and parse the GPU number list parameter, which is the GPU resource to be unlocked; Step 2: Traverse the list of GPU resources to be unlocked. The unlocking operation involves deleting the corresponding lock key in Redis to release the GPU resources. Use the Redis atomic operation DEL command to delete the lock mark of the specified GPU resources and unlock them one by one.
10. The GPU resource scheduling system for large model services according to claim 6, characterized in that: The specific operations of the resource release module include: Step 1: When the user chooses to actively stop the large model service, the system obtains the UUID of the large model service; Step 2: Based on the large model service UUID, call the Agent interface of the machine where the GPU resources are located, stop the related processes of the large model service, and release the related GPU resources; Step 3: Return the Agent interface return value.
