Model training data loading method and device, electronic equipment and storage medium

By separating data loading and model training into independent processes and performing them in parallel, the waiting problem in traditional training is solved, and the efficiency and speed of model training are improved.

CN117149296BActive Publication Date: 2026-07-03BEIJING QIYI CENTURY SCI & TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING QIYI CENTURY SCI & TECH CO LTD
Filing Date
2023-07-25
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

In traditional model training, data loading and model training wait for each other, resulting in low efficiency in training large datasets and large models.

Method used

Data loading and model training are separated into two independent processes. The GPU data loading process stores training data in GPU memory and stores the memory address in a storage queue. The model training process retrieves data from the queue for training, thus achieving parallel processing of data loading and model training.

Benefits of technology

This effectively avoids the mutual waiting between data loading and model training, improves model training efficiency, shortens data loading time, and increases overall training speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117149296B_ABST
    Figure CN117149296B_ABST
Patent Text Reader

Abstract

The model training data loading method, apparatus, electronic device, and storage medium provided in this invention include, upon receiving a model training instruction, creating a model training process and multiple GPU data loading processes, and executing the following for each GPU data loading process: loading model training data from the model training dataset, storing the model training data in the GPU memory of the corresponding GPU, obtaining the GPU memory address, storing the memory address in a storage queue, and repeating the next data loading; for each training cycle, based on the model training process, sequentially retrieving a target memory address from the storage queue, reading model training data from the corresponding GPU memory according to the target memory address, and performing model training based on the model training data until model training is complete. This invention separates data loading and model training into two independent processes, effectively avoiding mutual waiting and greatly improving model training efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of model training technology, and in particular to a model training data loading method, apparatus, electronic device and storage medium. Background Technology

[0002] Traditional model training, whether data-parallel or distributed, employs a data-load-then-model-training approach. The specific process is as follows: data loading - model training - data loading - model training, repeating in a loop, with data loading and model training waiting for each other. This waiting is almost imperceptible when training small datasets, but when training large datasets and models, this mutual waiting can easily reduce model training efficiency. Summary of the Invention

[0003] In view of this, embodiments of the present invention provide a method, apparatus, electronic device, and storage medium for loading model training data, which allows data loading and model training to run independently to avoid waiting for each other. This parallel approach to data loading and model training effectively improves model training efficiency.

[0004] In a first aspect, embodiments of the present invention provide a method for loading model training data, wherein the method includes:

[0005] Upon receiving a model training instruction, a model training process and multiple GPU data loading processes are created; each GPU data loading process is created by the corresponding GPU.

[0006] For each GPU data loading process, the following steps are performed: load the model training data from the model training dataset, store the model training data in the GPU memory of the GPU corresponding to the GPU data loading process, obtain the memory address of the GPU memory, store the memory address in the storage queue, and repeat the next data loading process.

[0007] For each training cycle, the model training process sequentially retrieves a target GPU memory address from the storage queue, reads model training data from the corresponding GPU memory based on the target GPU memory address, and performs model training based on the model training data until the model training is completed and the model training process and multiple GPU data loading processes end.

[0008] In one possible implementation, the model training dataset includes multiple model training sample data, as well as a specific GPU identifier and model label corresponding to each model training sample data; wherein, the model label is a multi-bit string composed of a hierarchy identifier and a category identifier;

[0009] The model training data is loaded from the model training dataset, including:

[0010] Find the target-specific GPU identifier in the model training dataset that matches the GPU identifier of the GPU corresponding to the GPU data loading process;

[0011] Obtain training sample data for multiple target models corresponding to a specific GPU identifier;

[0012] Randomly load a specified number of target model training sample data from multiple target model training sample data sets;

[0013] The training sample data of the target model is processed by frame extraction, and the model labels corresponding to the training sample data of the target model are processed by string encoding to obtain the model training data.

[0014] In one possible implementation, the training sample data of the target model is subjected to frame extraction processing, including:

