Training methods and devices for network models, storage media, and electronic devices

By acquiring historical data blocks and access logs, dynamically adjusting the cache level and optimizing the cache strategy, the problems of high data access latency and low cache utilization in distributed large model training are solved, achieving more efficient model training.

CN119250163BActive Publication Date: 2026-11-17CHINA TELECOM CORP LTD TECHNOLOGY INNOVATION CENTER +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411397564.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-08
Publication Date
2026-11-17
Estimated Expiration
2044-10-08

AI Technical Summary

Technical Problem

In the process of training large distributed models, there are problems such as high data access latency and low cache utilization efficiency. In particular, remote data access becomes a bottleneck, and cache resources are not flexibly adjusted according to the frequency and importance of data access, resulting in low training speed and low cache resource utilization.

Method used

By acquiring historical data blocks and access logs from the trained neural network model, the current data access mode and access order of the data block to be accessed can be determined, the cache level can be dynamically adjusted, the cache strategy can be optimized, and a multi-level context caching and prefetching mechanism can be implemented to improve data access efficiency.

Benefits of technology

It effectively reduced data access latency, improved model training speed and cache resource utilization, and enhanced training efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119250163B_ABST
    Figure CN119250163B_ABST
Patent Text Reader

Abstract

This disclosure relates to a training method, apparatus, storage medium, and electronic device for a network model, belonging to the field of machine learning technology. The method includes: acquiring historical data blocks accessed by a trained neural network model during training and historical data block access logs generated during the access process; determining, based on the historical data blocks, the data blocks to be accessed by the neural network model to be trained during training, corresponding to the trained neural network model; determining, based on the historical data block access logs, the current data access mode and current data access order of the data blocks to be accessed, and determining the current data caching level of the data blocks to be accessed based on the data access mode; caching the data blocks to be accessed according to the current data access order and current data caching level, and training the neural network model to be trained based on the cached data blocks to be accessed. This disclosure improves model training efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of machine learning technology, and more specifically, to a method for training a network model, a device for training a network model, a computer-readable storage medium, and an electronic device. Background Technology

[0002] In the process of training large distributed models, the following drawbacks exist: On the one hand, high data access latency: that is, frequent remote data access between computing nodes leads to high latency, especially when processing large-scale models, the latency of remote data access often becomes the main bottleneck of the system, reducing the training speed; on the other hand, low cache utilization efficiency: that is, in the process of practical application, the caching mechanism in the relevant technical solutions cannot flexibly adjust the caching strategy according to the data access frequency and importance, resulting in low utilization of cache resources.

[0003] It should be noted that the information in the background section above is only used to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0004] The purpose of this disclosure is to provide a method for training a network model, a device for training a network model, a computer-readable storage medium, and an electronic device, thereby overcoming, at least to some extent, the problems of low training speed and low utilization of cache resources caused by the limitations and defects of related technologies.

[0005] According to one aspect of this disclosure, a method for training a network model is provided, comprising:

[0006] Obtain the historical data blocks accessed by the trained neural network model during the training process, as well as the historical data block access logs generated during the access of the historical data blocks;

[0007] Based on the historical data blocks, determine the data blocks to be accessed during the training process of the neural network model to be trained, which correspond to the trained neural network model.

[0008] Based on the historical data block access logs, determine the current data access mode and current data access order of the data block to be accessed, and determine the current data cache level of the data block to be accessed based on the data access mode.

[0009] The data block to be accessed is cached according to the current data access order and the current data caching level, and the neural network model to be trained is trained based on the cached data block to be accessed.

[0010] In one exemplary embodiment of this disclosure, determining the data blocks to be accessed during the training process of the neural network model to be trained, corresponding to the trained neural network model, based on the historical data blocks, includes:

[0011] The training is performed on the data block prediction model to be trained based on the historical data blocks and the trained neural network model to obtain the trained data block prediction model.

[0012] The neural network model to be trained is input into the trained data block prediction model to obtain the data block prediction result; wherein the neural network model to be trained and the trained neural network model have the same model structure;

[0013] Data blocks whose predicted probability is greater than a preset probability threshold are extracted from the data block prediction results and used as the data blocks to be accessed.

[0014] In one exemplary embodiment of this disclosure, determining the current data access mode and current data access order of the data block to be accessed based on the historical data block access log includes:

[0015] Based on the historical data block access logs, determine the current access probability and current data dependency of the data block to be accessed;

[0016] The current data access mode of the data block to be accessed is determined based on the current data access probability, and the current data access order of the data block to be accessed is determined based on the current data dependency relationship.

[0017] In one exemplary embodiment of this disclosure, the historical data block includes a first historical data block, a second historical data block, ..., an Nth historical data block, and the data block to be accessed includes a first data block to be accessed, a second data block to be accessed, ..., an Nth data block to be accessed; wherein, determining the current access probability of the data block to be accessed based on the access logs of the historical data blocks includes:

[0018] Based on the historical data block access logs, determine the first historical sub-access count of the trained neural network model during the training process and the total historical access count of all historical data blocks.

[0019] Based on the first historical sub-access count and the total historical access count, determine the first historical access probability of the first historical data block, and based on the first historical access probability, determine the first current access probability of the first data block to be accessed corresponding to the first historical data block.

[0020] Repeat the steps for determining the first current access probability to obtain other current access probabilities for data blocks other than the first data block to be accessed.

[0021] In one exemplary embodiment of this disclosure, determining the current data dependency of the data block to be accessed based on historical data block access logs includes:

[0022] Based on the historical data block access logs, determine the historical access order of the trained neural network model to the historical data blocks during the training process;

[0023] Construct a historical data block access relationship graph based on the historical data blocks and the historical access order of the historical data blocks;

[0024] Based on the historical data block access relationship graph, the historical data dependencies between the historical data blocks are determined, and based on the historical data dependencies between the historical data blocks, the current data dependencies between the data blocks to be accessed are determined.

[0025] In one exemplary embodiment of this disclosure, determining the current data access mode of the data block to be accessed based on the current data access probability includes:

[0026] If the current data access probability is greater than or equal to the first preset access probability threshold, then the current data access mode of the data block to be accessed is determined to be a high-frequency data access mode.

[0027] If the current data access probability is less than the first preset access probability threshold and greater than or equal to the second preset access probability threshold, then the current data access mode of the data block to be accessed is determined to be the medium frequency data access mode.

[0028] If the current data access probability is less than the second preset access probability threshold, then the current data access mode of the data block to be accessed is determined to be a low-frequency data access mode.

[0029] In one exemplary embodiment of this disclosure, determining the current data access order of the data block to be accessed based on the current data dependency relationship includes:

[0030] Based on the current data dependency relationship, a second data block that has a dependency relationship with the first data block to be accessed is determined, and a first current access probability of the first data block to be accessed and a second current access probability of the second data block to be accessed are determined.

