Network model training method and device, storage medium and electronic equipment

By dynamically adjusting the cache hierarchy and context prefetching mechanism and optimizing the data access mode, the problems of data access latency and low cache utilization efficiency in distributed large-scale model training are solved, and efficient data management and training speed are achieved.

CN119250163APending Publication Date: 2025-01-03CHINA TELECOM CORP LTD TECHNOLOGY INNOVATION CENTER +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411397564.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-08
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

During the distributed large-scale model training process, high data access latency and low cache utilization efficiency lead to reduced training speed. The existing technology cannot flexibly adjust the cache strategy according to the frequency and importance of data access, resulting in insufficient utilization of cache resources.

Method used

By obtaining the historical data blocks and access logs of the trained neural network model, determining the current data access mode and access order of the data blocks to be accessed, dynamically adjusting the cache level, optimizing the data cache strategy, and based on the multi-level cache architecture and context prefetching With the prediction mechanism, high-frequency access data is loaded in advance to the fast cache layer, reducing the delay in remote data access.

Benefits of technology

It significantly reduces data access latency, improves model training speed and cache resource utilization, and improves overall training efficiency and system performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119250163A_ABST
    Figure CN119250163A_ABST
Patent Text Reader

Abstract

The invention relates to a network model training method and device, a storage medium and electronic equipment, and relates to the technical field of machine learning, and the method comprises the steps: obtaining a historical data block accessed by a trained neural network model in a training process and a historical data block access log generated by accessing the historical data block; determining a to-be-accessed data block required by a to-be-trained neural network model corresponding to the trained neural network model in a training process according to the historical data block; determining a current data access mode and a current data access sequence of the to-be-accessed data block according to the historical data block access log, and determining a current data cache level of the to-be-accessed data block according to the data access mode; caching the to-be-accessed data block according to the current data access sequence and the current data caching hierarchy, and training a to-be-trained neural network model based on the cached to-be-accessed data block. The model training efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

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

[0003] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0004] The purpose of the present disclosure is to provide a network model training method, a network model training device, a computer-readable storage medium and an electronic device. , thereby at least to some extent overcoming 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 the present disclosure, a method for training a network model is provided, comprising:

[0006] Obtaining historical data blocks accessed by the trained neural network model during the training process and historical data block access logs generated by accessing the historical data blocks;

[0007] Determine, based on the historical data blocks, a data block to be accessed during the training process of the neural network model to be trained corresponding to the trained neural network model;

[0008] Determine the current data access mode and current data access order of the data block to be accessed according to the historical data block access log, and determine the current data cache level of the data block to be accessed according to the data access mode;

[0009] The data blocks to be accessed are cached according to the current data access sequence and the current data cache level, and the neural network model to be trained is trained based on the cached data blocks to be accessed.

[0010] In an exemplary embodiment of the present disclosure, determining, according to the historical data blocks, data blocks to be accessed during the training process of the neural network model to be trained corresponding to the trained neural network model includes:

[0011] Training the data block prediction model to be trained according to the historical data block and the trained neural network model to obtain a trained data block prediction model;

[0012] 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;

[0013] A data block whose prediction probability is greater than a preset probability threshold is extracted from the data block prediction results as the data block to be accessed.

[0014] In an exemplary embodiment of the present disclosure, determining the current data access mode and the current data access order of the data block to be accessed according to the historical data block access log includes:

[0015] Determining the current access probability and current data dependency of the data block to be accessed according to the historical data block access log;

[0016] The current data access mode of the data block to be accessed is determined according to the current data access probability, and the current data access sequence of the data block to be accessed is determined according to the current data dependency.

[0017] In an exemplary embodiment of the present disclosure, the historical data blocks include a first historical data block, a second historical data block, ..., and 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, ..., and an Nth data block to be accessed; wherein, according to the historical data block access log, determining the current access probability of the data block to be accessed includes:

[0018] Determine, according to the historical data block access log, a first historical sub-access number of the first historical data block accessed by the trained neural network model during the training process and a total historical access number of all historical data blocks accessed;

[0019] Determine a first historical access probability of the first historical data block according to the first historical sub-access number and the historical total access number, and determine a first current access probability of a first to-be-accessed data block corresponding to the first historical data block according to the first historical access probability;

[0020] Repeat the step of determining the first current access probability to obtain other current access probabilities of other data blocks to be accessed except the first data block to be accessed.

[0021] In an exemplary embodiment of the present disclosure, determining the current data dependency of the data block to be accessed according to the historical data block access log includes:

[0022] Determining, according to the historical data block access log, a historical access sequence of the trained neural network model to the historical data blocks during the training process;

[0023] Constructing a historical data block access relationship graph according to the historical data blocks and the historical access sequence of the historical data blocks;

[0024] The historical data dependency relationship between the historical data blocks is determined based on the historical data block access relationship graph, and the current data dependency relationship between the data blocks to be accessed is determined according to the historical data dependency relationship between the historical data blocks.