[0015] Set the frame extraction parameters for the DALI frame extraction rules; among them, the frame extraction parameters include the frame extraction sequence size parameter, the interval between adjacent frame extraction start frames parameter, and the frame extraction sampling interval.

[0016] The training sample data of the target model is processed by extracting frames according to the frame extraction parameters.

[0017] In one possible implementation, after storing the video memory address into the storage queue, the method further includes:

[0018] Stop the GPU data loading process.

[0019] In one possible implementation, the method further includes:

[0020] During the process of stopping GPU data loading, monitor whether the model training data corresponding to the video memory address has completed the model training for the current training cycle;

[0021] If the model training data corresponding to the video memory address is detected to have completed the model training for the current training cycle, a process wake-up instruction is generated.

[0022] The GPU data loading process is woken up based on the process wake-up command.

[0023] In one possible implementation, model training based on model training data includes:

[0024] Perform string decoding on the model labels corresponding to the model training data;

[0025] The model labels after string decoding and the model training sample data after frame extraction are input into the preset neural network for model training.

[0026] In one possible implementation, the model labels after string decoding and the model training sample data after frame extraction are input into a preset neural network for model training, including:

[0027] The model labels after string decoding and the model training sample data after frame extraction are input into a preset neural network, and the preset neural network outputs the label prediction value.

[0028] The model loss value is determined based on the predicted label value and the model label after string decoding.

[0029] If the model loss value is greater than the preset loss value, the parameters of the preset neural network are updated using the model loss value until the model loss value converges to the preset loss value or the model training times reach the preset number of training times.

[0030] Secondly, embodiments of the present invention provide a model training data loading device, wherein the device includes:

[0031] A creation module is used to create a model training process and multiple GPU data loading processes when a model training instruction is received; each GPU data loading process is created by the corresponding GPU.

[0032] The data loading module is used to perform the following for each GPU data loading process: load the model training data from the model training dataset, store the model training data in the GPU memory of the GPU corresponding to the GPU data loading process, obtain the memory address of the GPU memory, store the memory address in the storage queue, and repeat the next data loading.

[0033] The model training module is used to retrieve a target GPU memory address from the storage queue sequentially for each training cycle, read model training data from the corresponding GPU memory according to the target GPU memory address, and perform model training based on the model training data until the model training is completed and the model training process and multiple GPU data loading processes end.

[0034] Thirdly, embodiments of the present invention provide an electronic device, comprising: a processor and a memory, wherein the processor is configured to execute a model training data loading program stored in the memory to implement the above-described model training data loading method.

[0035] Fourthly, embodiments of the present invention provide a storage medium, wherein the storage medium stores one or more programs, which can be executed by one or more processors to implement the above-described model training data loading method.

[0036] The model training data loading method, apparatus, electronic device, and storage medium provided in this invention include, upon receiving a model training instruction, creating a model training process and multiple GPU data loading processes, and executing the following for each GPU data loading process: loading model training data from the model training dataset, storing the model training data in the GPU memory of the GPU corresponding to the GPU data loading process, obtaining the GPU memory address, storing the memory address in a storage queue, and repeating the next data loading; for each training cycle, based on the model training process, sequentially retrieving a target memory address from the storage queue, reading model training data from the corresponding GPU memory according to the target memory address, and performing model training based on the model training data, until model training is completed and the model training process and multiple GPU data loading processes end. The GPU data loading process of this invention repeats the next data loading after placing the loaded data's memory address into the storage queue, and the model training process can retrieve the next model training data from the storage queue for model training after completing training on the current model training data. This method of separating data loading and model training into two independently running processes effectively avoids mutual waiting and greatly improves model training efficiency. Attached Figure Description

[0037] Figure 1 A flowchart illustrating an embodiment of a model training data loading method provided by this invention;

[0038] Figure 2 A schematic diagram of a process framework for loading model training data provided in an embodiment of the present invention;

[0039] Figure 3 A flowchart illustrating an embodiment of a model training data loading device provided by this invention;

