Method, device and equipment for fine adjustment of model and storage medium

Through the collaborative work of the agent unit and the target work unit, the submission and management of model fine-tuning tasks are simplified, the complexity requirement for hardware and system configuration in traditional methods is solved, and the efficiency of model fine-tuning and GPU utilization are improved.

CN119227838AActive Publication Date: 2024-12-31BEIJING VOLCANO ENGINE TECH CO LTD +1

Patent Information

Application Number
CN202411391800.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2024-12-31
Estimated Expiration
2044-09-30

AI Technical Summary

Technical Problem

The traditional model fine-tuning method requires in-depth understanding of the underlying hardware resources and machine configuration, which increases technical thresholds, and cumbersome resource allocation and environment initialization, resulting in inefficient GPU utilization and long queue waiting time, making it difficult to effectively utilize limited computing resources. .

Method used

The agent unit receives the model fine-tuning task, determines the target work unit and submits the task to it, the target work unit associates multiple graphics processing units, acquires training data based on distributed storage to perform fine-tuning, and stores the updated model parameters to local storage. Uploading to distributed storage units simplifies task submission and management processes.

Benefits of technology

It reduces the user's complexity needs for the underlying hardware and system configuration, improves the overall efficiency of model fine-tuning, reduces the cost of code writing, and improves the utilization rate of GPU and task execution efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119227838A_ABST
    Figure CN119227838A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to a method, device and equipment for fine adjustment of a model and a storage medium. The method provided herein includes: receiving, by a proxy unit, a model trimming task from a user; the agent unit determines a target working unit used for executing the model fine tuning task and submits the model fine tuning task to the target working unit, and the target working unit is associated with the plurality of graphic processing units; executing, by the target working unit, a model fine tuning task based on the training data acquired from the distributed storage unit; and the target working unit stores the updated model parameters to the local storage unit to trigger the proxy unit to upload the model parameters from the local storage unit to the distributed storage unit. In this way, the fine tuning efficiency of the model can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Example embodiments of the present disclosure generally relate to the field of computers, and more particularly, to a method, apparatus, device, and computer-readable storage medium for fine-tuning a model. Background Art

[0002] With the rapid development of artificial intelligence technology, large-scale models are widely used in various applications. Model fine-tuning is a technique in machine learning that involves additional training of a model that has been pre-trained on a large dataset to adapt it to a specific task or dataset. This process is usually performed after the pre-training phase of the model, with the goal of adjusting the weights of the model so that it can better handle the target task. How to fine-tune the model efficiently has become a technical challenge. Summary of the invention

[0003] In a first aspect of the present disclosure, a method for fine-tuning a model is provided. The method includes: an agent unit receives a model fine-tuning task from a user; the agent unit determines a target work unit for executing the model fine-tuning task and submits the model fine-tuning task to the target work unit, wherein the target work unit is associated with a plurality of graphics processing units; the target work unit executes the model fine-tuning task based on training data obtained from a distributed storage unit; and the target work unit stores updated model parameters in a local storage unit to trigger the agent unit to upload the model parameters from the local storage unit to the distributed storage unit.

[0004] In a second aspect of the present disclosure, a system for model fine-tuning is provided. The device includes: an agent unit is configured to: receive a model fine-tuning task from a user; and determine a target work unit for executing the model fine-tuning task, and submit the model fine-tuning task to the target work unit, wherein the target work unit is associated with a plurality of graphics processing units; and the target work unit is configured to: execute the model fine-tuning task based on training data obtained from a distributed storage unit; and store updated model parameters in a local storage unit to trigger the agent unit to upload the model parameters from the local storage unit to the distributed storage unit.

[0005] In a third aspect of the present disclosure, an electronic device is provided. The device includes at least one processing unit; and at least one memory, the at least one memory is coupled to the at least one processing unit and stores instructions for execution by the at least one processing unit. When the instructions are executed by the at least one processing unit, the device executes the method of the first aspect.

[0006] In a fourth aspect of the present disclosure, a computer-readable storage medium is provided, wherein a computer program is stored on the computer-readable storage medium, and the computer program can be executed by a processor to implement the method of the first aspect.

[0007] In a fifth aspect of the present disclosure, a computer program product is provided, which includes computer executable instructions, wherein the computer executable instructions implement the method of the first aspect when executed by a processor.