[0025] In an exemplary embodiment of the present disclosure, determining the current data access mode of the data block to be accessed according to the current data access probability includes:

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

[0027] If the current data access probability is less than a first preset access probability threshold and greater than or equal to a second preset access probability threshold, determining that the current data access mode of the to-be-accessed data block is an intermediate frequency data access mode;

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

[0029] In an exemplary embodiment of the present disclosure, determining the current data access order of the to-be-accessed data blocks according to the current data dependency relationship includes:

[0030] Determine, according to the current data dependency, 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;

[0031] 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;

[0032] Repeat the first data extraction priority determination step in sequence to obtain other data extraction priorities of other data blocks to be accessed except the first data block to be accessed;

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

[0034] In an exemplary embodiment of the present disclosure, determining the current data cache level of the to-be-accessed data block according to the data access mode includes:

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

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

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

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

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

[0040] In an exemplary embodiment of the present disclosure, the network model training method further includes:

[0041] Determine a first task execution time for executing a data loading task corresponding to the to-be-accessed data block, and a second task execution time for executing a data computing task corresponding to the to-be-trained neural network model;

[0042] Determine, according to the first task execution time and the second task execution time, a first task execution time period for executing a data loading task corresponding to the to-be-accessed data block, and a second task execution time period for executing a data computing task corresponding to the to-be-trained neural network model;

[0043] Executing a data loading task corresponding to the to-be-accessed data block based on the first task execution time period, and executing a data computing task corresponding to the to-be-trained neural network model based on the second task execution time period;

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

[0045] In an exemplary embodiment of the present disclosure, determining a first task execution duration of a data loading task corresponding to the data block to be accessed, and a second task execution duration of a data computing task corresponding to the neural network model to be trained, includes:

[0046] Determine a first computing time required to calculate the current data access sequence and the current data cache level, and determine a second computing time required to cache the to-be-accessed data block;

[0047] Determine, according to the first operation duration and the second operation duration, a first task execution duration for executing a data loading task corresponding to the to-be-accessed data block;

[0048] Determine the historical model training duration of the trained neural network model during the training process, and determine the second task execution duration of the data calculation task corresponding to the neural network model to be trained based on the historical model training duration.

[0049] According to one aspect of the present disclosure, a network model training device is provided, comprising:

[0050] A data block access log acquisition module is used to acquire historical data blocks accessed by the trained neural network model during the training process and historical data block access logs generated by accessing the historical data blocks;

[0051] A module for determining a data block to be accessed, used to determine, based on the historical data blocks, a data block to be accessed required by the neural network model to be trained corresponding to the trained neural network model during the training process;

[0052] A data cache level determination module, used to determine the current data access mode and current data access order of the data block to be accessed according to the historical data block access log, and determine the current data cache level of the data block to be accessed according to the data access mode;

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

[0054] According to one aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the training method of the network model described in any one of the above is implemented.

[0055] According to one aspect of the present disclosure, there is provided an electronic device, including:

[0056] Processor; and

[0057] A memory, configured to store executable instructions of the processor;

[0058] Wherein, the processor is configured to execute any one of the above-mentioned network model training methods by executing the executable instructions.

[0059] A network model training method provided by an embodiment of the present disclosure comprises the following steps: on the one hand, obtaining historical data blocks accessed by a trained neural network model during the training process and historical data block access logs generated by accessing the historical data blocks; then determining 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 according to the historical data blocks; then determining the current data access mode and the current data access order of the data blocks to be accessed according to the historical data block access logs, and determining the current data cache level of the data blocks to be accessed according to the data access mode; finally, caching the data blocks to be accessed according to the current data access order and the current data cache level, and training the neural network model to be trained based on the cached data blocks to be accessed. Since the corresponding data blocks can be accessed from the corresponding data cache level, the problem of high data access delay caused by the need for remote data access can be avoided, and the training speed of the model is improved on the basis of improving data access efficiency. On the other hand, since the data cache level can be determined according to the current data access mode and the current data access order and then the data blocks are cached, the problem of low utilization of cache resources due to the inability to flexibly adjust the cache strategy according to the data access frequency and importance is solved.

[0060] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.

[0062] Figure 1 A flowchart of a network model training method according to an exemplary embodiment of the present disclosure is schematically shown.

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

[0064] Figure 3 A structural example diagram of a Transformer model according to an example embodiment of the present disclosure is schematically shown.

[0065] Figure 4 A diagram schematically illustrates an example structure of a data cache hierarchy according to an example embodiment of the present disclosure.

[0066] Figure 5 An example diagram schematically illustrates an access relationship between data blocks according to an example embodiment of the present disclosure.

[0067] Figure 6 The flowchart schematically shows a method for determining a task execution time period according to an exemplary embodiment of the present disclosure.

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

[0069] Figure 8 An electronic device for implementing the training method of the network model according to an exemplary embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0070] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.