[0040] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0041] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0042] To facilitate understanding of the embodiments of the present invention, further explanations and descriptions will be provided below with reference to the accompanying drawings and specific embodiments. These embodiments do not constitute a limitation on the embodiments of the present invention.

[0043] This invention provides a method for loading model training data, see [link to relevant documentation]. Figure 1 The above is a flowchart of an embodiment of a model training data loading method provided by the present invention. Figure 1 The process shown may include the following steps:

[0044] Step 101: Upon receiving the model training instruction, create a model training process and multiple GPU data loading processes;

[0045] Each GPU (Graphics Processing Unit) data loading process is created by the corresponding GPU; this can be understood as one GPU creating one GPU data loading process. In other words, loading model training data is done on the GPU. The number of GPU data loading processes can be set according to actual needs and is not limited here. The model training process can be created by either the GPU or the CPU (Central Processing Unit / Processor).

[0046] A process refers to a model with a series of thread segments, each performing an action. In this embodiment, creating the model training process and the GPU data loading process involves creating a series of thread segments. For example, defining the thread segment corresponding to the process of loading model training data from the model training dataset, the thread segment corresponding to the process of storing model training data in the GPU memory of the GPU corresponding to the GPU data loading process, and so on, for different processes. In general, the created GPU data loading process and model training process are repetitive and continuous to achieve data loading and model training.

[0047] Step 102: For each GPU data loading process, the following steps are performed: Load the model training data from the model training dataset, store the model training data in the GPU memory of the GPU corresponding to the GPU data loading process, obtain the memory address of the GPU memory, store the memory address in the storage queue, and repeat the next data loading.

[0048] In this embodiment, each GPU data loading process loads a fixed number of model training data from the model training dataset at a time. This fixed number is at least one, and the model training data loaded by each GPU data loading process is different from each other.

[0049] After loading the model training data, each GPU data loading process stores the model training data in the GPU memory of the corresponding GPU. This can be understood as storing the model training data in the GPU memory of the GPU that created the GPU data loading process. After each GPU data loading process finishes loading the model training data for the current round, it will sequentially put the GPU memory address where the model training data was stored into the stack of the storage queue. After that, each GPU data loading process repeats the above process to load the next round of model training data.

[0050] Step 103: For each training cycle, based on the model training process, a target GPU memory address is retrieved from the storage queue in sequence, and model training data is read from the corresponding GPU memory according to the target GPU memory address. Model training is performed based on the model training data until the model training is completed and the model training process and multiple GPU data loading processes end.

[0051] In this embodiment, model training is not limited to video model training, audio model training, etc. In each model training cycle, the model training process extracts a target memory address from the memory queue in the order of the memory addresses in the memory queue. Then, the corresponding GPU memory is found according to the target memory address, and the model training data corresponding to the target memory address is read from the GPU memory to perform model training.

[0052] To facilitate understanding of the above model training and data loading process, Figure 2 This diagram illustrates a workflow framework for loading model training data, as shown below. Figure 2 As shown, the process framework provides four GPU data loading processes 200, one model training process 201, and a storage queue 202. The four GPU data loading processes load model training data separately. After loading the model training data for the current round, the GPU data loading process stores the model training data in the GPU memory and puts the GPU memory address into the storage queue 202 before reloading the data. In each training cycle, the model training process 201 extracts a target memory address from the storage queue 202, reads the model training data corresponding to the target memory address, and performs model training. Then, the model training is repeated in the next training cycle until the model training is completed. This model training data loading method can achieve the effect of loading data and training simultaneously, achieving the goal of making the data loading process and the model training process independent of each other, thereby improving the model training efficiency.

[0053] Furthermore, traditional data loading is implemented using the CPU. Data loading typically uses multi-CPU processes, but experiments have shown that multi-CPU process data loading is less efficient than single-CPU process data loading. This is because data loading requires decoding and frame extraction of video or audio, a process that consumes a lot of CPU resources. When multiple processes are enabled, the CPU not only has to manage the state switching between processes, but also manages a large amount of data transfer between processes, further squeezing out CPU resources and resulting in low efficiency of multi-process.