[0031] Determine the third current access probability of accessing the second data block after accessing the first data block to be accessed, and determine the first data extraction priority of the first data block to be accessed based on the first current access probability, the second current access probability and the third current access probability.

[0032] Repeat the first data extraction priority determination steps sequentially to obtain other data extraction priorities for other data blocks to be accessed besides the first data block to be accessed;

[0033] The data blocks to be accessed are sorted based on their data extraction priority, and the current data access order of the data blocks to be accessed is determined according to the sorting result.

[0034] In one exemplary embodiment of this disclosure, determining the current data cache level of the data block to be accessed based on the data access mode includes:

[0035] If the data access mode is a high-frequency data access mode, then the current data cache level of the data block to be accessed is determined to be a fast cache layer;

[0036] If the data access mode is a medium-frequency data access mode, then the current data cache level of the data block to be accessed is determined to be a medium-speed cache layer;

[0037] If the data access mode is a low-frequency data access mode, then the current data cache level of the data block to be accessed is determined to be a low-speed cache level.

[0038] In one exemplary embodiment of this disclosure, caching the data block to be accessed according to the current data access order and the current data caching level includes:

[0039] According to the current data access order, the data blocks to be accessed are extracted sequentially, and according to the current data cache level of the data blocks to be accessed, the extracted data blocks to be accessed are stored in the data cache layer corresponding to the current data cache level.

[0040] In one exemplary embodiment of this disclosure, the training method for the network model further includes:

[0041] Determine the execution time of the first task corresponding to the data loading task to be accessed, and the execution time of the second task corresponding to the data computation task to be trained;

[0042] The execution time period for the first task corresponding to the data loading task and the execution time period for the second task are determined based on the execution time of the first task and the execution time of the second task.

[0043] The data loading task corresponding to the data block to be accessed is executed based on the first task execution time period, and the data calculation task corresponding to the neural network model to be trained is executed based on the second task execution time period.

[0044] The intersection between the execution time of the first task and the execution time of the second task is an empty set.

[0045] In one exemplary embodiment of this disclosure, determining the execution time of a first task for performing a data loading task corresponding to the data block to be accessed, and the execution time of a second task for performing a data computation task corresponding to the neural network model to be trained, includes:

[0046] Determine the first computation time required to calculate the current data access order and the current data caching level, and determine the second computation time required to cache the data block to be accessed;

[0047] Based on the first computation time and the second computation time, determine the first task execution time for executing the data loading task corresponding to the data block to be accessed;

[0048] The training duration of the historical model during the training process of the completed neural network model is determined, and based on the historical model training duration, the execution duration of the second task corresponding to the data computation task of the neural network model to be trained is determined.

[0049] According to one aspect of this disclosure, a training apparatus for a network model is provided, comprising:

[0050] The data block access log acquisition module is used to acquire the historical data blocks accessed by the trained neural network model during the training process, as well as the historical data block access logs generated by accessing the historical data blocks.

[0051] The data block to be accessed module is used to determine the data blocks to be accessed during the training process of the neural network model to be trained, which correspond to the trained neural network model, based on the historical data blocks.

[0052] The data cache level determination module is used to determine the current data access mode and current data access order of the data block to be accessed based on the historical data block access log, and to determine the current data cache level of the data block to be accessed based on the data access mode.

[0053] The network model training module is used to cache the data block to be accessed according to the current data access order and the current data caching level, and to train the neural network model to be trained based on the cached data block to be accessed.

[0054] According to one aspect of this disclosure, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements a training method for the network model described in any of the preceding claims.

[0055] According to one aspect of this disclosure, an electronic device is provided, comprising:

[0056] Processor; and

[0057] Memory for storing the executable instructions of the processor;

[0058] The processor is configured to execute the training method of any of the above-described network models by executing the executable instructions.

[0059] This disclosure provides a method for training a network model. On one hand, it acquires historical data blocks accessed by the trained neural network model during training, as well as historical data block access logs generated during the access process. Then, based on the historical data blocks, it determines the data blocks to be accessed by the neural network model to be trained, corresponding to the trained neural network model. Furthermore, based on the historical data block access logs, it determines the current data access mode and current data access order of the data blocks to be accessed, and determines the current data caching level of the data blocks to be accessed based on the data access mode. Finally, it caches the data blocks to be accessed based on the current data access order and the current data caching level, and trains the neural network model to be trained based on the cached data blocks. Since the corresponding data blocks can be accessed from the corresponding data caching level, the problem of high data access latency caused by remote data access can be avoided, thereby improving the training speed of the model while improving data access efficiency. On the other hand, since the data caching level can be determined based on the current data access mode and the current data access order to cache the data blocks, it solves the problem of low utilization of cache resources caused by the inability to flexibly adjust the caching strategy according to the data access frequency and importance.

[0060] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0061] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.

[0062] Figure 1 The flowchart schematically illustrates a method for training a network model according to an exemplary embodiment of the present disclosure.

[0063] Figure 2 The diagram schematically illustrates an example structure of a neural network model to be trained according to an exemplary embodiment of the present disclosure.

[0064] Figure 3 The diagram schematically illustrates a structural example of a Transformer model according to an exemplary embodiment of the present disclosure.

[0065] Figure 4 This diagram schematically illustrates a structural example of a data caching hierarchy according to an exemplary embodiment of the present disclosure.

[0066] Figure 5 An example diagram illustrating an access relationship between data blocks according to an exemplary embodiment of this disclosure is shown.

[0067] Figure 6 A flowchart illustrating a method for determining a task execution time period according to an example embodiment of the present disclosure is shown.

[0068] Figure 7 A block diagram schematically illustrates a training apparatus for a network model according to an exemplary embodiment of the present disclosure.

[0069] Figure 8 An electronic device for implementing the training method of the network model described above is illustrated according to an example embodiment of the present disclosure. Detailed Implementation

[0070] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this disclosure more comprehensive and complete, and to fully convey the concept of the example embodiments to those skilled in the art. The described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a full understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced with one or more of the specific details omitted, or other methods, components, apparatus, steps, etc., can be employed. In other instances, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of this disclosure.