[0008] It should be understood that the contents described in this content section are not intended to limit the key features or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein:

[0010] Figure 1 shows an example architecture according to some embodiments of the present disclosure;

[0011] Figure 2 A flowchart illustrating an example process of fine-tuning a model according to some embodiments of the present disclosure;

[0012] FIG. 3A to FIG. 3C A schematic diagram showing a scheduling method according to some embodiments of the present disclosure is shown;

[0013] Figure 4 A schematic diagram showing an example system in which embodiments according to the present disclosure may be implemented; and

[0014] Figure 5 A block diagram of an electronic device capable of implementing various embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0015] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0016] It should be noted that the titles of any sections / subsections provided herein are not restrictive. Various embodiments are described throughout this article, and any type of embodiment may be included under any section / subsection. In addition, the embodiments described in any section / subsection may be combined in any manner with any other embodiments described in the same section / subsection and / or different sections / subsections.

[0017] In the description of the embodiments of the present disclosure, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The term "some embodiments" should be understood as "at least some embodiments". Other explicit and implicit definitions may be included below. The terms "first", "second", etc. may refer to different or the same objects. Other explicit and implicit definitions may be included below.

[0018] The embodiments of the present disclosure may involve user data, data acquisition and / or use, etc. These aspects are subject to the corresponding laws, regulations and relevant provisions. In the embodiments of the present disclosure, all data collection, acquisition, processing, processing, forwarding, use, etc. are carried out on the premise that the user knows and confirms. Accordingly, when implementing each embodiment of the present disclosure, the type, scope of use, usage scenario, etc. of the data or information that may be involved should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with the relevant laws and regulations. The specific notification and / or authorization method can vary according to the actual situation and application scenario, and the scope of the present disclosure is not limited in this respect.

[0019] In this specification and the embodiments, if personal information processing is involved, it will be processed on the premise of having a legal basis (such as obtaining the consent of the subject of personal information, or it is necessary to perform a contract, etc.), and will only be processed within the scope of regulations or agreements. If a user refuses to process personal information other than the necessary information for basic functions, it will not affect the user's use of basic functions.

[0020] As mentioned above, model fine-tuning is a technique in machine learning that involves additional training of a model that has been pre-trained on a large dataset to adapt it to a specific task or dataset. According to traditional solutions, the fine-tuning process usually requires in-depth understanding of the underlying hardware resources and machine configuration, which increases the technical threshold and makes it difficult for non-professional system developers to participate.

[0021] In addition, according to traditional schemes, the resource allocation and environment initialization process is cumbersome and time-consuming, which not only prolongs the total execution time of the fine-tuning task, but also adds additional system overhead. When faced with a large number of fine-tuning requirements, traditional fine-tuning methods often have difficulty in effectively utilizing limited computing resources such as graphics processing units (GPUs), which leads to inefficient GPU utilization and long queue waiting times.

[0022] The embodiment of the present disclosure proposes a solution for fine-tuning a model. The solution includes: an agent unit receives a model fine-tuning task from a user; the agent unit determines a target work unit for executing the model fine-tuning task and submits the model fine-tuning task to the target work unit, wherein the target work unit is associated with multiple graphics processing units; the target work unit executes the model fine-tuning task based on training data obtained from a distributed storage unit; and the target work unit stores updated model parameters in a local storage unit to trigger the agent unit to upload the model parameters from the local storage unit to the distributed storage unit.

[0023] In this way, the embodiments of the present disclosure enable developers to easily submit and manage fine-tuning tasks without having to deeply understand the complexity of the underlying hardware and system configuration. Thus, the embodiments of the present disclosure can reduce the user's code writing costs and improve the overall efficiency of model fine-tuning.

[0024] Various example implementations of the solution are described in detail below in conjunction with the accompanying drawings.

[0025] Example Architecture

[0026] Figure 1 1 is a schematic diagram of an example architecture 100 according to some embodiments of the present disclosure. Figure 1 As shown, the architecture 100 may include an agent unit 130, a working unit 140, and a distributed storage unit 170, wherein the agent unit 130 may be associated with a control unit 150. The basic principle of each unit will be described below.