[0054] In this embodiment, GPUs are used instead of CPUs to load data. Each GPU manages its own data loading process, and there is no mutual interference between GPUs. Therefore, the multi-GPU data loading process can effectively accelerate the loading rate of model training data, shorten the data loading time, and thus further improve the model training efficiency.

[0055] The model training data loading method provided in this invention includes, upon receiving a model training instruction, creating a model training process and multiple GPU data loading processes, and executing the following for each GPU data loading process: loading model training data from the model training dataset, storing the model training data in the GPU memory of the GPU corresponding to the GPU data loading process, obtaining the GPU memory address, storing the memory address in a storage queue, and repeating the next data loading; for each training cycle, based on the model training process, sequentially retrieving a target memory address from the storage queue, reading model training data from the corresponding GPU memory according to the target memory address, and performing model training based on the model training data, until model training is completed and both the model training process and the multiple GPU data loading processes end. In this invention, the GPU data loading process repeatedly executes the next data loading after placing the loaded data's memory address into the storage queue. The model training process can retrieve the next model training data from the storage queue for model training after completing training on the current model training data. This method of separating data loading and model training into two independently running processes effectively avoids mutual waiting and greatly improves model training efficiency.

[0056] In addition, the multi-GPU data loading process can manage its own data loading process without affecting each other, effectively accelerating the loading rate of model training data, shortening the data loading time, and further improving model training efficiency.

[0057] In practical use, the model training dataset includes multiple model training sample data, as well as a specific GPU identifier and model label corresponding to each model training sample data; among them, the model label is a multi-character string composed of a hierarchy identifier and a category identifier;

[0058] The specific GPU identifier is a unique identifier for the GPU, used to indicate which model training sample data each GPU data loading process can load. For example, if there are 100 model training sample data, and the specific GPU identifier for the first 50 model training sample data is 1, and the specific GPU identifier for the last 50 model training sample data is 2, then it means that the first 50 model training sample data needs to be loaded by the GPU data loading process of the GPU with identifier 1, and the last 50 model training sample data needs to be loaded by the GPU data loading process of the GPU with identifier 2.

[0059] Model labels are used to mark the data classification features of model training sample data. In this embodiment, the model label is a multi-character string composed of a hierarchy identifier and a category identifier. The hierarchy can be understood as categories with completely different features. For example, furniture, clothing, and transportation are three completely different hierarchies. To refine the hierarchy, it can be further represented by categories. In this embodiment, the model training sample data is labeled with a two-level hierarchy-category label to clearly identify which level and category the model training sample data belongs to.

[0060] The hierarchy identifier is the unique identifier for the hierarchy, and the category identifier is the unique identifier for the category. To facilitate the distinction between hierarchy and category relationships, a 4-character string is used for model labeling. The first two characters represent the hierarchy, and the last two characters represent the category. Ideally, both the hierarchy and category identifiers should be represented by numbers. The hierarchy identifiers are numbered starting from 0, and the category identifiers are numbered starting from 1. For ease of explanation, for example, the `action_huodong` hierarchy includes six categories: singing, dancing, swimming, rowing, climbing, and professional rock climbing; the `event_absparty` hierarchy includes six categories: wedding, proposal, birthday, funeral, opening ceremony, and dance / party. The model labeling for each hierarchy and category is shown in Table 1.

[0061] Table 1

[0062]

[0063] In practical use, if there are many hierarchical categories, the number of characters in the string can be 6, 8, or 10; there is no limitation here.

[0064] Based on the above, in one embodiment, the process of loading model training data from the model training dataset in step 102 can be implemented through steps A1 to A4:

[0065] Step A1: Find the target-specific GPU identifier that matches the GPU identifier of the GPU corresponding to the GPU data loading process in the model training dataset;

