A training data storage processing method, device and medium

Through the management of distributed memory file systems and control nodes, distributed storage and backup of training data are realized, which solves the problem of slow data acquisition from external storage when training nodes fail, and improves the efficiency and speed of training tasks.

CN118427175BActive Publication Date: 2024-08-30MU XI LING ZHI KE JI (HANG ZHOU) YOU XIAN GONG SI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410888318.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-04
Publication Date
2024-08-30
Estimated Expiration
2044-07-04

AI Technical Summary

Technical Problem

When the training node fails, the existing distributed framework system obtains data from the external memory slowly, which affects the progress and duration of the training task.

Method used

A distributed memory file system is used to manage storage nodes, storage directories and backup numbers by controlling nodes to achieve distributed storage and backup of training data. When a training node fails, data is obtained from the memory to replace the failed node.

Benefits of technology

It speeds up the progress of training tasks, reduces training time, and improves data acquisition efficiency through memory-level read and write speeds.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118427175B
    Figure CN118427175B
Patent Text Reader

Abstract

The present application relates to the field of electronic digital data processing technology, and in particular to a processing method, device and medium for training data storage. The method is applied to a distributed training framework, the framework includes a distributed memory file system, the system includes a control node and a number of storage nodes, the control node is used to implement the management of storage nodes, storage directories and backup quantities, and each training node can implement read and write operations on the storage directory through the control node; the method includes the following steps: after the control node receives the request to save training data sent by the target training node, it returns the target storage directory to the target training node; after the target training node receives the target storage directory, it uploads the training data to be saved to the target storage directory; the control node backs up the training data uploaded by the target training node in other storage nodes according to the backup quantity corresponding to the target storage directory. The present invention achieves memory-level read and write speeds and speeds up the training progress.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electronic digital data processing, and in particular to a training data storage processing method, device and medium. Background Art

[0002] The existing distributed framework system includes several training nodes, each of which includes a server. Each server includes a graphics processing unit (GPU) and memory. Different training nodes perform different training tasks. The training data generated by the graphics processing unit of each training node will first be stored in the corresponding memory, and then stored from the memory to the external memory. The type of the external memory can be a disk, etc. The external memory is usually provided by the user. When a training node fails, causing the corresponding memory to exit, the new training node used to replace the failed training node needs to obtain the previous training data of the failed training node from the external memory to avoid the new training node repeating the training process before the failed training node failed, affecting the progress of the entire training task. However, compared with obtaining training data from memory, the speed of obtaining training data from external storage is slower, which affects the progress of the training task and has the problem of long training time. Summary of the invention

[0003] The present invention aims to provide a method, device and medium for processing training data storage to speed up the progress of training tasks and reduce training time.

[0004] According to a first aspect of the present invention, a method for processing training data storage is provided, the method being applied to a distributed training framework, the distributed training framework comprising a plurality of training nodes, each training node comprising a graphics processor, and different graphics processors being used to perform different training tasks; the distributed training framework further comprising a distributed memory file system, the distributed memory file system comprising a control node and a plurality of storage nodes, each storage node being composed of a memory of a server; the distributed memory file system further comprising a plurality of storage directories, each storage directory corresponding to a backup quantity, the control node being used to implement management of storage nodes, storage directories and backup quantities, and each training node being able to implement read and write operations on the plurality of storage directories through the control node; the method comprising the following steps:

[0005] If the target training node intends to save the training data, the target training node sends a request to save the training data to the control node; the target training node is a training node included in the distributed training framework.

[0006] After receiving the request for saving training data sent by the target training node, the control node returns a target storage directory to the target training node; the target storage directory is a storage directory among the several storage directories.

[0007] After receiving the target storage directory returned by the control node, the target training node uploads the training data to be saved to the target storage directory.

[0008] The control node obtains the backup quantity corresponding to the target storage directory, and backs up the training data uploaded by the target training node on other storage nodes according to the backup quantity; the other storage nodes are the storage nodes included in the distributed memory file system except the target storage node, and the target storage node is the storage node in the distributed memory file system that receives the training data uploaded by the target training node.

[0009] Furthermore, the process of obtaining the number of backups corresponding to the target storage directory includes:

[0010] Gets the importance of the training data to be stored in the target storage directory.

[0011] Gets the historical failure count of training nodes included in the distributed training framework.

[0012] Gets the storage space usage of the storage nodes included in the distributed memory file system.

[0013] The number of backups corresponding to the target storage directory is determined according to the importance, the number of historical failures, and the storage space usage rate.