[0027] In some embodiments, the agent unit 130 may be configured to receive a model fine-tuning task 120 from the user 110. As an example, such a model fine-tuning task 120 may include a LoRA (Low-Rank Adaptation) fine-tuning task.

[0028] In some embodiments, the proxy unit 130 may be deployed with only a central computing unit CPU, but not a graphics computing unit GPU. After receiving the model fine-tuning task 120 from the user 110, the proxy unit 130 may start a new work unit 140 to execute the model fine-tuning task 120, or assign the model fine-tuning task 120 to the started work unit 140.

[0029] Further, the agent unit 130 may send the model scheduling task 120 to the worker unit 140 to execute the task. During the task execution, the agent unit 130 may check the status of the task and collect the task results from the worker unit 140 in real time.

[0030] Additionally, the agent unit 130 may also present task information of the model fine-tuning task 120 to the user 110, wherein the task information is determined based on the status data received from the worker unit 140. As an example, the agent unit 130 may display the training progress and performance indicators (such as the remaining cycles and training loss) of the task, thereby providing a graphical interface for the user 110 to view the execution status of the task. In this way, the agent unit 130 may serve as the only component that interacts with the user 110, thereby reducing the complexity of the model fine-tuning system and providing a more efficient low-code interface for task submission.

[0031] In some embodiments, the work unit 140 may be associated with multiple graphics processing units (GPUs) 160, and may utilize the multiple GPUs 160 to execute in parallel the tasks submitted by the agent unit 130. When the work unit 140 is started, it may load the initial parameters (e.g., initial weights) of the pre-trained model from the distributed storage unit 170, and may store such initial parameters in the video memory of the multiple GPUs 160.

[0032] Further, when the agent unit 130 submits the model fine-tuning task 120 to the worker unit 140, the worker unit 140 can load the training data from the distributed storage unit 170 accordingly and start the fine-tuning process. As will be described in detail below, the worker unit 140 can use a task interleaving scheduling strategy to concurrently execute multiple model fine-tuning tasks to improve system efficiency.

[0033] During the fine-tuning process, the working unit 140 is configured to perform forward and backward passes to update the parameters of the model. When the fine-tuning task is completed, the working unit can store the fine-tuned model parameters in the local storage unit and trigger the proxy unit 130 to upload the model parameters from the local storage unit to the distributed storage unit 170.

[0034] In some embodiments, the proxy unit 130 may be configured to asynchronously upload the model parameters from the local storage unit to the distributed storage unit 170 , which enables the worker unit 140 to perform the next model fine-tuning task without waiting for the model parameter upload to be completed.

[0035] In some embodiments, Figure 1As shown, each work unit 140 may also be associated with a control unit 150. The control unit 150 may be used to manage the execution of the work unit 140 and the interaction between the work unit 140 and the agent unit 130. In the case where the work unit 140 executes multiple tasks concurrently, the control unit 150 is configured to decide which task to execute next. In addition, at the end of each step, the control unit 150 collects the outputs from the work unit 140, which may include the results of multiple tasks, and passes the results to the corresponding agent unit 130. Once a task is completed or terminated, the control unit 150 can clean up the resources used by the task and remove the task from the job queue of the work unit 140.

[0036] In some embodiments, the distributed storage unit 170 may be a distributed file system, such as HDFS. As an example, the distributed storage unit 170 may provide shared storage for the entire architecture 100. The distributed storage unit 170 may store the weights of all supported pre-trained models. Additionally, the user 110 may also upload training data to the distributed storage unit 170 for performing model fine-tuning tasks, and obtain a checkpoint of the fine-tuning model after the task is completed.

[0037] It should be understood that the structure and function of each element in the environment are described for illustrative purposes only and do not imply any limitation on the scope of the present disclosure.

[0038] Some example embodiments of the present disclosure will be described below with continued reference to the accompanying drawings.

[0039] Example Process

[0040] Figure 2 1 is a flowchart showing an example process 200 for fine-tuning a model according to some embodiments of the present disclosure. Process 200 may be implemented at system 100. Figure 1 The process 200 is described below.

[0041] like Figure 2 As shown, in box 210 , the agent unit 130 receives the model fine-tuning task 120 from the user 110 .

[0042] As reference Figure 1 As shown and described, the agent unit 130 can provide a task upload interface for the user 110 to receive the model fine-tuning task 120.