[0066] Step A2: Obtain training sample data for multiple target models corresponding to the target-specific GPU identifier;

[0067] The purpose of steps A1-A2 above is to determine which specific model training sample data the GPU data loading process needs to load.

[0068] Step A3: Randomly load a specified number of target model training sample data from multiple target model training sample data;

[0069] Because the amount of training data required for model training is enormous, the amount of training sample data for the target model is also very large. Therefore, the GPU data loading process loads a specified number of training sample data for the target model at a time. This specified data can be one or more, and is not limited here.

[0070] Step A4 involves performing frame extraction on the target model training sample data and string encoding on the model labels corresponding to the target model training sample data to obtain the model training data.

[0071] After obtaining the target model training sample data, it is necessary to perform frame extraction processing on each target model training sample data. The specific frame extraction process is as follows: set the frame extraction parameters of the DALI frame extraction rules; and perform frame extraction processing on the target model training sample data according to the frame extraction parameters.

[0072] The frame extraction parameters in the DALI (NVIDIA Data Loading Library) frame extraction rules include the sequence length parameter, the step parameter (interval between starting frames of adjacent extractions), and the stride parameter. If sequence_length = 16, it means that the size of each extracted frame sequence is 16. Step = 1 means that the interval between the starting frames of two consecutive extractions is 1. For example, if the total number of frames in the target model training sample data is 100, then the starting frame of the previous extraction is 0, the starting frame of the next extraction is 1, the starting frame of the next extraction is 2, and so on. (The details are omitted here.) stride = 4 means that the frame extraction sampling interval is 4, which can be understood as... Frames are extracted at intervals. Therefore, the frame extraction sequence obtained by extracting frames from the target model training sample data with a total of 100 frames according to sequence_length=16, step=1, stride=4 is: [0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60], [1, 5, 9, 13, 17, 21, 25, 29, 33, 37, 41, 45, 49, 53, 57, 61], ..., [39, 43, 47, 51, 55, 59, 63, 67, 71, 75, 79, 83, 87, 91, 95, 99]. One frame extraction yields 40 frame extraction sequences.

[0073] When sequence_length=16, step=1, stride=5, the frame extraction sequence obtained by extracting frames from the training sample data of the target model with a total of 100 frames is: [0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75], [1, 6, 11, 16, 21, 26, 31, 36, 41, 46, 51, 56, 61, 66, 71, 76], ..., [24, 29, 34, 39, 44, 49, 54, 59, 64, 69, 74, 79, 84, 89, 94, 99]. One frame extraction yields 25 frame extraction sequences.

[0074] When sequence_length=16, step=1, stride=6, the frame extraction sequence obtained by extracting frames from the training sample data of the target model with a total of 100 frames is: [0, 6, 12, 18, 24, 30, 36, 42, 48, 54, 60, 66, 72, 78, 84, 90], [1, 7, 13, 19, 25, 31, 37, 43, 49, 55, 61, 67, 73, 79, 85, 91], ..., [9, 15, 21, 27, 33, 39, 45, 51, 57, 63, 69, 75, 81, 87, 93, 99]. One frame extraction yields 10 frame extraction sequences.

[0075] In this embodiment, multiple different frame-skipping parameters can be set, and multiple frame-skipping sequences can be obtained from one frame-skipping operation. Compared with the existing DALI frame-skipping which defaults to skimming consecutive frames, this method can achieve random frame-skipping across the entire data range.

[0076] The process of string encoding the model labels is to convert multi-character strings into integers. For ease of understanding, the encoded labels in Table 1 are obtained by string encoding the model labels. In this embodiment, multiple frame sequences and encoded labels are used as a model training data.

[0077] In practical use, there is a problem with this GPU data loading process: after loading the current round of model training data and putting the GPU memory address where the model training data is stored into the storage queue, and starting to load the next round of model training data, DALI does not allocate new memory to store the next round of model training data. Instead, it overwrites the memory corresponding to the previous round of model training data. This results in the model training process trying to retrieve the model training data corresponding to the memory address from the storage queue, which has already been modified or overwritten, causing the model training data to be abnormal.