[0071] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0072] In today's big data era, the rapid development of artificial intelligence (AI) and deep learning technology has greatly promoted the application of various complex models, especially in the fields of natural language processing (NLP), computer vision (CV), and recommendation systems. However, as the scale of deep learning models becomes larger and larger, the amount of data and computing resources required to train these models are also growing exponentially. Distributed computing has become a key approach to address this challenge, significantly shortening the training time by processing data in parallel on multiple computing nodes. However, during the training of distributed large models, frequent data exchange and remote data access between computing nodes can easily lead to communication bottlenecks, which in turn affects the performance and efficiency of the overall system. Furthermore, in the process of training related distributed large models, there are the following defects: on the one hand, the data access delay is high: that is, the 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, the cache utilization efficiency is low: that is, in the process of actual application, the cache mechanism in the relevant technical solution cannot flexibly adjust the cache strategy according to the frequency and importance of data access, resulting in insufficient utilization of cache resources; for example, frequently accessed data is not effectively stored in the cache, while infrequently accessed data occupies valuable cache space, resulting in low cache utilization efficiency; on the other hand, data pre-fetching and prediction are not smart enough: that is, in the process of actual application, the system in the relevant technical solution often lacks in-depth analysis of data access patterns for pre-fetching context data, resulting in inaccurate or inappropriate timing of pre-fetched data, further aggravating the data waiting problem in the training process.

[0073] In order to solve the above-mentioned bottleneck problem, the present disclosure provides a network model training method, which can perform multi-level context cache optimization on the data blocks involved in the model training process, and combine the context prefetching and prediction mechanism to effectively reduce the data access delay in distributed large model training and improve the training efficiency.

[0074] Based on this, this exemplary embodiment first provides a network model training method, which can be run on a terminal device server, server cluster or cloud server where the model training system is located; of course, those skilled in the art can also run the method disclosed in this disclosure on other platforms as required, and this exemplary embodiment does not specifically limit this. Figure 1 As shown, the training method of the network model may include the following steps:

[0075] Step S110. 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;

[0076] Step S120. Determine, based on the historical data blocks, 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;

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

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

[0079] In the training method of the above 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 by accessing the historical data blocks are obtained; then 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 are determined according to the historical data blocks; then the current data access mode and the current data access order of the data blocks to be accessed are determined according to the historical data block access logs, and the current data cache level of the data blocks to be accessed is determined according to the data access mode; finally, the data blocks to be accessed are 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 blocks to be accessed. Since the corresponding data blocks can be accessed from the corresponding data cache level, the problem of high data access delay caused by the need for remote data access can be avoided, and the training speed of the model is improved on the basis of improving data access efficiency; on the other hand, since the data cache level can be determined according to the current data access mode and the current data access order and then the data blocks are cached, the problem of low utilization of cache resources due to the inability to flexibly adjust the cache strategy according to the data access frequency and importance is solved.

[0080] Hereinafter, the training method of the network model involved in the exemplary embodiment of the present disclosure will be explained and illustrated in detail with reference to the accompanying drawings.

[0081] First, the application scenarios of the exemplary embodiments of the present disclosure are explained and illustrated. Specifically, the training method of the network model recorded in the exemplary embodiments of the present disclosure can be used to train the network model in the natural language processing scenario, and can also be used to train the network model in the computer vision scenario. Among them, the network model in the natural language processing scenario recorded here may include but is not limited to the Bert model, the GPT model, and the multilingual translation model, etc.; among them, the Bert model recorded here can be composed of multiple Transformer models, and the specific model structure can be referred to Figure 2 As shown; further, the model structure of the Transformer model can refer to Figure 3 As shown. At the same time, network models in computer vision scenarios may include but are not limited to large-scale image classification models, object detection models, and video analysis models, etc. In the process of actual application, for network models in natural language processing scenarios, since these models need to process massive amounts of text data, multi-level cache optimization and context pre-fetching mechanisms can significantly reduce data access delays during training, increase training speed, and improve model accuracy and performance; further, for network models in computer vision scenarios, since the training tasks of these models usually involve a large amount of high-resolution image or video frame data, by optimizing the cache and data pre-fetching mechanism, the data loading time can be effectively reduced, the training efficiency can be improved, and the model development and deployment can be completed faster.

[0082] Secondly, the technical implementation principle of the exemplary embodiment of the present disclosure is explained and illustrated. Specifically, the training method of the network model recorded in the exemplary embodiment of the present disclosure can be composed of cache level division and context pre-fetching and prediction mechanism; wherein, the core idea of ​​cache level division is to build a multi-level context cache mechanism; the core idea of ​​context pre-fetching and prediction mechanism is to load the data that may be needed in advance through the analysis of context data access patterns and the application of prediction algorithms during the training process, reduce the waiting time during data access, and further improve the continuity and efficiency of the training task. Furthermore, the method recorded in the exemplary embodiment of the present disclosure can also be combined with the context pre-fetching and prediction mechanism to solve the following technical defects in the relevant technical solutions: on the one hand, multi-level context cache optimization: by designing a multi-level cache architecture, the 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; for example, high-frequency access data can be preferentially stored in the fast cache layer to reduce access delay; low-frequency access data can be stored in the remote cache layer to save high-level cache space; on the other hand, dynamic cache management: in the training process In the process, the access pattern of context data is monitored in real time, and the cache strategy is adjusted dynamically. For example, an adaptive cache management algorithm can be used to regularly analyze access logs, promote frequently used data to a higher level cache, and downgrade data that is no longer frequently accessed to ensure the optimal allocation and utilization of cache resources. On the other hand, the context prefetching and prediction mechanism: by analyzing the access pattern of context data, the probability model and prediction algorithm are used to predict in advance the data blocks that may be accessed next, and load these data into the appropriate cache level in advance. At the same time, asynchronous loading technology can also be used to make data prefetching and prediction proceed in parallel with computing tasks, further reducing the waiting time for data access.