[0043] In some embodiments, the model fine-tuning task 120 sent by the user 110 may indicate at least one of the following: a model to be fine-tuned; a path to the training data; a set of hyperparameters. For example, the model fine-tuning task 120 may indicate a pre-trained base model. Additionally, the model fine-tuning task 120 may also indicate a path in the distributed storage unit 170 where the training data is stored. Additionally, the model fine-tuning task 120 may also indicate one or more hyperparameters, such as LoRA configuration, learning rate, batch size, and maximum number of cycles. In this way, users do not need to worry about the underlying infrastructure and can focus on the fine-tuning process, thereby achieving a more simplified task submission.

[0044] In block 220, the proxy unit 130 determines a target work unit 140 for executing the model fine-tuning task, and submits the model fine-tuning task to the target work unit 130. Figure 1 As described, the target work unit 130 may be associated with a plurality of GPUs 160 .

[0045] In some embodiments, the agent unit 130 may determine whether a group of candidate work units currently enabled are suitable for executing the model fine-tuning task 120 based on the working status of the group of candidate work units. For example, the agent unit 130 may determine whether the group of candidate work units are suitable for executing the model fine-tuning task 120 to be assigned based on the computing resource usage of the group of candidate work units.

[0046] In some embodiments, if a specific enabled candidate work unit is suitable for executing the model fine-tuning task 120, the agent unit 130 may assign the to-be-model-fine-tuning task 120 to the candidate work unit. On the contrary, if it is determined that the group of candidate work units is not suitable for executing the model fine-tuning task, the agent unit 130 may trigger the start of a new work unit as the target work unit.

[0047] As reference Figure 1 As described, when the working unit 140 is started, the initial parameters (e.g., initial weights) of the pre-trained model can be loaded from the distributed storage unit 170 , and such initial parameters can be stored in the video memory of multiple graphics processing units 160 .

[0048] In box 230 , the target work unit 140 performs the model fine-tuning task 120 based on the training data obtained from the distributed storage unit 170 .

[0049] In some embodiments, after receiving the model fine-tuning task 120 to be executed from the agent unit 130, the target work unit 140 can load the training data for the model fine-tuning task 120 from the distributed storage unit 170 based on the path indicated by the model fine-tuning task 120, and can start executing the fine-tuning process.

[0050] In some embodiments, as shown in reference Figure 1 As described, the target work unit 140 may also be configured to execute multiple model fine-tuning tasks concurrently, and the control unit 150 may be configured to schedule the execution of the multiple model fine-tuning tasks on multiple GPUs 160 .

[0051] In some embodiments, the control unit 150 may use a one forward one backward (1F1B) scheduling strategy. Figure 3A As shown, the 1F1B scheduling strategy may include three phases, namely, a warm-up phase 305 , a stabilization phase 310 , and a cool-down phase 315 .

[0052] In the warm-up phase 305, the worker 140 performs a forward pass of a portion of a mini-batch. To reduce the memory footprint of activations, the number of mini-batches in the pipeline in the warm-up phase 305 is limited to the pipeline parallelism. After the warm-up phase 305, the worker 140 may enter a stabilization phase 310, which may perform a forward pass followed by a backward pass, i.e., 1F1B.

[0053] Further, after completing all forward passes, the work unit 140 may enter the cool-down phase 315 to perform the remaining backward passes. When the work unit 140 is in the warm-up phase 305 or the cool-down phase 315, idle (also called bubble) occurs. Figure 3A As shown in Figure 1, staggered 1F1B scheduling reduces the bubble rate by dividing each stage into multiple virtual stages. For example, a single batch includes mini-batches numbered 0 to 7, where 0 to 3 constitute the first virtual stage and 4 to 7 constitute the second virtual stage. As the number of virtual stages increases, the pipeline can be flushed earlier, thereby reducing the idle rate of the work unit.

[0054] refer to Figure 3A As shown, according to the 1F1B scheduling scheme, the warm-up phase 305 and the cool-down phase 315 still exist and contain bubbles. In order to reduce the idle rate, the control unit 150 can also use a cross-scheduling strategy based on training batches.