[0014] Furthermore, obtaining the importance of the training data to be stored in the target storage directory includes:

[0015] Get the training progress of the training node corresponding to the training data to be stored in the target storage directory.

[0016] Get the number of downstream training nodes of the training node corresponding to the training data to be stored in the target storage directory.

[0017] The importance of the training data to be stored in the target storage directory is determined according to the training progress and the number of downstream training nodes.

[0018] Furthermore, the method further comprises the following steps:

[0019] If the target training node fails, a new training node is started and added to the distributed training framework.

[0020] The newly added training node sends a request to the control node to obtain the training data of the target training node.

[0021] After the control node receives the request sent by the newly added training node to obtain the training data of the target training node, it determines whether the storage directory included in the distributed memory file system stores the training data of the target training node. If the judgment result is that the storage directory included in the distributed memory file system stores the training data of the target training node, the first storage directory is returned to the newly added training node; the first storage directory stores the training data of the target training node.

[0022] After receiving the first storage directory returned by the control node, the newly added training node obtains the training data of the target training node from the first storage directory and stores the data in its own graphics processor.

[0023] Further, if the target storage node is composed of the memory of the server included in the target training node, and the failure type of the target training node is that the graphics processor fails and the memory is not exited, then the storage node having a mapping relationship with the first storage directory is the target storage node.

[0024] Further, if the judgment result is that the storage directory included in the distributed memory file system does not store the training data of the target training node, it is determined whether the training data of the target training node is stored in the external storage of the distributed memory file system.

[0025] If the training data of the target training node is stored in the external storage of the distributed memory file system, the control node obtains the training data of the target training node from the external storage and stores it in the second storage directory.

[0026] The control node returns the second storage directory to the newly added training node.

[0027] After receiving the second storage directory, the newly added training node obtains the training data of the target training node from the second storage directory, and stores the obtained training data of the target training node in its own graphics processor.

[0028] Furthermore, the storage node having a mapping relationship with the second storage directory is composed of the memory of the server included in the newly added training node.

[0029] Further, backing up the training data uploaded by the target training node on other storage nodes according to the backup quantity includes:

[0030] If the number of backups corresponding to the target storage directory is 2, the training data uploaded by the target training node is backed up in a storage node other than the target storage node among the storage nodes included in the distributed memory file system.

[0031] If the number of backups corresponding to the target storage directory is 3, the training data uploaded by the target training node is backed up in two storage nodes other than the target storage node among the storage nodes included in the distributed memory file system.

[0032] Furthermore, the method further comprises the following steps:

[0033] Create several storage directories.

[0034] A storage node is mapped for each storage directory.

[0035] Furthermore, the method further comprises the following steps:

[0036] If the preset external storage condition is met, the control node stores part of the training data stored in the target storage directory to the external storage of the distributed memory file system; the preset external storage condition includes one of the following conditions: the ratio of the storage space occupied by the data stored in all storage nodes included in the distributed memory file system to the total storage space of all storage nodes is greater than or equal to a preset ratio; the importance of the part of the training data stored in the target storage directory is greater than or equal to a preset degree threshold; the number of times the part of the training data stored in the target storage directory is accessed within a historical preset time period is less than or equal to a preset number threshold; the total number of times the part of the training data stored in the target storage directory is accessed is less than or equal to a preset number threshold.

[0037] According to a second aspect of the present invention, there is provided an electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned method for processing training data storage when executing the computer program.

[0038] According to a third aspect of the present invention, there is provided a computer-readable storage medium storing a computer program, wherein the computer program implements the above-mentioned processing method for storing training data when executed by a processor.

[0039] Compared with the prior art, the present invention has at least the following beneficial effects:

[0040] The present invention provides a processing method for storing training data, which is applied to a distributed training framework, wherein the distributed training framework includes a plurality of training nodes, each of which includes a graphics processor, and different graphics processors perform different training tasks; on this basis, the distributed training framework of the present invention also includes a distributed memory file system, which includes a plurality of storage nodes, each of which is composed of the memory of a server; the distributed memory file system also includes a plurality of storage directories, each of which corresponds to a backup quantity, and the control node is used to manage the storage nodes, storage directories and backup quantities, and each training node can implement read and write operations on the plurality of storage directories through the control node; specifically, when a training node in the distributed training framework wants to store training data, it no longer directly stores the training data in the memory of the server included in the training node, but first sends a request to store the training data to the control node, and the control node determines the storage directory for the training data. After the training node that wants to store the training data stores the training data in the corresponding storage directory, the control node will obtain the backup quantity corresponding to the storage directory returned to the training node that wants to store the training data, and back up the training data on other storage nodes according to the backup quantity. Therefore, when a storage node storing the training data exits, there are still other storage nodes storing the training data. The training node that needs to obtain the training data can still obtain the training data from the storage node, that is, obtain the training data from the memory of a server. Compared with the method of obtaining the training data from external storage, the present invention obtains the training data from the memory, that is, achieves the reading and writing speed of the memory level. Therefore, the acquisition process of the present invention is shorter, thereby speeding up the progress of the training task and reducing the training time. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0042] Figure 1 A flowchart of a method for storing and processing training data provided in Embodiment 1 of the present invention;