[0083] The following explains and illustrates the data cache hierarchy involved in the example embodiments of the present disclosure. Specifically, in the actual application process, in order to achieve multi-level context cache optimization, the cache resources at different levels can be reasonably configured based on the principle of locality of data access, so that commonly used context data can be quickly accessed, remote data requests can be reduced, and latency can be reduced; at the same time, through refined cache management, the utilization efficiency of cache resources can be improved, and efficient data management in a distributed training environment can be achieved. Furthermore, a multi-level cache architecture can be designed according to the hardware architecture and network topology of the computing nodes; for example, refer to Figure 4 As shown, the data cache levels described in the exemplary embodiments of the present disclosure may include a fast cache level, a medium cache level, a low cache level, etc. Among them:

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

[0085] Furthermore, after the data cache hierarchy is built, the data blocks to be accessed can be classified according to the access frequency, data size and importance of the context data. The specific strategies include: high-frequency access data: such as model parameters, gradient information and other key data, 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 fast reading when needed; low-frequency access data: such as historical training data and context information that is accessed in small quantities, are stored in the remote cache layer to reduce the storage pressure of the high-level cache.

[0086] At the same time, in the actual application process, the data cache level also needs to be dynamically managed; specifically, during the training process, the access pattern of the context data can be monitored in real time and the cache strategy can be adjusted dynamically; and by regularly analyzing the access logs, the adaptive cache management algorithm can be used to optimize the allocation of cache resources; for example, frequently used data can be gradually promoted to a higher level cache, while data that is no longer frequently accessed can be downgraded to free up high-level cache space.

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

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

[0089] Specifically, the trained neural network model recorded here has the same model structure as the neural network model to be trained; wherein, the same model structure means that the model levels they have are the same, and the parameter names and number of parameters corresponding to each model level are also the same, and the difference is that the specific values ​​of the parameters are different. At the same time, the data block names of the historical data blocks accessed by the trained neural network model during the training process can be obtained based on the model training log generated by the trained neural network model during the training process; the historical data block access log can be included in the model training log, that is, the historical data block access log 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 according to the historical data blocks.

[0091] Specifically, the specific determination process of the data block to be accessed can be achieved in the following manner: training the data block prediction model to be trained according to the historical data block 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; extracting the data block whose prediction probability is greater than a preset probability threshold from the data block prediction result as the data block to be accessed.

[0092] Specifically, in the actual application process, machine learning or rule-based prediction algorithms can be used to predict the contextual data that may be needed in the future during the training process and load it into the appropriate cache level in advance. The prediction algorithm can adopt the following strategies: one is prediction based on historical data: that is, using historical access data to predict the data that may be accessed in the future, which is suitable for regular access patterns; the other is adaptive prediction: for scenarios with more complex access patterns, an adaptive prediction algorithm is used to continuously adjust and optimize the prediction model to improve the accuracy of the prediction. It should be noted here 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 that the set of data blocks that may be accessed next is (D_hat), the prediction can be made by maximizing the conditional probability:

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