[0055] Specifically, Figure 3B As shown, the plurality of model fine-tuning tasks may include, for example, a first task J1 and a second task J2. In response to the image processing unit 160 completing the stabilization phase 325 of the first training batch of the first task J1, the control unit 150 utilizes the graphics processing unit 160 to interleave the cooling phase of the first training batch of the first task J1 and the warm-up phase of the second training batch of the second task J2, thereby forming a longer stabilization phase 325.

[0056] like Figure 3B As shown, there are 8 micro-batches in each training batch of the first task J1 and the second task J2, and an interleaved 1F1B schedule with 2 virtual phases is used. Initially, the worker 140 may process the first training batch of the first task J1. Then, the worker may sequentially enter the warm-up phase and the steady-state phase in the order of the 1F1B schedule.

[0057] When the cool-down phase of the first training batch begins, the worker 140 may interleave it with the warm-up phase of the next training batch of the second task J2. This interleaving continues until the worker 140 completes all micro-batches of the first task J1. Further, the worker 140 may switch to the steady-state phase of the second training batch of the second task J2 and repeat the process.

[0058] In this way, the worker 140 can achieve a zero bubble rate except for the warm-up phase of the global first training batch. In addition, the worker 140 maintains a 1F1B mode in the interleaved warm-up and cool-down phases, and the number of micro-batches in the pipeline is still limited to the pipeline parallelism. In this way, the embodiments of the present disclosure can ensure that batch-level interleaved scheduling does not increase the additional peak memory overhead of activation compared to 1F1B scheduling.

[0059] In some scenarios, when the size of the training batch of a task is too small, the number of micro-batches in each training batch may not be an integer multiple of the pipeline parallelism. In this case, interleaved 1F1B cannot be applied to each individual task, and batch-level interleaved scheduling cannot be used directly.

[0060] In some embodiments, the control unit 150 may further use a cross-scheduling strategy based on micro-batches. Specifically, the control unit 150 may construct multiple logical training batches based on multiple model fine-tuning tasks, wherein at least one logical training batch includes micro-batches associated with at least two model fine-tuning tasks. Further, the control unit 150 schedules multiple graphics processing units 160 to execute multiple model fine-tuning tasks based on multiple logical training batches.

[0061] by Figure 3CAs an example, the work unit 140 includes 4 pipeline stages and 5 model fine-tuning tasks (J1, J2, J3, J4, J5). The first four tasks J1 to J4 have 2 micro-batches in each training batch, and J5 includes 4 micro-batches in each training batch. Since each task does not need to wait for the completion of the previous task, the work unit can execute multiple tasks concurrently. According to the micro-batch processing level staggered scheduling strategy, the control unit 150 can combine J1, J2, J3, and J4 into a group and execute them in the same training batch. Thus, this group can include 8 micro-batches in each training batch, thereby realizing staggered 1F1B scheduling. Therefore, the micro-batch processing level staggered scheduling can achieve zero bubble rate and improve system efficiency in the stable stage 335 after the warm-up stage 330, which is suitable for fine-tuning tasks of small batch sizes.

[0062] In some embodiments, during the process of constructing a logic training batch, the control unit 150 may also dynamically create a logic training batch based on the execution of multiple model fine-tuning tasks. Specifically, the control unit 150 may determine whether multiple model fine-tuning tasks include a target task, wherein part of the micro-batches of the target task have been added to the existing logic training batch. If multiple model fine-tuning tasks include the target task, the control unit 150 may add the remaining micro-batches of the target task to the target logic training batch to be scheduled for execution.

[0063] For example, task J includes 8 micro-batches, and its first 4 micro-batches have been added to the created logical training batch. Accordingly, when creating the next logical training batch, the control unit 150 can add the remaining 4 micro-batches of task J to the new logical training batch.

[0064] Further, the control unit 150 may determine that the number of micro-batches added to the target logic training batch is less than a threshold value (e.g., an upper limit). If the number does not reach the upper limit, the control unit 150 may further add at least one micro-batch to the target logic training batch based on the remaining training steps of the plurality of model fine-tuning tasks. For example, the control unit 150 may preferentially add the micro-batch of the model fine-tuning task with the largest number of remaining training steps to the target logic training batch.

[0065] In this way, the embodiments of the present disclosure can further increase the proportion of staggered scheduling at the micro-batch processing level, thereby reducing the idle rate of the work unit.