[0043] Figure 2 A flowchart of a process for constructing a mapping relationship provided in the first embodiment of the present invention;

[0044] Figure 3 A flowchart of a backup process provided in Embodiment 1 of the present invention;

[0045] Figure 4 A flowchart of a process for obtaining the number of backups provided in the first embodiment of the present invention;

[0046] Figure 5 A flowchart of a process for obtaining the importance level provided in the first embodiment of the present invention;

[0047] Figure 6 A flowchart of a process for handling a fault when a fault occurs provided in the first embodiment of the present invention;

[0048] Figure 7 A flowchart of a processing procedure when a storage node does not store training data of a target training node provided in the first embodiment of the present invention. DETAILED DESCRIPTION

[0049] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0050] Embodiment 1:

[0051] The present embodiment provides a method for processing training data storage, which is applied to a distributed training framework, wherein the distributed training framework includes a plurality of training nodes, each training node includes a graphics processor, and different graphics processors are used to execute different training tasks; the distributed training framework also includes a distributed memory file system, wherein the distributed memory file system includes a control node and a plurality of storage nodes, each storage node being composed of the memory of a server; the distributed memory file system also includes a plurality of storage directories, each storage directory corresponding to a backup quantity, the control node being used to implement management of storage nodes, storage directories, and backup quantities, and each training node can implement read and write operations on the plurality of storage directories through the control node.

[0052] In this embodiment, the memory of the server constituting the storage node can be the memory of the server included in the training node or the memory of other servers. In this embodiment, each storage directory corresponds to one backup quantity, and the backup quantities corresponding to different storage directories are the same or different.

[0053] like Figure 1 As shown, the method comprises the following steps:

[0054] S100, if the target training node intends to save the training data, the target training node sends a request to save the training data to the control node; the target training node is a training node included in the distributed training framework.

[0055] In this embodiment, the timing for each training node to save training data can be set as needed, for example, saving training data once every preset time or every preset training step, or manually triggering the saving of training data, or saving training data at the end of training, or saving training data after completing several steps of model training.

[0056] S200, after receiving the request for saving training data sent by the target training node, the control node returns a target storage directory to the target training node; the target storage directory is a storage directory among the several storage directories.

[0057] As a specific implementation, Figure 2 As shown, the method further comprises the following steps:

[0058] S201, create several storage directories.

[0059] S202, mapping a storage node for each storage directory.

[0060] In this embodiment, when the control node sends a storage directory to a training node, the training node that receives the storage directory stores the training data in the storage directory or reads the training data from the storage directory. Each training node can read and write all storage directories through the control node, thereby realizing the sharing of all storage directories included in the distributed training framework.

[0061] As a specific implementation, the number of storage directories created is related to the preset training steps. For example, one storage directory is created for each training step so that the training node stores the training data in the storage directory corresponding to the training step after completing the corresponding training step.

[0062] In this embodiment, one storage directory corresponds to several storage nodes, that is, there may be a situation where there are more than or equal to one storage node corresponding to the same storage directory; similarly, one storage node may correspond to several storage directories. If a storage node corresponds to a storage directory, it means that the storage node has a mapping relationship with the storage directory.

[0063] S300, after receiving the target storage directory returned by the control node, the target training node uploads the training data to be saved to the target storage directory.

[0064] S400, the control node obtains the backup quantity corresponding to the target storage directory, and backs up the training data uploaded by the target training node in other storage nodes according to the backup quantity; the other storage nodes are the storage nodes included in the distributed memory file system except the target storage node, and the target storage node is the storage node in the distributed memory file system that receives the training data uploaded by the target training node.

[0065] Optionally, the target storage node is composed of the memory of the server included in the target training node, so that the target training node can write the training data in the memory of the server included in itself.