[0071] Furthermore, the accompanying drawings are merely illustrative of this disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0072] In today's era of big data, the rapid development of artificial intelligence (AI) and deep learning technologies has greatly promoted the application of various complex models, especially in fields such as natural language processing (NLP), computer vision (CV), and recommender systems. However, as deep learning models become increasingly large, the amount of data and computing resources required to train these models also grow exponentially. Distributed computing has become a key approach to address this challenge, significantly reducing training time by processing data in parallel across multiple computing nodes. However, during the training of large distributed models, frequent data exchange and remote data access between computing nodes can easily lead to communication bottlenecks, thereby affecting the overall system performance and efficiency. Furthermore, the following shortcomings exist in the training process of related distributed large-scale models: Firstly, high data access latency: frequent remote data access between computing nodes leads to high latency, especially when processing large-scale models, where the latency of remote data access often becomes the main bottleneck of the system, reducing training speed. Secondly, low cache utilization efficiency: in practical applications, the caching mechanisms in related technical solutions cannot flexibly adjust caching strategies according to the frequency and importance of data access, resulting in underutilization of cache resources. For example, frequently accessed data is not effectively stored in the high-speed cache, while infrequently accessed data occupies valuable cache space, resulting in low cache utilization efficiency. Thirdly, insufficiently intelligent data prefetching and prediction: in practical applications, the systems in related technical solutions often lack in-depth analysis of data access patterns when prefetching context data, leading to inaccurate or inappropriate prefetching, further exacerbating the data waiting problem during training.

[0073] To address the aforementioned bottleneck issues, this disclosure provides a training method for network models that optimizes multi-level context caching of data blocks involved in model training. By combining context prefetching and prediction mechanisms, it effectively reduces data access latency in distributed large-scale model training and improves training efficiency.

[0074] Based on this, this exemplary embodiment first provides a method for training a network model. This method can run on a terminal device server, server cluster, or cloud server where the model training system resides. Of course, those skilled in the art can also run the method disclosed herein on other platforms as needed, and this exemplary embodiment does not impose any special limitations on this. Specifically, refer to... Figure 1 As shown, the training method for this network model may include the following steps:

[0075] Step S110. Obtain the historical data blocks accessed by the trained neural network model during the training process, as well as the historical data block access logs generated by accessing the historical data blocks;

[0076] Step S120. Determine the data blocks to be accessed during the training process of the neural network model to be trained, which correspond to the trained neural network model, based on the historical data blocks;

[0077] Step S130. Based on the historical data block access log, determine the current data access mode and current data access order of the data block to be accessed, and determine the current data cache level of the data block to be accessed based on the data access mode;

[0078] Step S140. Cache the data block to be accessed according to the current data access order and the current data caching level, and train the neural network model to be trained based on the cached data block to be accessed.

[0079] In the training method of the aforementioned network model, on the one hand, the historical data blocks accessed by the trained neural network model during the training process and the historical data block access logs generated during the access of historical data blocks are obtained; then, based on the historical data blocks, the data blocks to be accessed by the neural network model to be trained corresponding to the trained neural network model are determined during the training process; furthermore, based on the historical data block access logs, the current data access mode and current data access order of the data blocks to be accessed are determined, and the current data caching level of the data blocks to be accessed is determined based on the data access mode; finally, the data blocks to be accessed are cached according to the current data access order and the current data caching level, and the neural network model to be trained is trained based on the cached data blocks to be accessed. Since the corresponding data blocks can be accessed from the corresponding data caching level, the problem of high data access latency caused by remote data access can be avoided, thereby improving the training speed of the model while improving data access efficiency. On the other hand, since the data caching level can be determined according to the current data access mode and the current data access order to cache the data blocks, the problem of low utilization of cache resources caused by the inability to flexibly adjust the caching strategy according to the data access frequency and importance is solved.

[0080] The training method of the network model involved in the exemplary embodiments of this disclosure will be explained and described in detail below with reference to the accompanying drawings.

[0081] First, the application scenarios of the exemplary embodiments of this disclosure will be explained and described. Specifically, the network model training method described in the exemplary embodiments of this disclosure can be used to train network models in natural language processing scenarios, and also to train network models in computer vision scenarios. The network models in natural language processing scenarios described herein may include, but are not limited to, BERT models, GPT models, and multilingual translation models, etc.; the BERT model described herein may be composed of multiple Transformer models, and the specific model structure can be found in [reference needed]. Figure 2 As shown; furthermore, the model structure of the Transformer model can be found in [reference needed]. Figure 3 As shown. Meanwhile, network models in computer vision scenarios can include, but are not limited to, large-scale image classification models, object detection models, and video analysis models. In practical applications, for network models in natural language processing scenarios, since these models need to process massive amounts of text data, multi-level caching optimization and context prefetching mechanisms can significantly reduce data access latency during training, improve training speed, and enhance model accuracy and performance. Furthermore, for network models in computer vision scenarios, since the training tasks of these models typically involve a large amount of high-resolution image or video frame data, optimizing caching and data prefetching mechanisms can effectively reduce data loading time, improve training efficiency, and thus complete model development and deployment faster.

[0082] Secondly, the technical implementation principles of the exemplary embodiments of this disclosure will be explained and described. Specifically, the training method of the network model described in the exemplary embodiments of this disclosure can be composed of cache hierarchy partitioning and context prefetching and prediction mechanisms; wherein, the core idea of ​​cache hierarchy partitioning is to construct a multi-level context caching mechanism; the core idea of ​​context prefetching and prediction mechanisms is to preload potentially needed data during the training process by analyzing the context data access patterns and applying prediction algorithms, thereby reducing the waiting time during data access and further improving the continuity and efficiency of the training task. Furthermore, the method described in the exemplary embodiments of this disclosure can also combine context prefetching and prediction mechanisms to solve the following technical defects in related technical solutions: on the one hand, multi-level context caching optimization: by designing a multi-level caching architecture, cache resources are divided into a fast cache layer, a medium-speed cache layer, and a remote cache layer; at the same time, the context data is classified according to the access frequency, importance, and data size, and stored in different cache levels respectively; for example, frequently accessed data can be preferentially stored in the fast cache layer to reduce access latency; and frequently accessed data can be stored in the remote cache layer to save high-level cache space; on the other hand, dynamic cache management: during the training process In this process, real-time monitoring of context data access patterns allows for dynamic adjustment of caching strategies. For example, adaptive cache management algorithms can be used to periodically analyze access logs, promoting frequently accessed data to higher cache levels while downgrading less frequently accessed data to ensure optimal allocation and utilization of cache resources. Furthermore, context prefetching and prediction mechanisms analyze context data access patterns, using probabilistic models and prediction algorithms to anticipate the next data blocks that may be accessed and preload these data into appropriate cache levels. Asynchronous loading techniques can also be employed to allow data prefetching and prediction to run in parallel with computational tasks, further reducing data access waiting time.

[0083] The following explains and describes the data caching layers involved in the exemplary embodiments of this disclosure. Specifically, in practical applications, to achieve multi-level context caching optimization, different levels of cache resources can be rationally configured based on the principle of locality of reference in data access. This allows frequently used context data to be accessed quickly, reducing remote data requests and latency. Simultaneously, through refined cache management, the utilization efficiency of cache resources is improved, achieving efficient data management in a distributed training environment. Furthermore, a multi-level caching architecture can be designed based on the hardware architecture and network topology of the computing nodes; for example, referring to... Figure 4 As shown, the data caching levels described in the example embodiments of this disclosure may include fast caching levels, medium-speed caching levels, and low-speed caching levels, etc. Wherein:

[0084] Fast caching layer: This can be a high-speed cache (such as a memory cache) located inside the compute node, mainly used to store frequently accessed context data with high real-time requirements; Medium-speed caching layer: This can be local storage on the node (such as SSD storage), used to store context data that is accessed frequently but does not require real-time response; Remote caching layer: This can be a distributed storage system (such as HDFS or object storage), used to store infrequently accessed or large-volume context data, mainly serving as the bottom layer of the caching system.

[0085] Furthermore, after the data caching hierarchy is constructed, the data blocks to be accessed can be classified according to the access frequency, data size, and importance of the context data. Specific strategies include: high-frequency access data, such as model parameters and gradient information, are preferentially stored in the fast cache layer to reduce access latency; medium-frequency access data, such as intermediate calculation results, can be stored in the medium-speed cache layer for quick retrieval when needed; low-frequency access data, such as historical training data and context information accessed infrequently, are stored in the remote cache layer to reduce the storage pressure on higher-level caches.

[0086] Meanwhile, in practical applications, dynamic management of data caching levels is also required. Specifically, during training, the access patterns of context data can be monitored in real time, and caching strategies can be dynamically adjusted. Furthermore, by periodically analyzing access logs, adaptive cache management algorithms can be used to optimize the allocation of cache resources. For example, frequently used data can be gradually promoted to higher-level caches, while data that is no longer frequently accessed can be downgraded to free up high-level cache space.

[0087] The following will combine Figures 2-4 right Figure 1 The training method of the network model shown will be further explained and illustrated. Specifically:

[0088] In step S110, the historical data blocks accessed by the trained neural network model during the training process and the historical data block access logs generated by accessing the historical data blocks are obtained.

[0089] Specifically, the trained neural network model described here has the same model structure as the neural network model to be trained. This identical model structure means that it has the same model layers, and the parameter names and number of parameters for each model layer are also the same; the difference lies in the specific values ​​of the parameters. Furthermore, the names of the historical data blocks accessed by the trained neural network model during training can be obtained based on the model training log generated during the training process. The historical data block access log can be included in the model training log, meaning it can be directly extracted from the model training log.

[0090] In step S120, the data blocks to be accessed during the training process of the neural network model to be trained, corresponding to the trained neural network model, are determined based on the historical data blocks.

[0091] Specifically, the process of determining the data block to be accessed can be implemented as follows: Based on the historical data blocks and the trained neural network model, train the data block prediction model to be trained to obtain the trained data block prediction model; input the neural network model to be trained into the trained data block prediction model to obtain the data block prediction result; wherein the neural network model to be trained and the trained neural network model have the same model structure; extract data blocks with a prediction probability greater than a preset probability threshold from the data block prediction result as the data blocks to be accessed.

[0092] Specifically, in practical applications, machine learning or rule-based prediction algorithms can be used to predict the context data that may be needed in the future during training and preload it into an appropriate cache level. Prediction algorithms can employ several strategies: one is prediction based on historical data, which uses historical access data to predict data that may be accessed in the future, suitable for regular access patterns; another is adaptive prediction, which uses adaptive prediction algorithms to continuously adjust and optimize the prediction model to improve prediction accuracy for scenarios with more complex access patterns. It should be noted that the goal of the prediction algorithm is to predict the set of data blocks that will be accessed in the future based on historical access data; therefore, assuming the set of data blocks that may be accessed next is (D_hat), prediction can be made by maximizing conditional probability.

[0093] D_hat=argmax{D_i∈D}P(D_iD_history);

[0094] Where (D_history) represents historical access data, and (D) is the set of all possible data blocks; by selecting the set of data blocks that maximizes the conditional probability P(D_iD_history), the system can load these data blocks into the cache in advance.

[0095] It should be further noted that the data block prediction model involved here can be a multi-class data prediction model, such as a decision tree model, or other multi-class models. This example does not impose any special restrictions on this. The loss function used in the model training process can be, for example, the cross-entropy loss function, etc.

[0096] In step S130, the current data access mode and current data access order of the data block to be accessed are determined according to the historical data block access log, and the current data cache level of the data block to be accessed is determined according to the data access mode.

[0097] In this example embodiment, firstly, based on the historical data block access logs, the current data access mode and current data access order of the data block to be accessed are determined. Specifically, this can be achieved as follows: Firstly, based on the historical data block access logs, the current access probability and current data dependency of the data block to be accessed are determined. Secondly, based on the current data access probability, the current data access mode of the data block to be accessed is determined, and based on the current data dependency, the current data access order of the data block to be accessed is determined. The historical data blocks mentioned here include a first historical data block, a second historical data block, ..., the Nth historical data block; the data blocks to be accessed mentioned here include a first data block to be accessed, a second data block to be accessed, ..., the Nth data block to be accessed. Specifically, the current access probability (also known as access frequency) recorded here refers to the probability of accessing a certain data block during model training, that is, the probability of using a certain data block during model training. By determining the access probability, we can identify frequently accessed context data and focus on its priority in prefetching and prediction. Furthermore, the current data dependency relationship recorded here refers to the simultaneous calling of one or more data blocks during the data block calling process, or the calling of one data block followed immediately by the calling of another data block. This calling relationship between data blocks can be called a data dependency relationship. At the same time, by analyzing the dependencies between context data, we can determine which data may be used in subsequent calculation steps, thus providing a basis for the prefetching mechanism.

[0098] In one example embodiment, determining the current access probability of the data block to be accessed based on the historical data block access log can be achieved as follows: First, based on the historical data block access log, determine the first historical sub-access count of the trained neural network model during training and the total historical access count of all historical data blocks; second, based on the first historical sub-access count and the total historical access count, determine the first historical access probability of the first historical data block, and based on the first historical access probability, determine the first current access probability of the first data block to be accessed corresponding to the first historical data block; then, repeat the steps of determining the first current access probability to obtain other current access probabilities of other data blocks to be accessed besides the first data block to be accessed. In practical applications, since the trained neural network model and the neural network model to be trained have the same model structure, and the names of the data blocks to be called during model training are consistent, the current access probability can be directly determined based on the historical access probability.

[0099] Furthermore, the specific calculation process for the first historical visit probability recorded above can be shown in the following formula (1):

[0100]

[0101] P(D_i) represents the historical access probability of the i-th historical data block, where D_i represents the i-th historical data block; the number of accesses (D_i) represents the number of historical sub-accesses of the i-th historical data block; and the total number of accesses represents the total number of historical accesses.

