Apparatus and method for accelerating fine-tuning of deep learning models using asynchronous parallel execution
Patent Information
- Application Number
- KR1020250034190
- Authority / Receiving Office
- KR · KR
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2025-03-17
- Publication Date
- 2026-09-04
- Estimated Expiration
- 2045-03-17
Smart Images

Figure 112025030209588-PAT00001_ABST
Abstract
Description
Technology Field
[0001] The present invention relates to a technology for accelerating the fine-tuning of a deep learning model, and in particular to a technology for reducing the fine-tuning time of a deep learning model and preventing additional memory usage through asynchronous parallel execution in a single GPU environment. Background Technology
[0002] In a single GPU (Graphic Process Unit) environment, a widely used method involves using pre-trained deep learning models by fine-tuning them to efficiently utilize system resources used for training.
[0003] When training deep learning models in such a single system, there is generally a problem in that system resources cannot be used efficiently because each deep learning model occupies the processor and memory.
[0004] To address these issues, Computation-Communication Overlap technology is used to maximize hardware resources by overlapping computationally intensive operators with memory-intensive operators.
[0005] While computation-communication overlap technology can alleviate memory bandwidth or computation bottlenecks by scheduling computations and memory accesses to occur simultaneously, it has limitations due to the need for additional memory usage caused by the requirement to allocate independent models to memory.
[0006] The inventors of the present invention have made long-term research efforts to overcome the limitations of the fine-tuning technology of the deep learning model of the prior art as described above, and have come to complete the present invention regarding a device and method for accelerating the fine-tuning of a deep learning model that can overcome the limitations of the prior art through asynchronous parallel execution and weight sharing technology in a single GPU system. The problem to be solved
[0007] To solve the problems of the prior art described above, the present invention aims to provide a deep learning model fine-tuning acceleration device and a method through asynchronous parallel execution that reduces fine-tuning time and prevents additional memory usage in a single GPU environment.
[0008] However, the problems that the present invention aims to solve are not limited to those mentioned above, and other unmentioned problems will be clearly understood by those skilled in the art from the description below. means of solving the problem
[0009] A deep learning model fine-tuning acceleration device through asynchronous parallel execution according to a preferred embodiment of the present invention for solving the above-mentioned problem is,
[0010] A mini-batch, which is a subset of an input dataset for fine-tuning of pre-training, is divided into micro-batches that are smaller than the mini-batch, and each of the divided micro-batches is input into a plurality of streams, which are independent workflows, and each of the plurality of streams independently updates a global adapter weight shared by the plurality of streams when backpropagation for the input micro-batches for fine-tuning of the pre-trained model is completed, wherein the stream includes a shared weight that is a copy of the pre-trained model and the global adapter weight.
[0011] The processor is characterized by setting the adapter of the first stream among the plurality of streams as the global adapter weight before fine-tuning the pre-trained model.
[0012] Each of the above plurality of streams is characterized by independently updating the global adapter weights and then reflecting the updated global adapter weights in the model weights of the streams.
[0013] Each of the above plurality of streams is characterized by updating the global adapter weights using the gradient, which is the learning result, when learning for the input micro-batch is completed.
[0014] The above processor is characterized by being a single GPU (Graphic Processor Unit).
[0015] A deep learning model fine-tuning acceleration method according to another preferred embodiment of the present invention is,
[0016] The method comprises the steps of: dividing a mini-batch, which is a subset of an input dataset for fine-tuning of a pre-training model, into micro-batches that are smaller than the mini-batch; inputting the divided micro-batches into a plurality of independent streams; and each of the plurality of streams independently updating a global adapter weight shared by the plurality of streams after backpropagation for the input micro-batches for fine-tuning of the pre-trained model is completed, wherein the streams include a shared weight that is a copy of the pre-trained model and the global adapter weight.
[0017] After the step of inputting the above-described divided micro-batches into a plurality of independent streams, the method further includes the step of setting the adapter of the first stream among the plurality of streams as the global adapter weight.
[0018] After the step of independently updating global adapter weights, the method further includes the step of reflecting the updated global adapter weights into the model weights of the stream.
[0019] The step of independently updating global adapter weights is characterized by updating the global adapter weights using the gradient, which is the learning result, when learning for the input micro-batch is completed.
[0020] The above deep learning model fine-tuning acceleration method is characterized by being performed by a single GPU. Effects of the invention
[0021] According to the present invention, by dividing a mini-batch, which is a subset of input data of a pre-trained model, into micro-batches and inputting them into a plurality of streams respectively, the utilization rate of system resources can be efficiently increased.
[0022] In addition, by allowing each of the multiple streams to independently update the global adapter weights, there is an advantage of effectively accelerating the fine-tuning of deep learning models even in a single GPU environment without using additional memory.
[0023] The effects obtainable from the present invention are not limited to those mentioned above, and other unmentioned effects will be clearly understood by those skilled in the art from the description below. Brief explanation of the drawing
[0024] FIG. 1 is a schematic diagram of a deep learning model fine-tuning acceleration device through asynchronous parallel execution according to a preferred embodiment of the present invention. FIG. 2 is a more detailed structural diagram of a processor of a deep learning model fine-tuning acceleration device through asynchronous parallel execution according to a preferred embodiment of the present invention. FIG. 3 is a more detailed structural diagram of a stream generating unit according to a preferred embodiment of the present invention. FIG. 4 shows an example of the configuration of a copy of a deep learning model according to a preferred embodiment of the present invention. FIG. 5 illustrates an example in which learning of a stream and sharing of a weight adapter are performed according to a preferred embodiment of the present invention. FIGS. 6 and 7 illustrate the performance of a deep learning model fine-tuning acceleration device through asynchronous parallel execution according to a preferred embodiment of the present invention. FIG. 8 is a schematic flowchart of a method for accelerating deep learning model fine-tuning through asynchronous parallel execution according to another preferred embodiment of the present invention. FIG. 9 is a drawing for illustrating a computing environment including a computing device according to another preferred embodiment of the present invention. ※ It should be noted that the attached drawings are provided as examples for reference to help understand the technical concept of the present invention, and the scope of the rights of the present invention is not limited by them. Specific details for implementing the invention
[0025] Hereinafter, specific embodiments according to embodiments of the present disclosure will be described with reference to the drawings. The following detailed description is provided to facilitate a comprehensive understanding of the methods, apparatus, and / or systems described herein. However, this is merely illustrative and the present invention is not limited thereto.
[0026] In describing the embodiments of the present disclosure, detailed descriptions of known technology related to the present invention are omitted if it is determined that such detailed descriptions would unnecessarily obscure the essence of the embodiments. Furthermore, terms used below are defined with consideration of their functions in the present invention, and these may vary depending on the intentions or practices of the user or operator. Therefore, such definitions should be based on the content throughout this specification. Terms used in the detailed description are intended merely to describe specific embodiments and should not be limiting. Unless explicitly stated otherwise, expressions in the singular form include the meaning of the plural form. In this description, expressions such as "include" or "comprise" are intended to refer to certain characteristics, numbers, steps, actions, elements, parts thereof, or combinations thereof, and should not be interpreted to exclude the existence or possibility of one or more other characteristics, numbers, steps, actions, elements, parts thereof, or combinations thereof other than those described. Additionally, terms such as "...part," "...unit," "module," and "block" described in the specification refer to a unit that processes at least one function or operation, and this may be implemented in hardware, software, or a combination of hardware and software.
[0028] FIG. 1 is a schematic diagram of a deep learning model fine-tuning acceleration device through asynchronous parallel execution according to a preferred embodiment of the present invention.
[0029] The deep learning model fine-tuning acceleration device (10) through asynchronous parallel execution according to the present invention may include one or more processors (11) and memory (12).
[0030] The memory (12) may store instructions, data structures, and program code that can be read by the processor (11). In embodiments, at least the operations performed by the processor (11) may be implemented by executing the instructions or code of the program stored in the memory (12).
[0031] The memory (12) may include a flash memory type, a hard disk type, a multimedia card micro type, a card type memory (e.g., SD or XD memory, etc.), a non-volatile memory including at least one of ROM (Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), PROM (Programmable Read-Only Memory), magnetic memory, a magnetic disk, and an optical disk, and a volatile memory such as RAM (Random Access Memory) or SRAM (Static Random Access Memory).
[0032] Memory (12) can store one or more instructions or programs that the processor (11) can use to accelerate fine-tuning of a deep learning model.
[0033] The processor (11) controls the overall operations of the deep learning model fine-tuning accelerator (10) through asynchronous parallel execution. For example, by executing one or more instructions stored in memory (12), the processor (11) can control the overall operations of the deep learning model fine-tuning accelerator (10) through asynchronous parallel execution to divide mini-batches into micro-batches and accelerate the fine-tuning of the deep learning model through asynchronous parallel execution using global weights.
[0034] The processor (11) may be composed of at least one of, for example, a Central Processing Unit, a microprocessor, a Graphic Processing Unit, ASICs (Application Specific Integrated Circuits), DSPs (Digital Signal Processors), DSPDs (Digital Signal Processing Devices), PLDs (Programmable Logic Devices), FPGAs (Field Programmable Gate Arrays), an Application Processor, a Neural Processing Unit, or an AI-dedicated processor designed with a hardware structure specialized for processing AI models, but is not limited thereto.
[0035] FIG. 2 is a more detailed structural diagram of a processor of a deep learning model fine-tuning acceleration device through asynchronous parallel execution according to a preferred embodiment of the present invention.
[0036] The processor (11) according to the present invention may include a stream generation unit (21), a stream learning unit (22), and a weight update unit (23).
[0037] At this time, the processor (11) may be a single GPU, but is not limited to this.
[0038] The stream generation unit (21) generates multiple streams for training a pre-trained deep learning model and generates a dataset for inputting to each of the multiple streams.
[0039] Fine-tuning refers to the process of optimizing a pre-trained deep learning model to fit a specific task or dataset.
[0040] Generally, since large datasets are required to train deep learning models, fine-tuning methods are used to train deep learning models on a single processor. These methods involve training only some layers or retraining the entire model to fit a new dataset, based on a deep learning model that has already been trained on such a large dataset. Fine-tuning uses pre-trained weights as initial values, which can speed up the learning process and prevent overfitting.
[0041] Fine tuning according to the present invention can be achieved through the PEFT (Parameter-Efficient Fine-Tuning) method.
[0042] PEFT is a technique that enhances the efficiency of fine-tuning by minimizing parameter updates. Instead of updating all model parameters, it enables efficient fine-tuning by training only the necessary parts or applying additional modules (adapters).
[0043] PEFT significantly reduces memory usage and training time by updating only a small number of parameters. Low-Rank Adaptation (LoRA), one of the representative PEFT techniques, decomposes the existing weights of a deep learning model into low-dimensional matrices and learns only these low-dimensional matrices.
[0044] Therefore, fine tuning according to the present invention may be performed using the LoRA technique, but is not limited thereto.
[0045] FIG. 3 is a more detailed structural diagram of a stream generating unit according to a preferred embodiment of the present invention.
[0046] The stream generation unit according to the present invention may include a plurality of streams (31).
[0047] A stream refers to an independent workflow of the GPU, and a copy of a pre-trained deep learning model is assigned to each stream.
[0048] A copy (33) of a pre-trained deep learning model (32) is assigned to each stream (31) of the present invention.
[0049] In addition, in the stream of the conventional technology, a mini-batch, which is a subset of the entire dataset used as input to a deep learning model, is used as input, but in the stream (31) of the present invention, the mini-batch (34) is divided into micro-batches (35), which are smaller batch sizes, and input.
[0050] In the case of the mini batch (34), dynamic padding is performed based on the longest sequence, so the size of the mini batch (34) is determined based on the longest sequence in the entire mini batch (34).
[0051] However, since the input data is divided into smaller units than the mini batch (34), dynamic padding is performed based on the longest sequence in each unit, so the sequence length can be smaller than the mini batch (34), which is an advantage.
[0052] Returning to Fig. 2, the stream learning unit (22) performs fine-tuning in such a way that learning is performed on each divided stream unit.
[0053] In FIG. 3, a copy (33) of a pre-trained deep learning model copied to each stream (31) is independently allocated to memory for training.
[0054] FIG. 4 shows an example of the configuration of a copy of a deep learning model according to a preferred embodiment of the present invention.
[0055] A copy (33) of a pre-trained deep learning model according to the present invention may consist of shared weights (41) and an adapter (42).
[0056] In the present invention, by sharing weights (41) so that different streams share weights that are not updated, excluding the adapter (42), there is an advantage of preventing additional memory usage caused by copies of the pre-trained model.
[0057] FIG. 5 illustrates an example in which learning of a stream and sharing of a weight adapter are performed according to a preferred embodiment of the present invention.
[0058] The stream learning unit (22) of the present invention learns each stream based on input data in micro-batch (35) units.
[0059] In this case, since each stream executes independently in asynchronous parallel, they cannot share the information they have learned with each other.
[0060] In such cases, a decrease in model accuracy may occur, so the present invention can solve such a problem by updating the global adapter weights (42) through the weight update unit (23).
[0061] In the present invention, among the weights of the pre-trained deep learning model copies copied to each stream, the weights that are not updated maintain the same value during training in all streams. Therefore, by referencing and using the model weights of the first stream (31) in the model of another stream, training of each stream is possible without copying and assigning weights to all streams.
[0062] Weight sharing is performed by allocating the model of the first stream (31) to memory and then allocating the model of another stream to memory by applying weight sharing.
[0063] When the learning for the micro-batch (35) of the first stream (31) is finished, that is, when backpropagation is finished, the backpropagation results are reflected in the model weights.
[0064] For example, only the global adapter weights (42) are updated using the gradient, which is the result of learning.
[0065] The global adapter weights (42) are updated by each stream, so they can be kept up to date.
[0066] Therefore, each stream updates the learning results in the global adapter weights (42), and then copies the global adapter weights (42) and reflects them in the weights of the copy of the deep learning model of each stream, thereby having the effect of reflecting the learning results of other streams.
[0067] The global adapter weight (42) is initially created by copying the adapter weight of the first stream and is accessible from all streams.
[0068] Since the global adapter weight (42) generally has a very small size, the global adapter weight also occupies only a very small amount of memory and the time to update and copy is very short. Therefore, in the present invention, each stream updates only the global adapter weight rather than updating the entire copy of the deep learning model, so the memory usage can be reduced.
[0069] FIGS. 6 and 7 illustrate the performance of a deep learning model fine-tuning acceleration device through asynchronous parallel execution according to a preferred embodiment of the present invention.
[0070] Figure 6 shows the results of evaluating the present invention using wikitext-2, a language modeling dataset commonly used in data fine-tuning, and SQuAD 1.1, a question-and-answer dataset.
[0071] The deep learning models used were GPT2 and BERT models, which are widely used in the field of natural language, at various parameter sizes, and the devices used were NVIDIA Jetson Oron Nano 8GB (Nano), NVIDIA Jetson Oron NX 16GB (NX), NVIDIA RTX 3090 24GB (3090), and NVIDIA RTX 4090 24GB (4090).
[0072] Figure 6(a) shows a comparison of the training times of the present invention and the prior art in the wikitext-2 dataset, and Figure 6(b) shows the results of a comparison of the training times of the present invention and the prior art in the SQuAD 1.1 dataset.
[0073] According to the present invention, it can be confirmed that for each dataset, a fine-tuning time reduction effect of 13.30% and 12.92% is shown.
[0074] Figure 7 shows the difference in accuracy between the present invention and the prior art.
[0075] Likewise, it shows an accuracy loss of less than 0.05% on the wikitext-2 and SQuAD 1.1 datasets, demonstrating that there is almost no difference from conventional technology in terms of performance.
[0076] Therefore, according to the present invention, in a single GPU environment with limited memory and computational capacity, it is possible to achieve nearly the same accuracy as the prior art while reducing the fine-tuning time.
[0078] FIG. 8 is a schematic flowchart of a method for accelerating deep learning model fine-tuning through asynchronous parallel execution according to another preferred embodiment of the present invention.
[0079] The deep learning model fine-tuning acceleration method according to the present invention can be performed by a deep learning model fine-tuning acceleration device comprising one or more processors and memory.
[0080] The deep learning model fine-tuning acceleration method according to the present invention can be performed by a single deep learning model fine-tuning acceleration device including one GPU.
[0081] To fine-tune the deep learning model, the input dataset is first partitioned (S11).
[0082] As previously discussed, while the input dataset typically uses a mini-batch, which is a subset of the entire dataset rather than the entire dataset, the present invention may use a micro-batch, which is an even smaller unit.
[0083] Micro-batches are input into each stream (S12).
[0084] A stream is an independent stream of work for training, and a copy of a pre-trained deep learning model is assigned to each stream.
[0085] In this case, the copy of the deep learning model may include shared weights common to all streams and adapters that are updated independently in each stream.
[0086] Each stream is independently trained by a copy of the deep learning model and a micro-batch of input data (S13).
[0087] Since each stream is trained independently, asynchronous parallel processing is possible, and thus the time required for training can be reduced.
[0088] Each stream updates the global weight adapter with the backpropagation result when training is complete, that is, when backpropagation is complete (S14).
[0089] Each stream can reduce memory and computational load by updating only the update results of the adapter to the global weight adapter instead of updating the entire copy of the pre-trained deep learning model, and consequently, reduce the time required for fine-tuning the deep learning model.
[0090] Updates to the global weight adapter can be performed using the gradient, which is the result of learning.
[0091] After updating the global weight adapter, the global weight adapter is reloaded (S15).
[0092] By reloading the global weight adapter, the adapter results updated by other streams can be reflected in the stream's training, thereby preventing a decrease in the accuracy of the training results caused by the independent training of each stream.
[0093] By updating only the global weight adapter instead of the entire deep learning model, it is possible to reduce memory usage and accelerate fine-tuning.
[0095] FIG. 9 is a drawing for illustrating a computing environment including a computing device according to another preferred embodiment of the present invention.
[0096] In the illustrated embodiments, each component may have different functions and capabilities in addition to those described below, and may include additional components in addition to those not described below. The illustrated computing environment (90) may include a computing device (891) to perform the deep learning model fine-tuning acceleration method through asynchronous parallel execution illustrated in FIG. 8. In one embodiment, the computing device (91) may be one or more components included in the deep learning model fine-tuning acceleration device through asynchronous parallel execution illustrated in FIG. 1.
[0097] The computing device (91) includes at least one processor (92), a computer-readable storage medium (93), and a communication bus (95). The processor (92) may enable the computing device (91) to operate according to the exemplary embodiment described above. For example, the processor (92) may execute one or more programs (94) stored in the computer-readable storage medium (93). The one or more programs (94) may include one or more computer-executable instructions, and the computer-executable instructions may be configured to enable the computing device (91) to perform operations according to the exemplary embodiment when executed by the processor (892).
[0098] The communication bus (95) interconnects various other components of the computing device (91), including the processor (92) and the computer-readable storage medium (93).
[0099] The computing device (91) may also include one or more input / output interfaces (96) and one or more communication interfaces (97) that provide an interface for one or more input / output devices (98). The input / output interfaces (96) and communication interfaces (97) are connected to a communication bus (95). The input / output devices (98) may be connected to other components of the computing device (91) through the input / output interfaces (96). An exemplary input / output device (98) may include input devices such as a pointing device (such as a mouse or trackpad), a keyboard, a touch input device (such as a touchpad or touchscreen), a voice or sound input device, various types of sensor devices and / or imaging devices, and / or output devices such as a display device, a printer, a speaker and / or a network card. An exemplary input / output device (98) may be included inside the computing device (91) as a component constituting the computing device (91), or it may be connected to the computing device (91) as a separate device distinct from the computing device (91).
[0101] According to the deep learning model fine-tuning acceleration device and method through asynchronous parallel execution according to the present invention as described above, the fine-tuning time in a single GPU environment with limited memory and computational capacity can be reduced, and additional memory usage in asynchronous parallel execution can be prevented.
[0103] Although specific embodiments have been described in the detailed description of the present invention, it is understood that various modifications are possible within the scope of the invention. Therefore, the scope of the present invention is not limited to the described embodiments but should be defined by the claims set forth below and equivalents thereof.
Claims
Claim 1 A deep learning model fine-tuning acceleration device through asynchronous parallel execution, comprising: a memory containing one or more instructions; and a processor that executes one or more instructions stored in the memory; wherein the processor divides a mini-batch, which is a subset of an input dataset for fine-tuning of a pre-training, into micro-batches that are smaller than the mini-batch, and inputs each of the divided micro-batches into a plurality of streams that are independent workflows, and each of the plurality of streams independently updates a global adapter weight shared by the plurality of streams when backpropagation for the input micro-batches for fine-tuning of the pre-trained model is completed, wherein the streams include a shared weight that is a copy of the pre-trained model and the global adapter weight, and wherein the processor is a single GPU (Graphic Processor Unit). Claim 2 A deep learning model fine-tuning acceleration device through asynchronous parallel execution, wherein, in claim 1, the processor sets the adapter of the first stream among the plurality of streams as the global adapter weight before fine-tuning the pre-trained model. Claim 3 A deep learning model fine-tuning acceleration device through asynchronous parallel execution, wherein, in claim 1, each of the plurality of streams independently updates the global adapter weights and then reflects the updated global adapter weights in the model weights of the streams. Claim 4 A deep learning model fine-tuning acceleration device through asynchronous parallel execution, wherein, in claim 1, each of the plurality of streams updates the global adapter weights using the gradient, which is the learning result, when learning for the input micro-batch is completed. Claim 5 delete Claim 6 A method for accelerating deep learning model fine-tuning through asynchronous parallel execution performed by a deep learning model fine-tuning acceleration device comprising one or more processors and memory, comprising: a step of dividing a mini-batch, which is a subset of an input dataset for fine-tuning a pre-training, into micro-batches that are smaller than the mini-batch; a step of inputting each of the divided micro-batches into a plurality of streams, which are independent workflows; and a step of each of the plurality of streams independently updating a global adapter weight shared by the plurality of streams when backpropagation for the micro-batches input for fine-tuning the pre-trained model is completed; wherein the streams include a shared weight that is a copy of the pre-trained model and the global adapter weight, and wherein the deep learning model fine-tuning acceleration method is characterized by being performed by a single GPU. Claim 7 A method for accelerating deep learning model fine-tuning through asynchronous parallel execution, characterized in that, in claim 6, after the step of inputting the divided micro-batches into a plurality of streams which are independent workflows, the adapter of the first stream among the plurality of streams is set as the global adapter weight. Claim 8 A method for accelerating deep learning model fine-tuning through asynchronous parallel execution, characterized in that, in claim 6, after the step of independently updating global adapter weights, the updated global adapter weights are reflected in the model weights of the stream. Claim 9 A method for accelerating fine-tuning of a deep learning model through asynchronous parallel execution, wherein the step of independently updating global adapter weights in claim 6 is characterized by updating the global adapter weights using the gradient, which is the learning result, when learning for the input micro-batch is completed. Claim 10 delete
Citation Information
Patent Citations
Distributed weight updates for backpropagation in neural networks
KR1020220074970A
Out-of-order backpropagation scheduling method for deep learning
KR1020230040282A