[0078] To prevent the next round of model training data from overwriting the previous round's model training data in the GPU memory, it is necessary to restrict the loading of the next round of model training data until the previous round's model training data has been completely used for model training. Specifically, after storing the GPU memory address in the storage queue, the GPU data loading process should be stopped to prevent it from reloading the model training data and thus effectively avoiding overwriting the previous round's data. During the process of stopping the GPU data loading process, it is necessary to monitor whether the model training data corresponding to the GPU memory address has completed the current training cycle. If it is detected that the model training data corresponding to the GPU memory address has completed the current training cycle, a process wake-up command is generated; the GPU data loading process is then woken up based on this command.

[0079] This process wake-up command can wake up the GPU data loading process to reload data. That is, after waiting for the model training process to retrieve the current round of model training data from the storage queue and complete the model training, the corresponding GPU data loading process is woken up to start reading the next round of model training data, and then the GPU data loading process is stopped again, waiting for the next wake-up.

[0080] In one embodiment, the process of training the model based on the model training data in step 103 above can be implemented through steps B1 to B2:

[0081] Step B1: Decode the model labels corresponding to the model training data into strings;

[0082] Because the model labels were encoded during the data loading process, string decoding is needed to clarify the specific model labels during model training. This decoding process yields the hierarchy and category identifiers. Specifically, the encoded model labels are padded with zeros to the left to create a multi-character string. For example, in Table 1, the number 1 is padded with zeros to the left to obtain the 4-character model identifier 0001.

[0083] Step B2: Input the model labels after string decoding and the model training sample data after frame extraction into the preset neural network for model training.

[0084] The specific model training process is as follows: input the model labels after string decoding and the model training sample data after frame extraction into the preset neural network, and the preset neural network outputs the label prediction value; determine the model loss value based on the label prediction value and the model labels after string decoding; if the model loss value is greater than the preset loss value, apply the model loss value to update the parameters of the preset neural network until the model loss value converges to the preset loss value or the number of model training times reaches the preset number of training times.

[0085] The process involves calculating the cross-entropy between the predicted label value and the model label to obtain the model loss value. If the determined model loss value is greater than the preset loss value, it indicates that the trained preset neural network has not reached the preset convergence. The parameters of the preset neural network are updated using the model loss value to obtain the updated preset neural network. A new memory address can be obtained from the storage queue, and the model training data at the memory address can be read to retrain the model until the determined model loss value is not greater than the preset loss value or the number of training iterations reaches the preset number of training iterations. This indicates that the updated preset neural network has achieved the preset convergence effect, and a trained model is obtained for subsequent model applications.

[0086] This invention provides a model training data loading device, see below. Figure 3 The above is a flowchart of an embodiment of a model training data loading device provided by an embodiment of the present invention. Figure 3 The process shown may include the following steps:

[0087] Module 301 is used to create a model training process and multiple GPU data loading processes when a model training instruction is received; each GPU data loading process is created by the corresponding GPU.

[0088] The data loading module 302 is used to perform the following for each GPU data loading process: loading model training data from the model training dataset, storing the model training data into the GPU memory of the GPU corresponding to the GPU data loading process, obtaining the memory address of the GPU memory, storing the memory address into the storage queue, and repeating the next data loading.

[0089] The model training module 303 is used to retrieve a target video memory address from the storage queue sequentially based on the model training process for each training cycle, read model training data from the corresponding GPU video memory according to the target video memory address, and perform model training based on the model training data until the model training is completed and the model training process and multiple GPU data loading processes end.