[0102] In one example embodiment, determining the current data dependency relationship of the data block to be accessed based on the historical data block access log can be achieved as follows: First, based on the historical data block access log, determine the historical access order of the historical data blocks during the training process of the trained neural network model; second, construct a historical data block access relationship graph based on the historical data blocks and their historical access order; finally, determine the historical data dependency relationship between the historical data blocks based on the historical data block access relationship graph, and determine the current data dependency relationship between the data blocks to be accessed based on the historical data dependency relationship between the historical data blocks. That is, the dependency relationship can be determined based on the specific access order; for example, during model training, data block A is accessed first, then data blocks B and C are accessed simultaneously, and after accessing data block B, data blocks E and F are also accessed; furthermore, after accessing data block C, data blocks G and H are also accessed, etc. Based on this, a dependency relationship can be constructed as follows: Figure 5 The diagram shows the data block access relationships.

[0103] In one example embodiment, determining the current data access mode of the data block to be accessed based on the current data access probability can be achieved as follows: if the current data access probability is greater than or equal to a first preset access probability threshold, then the current data access mode of the data block to be accessed is determined to be a high-frequency data access mode; if the current data access probability is less than the first preset access probability threshold but greater than or equal to a second preset access probability threshold, then the current data access mode of the data block to be accessed is determined to be a medium-frequency data access mode; if the current data access probability is less than the second preset access probability threshold, then the current data access mode of the data block to be accessed is determined to be a low-frequency data access mode. The first and second preset access probability thresholds mentioned here can be set empirically or predicted based on a corresponding neural network model; this example does not impose any special restrictions on this.

[0104] In one exemplary embodiment, determining the current data access order of the data blocks to be accessed based on the current data dependency relationship can be achieved as follows: Based on the current data dependency relationship, determine a second data block to be accessed that has a dependency relationship with the first data block to be accessed, and determine a first current access probability of the first data block to be accessed and a second current access probability of the second data block to be accessed; determine a third current access probability of accessing the second data block to be accessed after accessing the first data block to be accessed, and determine a first data extraction priority of the first data block to be accessed based on the first current access probability, the second current access probability, and the third current access probability; repeat the first data extraction priority determination step sequentially to obtain other data extraction priorities of other data blocks to be accessed besides the first data block to be accessed; sort the data blocks to be accessed based on the data extraction priorities of the data blocks to be accessed, and determine the current data access order of the data blocks to be accessed based on the sorting result.

[0105] Specifically, in practical applications, based on the results of context access pattern analysis, data that is about to be accessed can be preloaded from remote cache or lower-level cache into upper-level cache. Specific implementation methods include: sequential prefetching: for data with sequential access patterns, the system will automatically preload the next batch of data; dependency prefetching: for data with dependencies, by preloading the dependent data, it is ensured that the computing node can access it quickly when needed. Furthermore, in the process of data extraction based on dependency prefetching, the data extraction priority needs to be determined first; in the process of calculating the data extraction priority, in addition to considering the first current access probability and the second current access probability, the third current access probability also needs to be considered; in practical applications, the third historical access probability needs to be calculated first, and its specific calculation process can be shown by the following formula (3):

[0106]

[0107] Wherein, P(D_jD_i) represents the third historical access probability of accessing historical data block j after accessing historical data block i; at the same time, the third current access probability can be obtained after obtaining the third historical access probability; further, the specific calculation process of data extraction priority can be shown in the following formula (4):

[0108] P_prefetch(D_i)=αP(D_i)+β∑ {j≠i} P(D_jD_i)P(D_j); Formula (4)

[0109] Here, P_prefetch(D_i) represents the data extraction priority of data block i, and α and β are weight parameters used to balance the impact of the data block's own access frequency and dependencies on the prefetch priority. In practical applications, the model training system will prioritize prefetching data blocks with higher (P_prefetch(D_i)) values. It should be noted that the specific values ​​of α and β can be determined according to actual needs, as long as α + β = 1. This example does not impose any special restrictions on this.

[0110] Secondly, the current data cache level of the data block to be accessed is determined according to the data access mode. Specifically, this can be achieved as follows: if the data access mode is a high-frequency data access mode, then the current data cache level of the data block to be accessed is determined to be a fast cache layer; if the data access mode is a medium-frequency data access mode, then the current data cache level of the data block to be accessed is determined to be a medium-speed cache layer; if the data access mode is a low-frequency data access mode, then the current data cache level of the data block to be accessed is determined to be a low-speed cache layer. That is, for frequently accessed context data with high real-time requirements, it can be stored in a high-speed cache (such as a memory cache) located inside the computing node; for context data with high access frequency but no need for real-time response, it can be stored in node local storage (such as SSD storage); for context data with infrequent access or large volume, it can be stored in a distributed storage system (such as HDFS or object storage) that serves as the underlying layer of the caching system.

[0111] In step S140, the data block to be accessed is cached according to the current data access order and the current data cache level, and the neural network model to be trained is trained based on the cached data block to be accessed.

[0112] In this example embodiment, firstly, the data block to be accessed is cached according to the current data access order and the current data cache level. Specifically, this can be achieved as follows: the data blocks to be accessed are extracted sequentially according to the current data access order, and the extracted data blocks to be accessed are stored sequentially in the data cache layer corresponding to the current data cache level according to the current data cache level of the data blocks to be accessed. Secondly, the neural network model to be trained is trained based on the cached data blocks to be accessed. That is, in the specific model training process, the corresponding data blocks can be obtained from the corresponding cache level sequentially for model training according to the progress of model training.

[0113] Figure 6 This illustration schematically depicts a method for determining a task execution time period according to an example embodiment of this disclosure. Specifically, refer to... Figure 6 As shown, the specific process for determining the task execution time period may include the following steps:

[0114] Step S610: Determine the execution time of the first task for executing the data loading task corresponding to the data block to be accessed, and the execution time of the second task for executing the data computation task corresponding to the neural network model to be trained;

[0115] Step S620: Determine the first task execution time period for executing the data loading task corresponding to the data block to be accessed, and the second task execution time period for executing the data calculation task corresponding to the neural network model to be trained, based on the first task execution time period and the second task execution time period.

[0116] Step S630: Execute a data loading task corresponding to the data block to be accessed based on the first task execution time period, and execute a data calculation task corresponding to the neural network model to be trained based on the second task execution time period; wherein, the intersection between the first task execution time period and the second task execution time period is an empty set.

[0117] In one example embodiment, determining the execution duration of a first task for loading data corresponding to the data block to be accessed and the execution duration of a second task for computing data corresponding to the neural network model to be trained can be achieved as follows: determining the first computation time required to compute the current data access order and the current data caching level, and determining the second computation time required to cache the data block to be accessed; determining the first task execution duration for loading data corresponding to the data block to be accessed based on the first and second computation times; determining the historical model training time of the trained neural network model during the training process, and determining the second task execution duration for computing data corresponding to the neural network model to be trained based on the historical model training time.