[0066] In block 240 , the target work unit 140 stores the updated model parameters in the local storage unit to trigger the agent unit 130 to upload the model parameters from the local storage unit to the distributed storage unit 170 .

[0067] As reference Figure 1As described, when the fine-tuning task is completed, the working unit may store the fine-tuned model parameters in the local storage unit, and trigger the proxy unit 130 to upload the model parameters from the local storage unit to the distributed storage unit 170 .

[0068] In some embodiments, the proxy unit 130 may be configured to asynchronously upload the model parameters from the local storage unit to the distributed storage unit 170 , which enables the worker unit 140 to perform the next model fine-tuning task without waiting for the model parameter upload to be completed.

[0069] In this way, the embodiments of the present disclosure enable developers to easily submit and manage fine-tuning tasks without having to deeply understand the complexity of the underlying hardware and system configuration. Thus, the embodiments of the present disclosure can reduce the user's code writing costs and improve the overall efficiency of model fine-tuning.

[0070] Example System

[0071] The embodiments of the present disclosure also provide a corresponding system for implementing the above method or process. Figure 4 1 shows a schematic structural block diagram of an example system 400 in which an embodiment according to the present disclosure can be implemented. The system 400 can be implemented as or included in the environment 100. Each module / component in the system 400 can be implemented by hardware, software, firmware or any combination thereof.

[0072] like Figure 4 As shown, the system 400 includes: an agent unit 410 is configured to: receive a model fine-tuning task from a user; and determine a target work unit for executing the model fine-tuning task, and submit the model fine-tuning task to the target work unit, wherein the target work unit is associated with multiple graphics processing units; and a target work unit 420 is configured to: execute the model fine-tuning task based on training data obtained from a distributed storage unit; and store the updated model parameters to the local storage unit to trigger the agent unit to upload the model parameters from the local storage unit to the distributed storage unit.

[0073] In some embodiments, the model fine-tuning task indicates at least one of: a model to be fine-tuned; a path to training data; a set of hyperparameters.

[0074] In some embodiments, the agent unit 410 is further configured to: determine whether a set of candidate work units currently enabled are suitable for performing the model fine-tuning task; and in response to determining that a set of candidate work units are not suitable for performing the model fine-tuning task, trigger the start of the target work unit.

[0075] In some embodiments, the target work unit 420 is configured to: load initial parameters of the pre-trained model from the distributed storage unit in response to the target work unit being triggered to start; and store the initial parameters in the video memory of multiple graphics processing units.

[0076] In some embodiments, the proxy unit 410 is configured to asynchronously upload the model parameters from the local storage unit to the distributed storage unit, and the target work unit 420 allows the next model fine-tuning task to be executed without waiting for the model parameter upload to be completed.

[0077] In some embodiments, system 400 also includes a target work unit configured to execute multiple model fine-tuning tasks concurrently. System 400 also includes a control unit, and the target work unit is also associated with the control unit. The control unit is configured to schedule the execution of multiple model fine-tuning tasks on multiple graphics processing units.

[0078] In some embodiments, the multiple model fine-tuning tasks include a first task and a second task, and the control unit is further configured to: in response to the image processing unit completing the stabilization phase of the first batch of the first task, use the graphics processing unit to cross-execute the cooling phase of the first batch of the first task and the warm-up phase of the second batch of the second task.

[0079] In some embodiments, the multiple model fine-tuning tasks include a first task and a second task, and the control unit is configured to: in response to the image processing unit completing the stabilization phase of the first training batch of the first task, use the graphics processing unit to interleave the cooling phase of the first training batch of the first task and the warm-up phase of the second training batch of the second task.

[0080] In some embodiments, the control unit is configured to: construct a plurality of logical training batches based on a plurality of model fine-tuning tasks, wherein at least one logical training batch includes micro-batches associated with at least two model fine-tuning tasks; and schedule a plurality of graphics processing units to execute the plurality of model fine-tuning tasks based on the plurality of logical training batches.

[0081] In some embodiments, the control unit is configured to: determine whether multiple model fine-tuning tasks include a target task, and part of the micro-batches of the target task have been added to an existing logic training batch; in response to multiple model fine-tuning tasks including the target task, add the remaining micro-batches of the target task to the target logic training batch to be scheduled for execution; and in response to the number of micro-batches added to the target logic training batch being less than a threshold, add at least one micro-batch to the target logic training batch based on the remaining training steps of the multiple model fine-tuning tasks.