[0090] The model training data loading device provided in this invention includes, upon receiving a model training instruction, creating a model training process and multiple GPU data loading processes. For each GPU data loading process, the following steps are performed: loading model training data from the model training dataset, storing the model training data in the GPU memory of the GPU corresponding to the GPU data loading process, obtaining the GPU memory address, storing the memory address in a storage queue, and repeating the next data loading. For each training cycle, based on the model training process, a target memory address is sequentially retrieved from the storage queue, model training data is read from the corresponding GPU memory according to the target memory address, and model training is performed based on the model training data until model training is complete and both the model training process and the multiple GPU data loading processes terminate. In this invention, the GPU data loading process repeatedly executes the next data loading after placing the loaded data's memory address into the storage queue. The model training process can retrieve the next model training data from the storage queue for model training after completing training on the current model training data. This method of separating data loading and model training into two independently running processes effectively avoids mutual waiting and greatly improves model training efficiency.

[0091] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Figure 4The illustrated electronic device 500 includes at least one processor 501, a memory 502, at least one network interface 504, and other user interfaces 503. The various components in the electronic device 500 are coupled together via a bus system 505. It is understood that the bus system 505 is used to implement communication between these components. In addition to a data bus, the bus system 505 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 4 The general designated all buses as Bus System 505.

[0092] The user interface 503 may include a display, keyboard, or clicking device (e.g., mouse, trackball, touchpad, or touchscreen).

[0093] It is understood that the memory 502 in the embodiments of the present invention can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The memory 502 described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0094] In some implementations, memory 502 stores elements, executable units or data structures, or subsets thereof, or extended sets thereof: operating system 5021 and application program 5022.

[0095] The operating system 5021 includes various system programs, such as the framework layer, core library layer, and driver layer, used to implement various basic business functions and handle hardware-based tasks. The application program 5022 includes various applications, such as a media player and a browser, used to implement various application functions. The program implementing the method of this embodiment can be included in the application program 5022.

[0096] In this embodiment of the invention, the processor 501 executes the method steps provided in each method embodiment by calling the program or instructions stored in the memory 502, specifically the program or instructions stored in the application program 5022.

[0097] The methods disclosed in the above embodiments of the present invention can be applied to or implemented by processor 501. Processor 501 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in processor 501 or by instructions in the form of software. The processor 501 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of the present invention can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software units in the decoding processor. The software units may be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 502. Processor 501 reads the information in memory 502 and, in conjunction with its hardware, completes the steps of the above method.

[0098] It is understood that the embodiments described herein can be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described herein, or combinations thereof.

[0099] For software implementation, the techniques described herein can be implemented by units that perform the functions described herein. The software code can be stored in memory and executed by a processor. The memory can be implemented in the processor or external to the processor.

[0100] The electronic device provided in this embodiment may be as follows: Figure 4 The electronic device shown can perform the following: Figure 1 All steps of the model training data loading method are implemented to achieve... Figure 1 For details on the technical effectiveness of the model training data loading method shown, please refer to [link / reference]. Figure 1 The relevant descriptions are presented concisely and will not be elaborated upon here.

[0101] This invention also provides a storage medium (computer-readable storage medium). This storage medium stores one or more programs. The storage medium may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as read-only memory, flash memory, hard disk, or solid-state drive; the memory may also include combinations of the above types of memory.

[0102] When one or more programs in the storage medium can be executed by one or more processors to implement the above-described model training data loading method.

[0103] The processor is used to execute the model training data loading program stored in the memory to implement the steps of the model training data loading method.

[0104] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0105] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented in hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0106] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A model training data loading method, characterized in that, The method includes: Upon receiving a model training instruction, a model training process and multiple GPU data loading processes are created; wherein each GPU data loading process is created by a corresponding GPU. For each GPU data loading process, the following steps are performed: loading model training data from the model training dataset, storing the model training data in the GPU memory of the GPU corresponding to the GPU data loading process, obtaining the memory address of the GPU memory, storing the memory address in the storage queue, and repeating the next data loading. For each training cycle, based on the model training process, a target video memory address is retrieved from the storage queue in sequence, model training data is read from the corresponding GPU video memory according to the target video memory address, and model training is performed based on the model training data until the model training is completed and the model training process and multiple GPU data loading processes end. The model training dataset includes multiple model training sample data, as well as a specific GPU identifier and model label corresponding to each model training sample data; wherein the model label is a multi-character string composed of a hierarchy identifier and a category identifier; The process of loading model training data from the model training dataset includes: Find the target specific GPU identifier in the model training dataset that matches the GPU identifier of the GPU corresponding to the GPU data loading process; Obtain training sample data of multiple target models corresponding to the target-specific GPU identifier; A specified number of target model training sample data are randomly loaded from the multiple target model training sample data; The target model training sample data is processed by frame extraction, and the model labels corresponding to the target model training sample data are processed by string encoding to obtain model training data.