[0118] The following section will further explain and illustrate the specific process for determining the task execution duration. Specifically, in practical applications, to avoid affecting the execution of the current computation task, the prefetching and prediction loading of context data are performed asynchronously. Simultaneously, through asynchronous loading technology, the preloading of data and the computation task are performed in parallel, thereby reducing the waiting time of the computation task and improving the overall response speed of the system. Furthermore, to maximize the parallelism of the system, the asynchronous loading mechanism adopts a parallel task execution method. Assuming that at time (t), the data computation task being executed by the system is T(t), and the data loading task for prefetching and prediction is L(t), under this premise, to avoid the loading task blocking the execution of the computation task, the system needs to ensure that:

[0119] That is, the loading task (L(t)) and the computation task (T(t)) do not overlap in time (t), thereby achieving efficient utilization of system resources.

[0120] Thus, the training method for the network model described in the exemplary embodiments of this disclosure has been fully implemented. Based on the foregoing description, it can be understood that the training method for the network model described in the exemplary embodiments of this disclosure, on the one hand, can improve the efficiency of large-scale model training: that is, by optimizing the caching hierarchy and data prefetching strategy, the exemplary embodiments of this disclosure significantly reduce data access latency during large-scale model training, thereby improving overall training efficiency; based on this approach, it has extremely high value for application scenarios that require processing massive amounts of data and complex models, helping enterprises and research institutions to develop and deploy high-performance artificial intelligence models more quickly; on the other hand, it can reduce computational costs: that is, by improving the utilization efficiency of caching resources and reducing data access latency, the exemplary embodiments of this disclosure can significantly reduce the computational costs in distributed large-scale model training; at the same time, it reduces system resource waste, enabling more computational tasks to be completed under the same hardware conditions, thereby saving enterprises a significant amount of computational expenses; furthermore, it can significantly reduce data access latency: also In other words, by classifying context data according to access frequency and importance and storing it in different cache levels, this disclosure enables frequently accessed data to be preferentially stored in the fast cache layer, thereby significantly reducing latency issues caused by remote data access. Compared with the prior art, this disclosure significantly improves system response speed and training efficiency through more refined cache management. Furthermore, it can also improve the utilization efficiency of cache resources: that is, by combining dynamic cache management mechanisms and context prefetching and prediction mechanisms, this disclosure not only monitors and adjusts cache strategies in real time, but also ensures that key data can be loaded into the appropriate cache level in a timely manner through in-depth analysis and prediction of data access patterns. Based on this flexible cache resource allocation and management strategy, not only is the cache hit rate optimized, but also the waste of cache resources is avoided, especially when dealing with large-scale model training, it can make more efficient use of existing computing resources.

[0121] In summary, the exemplary embodiments of this disclosure, through the innovative combination of multi-level caching architecture design, dynamic cache management, and context prefetching and prediction mechanisms, not only solve the common problems of data access latency and low cache utilization efficiency in distributed large-scale model training, but also further improve the overall performance and training speed of the system. Compared with the network model training methods in related technical solutions, the exemplary embodiments of this disclosure demonstrate stronger adaptability and efficiency in large-scale model training scenarios, providing more competitive technical support for deep learning model training in the field of artificial intelligence.

[0122] The following are embodiments of the apparatus disclosed herein, which can be used to execute embodiments of the method disclosed herein. For details not disclosed in the apparatus embodiments of this disclosure, please refer to the embodiments of the method disclosed herein.

[0123] This disclosure also provides an example embodiment of a network model training apparatus. Specifically, refer to... Figure 7 The training apparatus for the unchanged network model shown may include a data block access log acquisition module 710, a data block to be accessed determination module 720, a data cache level determination module 730, and a network model training module 740. Wherein:

[0124] The data block access log acquisition module 710 can be used to acquire the historical data blocks accessed by the trained neural network model during the training process and the historical data block access logs generated by accessing the historical data blocks.

[0125] The data block to be accessed determination module 720 can be used to determine the data blocks to be accessed by the neural network model to be trained during the training process, which correspond to the trained neural network model, based on the historical data blocks.

[0126] The data cache level determination module 730 can be used to determine the current data access mode and current data access order of the data block to be accessed based on the historical data block access log, and determine the current data cache level of the data block to be accessed based on the data access mode.

[0127] The network model training module 740 can be used to cache the data block to be accessed according to the current data access order and the current data caching level, and train the neural network model to be trained based on the cached data block to be accessed.

[0128] In one exemplary embodiment of this disclosure, determining the data blocks to be accessed during the training process of the neural network model to be trained, corresponding to the trained neural network model, based on the historical data blocks includes: training the data block prediction model to be trained based on the historical data blocks and the trained neural network model to obtain the trained data block prediction model; inputting the neural network model to be trained into the trained data block prediction model to obtain a data block prediction result; wherein the neural network model to be trained and the trained neural network model have the same model structure; and extracting data blocks with a prediction probability greater than a preset probability threshold from the data block prediction result as the data blocks to be accessed.

[0129] In one exemplary embodiment of this disclosure, determining the current data access mode and current data access order of the data block to be accessed based on the historical data block access log includes: determining the current access probability and current data dependency of the data block to be accessed based on the historical data block access log; determining the current data access mode of the data block to be accessed based on the current data access probability; and determining the current data access order of the data block to be accessed based on the current data dependency.

[0130] In one exemplary embodiment of this disclosure, the historical data block includes a first historical data block, a second historical data block, ..., an Nth historical data block, and the data block to be accessed includes a first data block to be accessed, a second data block to be accessed, ..., an Nth data block to be accessed; wherein, determining the current access probability of the data block to be accessed based on the historical data block access log includes: determining, based on the historical data block access log, the first historical sub-access count of the trained neural network model accessing the first historical data block and the total historical access count of all historical data blocks during the training process; determining the first historical access probability of the first historical data block based on the first historical sub-access count and the total historical access count, and determining the first current access probability of the first data block to be accessed corresponding to the first historical data block based on the first historical access probability; repeating the step of determining the first current access probability to obtain other current access probabilities of other data blocks to be accessed besides the first data block to be accessed.

[0131] In one exemplary embodiment of this disclosure, determining the current data dependency relationship of the data block to be accessed based on the historical data block access log includes: determining the historical access order of the trained neural network model to the historical data blocks during the training process based on the historical data block access log; constructing a historical data block access relationship graph based on the historical data blocks and the historical access order of the historical data blocks; determining the historical data dependency relationship between the historical data blocks based on the historical data block access relationship graph; and determining the current data dependency relationship between the data blocks to be accessed based on the historical data dependency relationship between the historical data blocks.

[0132] In one exemplary embodiment of this disclosure, determining the current data access mode of the data block to be accessed based on the current data access probability includes: if the current data access probability is greater than or equal to a first preset access probability threshold, then determining the current data access mode of the data block to be accessed as a high-frequency data access mode; if the current data access probability is less than the first preset access probability threshold but greater than or equal to a second preset access probability threshold, then determining the current data access mode of the data block to be accessed as a medium-frequency data access mode; if the current data access probability is less than the second preset access probability threshold, then determining the current data access mode of the data block to be accessed as a low-frequency data access mode.