[0066] As a specific implementation, Figure 3 As shown, backing up the training data uploaded by the target training node in other storage nodes according to the backup quantity includes:

[0067] S401, if the number of backups corresponding to the target storage directory is 2, the training data uploaded by the target training node is backed up in a storage node other than the target storage node among the storage nodes included in the distributed memory file system.

[0068] In this embodiment, backing up the training data uploaded by the target training node in a storage node other than the target storage node among the storage nodes included in the distributed memory file system includes: after the target training node uploads the training data to the target storage directory of the target storage node, if the number of backups corresponding to the target storage directory is 2, searching in other storage nodes; if one of the other storage nodes also includes the target storage directory, backing up the training data uploaded by the target training node on the other storage node that also includes the target storage directory, i.e. storing the training data uploaded by the target training node in the target storage directory of the other storage node; thereby, in addition to the target storage node, there is another storage node in the distributed memory file system that stores the training data uploaded by the target training node, and the storage of the training data uploaded by the target training node in two storage nodes is also realized.

[0069] S402: If the number of backups corresponding to the target storage directory is 3, the training data uploaded by the target training node is backed up in two storage nodes other than the target storage node among the storage nodes included in the distributed memory file system.

[0070] In this embodiment, backing up the training data uploaded by the target training node in two storage nodes other than the target storage node among the storage nodes included in the distributed memory file system includes: after the target training node uploads the training data to the target storage directory of the target storage node, if the number of backups corresponding to the target storage directory is 3, searching in other storage nodes; if two other storage nodes also include the target storage directory, backing up the training data uploaded by the target training node on the two other storage nodes that also include the target storage directory, that is, storing the training data uploaded by the target training node in the target storage directories of the two other storage nodes; thereby, in addition to the target storage node, there are two storage nodes in the distributed memory file system that store the training data uploaded by the target training node, and the storage of the training data uploaded by the target training node in three storage nodes is also realized.

[0071] As an optional specific implementation, the number of backups corresponding to the target storage directory is an empirical value. For example, the number of backups corresponding to the target storage directory is 2 or 3.

[0072] As a preferred embodiment, Figure 4 As shown, the process of obtaining the number of backups corresponding to the target storage directory includes:

[0073] S410, obtaining the importance of the training data to be stored in the target storage directory.

[0074] As an optional specific implementation, the importance of the training data to be stored in the target storage directory is an empirical value, and the importance of the training data to be stored in the target storage directory is a value between 0-1, for example, the importance of the training data to be stored in the target storage directory is 0.5 or 0.8.

[0075] As a preferred embodiment, Figure 5 As shown, the process of obtaining the importance of the training data to be stored in the target storage directory includes:

[0076] S411, obtaining the training progress of the training node corresponding to the training data to be stored in the target storage directory.

[0077] In this embodiment, the training progress of the training node corresponding to the training data to be stored in the target storage directory reflects the overall training progress of the training nodes corresponding to all the training data to be stored in the target storage directory. Optionally, the training progress of the training node corresponding to the training data to be stored in the target storage directory is the average of the training progress of the training nodes corresponding to all the training data to be stored in the target storage directory. For a certain training data to be stored in the target storage directory, if the training data is generated when the training task of the corresponding training node is executed to 10%, then the training progress of the training node corresponding to the training task is 10%; if the training data is generated when the training task of the corresponding training node is executed to 20%, then the training progress of the training node corresponding to the training task is 20%; if the training data is generated when the training task of the corresponding training node is executed to 63%, then the training progress of the training node corresponding to the training task is 63%; if the training data is generated when the training task of the corresponding training node is executed to 82%, then the training progress of the training node corresponding to the training task is 82%. The training node corresponding to the training data is the training node to which the graphics processor that generates the training data belongs.

[0078] S412, obtaining the number of downstream training nodes of the training node corresponding to the training data to be stored in the target storage directory.

[0079] In this embodiment, when multiple training nodes included in the distributed training framework jointly execute a certain training task, a certain training node may be the upstream training task or downstream training task of other training nodes. For example, when a certain training node (worker1) is the upstream training task of another training node (worker2), it means that the training data of worker1 is the basic data when worker2 performs the training task, and worker2 relies on the training data of worker1 when performing the training task; when a certain training node (worker1) is the downstream training task of another training node (worker3), it means that the training data of worker3 is the basic data when worker1 performs the training task, and worker1 relies on the training data of worker3 when performing the training task.

