A model training acceleration method, device and storage medium
By using the feature reconstruction module and the long-short-term memory network module in the storage-level prediction model, the storage-level prediction accuracy of training samples is improved, the problem of data IO delay in the storage and calculation separation mode is solved, and the accelerated training of the target model is achieved. .
Patent Information
- Application Number
- CN202410937902.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-12
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2044-07-12
AI Technical Summary
In the storage and calculation separation mode, how to improve the storage level accuracy of prediction training samples to improve the upper-level cache hit rate, thereby accelerating target model training.
The storage level prediction model uses the feature reconstruction module and the long short-term memory network module to determine the feature parameters by obtaining the accessed information and storage level of the training sample as labels, and trains the model through feature reconstruction and prediction results to improve storage Accuracy of hierarchical predictions.
It improves the accuracy of storage-level prediction and enhances the upper-level cache hit rate, thereby accelerating the training process of the target model.
Smart Images

Figure CN118468045B
Abstract
Description
Technical Field
[0001] This specification relates to the field of computers, and in particular to a model training acceleration method, device, and storage medium. Background Art
[0002] As the scale of deep learning training continues to expand, the size of the data set used for training has also been growing rapidly. In order to support larger training data sets, the storage-computing separation mode is usually used to train the model. In addition, in order to solve the data IO latency problem in the storage-computing separation mode, local storage space can also be deployed on the computing nodes, and the local storage space of the computing nodes can be used to cache some hot data. The storage level of the local storage of the computing nodes can also be called the upper storage, then the storage level of the storage node can be called the lower storage. In other words, the level used to store training samples includes upper storage and lower storage. Among them, hot data refers to training samples that are used more frequently.
[0003] Generally speaking, during the training of the target model, the importance of each training sample can be determined by the importance sampling method, and selecting training samples with higher importance can accelerate the training efficiency of the target model. Then, when training the target model using training samples whose importance is determined by the importance sampling method, how to improve the accuracy of the storage level of the predicted training samples to improve the upper cache hit rate and thus accelerate the training of the target model is an urgent problem to be solved.
[0004] Based on this, this specification provides a model training acceleration method. Summary of the invention
[0005] This specification provides a model training acceleration method, device, storage medium and electronic device to partially solve the above-mentioned problems existing in the prior art.
[0006] This manual adopts the following technical solutions:
[0007] This specification provides a model training acceleration method, wherein the storage level prediction model includes a feature reconstruction module and a long short-term memory network module, and the method includes:
[0008] Acquire access information of the training sample and the storage level of the training sample, and use the storage level of the training sample as a label, wherein the access information includes the importance of the training sample;
[0009] Determining characteristic parameters of the training sample based on the accessed information;
[0010] Inputting the feature parameters into a feature reconstruction module of the storage level prediction model to obtain a reconstructed feature output by the feature reconstruction module;
[0011] Inputting the reconstructed features into the long short-term memory network module of the storage level prediction model to obtain the prediction result output by the long short-term memory network module;
[0012] The storage level prediction model is trained according to the prediction result and the label, so as to determine the predicted storage level of the training sample to be predicted through the trained storage level prediction model.
[0013] Optionally, the accessed information further includes the identification, size, historical access time, historical access times, and relative importance of the training sample;
[0014] Determining characteristic parameters of the training sample based on the accessed information specifically includes:
[0015] Determining a feature vector of the training sample according to the accessed information;
[0016] According to a preset standardization processing method, the feature vector is standardized to obtain the feature parameters of the training sample.
[0017] Optionally, the feature reconstruction module includes a variational autoencoder;
[0018] Inputting the feature parameters into the feature reconstruction module of the storage level prediction model to obtain the reconstructed features output by the feature reconstruction module specifically includes:
[0019] Inputting the characteristic parameters into an encoding module in the variational autoencoder to obtain an encoding result output by the encoding module;
[0020] Sampling the encoding result to obtain a sampled encoding result;
[0021] The sampled encoding result is input into the decoding module of the variational autoencoder to obtain the reconstructed features output by the decoding module.
[0022] Optionally, the long short-term memory network module includes an attention layer.
[0023] Optionally, training the storage level prediction model according to the prediction result and the label specifically includes:
[0024] Determine a first loss according to the prediction result and the label;
[0025] The storage level prediction model is trained according to the first loss.
[0026] Optionally, the method further comprises:
[0027] Determining a second loss according to the reconstructed feature and the feature parameter;
[0028] Training the storage level prediction model according to the first loss specifically includes:
[0029] The storage level prediction model is trained according to the first loss and the second loss.
[0030] Optionally, the method further comprises:
[0031] When the preset time arrives, the access information of the pre-stored training sample to be predicted is obtained as the target prediction information;
[0032] Based on the target prediction information, determining target feature parameters of the training sample to be predicted;
[0033] The target feature parameter is input into the trained storage level prediction model to obtain the predicted storage level of the training sample to be predicted output by the trained storage level prediction model.
[0034] Optionally, the method further comprises:
[0035] Obtaining the current storage level of the training sample to be predicted at the current moment;
[0036] Determining whether the current storage level matches the predicted storage level;
[0037] If not, the to-be-predicted training samples are migrated according to the prediction storage level.
[0038] This specification provides a model training acceleration device, the device comprising:
[0039] An accessed information acquisition module, used to acquire accessed information of a training sample and a storage level of the training sample, and use the storage level of the training sample as a label, wherein the accessed information includes the importance of the training sample;
[0040] A feature parameter determination module, used to determine the feature parameters of the training sample based on the accessed information;
[0041] A feature parameter reconstruction module, used for inputting the feature parameters into the feature reconstruction module of the storage level prediction model to obtain the reconstructed features output by the feature reconstruction module;
[0042] A prediction result determination module, used for inputting the reconstructed features into the long short-term memory network module of the storage level prediction model to obtain the prediction result output by the long short-term memory network module;
[0043] The training module is used to train the storage level prediction model according to the prediction result and the label, so as to determine the predicted storage level of the training sample to be predicted through the trained storage level prediction model.
[0044] Optionally, the accessed information further includes the identification, size, historical access time, historical access times, and relative importance of the training sample;
[0045] The characteristic parameter determination module is specifically used to determine the characteristic vector of the training sample according to the accessed information; and perform standardization processing on the characteristic vector according to a preset standardization processing method to obtain the characteristic parameter of the training sample.
[0046] Optionally, the feature reconstruction module includes a variational autoencoder;
[0047] The feature parameter reconstruction module is specifically used to input the feature parameters into the encoding module in the variational autoencoder to obtain the encoding result output by the encoding module; sample the encoding result to obtain the sampled encoding result; input the sampled encoding result into the decoding module of the variational autoencoder to obtain the reconstructed features output by the decoding module.
[0048] Optionally, the long short-term memory network module includes an attention layer.
[0049] Optionally, the training module is specifically used to determine a first loss based on the prediction result and the label; and train the storage level prediction model based on the first loss.
[0050] Optionally, the training module is specifically used to determine the second loss based on the reconstruction feature and the feature parameter; and train the storage level prediction model based on the first loss, specifically including: training the storage level prediction model based on the first loss and the second loss.
[0051] Optionally, the device further comprises:
[0052] The prediction module is used to obtain the pre-stored access information of the training sample to be predicted as the target prediction information when the preset moment arrives; determine the target feature parameters of the training sample to be predicted based on the target prediction information; input the target feature parameters into the trained storage level prediction model to obtain the predicted storage level of the training sample to be predicted output by the trained storage level prediction model.
[0053] Optionally, the device further comprises:
[0054] A migration module is used to obtain the current storage level of the training sample to be predicted at the current moment; determine whether the current storage level matches the predicted storage level; if not, migrate the training sample to be predicted according to the predicted storage level.
[0055] This specification provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned model training acceleration method is implemented.
[0056] This specification provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned model training acceleration method when executing the program.
[0057] At least one of the above technical solutions adopted in this specification can achieve the following beneficial effects:
[0058] The access information of the training sample and the storage level of the training sample are obtained from the model training acceleration method provided in this specification, and the storage level of the training sample is used as a label, wherein the access information includes the importance of the training sample. Based on the access information, the characteristic parameters of the training sample are determined, and the characteristic parameters are input into the feature reconstruction module of the storage level prediction model to obtain the reconstructed features output by the feature reconstruction module. The reconstructed features are input into the long short-term memory network module of the storage level prediction model to obtain the prediction results output by the long short-term memory network module. According to the prediction results and the label, the storage level prediction model is trained to determine the predicted storage level of the training sample to be predicted through the trained storage level prediction model.
[0059] It can be seen from the above method that this method is used for training samples of the target model trained using the importance sampling method in the storage-computation separation mode. By setting a feature reconstruction module and a long short-term memory network module in the storage-level prediction model, the feature reconstruction module is used to reconstruct the feature parameters of the accessed information of the training samples, so that the storage-level prediction model can fully learn the features of the accessed information. Afterwards, the long short-term memory network is used to overcome the problems of gradient vanishing and gradient explosion. Then, the reconstructed features are input into the long short-term memory network module to obtain the prediction results. According to the prediction results and labels, the storage-level prediction model is trained, which improves the accuracy of the storage level of the training samples required for the storage-level prediction model to predict the target model, thereby improving the upper cache hit rate and accelerating the target model training. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] The drawings described herein are used to provide a further understanding of this specification and constitute a part of this specification. The illustrative embodiments and descriptions of this specification are used to explain this specification and do not constitute an improper limitation on this specification. In the drawings:
[0061] Figure 1 A flowchart of a model training acceleration method provided in this specification;
[0062] Figure 2 A schematic diagram of the internal structure of the storage level prediction model provided in this specification;
[0063] Figure 3 A schematic diagram of the internal structure of the reconstruction feature module provided in this specification;
[0064] Figure 4 A schematic diagram of the internal structure of the long short-term memory network module provided in this manual;
[0065] Figure 5 A schematic diagram of the storage and computing separation mode structure provided in this manual;
[0066] Figure 6 A schematic diagram of the internal structure of a node K provided in this specification;
[0067] Figure 7 A schematic diagram of a model training acceleration device provided in this specification;
[0068] Figure 8 A method corresponding to the Figure 1 Schematic diagram of the structure of an electronic device. DETAILED DESCRIPTION
[0069] In order to make the purpose, technical solutions and advantages of this specification more clear, the technical solutions of this specification will be clearly and completely described below in combination with the specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of them. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this specification.
[0070] The technical solutions provided by the embodiments of this specification are described in detail below in conjunction with the accompanying drawings.
[0071] Figure 1 The following is a flow chart of a model training acceleration method provided in this specification, which includes the following steps:
[0072] S100: Acquire access information of training samples and storage levels of the training samples, and use the storage levels of the training samples as labels, wherein the access information includes the importance of the training samples.
[0073] When training the target model, a large number of training samples are required, especially when the model function requirements are increasing, the magnitude of the training samples is gradually increasing. Therefore, the storage space is increased through the storage and computation separation mode to meet the training requirements of the target model. Among them, the target model can be an image classification model, such as ResNet18, MobileNet, ResNet50, VGG11, DenseNet121, etc., which is used to classify the target objects in the image. Then, the training samples are images of several categories.
[0074] In the storage-computation separation mode, the data transmission speed is low, resulting in a decrease in the training efficiency of the image classification model. Then, the local storage space of the computing node can be used to store hot data to reduce the number of times the training sample image is transmitted from the storage node to the computing node, thereby improving the training efficiency of the image classification model. This specification provides a model training acceleration method that can improve the accuracy of predicting the storage level where the training sample image should be located, so as to improve the upper cache hit rate and accelerate the training of the image classification model. The execution subject of this specification can be any node in the storage-computation separation mode that can train the model. The node can be a server. The node can be a node independent of the computing node and the storage node in the storage-computation separation mode, or it can be a node that does not belong to the storage-computation classification mode. The execution subject of this specification can also be a device such as a mobile phone, a personal computer (Personal Computer, PC) that can execute the solution of this specification, and can also be other computing devices with computing capabilities. This specification does not limit this. For the sake of convenience, this specification is described with the server as the execution subject.
[0075] In one or more embodiments of the present specification, there are several computing nodes and several storage nodes in the storage-computation separation mode, the storage level of the local storage space in the computing node is the upper storage, and the storage level of the storage space in the storage node is the lower storage. Normally, the sum of the local storage space of all computing nodes is much smaller than the sum of the storage space in all storage nodes. In order to determine the storage level where the training samples should be located, so that the upper storage space contains all hot data, thereby reducing the number of times training samples are obtained from the lower storage, and thereby improving the training efficiency of the target model, the storage level prediction model can be trained by the model training acceleration method provided in this specification to improve the accuracy of the storage level prediction model. That is, the cache hit rate of the upper storage is improved to increase the training speed of the target model.
[0076] Specifically, the server obtains the access information of the training sample and the storage level of the training sample, and uses the storage level of the training sample as a label, wherein the storage level of the training sample can be determined by a preset rule. For example, if the number of accesses to the training sample exceeds three times within a specified time step, it is considered to be highly popular, and the storage level of the training sample is determined as the upper storage. This specification does not limit the method of determining the label. The access information includes the importance of the training sample, which can be determined by an importance sampling method. The importance sampling method can evaluate the impact of each training sample on the accuracy of the model and assign importance to each training sample. Determining the importance of training samples by an importance sampling method is a technique well known to those skilled in the art, and therefore, this specification will not go into detail.
[0077] Since there are several computing nodes in the storage and computing separation mode in this specification, each computing node can perform different training tasks, which can be tasks for training different stages of the same model or tasks for training different models. Therefore, for each training sample, if the training sample can be used for training tasks of different computing nodes, the training sample has more than one importance.
[0078] For example, there are three computing nodes, namely computing node A, computing node B and computing node C. Computing nodes A, B and C can all use training sample 1 when performing their own training tasks. Then, for training sample 1, there are three importances, namely importance A, importance B and importance C. Among them, importance A refers to the importance of training sample 1 to computing node A, importance B refers to the importance of training sample 1 to computing node B, and importance C refers to the importance of training sample 1 to computing node C.
[0079] In addition, the training samples mentioned in this specification refer to training samples that can be used to train image classification models, and the storage level prediction model can also be trained through the access information of the training samples.
[0080] S102: Determine characteristic parameters of the training sample based on the accessed information.
[0081] Specifically, the accessed information also includes the identification, size, historical access time, historical access times, and relative importance of the training sample. The relative importance can be determined by the importance of the training sample to each computing node. Continuing with the above example, for training sample 1, the relative importance can be the weighted average result of importance A, importance B, and importance C. This specification does not limit the specific method of determining the relative importance, and the relative importance can be related to the importance. Of course, the accessed information can also include other information of the training sample, which is not limited by this specification.
[0082] When determining the characteristic parameters of the training sample, the server may first determine the characteristic vector of the training sample based on the accessed information. Then, in order to avoid errors in data magnitude caused by different dimensions, the characteristic vector may be standardized according to a preset standardization processing method to obtain the characteristic parameters of the training sample. The preset standardization processing method may include a min-max normalization method.
[0083] For example, if the training sample has ID x1, size x2, historical access time x3, historical access times x4, importance x5, and relative importance x6, then the feature vector of the training sample is the sequence , for the sequence Standardization is performed as follows:
[0084]
[0085] The characteristic parameters of the training samples are And dimensionless.
[0086] S104: Inputting the feature parameters into the feature reconstruction module of the storage level prediction model to obtain the reconstructed features output by the feature reconstruction module.
[0087] Figure 2 The internal structure diagram of the storage level prediction model provided in this specification is as follows: Figure 2 shown.
[0088] The storage level prediction model includes a feature reconstruction module and a long short-term memory network module. After obtaining the feature parameters, the server can input the feature parameters into the feature reconstruction module of the storage level prediction model to obtain the reconstructed features output by the feature reconstruction module.
[0089] Specifically, the feature reconstruction module includes a variational autoencoder, Figure 3 The internal structure diagram of the reconstruction feature module provided in this specification is as follows: Figure 3 As shown in Figure 2, the variational autoencoder includes an encoding module, a sampling module and a decoding module.
[0090] The server inputs the feature parameter into the encoding module in the variational autoencoder to obtain the encoding result output by the encoding module, and the encoding result includes the normal distribution of the feature parameter. Afterwards, the encoding result is sampled to obtain the sampled encoding result, and the encoding result can be sampled by the sampling module in the variational autoencoder. Finally, the sampled encoding result is input into the decoding module of the variational autoencoder to obtain the reconstructed feature output by the decoding module.
[0091] For example, the characteristic parameter is x k , then the encoding result of the characteristic parameter is a normal distribution p(z|xk )’s mean and variance:
[0092]
[0093]
[0094] in, is the mean vector, is the variance vector, here we choose to fit Rather than directly fitting , because Need to add activation function processing, and fitting No activation function is needed;
[0095] Afterwards, for x k The normal distribution p(z|x k ) to obtain z k , that is, the encoding result after sampling, and finally decoded by the decoding module to obtain the reconstructed features :
[0096]
[0097] Reconstructing the features enables the storage-level prediction model to not only learn efficient and interpretable data representations, but also ensures that the storage-level prediction model has strong data generation capabilities.
[0098] S106: Input the reconstructed features into the long short-term memory network module of the storage level prediction model to obtain the prediction result output by the long short-term memory network module.
[0099] Figure 4 The internal structure diagram of the long short-term memory network module provided in this manual is as follows: Figure 4 As shown in the figure, the long short-term memory network module includes an attention layer, a fully connected layer and several long short-term memory layers.
[0100] The key part of the long short-term memory layer is the time memory unit that records the current state, also known as the cell of the long short-term memory neural network. Connected to each cell are three information transmission switch gates: forget gate, input gate and output gate.
[0101] The forget gate determines the information discarded from the cell when the feature data at a certain moment passes through, and outputs a value between 0 and 1 for each cell state. h represents the output of the long short-term memory neural network cell, and x represents the input of the long short-term memory neural network cell.
[0102]
[0103] The input gate determines how much new information is stored in the LSTM neural network cells. The input gate contains two processing layers. The sigmoid layer determines what values need to be updated, and the tanh layer creates a new candidate value vector. ;
[0104]
[0105]
[0106] The cell state of the long short-term memory neural network is updated to the original cell state after discarding some information, and then adding a new candidate value vector of and;
[0107]
[0108] The output gate determines which part of the cell state is output based on the updated LSTM neural network cell state through a sigmoid layer. The cell state passes through the tanh layer and is multiplied by the sigmoid output.
[0109]
[0110]
[0111] The server inputs the reconstructed features into the long short-term memory network module, which passes through several long short-term memory layers, attention layers and fully connected layers to obtain the prediction result output by the long short-term memory network module. The prediction result is the probability that the training sample belongs to each storage level.
[0112] It should be noted that the long short-term memory network module is selected because it continues the advantages of the recurrent neural network in processing time-related problems, and can solve the problems of gradient disappearance and gradient explosion. Then, other neural networks that can solve gradient disappearance and gradient explosion can also be used, such as the gated recurrent unit (Gated Recurrent Unit, GRU), residual network (ResNet), layer normalization (Layer Normalization) and batch normalization (BatchNormalization), etc., which are not limited in this manual.
[0113] S108: Training the storage level prediction model according to the prediction result and the label, so as to determine the predicted storage level of the training sample to be predicted through the trained storage level prediction model.
[0114] Specifically, the server determines a first loss according to the prediction result and the label. According to the reconstruction feature and the feature parameter, a second loss is determined, and the second loss can also be called a reconstruction loss. The server trains the storage level prediction model according to the first loss and the second loss.
[0115] The cross entropy loss function can be used as the first loss, as shown in the following formula:
[0116]
[0117] According to the first loss and the second loss, a random seed is given to randomize the weights and biases in the storage level prediction model, the number of hidden layers and hidden nodes of the network is set, the initial learning rate and the number of training steps are set, the training uses the gradient back propagation algorithm, and the Adam random optimization algorithm is used to update the parameters in the storage level prediction model. Among them, For labels, For the prediction results, a is a preset value and can be set as needed.
[0118] Furthermore, a third loss may be determined according to the encoding result and the preset result, and the preset result may be a standard normal distribution, and the third loss may be a KL divergence. Finally, the storage level prediction model is trained according to the first loss, the second loss and the third loss.
[0119] The reconstruction loss measures the difference between the reconstructed features after the encoding-decoding process and the original input features. It is defined by comparing the likelihood of the input features and the corresponding reconstructed features. Common methods are mean square error (MSE) or binary cross entropy. The reconstruction loss can prompt the storage-level prediction model to learn how to effectively encode data into the latent space and accurately restore the original features through the decoding process, which helps the storage-level prediction model capture important features in the data, achieve effective representation of the data, and fully learn the features of the accessed information.
[0120] The third loss measures the difference between the latent variable distribution learned by the storage-level prediction model and the prior distribution, which is usually a simple distribution such as the standard normal distribution. The smaller the KL divergence, the closer the learned latent variable distribution is to the pre-set simple prior distribution. The third loss can prevent the storage-level prediction model from overfitting the training data and increase the generalization ability of the storage-level prediction model. At the same time, the KL divergence also helps prevent "model collapse", that is, all input data is mapped to the same area of the latent space, losing the ability to generate diversity.
[0121] based on Figure 1The model training acceleration method shown is used for training samples of the target model trained using the importance sampling method in the storage-computation separation mode. By setting a feature reconstruction module and a long short-term memory network module in the storage-level prediction model, the feature reconstruction module is used to reconstruct the feature parameters of the accessed information of the training samples, so that the storage-level prediction model can fully learn the features of the accessed information. Afterwards, the long short-term memory network is used to overcome the problems of gradient vanishing and gradient exploding. Then, the reconstructed features are input into the long short-term memory network module to obtain the prediction results. According to the prediction results and labels, the storage-level prediction model is trained, which improves the accuracy of the storage level of the training samples required for the storage-level prediction model to predict the target model, thereby improving the upper cache hit rate and accelerating the target model training.
[0122] Of course, the server can also obtain access information of several training samples at different sampling times, and execute steps S100 to S108 for the access information of each training sample to train the storage level prediction model. Then, the feature parameters of the feature reconstruction module input to the storage level prediction model can be in the form of a feature matrix.
[0123] For example, after acquiring the accessed information at t sampling moments, a t×6-dimensional feature matrix is obtained, as shown in the following formula:
[0124]
[0125] After the storage level prediction model is trained, the storage level prediction can be performed on the training samples to be predicted.
[0126] Figure 5 A schematic diagram of the storage and computing separation mode structure provided in this manual is as follows: Figure 5 As shown, there are several computing nodes and several storage nodes in the storage-computation separation mode, and each computing node includes a GPU, a training task, and an upper-level memory RAM, which is the local storage space of the computing node. The trained storage-level prediction model can be deployed in any node K that is independent of the computing node and the storage node. The training process of the storage-level prediction model can also be completed in the node K or in other nodes, and this specification does not limit this. This specification adds an additional data monitoring module to each computing node, which is used to obtain the access information of each training sample in the computing node in real time, and store the information in a parameter database. The parameter database can be deployed in the same node as the storage-level prediction model, or in other nodes independent of the computing node and the storage node. In other words, the parameter database can be deployed in the same node as the storage-level prediction model, or in a different node. The node mentioned in this specification may be a server. The thin double-headed arrow represents the control flow, and the thick double-headed arrow represents the data flow.
[0127] Assuming that the server that trains the storage-level prediction model is node K, then after the storage-level prediction model is trained, when the preset time arrives, the server obtains the access information of the pre-stored training samples to be predicted as the target prediction information. The pre-stored access information of the training samples to be predicted is usually obtained by the data monitoring module deployed in each computing node and sent to the parameter database. In other words, the server obtains the access information of the pre-stored training samples to be predicted from the parameter database.
[0128] As the training phase changes, the accessed information of the training samples will also change, and accordingly, the storage level of the training samples may also change. Therefore, the server can use the trained storage level prediction model to predict the storage level of the training samples according to the cycle, and then migrate the training samples to improve the upper cache hit rate to accelerate the training speed of the image classification model. Then, the training samples to be predicted can be all the training samples required for training the image classification model, and some samples can also be set as training samples to be predicted as needed. This manual does not limit this.
[0129] After the server obtains the target prediction information, it determines the target feature parameters of the training sample to be predicted based on the target prediction information. That is, based on the target prediction information, it determines the feature vector of the training sample to be predicted, and performs standardization processing on the feature vector of the training sample to be predicted according to a preset standardization processing method to obtain the target feature parameters of the training sample to be predicted. Afterwards, the target feature parameters are input into the trained storage level prediction model to obtain the predicted storage level of the training sample to be predicted output by the trained storage level prediction model.
[0130] Finally, the current storage level of the training sample to be predicted at the current moment is obtained, and it is determined whether the current storage level matches the predicted storage level, that is, whether the current storage level is consistent with the predicted storage level. If not, the training sample to be predicted is migrated according to the predicted storage level. The current moment refers to any moment between the preset moment of the current cycle and the preset moment of the previous cycle of the current cycle. If the storage level of the training sample is not predicted between the preset moment of the current cycle and the preset moment of the previous cycle of the current cycle, then the storage level of the training sample will not change.
[0131] For example, if the current cycle is t1, then the previous cycle of t1 is t0, and the time interval between t0 and t1 is 20s. If t0 is 18:20:00, then t1 is 18:20:20. At 18:20:20, the trained storage level prediction model is used to predict the storage level of the training sample to be predicted, and the storage level of the training sample to be predicted at any time between 18:20:00 and 18:20:20 is obtained as the current storage level. Determine whether the current storage level matches the predicted storage level predicted by the storage level prediction model. If so, it means that there is no need to migrate the training sample. If not, migrate the training sample to be predicted.
[0132] It should be noted that the training sample only exists in one storage level, that is, the storage level of the training sample is only one of the upper storage and lower storage, and one training sample will only be stored in one node. In other words, when the storage level of the training sample is the upper storage, although there are multiple computing nodes, the server will only store the training sample in one of the computing nodes. Similarly, when the storage level of the training sample is the lower storage, although there are multiple storage nodes, the server will only store the training sample in one of the storage nodes.
[0133] Figure 6 A schematic diagram of the internal structure of a node K provided in this specification is shown as follows: Figure 6 shown.
[0134] A hierarchical management system can also be deployed in node K, and the hierarchical management system includes a preprocessing module, a prediction module, a hierarchical control module and a migration module. When the preset time arrives, the hierarchical management system obtains the access information of the pre-stored training sample to be predicted as the target prediction information. The target prediction information is sent to the preprocessing module. The preprocessing module is used to perform standardization processing on the acquired target prediction information, obtain the target feature parameters of the training sample to be predicted, and send it to the prediction module, which includes a trained storage level prediction model. The prediction module is used to determine the predicted storage level of the training sample to be predicted based on the target feature parameters, and send the predicted storage level to the hierarchical control module. The hierarchical control module is used to obtain the current storage level of the training sample to be predicted at the current moment, determine whether the current storage level matches the predicted storage level, and if not, send the training sample migration instruction to the migration module. The migration module is used to receive the training sample migration instruction sent by the hierarchical control module, and perform storage level migration on the training sample to be predicted.
[0135] It should be noted that Figure 6This specification is only a system structure for predicting the storage level of training samples, and this specification does not limit the specific structure. In other words, the hierarchical management system may not exist, and only the method for predicting the storage level of training samples in this specification may be used, and only some modules exemplified in this specification may be included to implement the training sample storage level prediction method provided in this specification, and this specification does not limit this.
[0136] The above is one or more implementation methods of this specification, based on Figure 1 The flowchart of the model training acceleration method shown in FIG. 1 is a flowchart of the model training acceleration method shown in FIG. 1 , and this specification also provides a corresponding model training acceleration device, such as Figure 7 shown.
[0137] Figure 7 A schematic diagram of a model training acceleration device provided in this specification includes:
[0138] The accessed information acquisition module 700 is used to acquire the accessed information of the training sample and the storage level of the training sample, and use the storage level of the training sample as a label, wherein the accessed information includes the importance of the training sample;
[0139] A feature parameter determination module 702, configured to determine the feature parameters of the training sample based on the accessed information;
[0140] A feature parameter reconstruction module 704, used to input the feature parameters into the feature reconstruction module of the storage level prediction model to obtain the reconstructed features output by the feature reconstruction module;
[0141] A prediction result determination module 706 is used to input the reconstructed features into the long short-term memory network module of the storage level prediction model to obtain the prediction result output by the long short-term memory network module;
[0142] The training module 708 is used to train the storage level prediction model according to the prediction result and the label to obtain a trained storage level prediction model.
[0143] Optionally, the accessed information further includes the identification, size, historical access time, historical access times, and relative importance of the training sample;
[0144] The characteristic parameter determination module 702 is specifically used to determine the characteristic vector of the training sample according to the accessed information; and perform standardization processing on the characteristic vector according to a preset standardization processing method to obtain the characteristic parameter of the training sample.
[0145] Optionally, the feature reconstruction module includes a variational autoencoder;
[0146] The feature parameter reconstruction module 704 is specifically used to input the feature parameters into the encoding module in the variational autoencoder to obtain the encoding result output by the encoding module; sample the encoding result to obtain the sampled encoding result; input the sampled encoding result into the decoding module of the variational autoencoder to obtain the reconstructed features output by the decoding module.
[0147] Optionally, the long short-term memory network module includes an attention layer.
[0148] Optionally, the training module 708 is specifically used to determine a first loss according to the prediction result and the label; and train the storage level prediction model according to the first loss.
[0149] Optionally, the training module 708 is specifically used to determine the second loss based on the reconstruction feature and the feature parameter; and train the storage level prediction model based on the first loss, specifically including: training the storage level prediction model based on the first loss and the second loss.
[0150] Optionally, the device further comprises:
[0151] The prediction module 710 is used to obtain the pre-stored access information of the training sample to be predicted as the target prediction information when the preset moment arrives; determine the target feature parameters of the training sample to be predicted based on the target prediction information; input the target feature parameters into the trained storage level prediction model to obtain the predicted storage level of the training sample to be predicted output by the trained storage level prediction model.
[0152] Optionally, the device further comprises:
[0153] The migration module 712 is used to obtain the current storage level of the training sample to be predicted at the current moment; determine whether the current storage level matches the predicted storage level; if not, migrate the training sample to be predicted according to the predicted storage level.
[0154] This specification also provides a computer-readable storage medium, which stores a computer program, which can be used to execute the above Figure 1 A model training acceleration method provided.
[0155] This manual also provides Figure 8 The one shown corresponds to Figure 1 Schematic diagram of the structure of the electronic equipment. Figure 8As shown, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and may also include other hardware required for the business. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to achieve the above Figure 1 The model training acceleration method described.
[0156] Of course, in addition to software implementation, this specification does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the executor of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0157] In the 1990s, it was very clear whether the improvement of a technology was hardware improvement (for example, improvement of the circuit structure of diodes, transistors, switches, etc.) or software improvement (improvement of the method flow). However, with the development of technology, many improvements of the method flow today can be regarded as direct improvements of the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be implemented with hardware entity modules. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask chip manufacturers to design and make dedicated integrated circuit chips. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one kind of HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0158] The controller may be implemented in any suitable manner, for example, the controller may take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (e.g., software or firmware) executable by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, and the memory controller may also be implemented as part of the control logic of the memory. It is also known to those skilled in the art that, in addition to implementing the controller in a purely computer-readable program code manner, the controller may be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, such a controller may be considered as a hardware component, and the devices for implementing various functions included therein may also be considered as structures within the hardware component. Or even, the devices for implementing various functions may be considered as both software modules for implementing the method and structures within the hardware component.
[0159] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0160] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0161] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0162] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0163] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0164] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0165] In a typical configuration, a computing device includes one or more processors (first chips), input / output interfaces, network interfaces, and memory.
[0166] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0167] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0168] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0169] It should be understood by those skilled in the art that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0170] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0171] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0172] The above description is only an embodiment of the present specification and is not intended to limit the present specification. For those skilled in the art, the present specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification shall be included in the scope of the claims of the present specification.
Claims
1. A model training acceleration method, characterized in that: The storage level prediction model includes a feature reconstruction module and a long short-term memory network module, and the method includes: Acquire access information of the training sample and the storage level of the training sample, and use the storage level of the training sample as a label, wherein the access information includes the importance of the training sample; Determining characteristic parameters of the training sample based on the accessed information; Inputting the feature parameters into a feature reconstruction module of the storage level prediction model to obtain a reconstructed feature output by the feature reconstruction module; Inputting the reconstructed features into the long short-term memory network module of the storage level prediction model to obtain the prediction result output by the long short-term memory network module; The storage level prediction model is trained according to the prediction result and the label, so as to determine the predicted storage level of the training sample to be predicted through the trained storage level prediction model; The accessed information also includes the identification, size, historical access time, historical access times, and relative importance of the training sample; Determining characteristic parameters of the training sample based on the accessed information specifically includes: Determining a feature vector of the training sample according to the accessed information; According to a preset standardization processing method, the feature vector is standardized to obtain the feature parameters of the training sample; The feature reconstruction module includes a variational autoencoder; Inputting the feature parameters into the feature reconstruction module of the storage level prediction model to obtain the reconstructed features output by the feature reconstruction module specifically includes: Inputting the characteristic parameters into an encoding module in the variational autoencoder to obtain an encoding result output by the encoding module; Sampling the encoding result to obtain a sampled encoding result; The sampled encoding result is input into the decoding module of the variational autoencoder to obtain the reconstructed features output by the decoding module.
2. The method according to claim 1, characterized in that The long short-term memory network module includes an attention layer.
3. The method according to claim 1, characterized in that According to the prediction result and the label, the storage level prediction model is trained, specifically including: Determine a first loss according to the prediction result and the label; The storage level prediction model is trained according to the first loss.
4. The method according to claim 3, characterized in that The method further comprises: Determining a second loss according to the reconstructed feature and the feature parameter; Training the storage level prediction model according to the first loss specifically includes: The storage level prediction model is trained according to the first loss and the second loss.
5. The method according to claim 1, characterized in that The method further comprises: When the preset time arrives, the access information of the pre-stored training sample to be predicted is obtained as the target prediction information; Based on the target prediction information, determining target feature parameters of the training sample to be predicted; The target feature parameter is input into the trained storage level prediction model to obtain the predicted storage level of the training sample to be predicted output by the trained storage level prediction model.
6. The method according to claim 5, characterized in that The method further comprises: Obtaining the current storage level of the training sample to be predicted at the current moment; Determining whether the current storage level matches the predicted storage level; If not, the to-be-predicted training samples are migrated according to the prediction storage level.
7. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method described in any one of claims 1 to 6 is implemented.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method described in any one of claims 1 to 6 is implemented.