[0133] In one exemplary embodiment of this disclosure, determining the current data access order of the data blocks to be accessed based on the current data dependency relationship includes: determining a second data block to be accessed that has a dependency relationship with the first data block to be accessed based on the current data dependency relationship, and determining a first current access probability of the first data block to be accessed and a second current access probability of the second data block to be accessed; determining a third current access probability of accessing the second data block to be accessed after accessing the first data block to be accessed, and determining a first data extraction priority of the first data block to be accessed based on the first current access probability, the second current access probability, and the third current access probability; repeating the first data extraction priority determination step sequentially to obtain other data extraction priorities of other data blocks to be accessed besides the first data block to be accessed; sorting the data blocks to be accessed based on the data extraction priorities of the data blocks to be accessed, and determining the current data access order of the data blocks to be accessed based on the sorting result.

[0134] In one exemplary embodiment of this disclosure, determining the current data cache level of the data block to be accessed based on the data access mode includes: if the data access mode is a high-frequency data access mode, then determining the current data cache level of the data block to be accessed as a fast cache layer; if the data access mode is a medium-frequency data access mode, then determining the current data cache level of the data block to be accessed as a medium-speed cache layer; if the data access mode is a low-frequency data access mode, then determining the current data cache level of the data block to be accessed as a low-speed cache layer.

[0135] In one exemplary embodiment of this disclosure, caching the data block to be accessed according to the current data access order and the current data cache level includes: sequentially extracting the data block to be accessed according to the current data access order, and sequentially storing the extracted data block to be accessed in the data cache layer corresponding to the current data cache level according to the current data cache level of the data block to be accessed.

[0136] In one exemplary embodiment of this disclosure, the training apparatus for the network model further includes:

[0137] The task execution time calculation module can be used to determine the first task execution time of executing the data loading task corresponding to the data block to be accessed, and the second task execution time of executing the data calculation task corresponding to the neural network model to be trained;

[0138] The task execution time period determination module can be used to determine, based on the first task execution time and the second task execution time, the first task execution time and the second task execution time, the first task execution time and the second task execution time, the first task execution time and the second task execution time, the second task execution time period, the second task execution time period, the second task execution time period, the second task execution time period, the second task execution time period, the third ...

[0139] The task execution module can be used to execute a data loading task corresponding to the data block to be accessed based on the first task execution time period, and to execute a data calculation task corresponding to the neural network model to be trained based on the second task execution time period;

[0140] The intersection between the execution time of the first task and the execution time of the second task is an empty set.

[0141] In one exemplary embodiment of this disclosure, determining the execution duration of a first task for loading a data block corresponding to the data to be accessed and the execution duration of a second task for computing a data computation task corresponding to the neural network model to be trained includes: determining a first computation time required to compute the current data access order and the current data caching level, and determining a second computation time required to cache the data block to be accessed; determining the execution duration of the first task for loading a data block corresponding to the data to be accessed based on the first computation time and the second computation time; determining the historical model training time of the trained neural network model during the training process, and determining the execution duration of the second task for computing a data computation task corresponding to the neural network model to be trained based on the historical model training time.

[0142] The specific details of each module in the above-mentioned network model training device have been described in detail in the training method of the corresponding network model, so they will not be repeated here.

[0143] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0144] Furthermore, although the steps of the method in this disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.

[0145] In an exemplary embodiment of this disclosure, an electronic device capable of implementing the above-described method is also provided.

[0146] Those skilled in the art will understand that various aspects of this disclosure can be implemented as a system, method, or program product. Therefore, various aspects of this disclosure can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software aspects, collectively referred to herein as a "circuit," "module," or "system."

[0147] The following reference Figure 8 To describe an electronic device 800 according to such an embodiment of the present disclosure. Figure 8 The electronic device 800 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments disclosed herein.

[0148] like Figure 8 As shown, the electronic device 800 is manifested in the form of a general-purpose computing device. The components of the electronic device 800 may include, but are not limited to: at least one processing unit 810, at least one storage unit 820, a bus 830 connecting different system components (including storage unit 820 and processing unit 810), and a display unit 840.

[0149] The storage unit stores program code that can be executed by the processing unit 810, causing the processing unit 810 to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this disclosure. For example, the processing unit 810 can perform actions such as... Figure 1The steps shown are as follows: Step S110: Obtain the historical data blocks accessed by the trained neural network model during the training process and the historical data block access logs generated by accessing the historical data blocks; Step S120: Determine the data blocks to be accessed by the neural network model to be trained corresponding to the trained neural network model during the training process based on the historical data blocks; Step S130: Determine the current data access mode and current data access order of the data blocks to be accessed based on the historical data block access logs, and determine the current data cache level of the data blocks to be accessed based on the data access mode; Step S140: Cache the data blocks to be accessed according to the current data access order and current data cache level, and train the neural network model to be trained based on the cached data blocks to be accessed.

[0150] Storage unit 820 may include a readable medium in the form of a volatile storage unit, such as random access memory (RAM) 8201 and / or cache memory 8202, and may further include a read-only memory (ROM) 8203.

[0151] The storage unit 820 may also include a program / utility 8204 having a set (at least one) of program modules 8205, including but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.

[0152] Bus 830 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.

[0153] Electronic device 800 can also communicate with one or more external devices 900 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable a user to interact with electronic device 800, and / or with any device that enables electronic device 800 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 850. Furthermore, electronic device 800 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 860. As shown, network adapter 860 communicates with other modules of electronic device 800 via bus 830. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0154] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this disclosure.

[0155] In exemplary embodiments of this disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the methods described above is stored. In some possible implementations, various aspects of this disclosure may also be implemented as a program product including program code that, when the program product is run on a terminal device, causes the terminal device to perform the steps of the various exemplary embodiments of this disclosure described in the "Exemplary Methods" section above.

[0156] The program product for implementing the above-described method according to embodiments of the present disclosure may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto. In this document, the readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.

[0157] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0158] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.

[0159] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0160] Program code for performing the operations of this disclosure can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0161] Furthermore, the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of this disclosure and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Additionally, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.

[0162] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention described herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not invented by this disclosure. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.

Claims

1. A method for training a network model, characterized in that, include: Obtain the historical data blocks accessed by the trained neural network model during the training process, as well as the historical data block access logs generated during the access of the historical data blocks; Based on the historical data blocks, determine the data blocks to be accessed during the training process of the neural network model to be trained, which correspond to the trained neural network model; wherein the neural network model to be trained has the same model structure as the trained neural network model. Based on the historical data block access logs, determine the current data access mode and current data access order of the data block to be accessed, and determine the current data cache level of the data block to be accessed based on the data access mode. The data block to be accessed is cached according to the current data access order and the current data caching level, and the neural network model to be trained is trained based on the cached data block to be accessed. 2.The method of Claim 1, wherein, Based on the historical data blocks, determine the data blocks to be accessed during the training process of the neural network model to be trained, corresponding to the trained neural network model, including: The training is performed on the data block prediction model to be trained based on the historical data blocks and the trained neural network model to obtain the trained data block prediction model. The neural network model to be trained is input into the trained data block prediction model to obtain the data block prediction result; Data blocks whose predicted probability is greater than a preset probability threshold are extracted from the data block prediction results and used as the data blocks to be accessed.