[0094] Among them, (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 explained here that the trained data block prediction model involved here can be a multi-classification data prediction model, such as a decision tree model, or it can be other multi-classification models. This example does not impose any special restrictions on this; the loss function used in the model training process can be, for example, a cross entropy loss function, etc.

[0096] In step S130, the current data access mode and the 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, first, based on the historical data block access log, the current data access mode and the current data access order of the data block to be accessed are determined; specifically, it can be achieved in the following way: first, based on the historical data block access log, the current access probability and the 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; wherein, the historical data blocks recorded here include the first historical data block, the second historical data block, ..., the Nth historical data block; the data blocks to be accessed recorded here include the first data block to be accessed, the second data block to be accessed, ..., the Nth data block to be accessed. Specifically, the current access probability (also referred to as the access frequency) recorded here refers to the probability of accessing a certain data block during the model training process, that is, the probability of using a certain data block during the model training process; by determining the access probability, the frequently accessed context data can be identified, and its priority in prefetching and prediction can be focused on; further, the current data dependency recorded here refers to the process of calling a data block, in which one or more data blocks will be called at the same time, or after a data block is called, another data block will be called immediately. This calling relationship between data blocks can be called a data dependency; at the same time, by analyzing the dependency between the context data, it is determined which data may be used in subsequent calculation steps, thereby providing a basis for the prefetching mechanism.

[0098] In an exemplary embodiment, according to the historical data block access log, determining the current access probability of the data block to be accessed can be achieved in the following manner: first, according to the historical data block access log, determining the first historical sub-access times of the first historical data block accessed by the trained neural network model during the training process and the total historical access times of all historical data blocks; second, determining the first historical access probability of the first historical data block according to the first historical sub-access times and the total historical access times, and determining the first current access probability of the first data block to be accessed corresponding to the first historical data block according to the first historical access probability; then, repeating the step of determining the first current access probability to obtain other current access probabilities of other data blocks to be accessed except the first data block to be accessed. In the actual application process, since the trained neural network model and the neural network model to be trained have the same model structure, and the data block names to be called during the model training process are consistent, the current access probability can be determined directly based on the historical access probability.

[0099] Furthermore, the specific calculation process of the first historical access probability recorded above can be shown as the following formula (1):

[0100]

[0101] P(D_i) is the historical access probability of the i-th historical data block, 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; the total number of accesses represents the total number of historical accesses.

[0102] In an exemplary embodiment, the current data dependency of the data block to be accessed is determined based on the historical data block access log, which can be achieved in the following manner: first, the historical access order of the historical data blocks by the trained neural network model during the training process is determined based on the historical data block access log; second, a historical data block access relationship graph is constructed based on the historical data blocks and the historical access order of the historical data blocks; finally, the historical data dependencies between the historical data blocks are determined based on the historical data block access relationship graph, and the current data dependencies between the data blocks to be accessed are determined based on the historical data dependencies between the historical data blocks. That is, the dependency can be determined based on a specific access order; for example, during the model training process, data block A is accessed first, and then data blocks B and C are accessed at the same time. After accessing data block B, data blocks E and F are also accessed; further, after accessing data block C, data blocks G and H are also accessed, and so on; based on this, the following can be constructed: Figure 5 The data block access relationship diagram is shown.

[0103] In an example embodiment, determining the current data access mode of the data block to be accessed according to the current data access probability can be achieved in the following manner: 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 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 a second preset access probability threshold, then determining the current data access mode of the data block to be accessed to be 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 to be a low-frequency data access mode. Among them, the first preset access probability threshold and the second preset access probability threshold recorded here can be set according to experience, or can be predicted based on the corresponding neural network model, and this example does not impose any special restrictions on this.

[0104] In an exemplary embodiment, determining the current data access order of the data blocks to be accessed according to the current data dependency relationship can be achieved in the following manner: determining a second data block to be accessed that has a dependency relationship with the first data block to be accessed according to 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 according to the first current access probability, the second current access probability and the third current access probability; repeating the step of determining the first data extraction priority in sequence to obtain other data extraction priorities of other data blocks to be accessed except 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 according to the sorting result.

[0105] Specifically, in the actual application process, the data to be accessed can be loaded from the remote cache or the lower-level cache to the upper-level cache in advance according to the results of the context access pattern analysis. Specific implementation methods include: sequential prefetching: for data with sequential access patterns, the system will automatically load the next batch of data in advance; dependency prefetching: for data with dependencies, by loading dependent data in advance, it is ensured that the computing nodes can quickly access it when needed. Furthermore, in the process of extracting data based on dependency prefetching, it is first necessary to determine the data extraction priority; wherein, in the calculation process of the data extraction priority, in addition to considering the first current access probability and the second current access probability, it is also necessary to consider the third current access probability; in the actual application process, it is first necessary to calculate the third historical access probability, 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, after obtaining the third historical access probability, the third current access probability can be obtained; 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] Among them, P_prefetch(D_i) represents the data extraction priority of data block i, α and β are weight parameters, which are used to balance the impact of the access frequency and dependency of the data block itself on the prefetch priority; in the actual application process, the model training system will give priority to prefetching those data blocks with higher (P_prefetch(D_i)) values. It should be noted here that the specific values ​​of α and β can be determined according to actual needs, and they only need to satisfy α+β=1, and this example does not make 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, it can be implemented in the following way: if the data access mode is a high-frequency data access mode, the current data cache level of the data block to be accessed is determined to be a fast cache level; if the data access mode is a medium-frequency data access mode, the current data cache level of the data block to be accessed is determined to be a medium-speed cache level; if the data access mode is a low-frequency data access mode, the current data cache level of the data block to be accessed is determined to be a low-speed cache level. That is, for context data that is frequently accessed and has 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 that is frequently accessed but does not require real-time response, it can be stored in the node local storage (such as SSD storage); for context data that is less frequently accessed or has a large volume, it can be stored in a distributed storage system (such as HDFS or object storage) that serves as the bottom layer of the cache system.

[0111] In step S140, the data blocks to be accessed are 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 blocks to be accessed.