[0080] In this embodiment, the number of downstream training nodes of the training nodes corresponding to the training data to be stored in the target storage directory reflects the overall number of downstream training nodes of the training nodes corresponding to all training data to be stored in the target storage directory. Optionally, the number of downstream training nodes of the training nodes corresponding to the training data to be stored in the target storage directory is the average number of downstream training nodes of the training nodes corresponding to all training data to be stored in the target storage directory.

[0081] S413. Determine the importance level of the training data to be stored in the target storage directory based on the training progress and the number of downstream training nodes.

[0082] In this embodiment, the training progress of the training node corresponding to the training data to be stored in the target storage directory is positively correlated with the importance level of the training data to be stored in the target storage directory, and the number of downstream training nodes of the training node corresponding to the training data to be stored in the target storage directory is also positively correlated with the importance level of the training data to be stored in the target storage directory.

[0083] As a preferred specific implementation, the importance level of the training data to be stored in the target storage directory is d, where d = w1×a + w2×b / c. Here, a is the training progress of the training node corresponding to the training data to be stored in the target storage directory, b is the number of downstream training nodes of the training node corresponding to the training data to be stored in the target storage directory, c is the number of training nodes included in the distributed training framework, and w1 and w2 are the weights corresponding to the training progress and the number of downstream training nodes respectively, with 0 < w1 < 1, 0 < w2 < 1, and w1 + w2 = 1. Optionally, both w1 and w2 are empirical values. For example, w1 = w2 = 0.5.

[0084] S420. Obtain the historical failure count of the training nodes included in the distributed training framework.

[0085] In this embodiment, the historical failure count of the training nodes included in the distributed training framework is determined based on the number of training nodes that failed during the execution of historical training tasks by the distributed training framework. For example, the distributed training framework has executed multiple training tasks during a historical time period. Optionally, the average or maximum value of the number of training nodes that failed during the execution of these multiple training tasks during the historical time period is determined as the historical failure count of the training nodes included in the distributed training framework.

[0086] S430. Obtain the storage space utilization rate of the storage nodes included in the distributed memory file system.

[0087] In this embodiment, the storage space utilization rate of the storage nodes included in the distributed memory file system is the ratio of the storage space occupied by the training data generated during the execution of the current training task by the distributed training framework to the total storage space of the storage nodes included in the distributed memory file system. The larger the value of the storage space utilization rate of the storage nodes included in the distributed memory file system, the smaller the total storage space of the storage nodes included in the distributed memory file system is compared to the training task. Optionally, the storage space occupied by the training data generated during the execution of the training task by the distributed training framework is an empirical value.

[0088] S440. Determine the backup count corresponding to the target storage directory based on the importance level, historical failure count, and storage space utilization rate.

[0089] In this embodiment, the importance level of the training data to be stored in the target storage directory is positively correlated with the number of backups corresponding to the target storage directory. The historical failure number of the training nodes included in the distributed training framework is positively correlated with the number of backups corresponding to the target storage directory. The storage space utilization rate of the storage nodes included in the distributed memory file system is negatively correlated with the number of backups corresponding to the target storage directory.

[0090] As a preferred specific implementation, the number of backups corresponding to the target storage directory is g, where g = int((w3×e + w4 / f)×d / k), int( ) represents taking the integer, k is a preset importance level threshold, 0 < k < 1, w3 and w4 are the weights corresponding to the historical failure number of the training nodes and the storage space utilization rate included in the distributed training framework respectively, 0 < w3 < 1, 0 < w4 < 1, and w3 + w4 = 1, e is the historical failure number of the training nodes included in the distributed training framework, and f is the storage space utilization rate of the storage nodes included in the distributed memory file system. Optionally, k, w3, and w4 are all empirical values. For example, w3 = w4 = 0.5. Based on this preferred specific implementation, even if some training nodes in the distributed training framework fail, the training data stored in the target storage directory can大概率 be obtained from the storage directories included in the distributed file system, enabling the newly added training nodes to obtain the training data in the target storage directory from the storage directories included in the distributed file system, achieving read and write at the memory level, and thus improving the training efficiency.

[0091] As a specific implementation, as Figure 6 shown, the method further includes the following steps:

[0092] S500, if the target training node fails, then start 1 newly added training node and add it to the distributed training framework.

[0093] S600, the newly added training node sends a request to the control node to obtain the training data of the target training node.

[0094] In this embodiment, the role of the newly added training node is to replace the target training node to execute the subsequent training tasks. To avoid repeating the training process before the failure of the target training node, the newly added training node in this embodiment obtains the training data of the target training node before by sending a request to obtain the training data of the target training node to the control node.