[0082] In some embodiments, the agent unit 410 is further configured to present task information of the model fine-tuning task to the user, where the task information is determined based on the status data received from the target work unit.

[0083] like Figure 5 As shown, in some embodiments, the electronic device 500 is in the form of a general electronic device. The components of the electronic device 500 may include, but are not limited to, one or more processors or processing units 510, a memory 520, a storage device 530, one or more communication units 540, one or more input devices 550, and one or more output devices 560. The processing unit 510 may be an actual or virtual processor and is capable of performing various processes according to a program stored in the memory 520. In a multi-processor system, multiple processing units execute computer executable instructions in parallel to improve the parallel processing capability of the electronic device 500.

[0084] The electronic device 500 typically includes a plurality of computer storage media. Such media may be any accessible media that is accessible to the electronic device 500, including but not limited to volatile and non-volatile media, removable and non-removable media. The memory 520 may be a volatile memory (e.g., registers, caches, random access memory (RAM)), a non-volatile memory (e.g., a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), flash memory), or some combination thereof. The storage device 530 may be a removable or non-removable medium, and may include a machine-readable medium, such as a flash drive, a disk, or any other medium, which may be capable of being used to store information and / or data and may be accessed within the electronic device 500.

[0085] The electronic device 500 may further include additional removable / non-removable, volatile / non-volatile storage media. Figure 5 As shown in , a disk drive for reading or writing from a removable, non-volatile disk (e.g., a "floppy disk") and an optical drive for reading or writing from a removable, non-volatile optical disk may be provided. In these cases, each drive may be connected to the bus (not shown) by one or more data media interfaces. The memory 520 may include a computer program product 525 having one or more program modules that are configured to perform various methods or actions of various embodiments of the present disclosure.

[0086] The communication unit 540 implements communication with other electronic devices through a communication medium. Additionally, the functions of the components of the electronic device 500 can be implemented in a single computing cluster or multiple computing machines that can communicate through a communication connection. Therefore, the electronic device 500 can operate in a networked environment using a logical connection with one or more other servers, a network personal computer (PC), or another network node.

[0087] The input device 550 may be one or more input devices, such as a mouse, a keyboard, a tracking ball, etc. The output device 560 may be one or more output devices, such as a display, a speaker, a printer, etc. The electronic device 500 may also communicate with one or more external devices (not shown) through the communication unit 540 as needed, such as a storage device, a display device, etc., communicate with one or more devices that allow a user to interact with the electronic device 500, or communicate with any device that allows the electronic device 500 to communicate with one or more other electronic devices (e.g., a network card, a modem, etc.). Such communication may be performed via an input / output (I / O) interface (not shown).

[0088] According to an exemplary implementation of the present disclosure, a computer-readable storage medium is provided, on which computer-executable instructions are stored, wherein the computer-executable instructions are executed by a processor to implement the method described above. According to an exemplary implementation of the present disclosure, a computer program product is also provided, which is tangibly stored on a non-transitory computer-readable medium and includes computer-executable instructions, and the computer-executable instructions are executed by a processor to implement the method described above.

[0089] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices, equipment, and computer program products implemented according to the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.

[0090] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0091] Computer-readable program instructions can be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, so that the instructions executed on the computer, other programmable data processing apparatus, or other device implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0092] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple implementations of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of a module, program segment or instruction includes one or more executable instructions for realizing the logical function of the specification. In some implementations as replacements, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be realized by a special hardware-based system that performs the function or action of the specification, or can be realized by a combination of special hardware and computer instructions.

[0093] The above descriptions of various implementations of the present disclosure are exemplary, non-exhaustive, and not limited to the disclosed implementations. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described implementations. The selection of terms used herein is intended to best explain the principles of the implementations, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the various implementations disclosed herein.

Claims

1. A method for fine-tuning a model, comprising: The agent unit receives the model fine-tuning task from the user; The proxy unit determines a target work unit for executing the model fine-tuning task, and submits the model fine-tuning task to the target work unit, wherein the target work unit is associated with a plurality of graphics processing units; The target work unit executes the model fine-tuning task based on the training data obtained from the distributed storage unit; as well as The target working unit stores the updated model parameters in the local storage unit to trigger the proxy unit to upload the model parameters from the local storage unit to the distributed storage unit.