3. The training method for the network model according to claim 1, characterized in that, Based on the historical data block access logs, determine the current data access mode and current data access order of the data block to be accessed, including: Based on the historical data block access logs, determine the current data access probability and current data dependency of the data block to be accessed; The current data access mode of the data block to be accessed is determined based on the current data access probability, and the current data access order of the data block to be accessed is determined based on the current data dependency relationship.

4. The training method for the network model according to claim 3, characterized in that, The historical data blocks include a first historical data block, a second historical data block, ..., an Nth historical data block, and the data blocks to be accessed include a first data block to be accessed, a second data block to be accessed, ..., an Nth data block to be accessed; wherein, determining the current access probability of the data blocks to be accessed based on the access logs of the historical data blocks includes: Based on the historical data block access logs, determine the first historical sub-access count of the trained neural network model during the training process and the total historical access count of all historical data blocks. Based on the first historical sub-access count and the total historical access count, determine the first historical access probability of the first historical data block, and based on the first historical access probability, determine the first current access probability of the first data block to be accessed corresponding to the first historical data block. Repeat the steps for determining the first current access probability to obtain other current access probabilities for data blocks other than the first data block to be accessed.

5. The training method for the network model according to claim 3, characterized in that, Based on historical data block access logs, determine the current data dependencies of the data block to be accessed, including: Based on the historical data block access logs, determine the historical access order of the trained neural network model to the historical data blocks during the training process; Construct a historical data block access relationship graph based on the historical data blocks and the historical access order of the historical data blocks; Based on the historical data block access relationship graph, the historical data dependencies between the historical data blocks are determined, and based on the historical data dependencies between the historical data blocks, the current data dependencies between the data blocks to be accessed are determined.

6. The training method for the network model according to claim 3, characterized in that, Determining the current data access mode of the data block to be accessed based on the current data access probability includes: If the current data access probability is greater than or equal to the first preset access probability threshold, then the current data access mode of the data block to be accessed is determined to be a high-frequency data access mode. If the current data access probability is less than the first preset access probability threshold and greater than or equal to the second preset access probability threshold, then the current data access mode of the data block to be accessed is determined to be the medium frequency data access mode. If the current data access probability is less than the second preset access probability threshold, then the current data access mode of the data block to be accessed is determined to be a low-frequency data access mode.

7. The training method for the network model according to claim 3, characterized in that, Based on the current data dependencies, the current data access order of the data block to be accessed is determined, including: Based on the current data dependency relationship, a second data block that has a dependency relationship with the first data block to be accessed is determined, and a first current access probability of the first data block to be accessed and a second current access probability of the second data block to be accessed are determined. Determine the third current access probability of accessing the second data block after accessing the first data block to be accessed, and determine the first data extraction priority of the first data block to be accessed based on the first current access probability, the second current access probability and the third current access probability. Repeat the first data extraction priority determination steps sequentially to obtain other data extraction priorities for other data blocks to be accessed besides the first data block to be accessed; The data blocks to be accessed are sorted based on their data extraction priority, and the current data access order of the data blocks to be accessed is determined according to the sorting result.

8. The training method for the network model according to claim 1, characterized in that, Determining the current data cache level of the data block to be accessed based on the data access mode includes: If the data access mode is a high-frequency data access mode, then the current data cache level of the data block to be accessed is determined to be a fast cache layer; If the data access mode is a medium-frequency data access mode, then the current data cache level of the data block to be accessed is determined to be a medium-speed cache layer; If the data access mode is a low-frequency data access mode, then the current data cache level of the data block to be accessed is determined to be a low-speed cache level.

9. The training method for the network model according to claim 1, characterized in that, The data block to be accessed is cached according to the current data access order and the current data caching level, including: According to the current data access order, the data blocks to be accessed are extracted sequentially, and according to the current data cache level of the data blocks to be accessed, the extracted data blocks to be accessed are stored in the data cache layer corresponding to the current data cache level.

10. The training method for the network model according to claim 1, characterized in that, The training method for the network model also includes: Determine the execution time of the first task for executing the data loading task corresponding to the data block to be accessed, and the execution time of the second task for executing the data computation task corresponding to the neural network model to be trained; The execution time period for the first task corresponding to the data loading task and the execution time period for the second task are determined based on the execution time of the first task and the execution time of the second task. The data loading task corresponding to the data block to be accessed is executed based on the first task execution time period, and the data calculation task corresponding to the neural network model to be trained is executed based on the second task execution time period. The intersection between the execution time of the first task and the execution time of the second task is an empty set.

11. The training method for the network model according to claim 10, characterized in that, Determining the execution duration of the first task (data loading task corresponding to the data block to be accessed) and the execution duration of the second task (data computation task corresponding to the neural network model to be trained) includes: Determine the first computation time required to calculate the current data access order and the current data caching level, and determine the second computation time required to cache the data block to be accessed; Based on the first computation time and the second computation time, determine the first task execution time for executing the data loading task corresponding to the data block to be accessed; Determine the historical model training time of the completed neural network model during the training process, and based on the historical model training time, determine the second task execution time for executing the data computation task corresponding to the neural network model to be trained.

12. A training device for a network model, characterized in that, include: The data block access log acquisition module is used to acquire the historical data blocks accessed by the trained neural network model during the training process, as well as the historical data block access logs generated by accessing the historical data blocks. The data block to be accessed module is used to determine, based on the historical data blocks, the data blocks to be accessed required by the neural network model to be trained during the training process, corresponding to the trained neural network model; wherein, the neural network model to be trained and the trained neural network model have the same model structure. The data cache level determination module is used to determine the current data access mode and current data access order of the data block to be accessed based on the historical data block access log, and to determine the current data cache level of the data block to be accessed based on the data access mode. The network model training module is used to cache the data block to be accessed according to the current data access order and the current data caching level, and to train the neural network model to be trained based on the cached data block to be accessed.

13. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the training method of the network model according to any one of claims 1-11.

14. An electronic device, characterized in that, include: processor; as well as Memory for storing the executable instructions of the processor; The processor is configured to execute the training method of the network model according to any one of claims 1-11 by executing the executable instructions.

Citation Information

Patent Citations

  • Data caching method and device for multi-concurrent deep learning training tasks

    CN114968588A

  • Selectable caching policy

    CN117280329A