[0095] S700, after the control node receives a request from the newly added training node to obtain the training data of the target training node, the control node determines whether the storage directory included in the distributed memory file system stores the training data of the target training node. If the judgment result is that the storage directory included in the distributed memory file system stores the training data of the target training node, the control node returns the first storage directory to the newly added training node; the first storage directory stores the training data of the target training node.

[0096] In this embodiment, if the target storage node is composed of the memory of the server included in the target training node, and the failure type of the target training node is that the graphics processor fails and the memory is not exited, then the storage node having a mapping relationship with the first storage directory is the target storage node.

[0097] In this embodiment, if the target storage node is composed of the memory of the server included in the target training node, and the failure type of the target training node includes memory exit, then the storage node having a mapping relationship with the first storage directory is not the target storage node.

[0098] As a specific implementation, if the judgment result is that the storage directory included in the distributed memory file system does not store the training data of the target training node, then enter S701, such as Figure 7 As shown;

[0099] S701, determine whether the training data of the target training node is stored in the external storage of the distributed memory file system.

[0100] S702: If the training data of the target training node is stored in the external storage of the distributed memory file system, the control node obtains the training data of the target training node from the external storage and stores it in the second storage directory.

[0101] Preferably, the storage node having a mapping relationship with the second storage directory is composed of the memory of the server included in the newly added training node, thereby, the newly added training node can obtain the training data of the target training node from the memory of the server included in itself.

[0102] In this embodiment, if the training data of the target training node is not stored in the external storage of the distributed memory file system, the control node returns the acquisition failure information to the newly added training node, so that the newly added training node repeats the training process of the target training node after receiving the acquisition failure information.

[0103] S703: The control node returns the second storage directory to the newly added training node.

[0104] S704: After receiving the second storage directory, the newly added training node obtains the training data of the target training node from the second storage directory, and stores the obtained training data of the target training node in its own graphics processor.

[0105] Based on S702-S704, this embodiment enables the newly added training node to obtain the training data of the target training node when the storage directory included in the distributed memory file system does not store the training data of the target training node, and the training data of the target training node is stored in the external storage of the distributed memory file system.

[0106] S800, after receiving the first storage directory returned by the control node, the newly added training node obtains the training data of the target training node from the first storage directory and stores it in its own graphics processor.

[0107] Based on S500-S800, when a target training node fails, the newly added training node can obtain the training data of the target training node from a storage directory, that is, obtain the training data of the target training node from the memory of a server, realizing memory-level reading and writing, and improving the speed of obtaining the training data of the target training node.

[0108] As a specific implementation, the method also includes the following steps: if a preset external storage condition is met, the control node stores part of the training data stored in the target storage directory to the external storage of the distributed memory file system; the preset external storage condition includes one of the following conditions: the ratio of the storage space occupied by the data stored in all storage nodes included in the distributed memory file system to the total storage space of all storage nodes is greater than or equal to a preset ratio; the importance of the part of the training data stored in the target storage directory is greater than or equal to a preset first threshold; the number of times the part of the training data stored in the target storage directory is accessed within a historical preset time period is less than or equal to a preset number threshold; the total number of times the part of the training data stored in the target storage directory is accessed is less than or equal to a preset number threshold.

[0109] The first threshold preset in the above specific implementation manner is a value greater than 0 and less than 1. Based on the above specific implementation manner, a process of writing part of the training data stored in the target storage directory into the external storage is implemented.

[0110] The present embodiment provides a method for processing training data storage, which is applied to a distributed training framework, wherein the distributed training framework includes a plurality of training nodes, each training node includes a graphics processor, and different graphics processors perform different training tasks; on this basis, the distributed training framework of the present embodiment also includes a distributed memory file system, which includes a plurality of storage nodes, each storage node is composed of the memory of a server; the distributed memory file system also includes a plurality of storage directories, each storage directory corresponds to a backup quantity, the control node is used to implement the management of storage nodes, storage directories and backup quantities, and each training node can implement read and write operations on the plurality of storage directories through the control node; specifically, when a training node in the distributed training framework wants to store training data, it no longer directly stores the training data in the memory of the server included in the training node, but first sends a request to store the training data to the control node, and the control node determines the storage directory of the training data. After the training node that wants to store the training data stores the training data in the corresponding storage directory, the control node will obtain the backup quantity corresponding to the storage directory returned to the training node that wants to store the training data, and back up the training data on other storage nodes according to the backup quantity. Therefore, when a storage node storing the training data exits, there are still other storage nodes storing the training data. The training node that needs to obtain the training data can still obtain the training data from the storage node, that is, obtain the training data from the memory of a server. Compared with the method of obtaining the training data from external storage, this embodiment obtains the training data from the memory, that is, achieves memory-level reading and writing speeds. Therefore, the acquisition process of this embodiment is shorter, thereby speeding up the progress of the training task and reducing the training time.