[0112] In this example embodiment, first, the data blocks to be accessed are cached according to the current data access order and the current data cache level; specifically, it can be achieved in the following way: the data blocks to be accessed are extracted in sequence according to the current data access order, 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 sequence in the data cache layer corresponding to the current data cache level; 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 levels in sequence according to the progress of the model training for model training.

[0113] Figure 6 A method for determining a task execution time period according to an exemplary embodiment of the present disclosure is schematically shown. Figure 6 As shown, the specific process of determining the task execution time period may include the following steps:

[0114] Step S610, determining a first task execution time of executing a data loading task corresponding to the to-be-accessed data block, and a second task execution time of executing a data computing task corresponding to the to-be-trained neural network model;

[0115] Step S620, determining a first task execution time period for executing a data loading task corresponding to the to-be-accessed data block, and a second task execution time period for executing a data computing task corresponding to the to-be-trained neural network model, according to the first task execution time period and the second task execution time period;

[0116] Step S630, executing the data loading task corresponding to the data block to be accessed based on the first task execution time period, and executing the 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 time period is an empty set.

[0117] In an exemplary embodiment, determining a first task execution duration for executing a data loading task corresponding to the data block to be accessed, and a second task execution duration for executing a data calculation task corresponding to the neural network model to be trained, can be achieved in the following manner: determining a first operation duration required for calculating the current data access order and the current data cache level, and determining a second operation duration required for caching the data block to be accessed; determining a first task execution duration for executing the data loading task corresponding to the data block to be accessed based on the first operation duration and the second operation duration; determining a historical model training duration of a trained neural network model during the training process, and determining a second task execution duration for executing the data calculation task corresponding to the neural network model to be trained based on the historical model training duration.

[0118] The following will further explain and illustrate the specific process of determining the task execution time. Specifically, in the actual application process, in order not to affect the execution of the current computing task, the pre-fetching and predictive loading of context data are performed asynchronously; at the same time, through asynchronous loading technology, the advance loading of data is carried out in parallel with the computing task, thereby reducing the waiting time of the computing task and improving the overall response speed of the system. Furthermore, in order to maximize the parallelism of the system, the asynchronous loading mechanism adopts a parallel task execution method. Assume that at time (t), the data computing task being executed by the system is T(t), and the data loading task of pre-fetching and predicting data is L(t). Under this premise, in order to avoid the loading task blocking the execution of the computing task, the system needs to ensure:

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

[0120] At this point, the training method of the network model recorded in the example embodiment of the present disclosure has been fully realized. Based on the above-mentioned contents, it can be known that the training method of the network model recorded in the example embodiment of the present disclosure can, on the one hand, improve the efficiency of large-scale model training: that is, the example embodiment of the present disclosure significantly reduces the data access delay in the large-scale model training process by optimizing the cache hierarchy and data prefetching strategy, thereby improving the overall training efficiency; based on this method, it has extremely high value for application scenarios that need to process massive data and complex models, and can help enterprises and research institutions develop and deploy high-performance artificial intelligence models more quickly; on the other hand, it can reduce computing costs: that is, by improving the utilization efficiency of cache resources and reducing data access delays, the example embodiment of the present disclosure can significantly reduce the computing costs in distributed large model training; at the same time, it reduces the waste of system resources, so that more computing tasks can be completed under the same hardware conditions, thereby saving a lot of computing expenses for enterprises; on the other hand, it can significantly reduce data access delays: also That is, the example embodiments of the present disclosure classify context data according to access frequency and importance, and store them in different cache levels, so that frequently accessed data can be preferentially stored in the fast cache layer, thereby significantly reducing the latency problem caused by remote data access; compared with the prior art, the example embodiments of the present disclosure greatly improve the system response speed and training efficiency through more refined cache management; further, the utilization efficiency of cache resources can also be improved: that is, the example embodiments of the present disclosure combine dynamic cache management mechanism and context prefetching and prediction mechanism to not only monitor and adjust cache strategies in real time, but also ensure that key data can be loaded into the appropriate cache level in time through in-depth analysis and prediction of data access patterns; based on this flexible cache resource allocation and management strategy, not only the cache hit rate is optimized, but also the waste of cache resources is avoided, especially when processing large-scale model training, existing computing resources can be used more efficiently.

[0121] In summary, the example embodiments of the present disclosure not only solve the common problems of data access delay and low cache utilization efficiency in distributed large model training through the innovative combination of multi-level cache architecture design, dynamic cache management, and context prefetching and prediction mechanism, but also further improve the overall performance and training speed of the system; compared with the network model training method in the relevant technical solutions, the example embodiments of the present disclosure show stronger adaptability and efficiency in large-scale model training scenarios, and provide more competitive technical support for deep learning model training in the field of artificial intelligence.

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

[0123] The exemplary embodiment of the present disclosure also provides a training device for a network model. Specifically, refer to Figure 7 The training device of the network model shown in the figure may include a data block access log acquisition module 710, a to-be-accessed data block determination module 720, a data cache level determination module 730, and a network model training module 740. Among them:

[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 to-be-accessed data block determination module 720 may be used to determine, based on the historical data blocks, the to-be-accessed data blocks required by the to-be-trained neural network model corresponding to the trained neural network model during the training process;

[0126] The data cache level determination module 730 may be used to determine the current data access mode and the current data access order of the data block to be accessed according to the historical data block access log, and determine the current data cache level of the data block to be accessed according to the data access mode;

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

[0128] In an exemplary embodiment of the present 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; extracting the data block whose prediction probability is greater than a preset probability threshold from the data block prediction result as the data block to be accessed.

[0129] In an exemplary embodiment of the present disclosure, the current data access mode and the current data access order of the data block to be accessed are determined based on the historical data block access log, including: determining the current access probability and the 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 an exemplary embodiment of the present disclosure, 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 according to the historical data block access log includes: determining, according to the historical data block access log, a first historical sub-access number of times the trained neural network model accesses the first historical data block and a total historical access number of times all historical data blocks are accessed during the training process; determining a first historical access probability of the first historical data block according to the first historical sub-access number and the total historical access number, and determining a first current access probability of a first data block to be accessed corresponding to the first historical data block according to 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 except the first data block to be accessed.

[0131] In an exemplary embodiment of the present disclosure, the current data dependency of the data block to be accessed is determined according to the historical data block access log, including: determining the historical access order of the historical data blocks by the trained neural network model during the training process according to the historical data block access log; constructing a historical data block access relationship graph according to the historical data blocks and the historical access order of the historical data blocks; determining the historical data dependencies between the historical data blocks based on the historical data block access relationship graph, and determining the current data dependencies between the data blocks to be accessed according to the historical data dependencies between the historical data blocks.

[0132] In an exemplary embodiment of the present disclosure, the current data access mode of the data block to be accessed is determined according to the current data access probability, including: 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 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 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.

[0133] In an exemplary embodiment of the present disclosure, the current data access order of the data blocks to be accessed is determined according to the current data dependency, including: determining a second data block to be accessed that has a dependency relationship with the first data block to be accessed according to the current data dependency, 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 according to the first current access probability, the second current access probability and the third current access probability; repeating the step of determining the first data extraction priority in sequence to obtain other data extraction priorities of other data blocks to be accessed except 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 according to the sorting result.

[0134] In an exemplary embodiment of the present disclosure, the current data cache level of the data block to be accessed is determined according to the data access mode, including: 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 level; 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 level; 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.

[0135] In an exemplary embodiment of the present disclosure, the data blocks to be accessed are cached according to the current data access order and the current data cache level, including: extracting the data blocks to be accessed in sequence according to the current data access order, and storing the extracted data blocks to be accessed in sequence 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.

[0136] In an exemplary embodiment of the present disclosure, the network model training device further includes:

[0137] A task execution duration calculation module, which can be used to determine a first task execution duration for executing a data loading task corresponding to the data block to be accessed, and a second task execution duration for executing a data calculation task corresponding to the neural network model to be trained;

[0138] A task execution time period determination module, which can be used to determine a first task execution time period for executing a data loading task corresponding to the data block to be accessed, and a second task execution time period for executing a data calculation task corresponding to the neural network model to be trained, according to the first task execution time period and the second task execution time period;

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

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

[0141] In an exemplary embodiment of the present disclosure, determining a first task execution duration for executing a data loading task corresponding to the data block to be accessed, and a second task execution duration for executing a data calculation task corresponding to the neural network model to be trained, includes: determining a first operation duration required for calculating the current data access order and the current data cache level, and determining a second operation duration required for caching the data block to be accessed; determining a first task execution duration for executing the data loading task corresponding to the data block to be accessed based on the first operation duration and the second operation duration; determining a historical model training duration of a trained neural network model during the training process, and determining a second task execution duration for executing the data calculation task corresponding to the neural network model to be trained based on the historical model training duration.

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

[0143] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0144] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.

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

[0146] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as "circuits", "modules" or "systems".

[0147] Refer to the following Figure 8 The electronic device 800 according to this embodiment of the present disclosure is described. Figure 8 The electronic device 800 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

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

[0149] The storage unit stores program codes, which can be executed by the processing unit 810, so that the processing unit 810 performs the steps according to various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification. For example, the processing unit 810 can perform the following steps: Figure 1Step S110 shown in: obtaining historical data blocks accessed by the trained neural network model during the training process and historical data block access logs generated by accessing the historical data blocks; step S120: determining the data blocks to be accessed required 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: determining 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 determining the current data cache level of the data blocks to be accessed based on the data access mode; step S140: caching the data blocks to be accessed based on the current data access order and the current data cache level, and training the neural network model to be trained based on the cached data blocks to be accessed.

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

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

[0152] Bus 830 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0153] The electronic device 800 may also communicate with one or more external devices 900 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 800, and / or communicate with any device that enables the electronic device 800 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 850. Furthermore, the electronic device 800 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 860. As shown, the network adapter 860 communicates with other modules of the electronic device 800 via a bus 830. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the 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, etc.