2. The method of claim 1, wherein, The step of performing frame extraction processing on the training sample data of the target model includes: Set the frame extraction parameters for the DALI frame extraction rules; wherein, the frame extraction parameters include the frame extraction sequence size parameter, the interval between adjacent frame extraction start frames parameter, and the frame extraction sampling interval; The training sample data of the target model is processed by extracting frames according to the frame extraction parameters.

3. The method of claim 1, wherein, After storing the video memory address into the storage queue, the method further includes: Stop the GPU data loading process.

4. The method of claim 3, wherein, The method further includes: During the process of stopping the GPU data loading process, monitor whether the model training data corresponding to the video memory address has completed the model training for the current training cycle; If the model training data corresponding to the video memory address is detected to have completed the model training for the current training cycle, a process wake-up instruction is generated. The GPU data loading process is woken up based on the process wake-up command.

5. The method of claim 1, wherein, The process of training the model based on the model training data includes: Perform string decoding on the model labels corresponding to the model training data; The model labels after string decoding and the model training sample data after frame extraction are input into a preset neural network for model training.

6. The method of claim 5, wherein, The step of inputting the model labels after string decoding and the model training sample data after frame extraction into a preset neural network for model training includes: The model labels after string decoding and the model training sample data after frame extraction are input into a preset neural network, and the preset neural network outputs the label prediction value. The model loss value is determined based on the predicted label value and the model label after string decoding. If the model loss value is greater than the preset loss value, the parameters of the preset neural network are updated using the model loss value until the model loss value converges to the preset loss value or the number of training iterations reaches the preset number of training iterations.

7. A model training data loading device, characterized in that, The device includes: A creation module is used to create a model training process and multiple GPU data loading processes when a model training instruction is received; wherein each GPU data loading process is created by the corresponding GPU. The data loading module is used to perform the following for each of the GPU data loading processes: loading model training data from the model training dataset, storing the model training data in the GPU video memory of the GPU corresponding to the GPU data loading process, obtaining the video memory address of the GPU video memory, storing the video memory address in the storage queue, and repeating the next data loading. The model training module is used to, for each training cycle, sequentially retrieve a target video memory address from the storage queue based on the model training process, read model training data from the corresponding GPU video memory according to the target video memory address, and perform model training based on the model training data until the model training is completed and the model training process and multiple GPU data loading processes end. The model training dataset includes multiple model training sample data, as well as a specific GPU identifier and model label corresponding to each model training sample data; wherein the model label is a multi-character string composed of a hierarchy identifier and a category identifier; The data loading module is specifically used for: Find the target specific GPU identifier in the model training dataset that matches the GPU identifier of the GPU corresponding to the GPU data loading process; Obtain training sample data of multiple target models corresponding to the target-specific GPU identifier; A specified number of target model training sample data are randomly loaded from the multiple target model training sample data; The target model training sample data is processed by frame extraction, and the model labels corresponding to the target model training sample data are processed by string encoding to obtain model training data.

8. An electronic device, comprising: include: A processor and a memory, the processor being configured to execute a model training data loading program stored in the memory to implement the model training data loading method according to any one of claims 1 to 6.

9. A storage medium, characterized by The storage medium stores one or more programs, which can be executed by one or more processors to implement the model training data loading method according to any one of claims 1 to 6.