[0111] Embodiment 2:

[0112] The present embodiment provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, a processing method for storing training data is implemented. The method is applied to a distributed training framework. The distributed training framework includes a plurality of training nodes, each of which includes a graphics processor, and different graphics processors are used to execute different training tasks; the distributed training framework also includes a distributed memory file system, the distributed memory file system includes a control node and a plurality of storage nodes, each of which is composed of a memory of a server; the distributed memory file system also includes a plurality of storage directories, each of which corresponds to a backup quantity, the control node is used to implement management of storage nodes, storage directories, and backup quantities, and each training node can implement read and write operations on the plurality of storage directories through the control node; the method includes the following steps:

[0113] If the target training node intends to save the training data, the target training node sends a request to save the training data to the control node; the target training node is a training node included in the distributed training framework.

[0114] After receiving the request for saving training data sent by the target training node, the control node returns a target storage directory to the target training node; the target storage directory is a storage directory among the several storage directories.

[0115] After receiving the target storage directory returned by the control node, the target training node uploads the training data to be saved to the target storage directory.

[0116] The control node obtains the backup quantity corresponding to the target storage directory, and backs up the training data uploaded by the target training node on other storage nodes according to the backup quantity; the other storage nodes are the storage nodes included in the distributed memory file system except the target storage node, and the target storage node is the storage node in the distributed memory file system that receives the training data uploaded by the target training node.

[0117] Embodiment three:

[0118] The present embodiment provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, a processing method for storing training data is implemented. The method is applied to a distributed training framework, and the distributed training framework includes a plurality of training nodes, each of which includes a graphics processor, and different graphics processors are used to perform different training tasks; the distributed training framework also includes a distributed memory file system, and the distributed memory file system includes a control node and a plurality of storage nodes, each of which is composed of a memory of a server; the distributed memory file system also includes a plurality of storage directories, each of which corresponds to a backup quantity, and the control node is used to implement management of storage nodes, storage directories, and backup quantities, and each training node can implement read and write operations on the plurality of storage directories through the control node; the method includes the following steps:

[0119] If the target training node intends to save the training data, the target training node sends a request to save the training data to the control node; the target training node is a training node included in the distributed training framework.

[0120] After receiving the request for saving training data sent by the target training node, the control node returns a target storage directory to the target training node; the target storage directory is a storage directory among the several storage directories.

[0121] After receiving the target storage directory returned by the control node, the target training node uploads the training data to be saved to the target storage directory.

[0122] The control node obtains the backup quantity corresponding to the target storage directory, and backs up the training data uploaded by the target training node on other storage nodes according to the backup quantity; the other storage nodes are the storage nodes included in the distributed memory file system except the target storage node, and the target storage node is the storage node in the distributed memory file system that receives the training data uploaded by the target training node.

[0123] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0124] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0125] Although some specific embodiments of the present invention have been described in detail by way of example, it will be appreciated by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the present invention. It will also be appreciated by those skilled in the art that various modifications may be made to the embodiments without departing from the scope and spirit of the present invention. The scope of the present invention is defined by the appended claims.

Claims

1. A method for processing training data storage, characterized in that: The method is applied to a distributed training framework, which includes a plurality of training nodes, each of which includes a graphics processor, and different graphics processors are used to perform different training tasks; the distributed training framework also includes a distributed memory file system, which includes a control node and a plurality of storage nodes, and each storage node is composed of the memory of a server; the distributed memory file system also includes a plurality of storage directories, each storage directory corresponds to a backup quantity, the control node is used to implement the management of the storage nodes, storage directories and backup quantities, and each training node can implement the read and write operations on the plurality of storage directories through the control node; the method includes the following steps: If the target training node intends to save the training data, the target training node sends a request to save the training data to the control node; the target training node is a training node included in the distributed training framework; After receiving the request for saving training data sent by the target training node, the control node returns a target storage directory to the target training node; the target storage directory is a storage directory among the plurality of storage directories; After receiving the target storage directory returned by the control node, the target training node uploads the training data to be saved to the target storage directory; The control node obtains the backup quantity corresponding to the target storage directory, and backs up the training data uploaded by the target training node on other storage nodes according to the backup quantity; the other storage nodes are the storage nodes included in the distributed memory file system except the target storage node, and the target storage node is the storage node in the distributed memory file system that receives the training data uploaded by the target training node.