[0154] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0155] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible implementations, various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary implementations of the present disclosure described in the above "Exemplary Method" section of the present specification.

[0156] According to the program product for implementing the above method in the embodiment of the present disclosure, it can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be 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, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.

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

[0158] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0159] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

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

[0161] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0162] Other embodiments of the present disclosure will be readily apparent to those skilled in the art after considering the specification and practicing the inventions invented herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not invented by the present disclosure. The specification and examples are to be considered merely exemplary, and the true scope and spirit of the present disclosure are indicated by the claims.

Claims

1. A network model training method, characterized in that: include: Obtaining historical data blocks accessed by the trained neural network model during the training process and historical data block access logs generated by accessing the historical data blocks; Determine, based on the historical data blocks, data blocks to be accessed during the training process of the neural network model to be trained corresponding to the trained neural network model; Determine the current data access mode and current data access order of the data block to be accessed according to the historical data block access log, and determine the current data cache level of the data block to be accessed according to the data access mode; The data blocks to be accessed are cached according to the current data access sequence and the current data cache level, and the neural network model to be trained is trained based on the cached data blocks to be accessed.

2. The network model training method according to claim 1, characterized in that: Determining, based on the historical data blocks, 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: Training the data block prediction model to be trained according to the historical data block and the trained neural network model to obtain a 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; A data block whose prediction probability is greater than a preset probability threshold is extracted from the data block prediction results as the data block to be accessed.

3. The network model training method according to claim 1, characterized in that: Determining the current data access mode and the current data access order of the data block to be accessed according to the historical data block access log includes: Determining the current access probability and current data dependency of the data block to be accessed according to the historical data block access log; The current data access mode of the data block to be accessed is determined according to the current data access probability, and the current data access sequence of the data block to be accessed is determined according to the current data dependency.

4. The network model training method according to claim 3, characterized in that: The historical data blocks include a first historical data block, a second historical data block, ..., and 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, ..., and an Nth data block to be accessed; wherein, according to the historical data block access log, determining the current access probability of the data block to be accessed includes: Determine, according to the historical data block access log, a first historical sub-access number of the first historical data block accessed by the trained neural network model during the training process and a total historical access number of all historical data blocks accessed; Determine a first historical access probability of the first historical data block according to the first historical sub-access number and the historical total access number, and determine a first current access probability of a first to-be-accessed data block corresponding to the first historical data block according to the first historical access probability; Repeat the step of determining the first current access probability to obtain other current access probabilities of other data blocks to be accessed except the first data block to be accessed.

5. The network model training method according to claim 3, characterized in that: Determining the current data dependency of the data block to be accessed according to the historical data block access log includes: Determining, according to the historical data block access log, a historical access sequence of the trained neural network model to the historical data blocks during the training process; Constructing a historical data block access relationship graph according to the historical data blocks and the historical access sequence of the historical data blocks; The historical data dependency relationship between the historical data blocks is determined based on the historical data block access relationship graph, and the current data dependency relationship between the data blocks to be accessed is determined according to the historical data dependency relationship between the historical data blocks.

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

7. The network model training method according to claim 3, characterized in that: Determining the current data access order of the to-be-accessed data blocks according to the current data dependency relationship includes: Determine, according to the current data dependency, 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 in sequence to obtain other data extraction priorities of other data blocks to be accessed except the first data block to be accessed; The data blocks to be accessed are sorted based on the data extraction priorities of the data blocks to be accessed, and the current data access order of the data blocks to be accessed is determined according to the sorting result.

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

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

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

11. The network model training method according to claim 10, characterized in that: Determining a first task execution time of executing a data loading task corresponding to the to-be-accessed data block, and a second task execution time of executing a data computing task corresponding to the to-be-trained neural network model, comprising: Determine a first computing time required to calculate the current data access sequence and the current data cache level, and determine a second computing time required to cache the to-be-accessed data block; Determine, according to the first operation duration and the second operation duration, a first task execution duration for executing a data loading task corresponding to the to-be-accessed data block; Determine the historical model training duration of the trained neural network model during the training process, and determine the second task execution duration of the data calculation task corresponding to the neural network model to be trained based on the historical model training duration.

12. A network model training device, characterized in that: include: A data block access log acquisition module is used to acquire historical data blocks accessed by the trained neural network model during the training process and historical data block access logs generated by accessing the historical data blocks; A module for determining a data block to be accessed, used to determine, based on the historical data blocks, a data block to be accessed required by the neural network model to be trained corresponding to the trained neural network model during the training process; A data cache level determination module, used to determine the current data access mode and current data access order of the data block to be accessed according to the historical data block access log, and determine the current data cache level of the data block to be accessed according to the data access mode; The network model training module is used to cache the data blocks to be accessed according to the current data access order and the current data cache level, and to train the neural network model to be trained based on the cached data blocks 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, the training method of the network model described in any one of claims 1-11 is implemented.

14. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; Wherein, the processor is configured to execute the training method of the network model described in 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

  • Machine learning to improve caching efficiency in a storage system

    US20220350484A1