2. The method according to claim 1, wherein the model fine-tuning task indicates at least one of the following: The model to be fine-tuned; The path of the training data; A set of hyperparameters.

3. The method according to claim 1, further comprising: Determining, by the agent unit, whether a set of currently enabled candidate work units are suitable for performing the model fine-tuning task; as well as In response to determining that the set of candidate work units are not suitable for executing the model fine-tuning task, the proxy unit triggers the start of the target work unit.

4. The method according to claim 3, further comprising: In response to the target work unit being triggered to start, loading initial parameters of the pre-trained model from the distributed storage unit; as well as The target working unit stores the initial parameters in the video memory of the plurality of graphics processing units.

5. The method according to claim 1, wherein the agent unit is configured to asynchronously upload the model parameters from the local storage unit to the distributed storage unit, and the target work unit allows the next model fine-tuning task to be executed without waiting for the model parameter upload to be completed.

6. The method according to claim 1, wherein the target work unit is configured to execute multiple model fine-tuning tasks concurrently, and the target work unit is also associated with a control unit, and the control unit is configured to schedule the execution of the multiple model fine-tuning tasks on the multiple graphics processing units.

7. The method according to claim 6, wherein the plurality of model fine-tuning tasks include a first task and a second task, and the control unit is configured to: In response to the graphics processing unit completing the stabilization phase of the first training batch of the first task, the graphics processing unit is used to alternately perform the cooling phase of the first training batch of the first task and the warming phase of the second training batch of the second task.

8. The method according to claim 6, wherein the control unit is configured to: Based on the multiple model fine-tuning tasks, construct multiple logical training batches, wherein at least one logical training batch includes mini-batches associated with at least two model fine-tuning tasks; and The plurality of graphics processing units are scheduled to execute the plurality of model fine-tuning tasks based on the plurality of logical training batches.

9. The method according to claim 8, wherein constructing a plurality of logical training batches based on the plurality of model fine-tuning tasks comprises: Determining whether the plurality of model fine-tuning tasks include a target task, wherein some micro-batches of the target task have been added to an existing logical training batch; In response to the multiple model fine-tuning tasks including the target task, adding the remaining micro-batches of the target task to the target logic training batch to be scheduled for execution; as well as In response to the number of micro-batches added to the target logic training batch being less than a threshold, at least one micro-batch is added to the target logic training batch based on remaining training steps of the multiple model fine-tuning tasks.

10. The method according to claim 1, further comprising: The agent unit presents task information of the model fine-tuning task to the user, where the task information is determined based on the status data received from the target work unit.

11. A system for fine-tuning a model, comprising an agent unit and a target work unit, wherein: The agent unit is configured to: receive a model fine-tuning task from a user; determine a target work unit for executing the model fine-tuning task, and submit the model fine-tuning task to the target work unit, wherein the target work unit is associated with a plurality of graphics processing units; as well as The target work unit is configured to: perform the model fine-tuning task based on the training data obtained from the distributed storage unit; And storing the updated model parameters in the local storage unit to trigger the agent unit to upload the model parameters from the local storage unit to the distributed storage unit.

12. An electronic device comprising: at least one processing unit; as well as At least one memory, the at least one memory being coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, the instructions causing the electronic device to perform the method according to any one of claims 1 to 10 when executed by the at least one processing unit.

13. A computer-readable storage medium having a computer program stored thereon, wherein the computer program can be executed by a processor to implement the method according to any one of claims 1 to 10.

14. A computer program product comprising computer executable instructions, wherein the computer executable instructions, when executed by a processor, implement the method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Deep learning task processing method and device and computer readable storage medium

    CN112306623A

  • Distributed training and reasoning method, system and device based on artificial intelligence, and readable storage medium

    CN114035937A

  • Deep neural network model parallel computing task asynchronous scheduling method

    CN115994567A

  • Large language model training method and device, equipment and storage medium

    CN117057411A

  • Training system and operating method thereof

    CN118278482A

Cited By

  • Large model training method and device based on staggered pipeline parallel strategy and computer equipment

    CN120494027A

  • Large model training method and device based on segment scheduling, medium and electronic equipment

    CN121119175A