2. The method for processing training data storage according to claim 1, characterized in that: The process of obtaining the number of backups corresponding to the target storage directory includes: Obtaining the importance of the training data to be stored in the target storage directory; Get the number of historical failures of training nodes included in the distributed training framework; Obtain storage space usage of storage nodes included in the distributed memory file system; The number of backups corresponding to the target storage directory is determined according to the importance, the number of historical failures, and the storage space usage rate.

3. The method for processing training data storage according to claim 2, characterized in that: The importance of obtaining the training data to be stored in the target storage directory includes: Obtain the training progress of the training node corresponding to the training data to be stored in the target storage directory; Obtain the number of downstream training nodes of the training node corresponding to the training data to be stored in the target storage directory; The importance of the training data to be stored in the target storage directory is determined according to the training progress and the number of downstream training nodes.

4. The method for processing training data storage according to claim 1, characterized in that: The method further comprises the following steps: If the target training node fails, start a new training node and add it to the distributed training framework; The newly added training node sends a request to the control node to obtain training data of the target training node; After receiving the request sent by the newly added training node to obtain the training data of the target training node, the control node judges whether the storage directory included in the distributed memory file system stores the training data of the target training node. If the judgment result is that the storage directory included in the distributed memory file system stores the training data of the target training node, the control node returns the first storage directory to the newly added training node; the first storage directory stores the training data of the target training node; After receiving the first storage directory returned by the control node, the newly added training node obtains the training data of the target training node from the first storage directory and stores the data in its own graphics processor.

5. The method for processing training data storage according to claim 4, characterized in that: If the target storage node is composed of the memory of the server included in the target training node, and the failure type of the target training node is that the graphics processor fails and the memory is not exited, then the storage node having a mapping relationship with the first storage directory is the target storage node.

6. The method for processing training data storage according to claim 4, characterized in that: If the judgment result is that the storage directory included in the distributed memory file system does not store the training data of the target training node, then judging whether the training data of the target training node is stored in the external storage of the distributed memory file system; If the training data of the target training node is stored in the external storage of the distributed memory file system, the control node obtains the training data of the target training node from the external storage and stores it in the second storage directory; The control node returns the second storage directory to the newly added training node; After receiving the second storage directory, the newly added training node obtains the training data of the target training node from the second storage directory, and stores the obtained training data of the target training node in its own graphics processor.

7. The method for processing training data storage according to claim 6, characterized in that: The storage node having a mapping relationship with the second storage directory is composed of the memory of the server included in the newly added training node.

8. The method for processing training data storage according to claim 1, characterized in that: Backing up the training data uploaded by the target training node at other storage nodes according to the backup quantity includes: If the number of backups corresponding to the target storage directory is 2, the training data uploaded by the target training node is backed up in a storage node other than the target storage node among the storage nodes included in the distributed memory file system; If the number of backups corresponding to the target storage directory is 3, the training data uploaded by the target training node is backed up in two storage nodes other than the target storage node among the storage nodes included in the distributed memory file system.

9. The method for processing training data storage according to claim 1, characterized in that: The method further comprises the following steps: Create several storage directories; A storage node is mapped for each storage directory.

10. The method for processing training data storage according to claim 1, characterized in that: The method further comprises the following steps: If the preset external storage condition is met, the control node stores part of the training data stored in the target storage directory to the external storage of the distributed memory file system; the preset external storage condition includes one of the following conditions: the ratio of the storage space occupied by the data stored in all storage nodes included in the distributed memory file system to the total storage space of all storage nodes is greater than or equal to a preset ratio; the importance of the part of the training data stored in the target storage directory is greater than or equal to a preset first threshold; the number of times the part of the training data stored in the target storage directory is accessed within a historical preset time period is less than or equal to a preset number threshold; the total number of times the part of the training data stored in the target storage directory is accessed is less than or equal to a preset number threshold.

11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the training data storage processing method according to any one of claims 1 to 10 is implemented.

12. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the training data storage processing method according to any one of claims 1 to 10 is implemented.

Citation Information

Patent Citations

  • Model training data processing method, device and system and storage medium

    CN111814959A

  • Fault file storage method and related apparatus

    WO2023165512A1