In-memory data processing method, device, equipment and medium based on model training
By determining and releasing sub-features with a low importance in the training parameter server, the problem of large memory required for model parameters is solved, and the model slimming and effective memory reduction is achieved.
Patent Information
- Application Number
- CN202411365359.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2044-09-27
AI Technical Summary
The memory required for model parameters is large, which causes the memory of the training parameter server to become a bottleneck in training and increases the difficulty of the model being launched.
By obtaining different categories of sub-features of target features, the importance of sub-features is determined based on the difference in model loss of target models under different training states, and the memory of the feature values of sub-features with a lower degree of importance is released in the memory space of the training parameter server.
It effectively reduces the amount of data stored in the training parameter server, reduces the memory required by the target model in the training parameter server, realizes model slimming, and reduces the memory footprint of the online parameter server.
Smart Images

Figure CN119226772B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a memory data processing method, device, equipment and medium based on model training. Background Art
[0002] As the features of the promotion search model continue to be enriched, the parameter server (PS) resources required for training and deployment are also growing. Among them, the parameter server required for training is called the training parameter server (training ps), and the parameter server required for deployment is called the online parameter server (online ps).
[0003] At present, the memory required for model parameters is large, and the training PS memory has always been a bottleneck for training, affecting the use of training resources. In addition, the large size of the online PS will increase the difficulty of model online. Therefore, a data processing method for processing model parameters is urgently needed. Summary of the invention
[0004] In view of this, the present invention provides a memory data processing method, device, electronic device, storage medium and program product based on model training to solve the problem of large memory required for model parameters.
[0005] In a first aspect, the present invention provides a memory data processing method for model training, which is applicable to a training parameter server, and the method comprises:
[0006] Obtaining sub-features of different categories of target features, where the target features are features corresponding to feature extraction performed by the target model on the input data;
[0007] Determining the importance of the sub-feature based on a difference in model loss of the target model between a first training state and a second training state, wherein the first training state is a state in which the target model is trained using the sub-feature, and the second training state is a state in which the target model is not trained using the sub-feature;
[0008] Determining a first sub-feature to be disabled among the sub-features of different categories based on the importance;
[0009] Releasing memory used to store the feature value of the first sub-feature in the memory space of the training parameter server;
[0010] The model parameters of the target model are updated based on the disabling conditions of the sub-features of different categories.
[0011] In a second aspect, the present invention provides a memory data processing method for model training, which is applicable to an online parameter server, and the method comprises:
[0012] Sending a feature value reading instruction for the target sub-feature to the training parameter server;
[0013] Receive a target feature value of the target sub-feature fed back by the training parameter server, where the target feature value is fed back by the training parameter server based on a disabled condition of the target sub-feature; wherein the disabled condition is determined by the training parameter server based on an importance of the target sub-feature; and the importance is determined by the training parameter server based on a difference in model loss when a target model is trained using the target sub-feature and when the target sub-feature is not used for training;
[0014] If the feature value of the target sub-feature is stored in the memory space of the online parameter server, updating the feature value of the target sub-feature in the memory space to the target feature value;
[0015] Based on the feature values of the sub-features of different categories stored in the memory space, determining the sub-features in the different categories that are in a disabled state;
[0016] The memory corresponding to the disabled sub-feature is released in the memory space.
[0017] In a third aspect, the present invention provides a memory data processing device based on model training, which is suitable for training parameter servers, and the device includes:
[0018] A model feature acquisition module is used to acquire different categories of sub-features of a target feature, where the target feature is a feature corresponding to feature extraction performed by the target model on the input data;
[0019] an importance calculation module, used to determine the importance of the sub-feature based on the difference in model loss of the target model between a first training state and a second training state, wherein the first training state is a state in which the target model is trained using the sub-feature, and the second training state is a state in which the target model is not trained using the sub-feature;
[0020] a disabled feature determination module, configured to determine a first disabled sub-feature among the sub-features of different categories based on the importance;
[0021] A parameter memory release module, used to release the memory used to store the feature value of the first sub-feature in the memory space of the training parameter server;
[0022] A model parameter updating module is used to update the model parameters of the target model based on the disabling conditions of the sub-features of different categories.
[0023] In a fourth aspect, the present invention provides a memory data processing device based on model training, which is applicable to an online parameter server, and the device comprises:
[0024] A read instruction sending module is used to send a feature value read instruction for a target sub-feature to a training parameter server;
[0025] A feedback information receiving module, used to receive a target feature value of the target sub-feature fed back by the training parameter server, wherein the target feature value is fed back by the training parameter server based on a disabled condition of the target sub-feature; wherein the disabled condition is determined by the training parameter server based on an importance of the target sub-feature; and the importance is determined by the training parameter server based on a difference in model loss when a target model is trained using the target sub-feature and when the target sub-feature is not used for training;
[0026] A feature value updating module, configured to update the feature value of the target sub-feature in the memory space to the target feature value if the feature value of the target sub-feature is stored in the memory space of the online parameter server;
[0027] a disabled feature determination module, configured to determine, based on feature values of sub-features of different categories stored in the memory space, sub-features of different categories that are in a disabled state;
[0028] The online memory release module is used to release the memory corresponding to the sub-feature in the disabled state in the memory space.
[0029] In a fifth aspect, the present invention provides an electronic device comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, computer instructions being stored in the memory, and the processor executing the above-mentioned memory data processing method based on model training by executing the computer instructions.
[0030] In a sixth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the above-mentioned memory data processing method based on model training.
[0031] In a seventh aspect, the present invention provides a computer program product, comprising computer instructions, which are used to enable a computer to execute the above-mentioned memory data processing method based on model training.
[0032] In the memory data processing method based on model training disclosed in the present invention, the training parameter server determines the importance of the sub-feature based on the difference in model loss when the target model is trained using the sub-feature and when the sub-feature is not used for training. Then, the training parameter server determines the first sub-feature to be disabled among the sub-features of different categories based on the importance, and releases the memory used to store the feature value of the first sub-feature in the memory space of the training parameter server. Therefore, the sub-features with lower importance stored in the training parameter server can be eliminated, and the amount of data required to be stored by the training parameter server can be effectively reduced, thereby reducing the memory required by the target model in the training parameter server, and effectively solving the problem of large memory required for model parameters. Furthermore, the training parameter server updates the model parameters of the target model based on the disabled conditions of the sub-features of different categories. Therefore, with the elimination of the first sub-feature in the training parameter server, the sub-features used for parameter update of the target model will also be reduced, thereby causing the model parameters generated by the target model corresponding to the sub-feature to be reduced, thereby reducing the model parameters of the target model, and achieving the purpose of model slimming. In addition, if the feature value of the target sub-feature fed back by the training parameter server is stored in the memory space of the online parameter server, the online parameter server updates the feature value of the target sub-feature in the memory space to the target feature value. Based on the feature values of different categories of sub-features stored in the memory space, the sub-features in the different categories that are in a disabled state are determined. Therefore, the online parameter server can be aligned with the elimination strategy of the training parameter server, so that the online parameter server eliminates the sub-features disabled by the training parameter server, thereby reducing the model parameters of the target model that the online parameter server needs to store, and effectively compressing the memory of the online parameter server. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0034] Figure 1 is a flow chart of a method for processing memory data based on model training according to an embodiment of the present invention;
[0035] Figure 2 is a schematic diagram of a process of eliminating sub-features according to an embodiment of the present invention;
[0036] Figure 3 is a schematic diagram of a process of writing a feature value of a sub-feature according to an embodiment of the present invention;
[0037] Figure 4 is a schematic diagram of a process of reading a feature value of a sub-feature according to an embodiment of the present invention;
[0038] Figure 5 is a flow chart of another memory data processing method based on model training according to an embodiment of the present invention;
[0039] Figure 6 is a schematic diagram of interaction between a training parameter server and an online parameter server for synchronizing feature values of sub-features according to an embodiment of the present invention;
[0040] Figure 7 is a structural block diagram of a memory data processing device based on model training according to an embodiment of the present invention;
[0041] Figure 8 is a structural block diagram of another memory data processing device based on model training according to an embodiment of the present invention;
[0042] Fig. 9 is a structural block diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.
[0044] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0045] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0046] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0047] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0048] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
[0049] As the features of the promotion search model continue to be enriched, the parameter server (PS) resources required for training and deployment are also growing. Among them, the parameter server required for training is called the training parameter server (training ps), and the parameter server required for deployment is called the online parameter server (online ps).
[0050] At present, the memory required for model parameters is large, and the training PS memory has always been a bottleneck for training, affecting the use of training resources. In addition, the large size of the online PS will increase the difficulty of launching the model. Therefore, the following two data processing methods are mainly proposed in the relevant technology: 1. Eliminate low-frequency features: Eliminate features whose number of occurrences is less than a threshold or whose most recent access time exceeds a threshold. However, this processing method considers low-frequency features to be unimportant features and has limited effect. 2. Group Lasso Algorithm (GroupLasso): Set features whose L2 norm is less than the specified threshold to zero, and eliminate all-zero features that have not been updated for many days. However, this processing method has a limited elimination range, and it is easy to cause damage to the target model when eliminating more features.
[0051] Therefore, there is an urgent need for a data processing method for processing model parameters.
[0052] In view of this, according to an embodiment of the present disclosure, an embodiment of a memory data processing method based on model training is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0053] In this embodiment, a memory data processing method based on model training is provided, which can be used for the above-mentioned training parameter server. Figure 1 is a flow chart of a memory data processing method based on model training according to an embodiment of the present disclosure, such as Figure 1 As shown, the process includes the following steps:
[0054] Step S101, obtaining sub-features of different categories of target features, where the target features are features corresponding to feature extraction performed by the target model on input data.
[0055] Specifically, the target model may be a search, promotion and recommendation model, which is a model used for search, promotion and recommendation. In addition, the target model may also be other models using a parameter server.
[0056] It should be noted that when the target model extracts features from the input data, it will extract multiple target features, each of which contains sub-features of different categories. For example, if the feature is gender, male and female are sub-features of gender.
[0057] Step S102, determining the importance of the sub-feature based on the difference in model loss of the target model between a first training state and a second training state, wherein the first training state is a state in which the target model is trained using the sub-feature, and the second training state is a state in which the target model is not trained using the sub-feature.
[0058] It should be noted that there are often different categories of sub-features in the target model, but not every sub-feature is important. Therefore, the impact of the sub-feature on the target model can be determined based on the difference in model loss when the target model is trained with the sub-feature and when the target model is not trained with the sub-feature, thereby determining the importance of the sub-feature.
[0059] Step S103: determining a disabled first sub-feature among sub-features of different categories based on the importance.
[0060] Specifically, in actual operation, a sub-feature whose importance is less than a preset threshold value can be determined as the first sub-feature to be disabled. Alternatively, in combination with the continuous non-update duration of the sub-feature, a sub-feature that has not been updated for a long time and whose importance is less than a preset threshold value can be selected as the first sub-feature to be disabled. Alternatively, in combination with the continuous use duration of the sub-feature for the target model to perform model training, a sub-feature that has not been used for a long time and whose importance is less than a preset threshold value can be selected as the first sub-feature to be disabled.
[0061] Step S104: releasing the memory used to store the feature value of the first sub-feature in the memory space of the training parameter server.
[0062] It should be noted that the feature values of different categories of sub-features are usually stored in the memory space of the training parameter server. If the first sub-feature is disabled, the memory of the first sub-feature in the memory space can be released to eliminate the first sub-feature, thereby reducing the amount of data stored in the training parameter server.
[0063] It should be noted that the memory space is the embedding space (also called embedding space) of the training parameter server.
[0064] Step S105: updating the model parameters of the target model based on the disabling conditions of the sub-features of different categories.
[0065] Specifically, if a sub-feature is disabled, the feature value of the sub-feature is not stored in the training parameter server. Therefore, in the process of updating the model parameters of the target model, the model parameters generated by the disabled sub-feature can be reduced, thereby achieving the purpose of slimming the target model.
[0066] The memory data processing method based on model training provided in this embodiment determines the importance of sub-features based on the difference in model loss when the target model is trained with sub-features and when it is not trained with sub-features. Then, the first sub-feature to be disabled is determined in the sub-features of different categories based on the importance, and the memory used to store the feature value of the first sub-feature is released in the memory space of the training parameter server. Therefore, the sub-features with lower importance stored in the training parameter server can be eliminated, and the amount of data required to be stored in the training parameter server can be effectively reduced, thereby reducing the memory required by the target model in the training parameter server, and effectively solving the problem of large memory required for model parameters. Furthermore, the model parameters of the target model are updated based on the disabled status of sub-features of different categories. Therefore, with the elimination of the first sub-feature in the training parameter server, the sub-features used for parameter updating of the target model will also be reduced, which will lead to a reduction in the model parameters generated by the target model corresponding to the sub-features, thereby reducing the model parameters of the target model and achieving the purpose of model slimming.
[0067] It is worth noting that, assuming the model loss in the first state is loss with fid (x), the model loss in the second state is loss with out fid (x). Then, the importance of the sub-feature can be determined according to the following formula: Among them, fid is the sub-feature, importance(fid) is the importance of the sub-feature, D is the set of input data, x is the input data, x∈D.
[0068] Assume that the weight of the sub-feature is W, and f(W) is the model loss of the target model. Then the above formula can be organized as: Among them, f(W,x) is the model loss of the target model corresponding to the input data x in the first state, and f(0,x) is the model loss of the target model corresponding to the input data x in the second state.
[0069] right Performing a first-order Taylor expansion, we can obtain the following formula: f(W+ω,x)=f(W,x)+<f(W,x)',ω> +o(ω). Where ω is the neighborhood radius of W, f(W+ω, x) is the model loss when the weight of the target model corresponding to the sub-feature is W+ω and the input data is x, and f(W,x)' is the derivative of f(W,x).<f(W,x)',ω> is the Cartesian product of f(W,x)' and ω, and o(ω) is the Peano remainder.
[0070] For the target model, the weight of the sub-feature approaches zero, so let ω = -W, then we can get:
[0071]
[0072] Among them, G is the gradient of the target model corresponding to the input data, and W is the weight of the sub-feature.
[0073] Based on the above analysis, in some optional implementations, determining the importance of the sub-feature based on the model loss difference of the target model between the first training state and the second training state in the above step S102 includes:
[0074] Step a1, obtain the weights of the sub-features and the gradient of the model loss of the target model corresponding to the input data.
[0075] It should be noted that, in the process of training the target model, the model training node obtains training samples (i.e., input data), obtains sub-features of different categories from the training samples, and sends the sub-features of different categories to the training parameter server. The training parameter server searches for the eigenvalues (also known as embedding) corresponding to each sub-feature in the local memory space, and returns the eigenvalues corresponding to each sub-feature to the model training node. Then, the model training node calculates the eigenvalues of sub-features of different categories, and optimizes the target model according to the calculation results, and obtains the gradient of the model loss of the target model corresponding to the training sample. Then, the model training node sends the gradient and sub-features of different categories to the training parameter server, and the training parameter server updates the model parameters of the target model according to the gradient; wherein the model parameters include the eigenvalues of each sub-feature. In addition, during the training process of the target model, each sub-feature corresponds to a weight.
[0076] Step a2: determining a model loss change based on weights and gradients, where the model loss change is used to characterize the model loss difference of the target model between the first training state and the second training state.
[0077] Specifically, the above step a2 includes:
[0078] Step a21, determining the Cartesian product of the weight and the gradient corresponding to each input data.
[0079] Step a22, summing the moduli of each Cartesian product to obtain the change in model loss.
[0080] It is worth noting that in the Adaptive Gradient Algorithm (Adagrad) optimizer, the gradient of the sub-feature and the gradient of the target model corresponding to the input data and other related momentum are stored in the training parameter server. Therefore, the change in model loss is determined based on the weight of the sub-feature and the gradient of the target model corresponding to the input data, which can avoid additional memory usage.
[0081] Step a3: Determine the importance of the sub-feature based on the change in model loss.
[0082] Specifically, the above step a3 includes:
[0083] Step a31, obtaining the dimension of the sub-feature.
[0084] Step a32, normalize the corresponding model loss change based on the dimension to obtain the importance of the sub-feature.
[0085] It is worth noting that after analyzing the model loss changes of each sub-feature, it is found that the larger the dimension of the sub-feature, the larger the range of its model loss change, and different sub-features cannot use the same degree threshold to judge the importance of the sub-feature. Therefore, in order to reduce the impact of the dimension on the importance of the sub-feature, it is necessary to use the dimension to normalize the model loss change.
[0086] Furthermore, the above step a32 includes:
[0087] Step a321, determine the square root of the dimension.
[0088] Step a322, based on the ratio of the model loss change to the corresponding square root, obtain the importance of the sub-feature.
[0089] Specifically, considering the impact of the dimension on the importance of the sub-feature, the formula for the importance of the sub-feature is redefined as:
[0090]
[0091] Among them, sqrt represents the square root, and dim is the dimension of the sub-feature.
[0092] The memory data processing method based on model training provided in this embodiment determines the change in model loss based on the weight of the sub-feature and the gradient of the target model corresponding to the input data, which can avoid additional memory usage. At the same time, the change in model loss is normalized according to the dimension of the sub-feature to obtain the importance of the sub-feature. Therefore, it is possible to avoid the influence of the dimension of the sub-feature on the judgment of its importance, effectively avoid setting different judgment criteria for the judgment of the importance of each sub-feature, further reduce the memory usage of the training parameter server, and improve the calculation efficiency of the importance.
[0093] In some optional embodiments, the model training-based memory data processing method disclosed herein also includes: obtaining the first continuous non-updated duration of the sub-feature; if the first continuous non-updated duration of the sub-feature is greater than or equal to the first preset duration threshold, adding the sub-feature to the disabled first sub-feature.
[0094] It should be noted that the first preset duration threshold can be determined based on experience, and if the first continuous non-update duration of the sub-feature is greater than or equal to the first preset duration threshold, it largely indicates that the sub-feature is less important to the target model. Therefore, the sub-feature can be disabled.
[0095] In the memory data processing method based on model training provided in this embodiment, if the first continuous non-updated time length of a sub-feature is greater than or equal to the first preset time length threshold, the sub-feature is determined as a disabled first sub-feature. Therefore, sub-features that have not been updated for a long time can be effectively eliminated, thereby effectively reducing the model parameters of the target model that need to be stored in the training parameter server.
[0096] In some optional implementations, determining the first sub-feature to be disabled among sub-features of different categories based on importance in the above step S103 includes:
[0097] Step b1, obtaining the second continuous non-updated time length of the sub-feature.
[0098] Step b2: if the second continuous non-update time length of the sub-feature is greater than the second preset time length threshold and the corresponding importance level is less than the first importance level threshold, the sub-feature is determined as a disabled first sub-feature.
[0099] Specifically, if the first continuous non-update duration of the sub-feature is less than the first preset duration threshold, the second continuous non-update duration of the sub-feature is obtained. If the second continuous non-update duration of the sub-feature is greater than the second preset duration threshold and the corresponding importance is less than the first importance threshold, the sub-feature is determined as a disabled first sub-feature.
[0100] It should be noted that if the second continuous non-update duration of the sub-feature is less than or equal to the second preset duration threshold, or the corresponding importance level is greater than or equal to the first level threshold, the sub-feature is determined as a sub-feature in a non-disabled state.
[0101] It should be noted that the second preset duration threshold is smaller than the first preset duration threshold.
[0102] In the memory data processing method based on model training provided in this embodiment, if the second continuous non-update time length of the sub-feature is greater than the second preset time length threshold and the corresponding importance is less than the first importance threshold, the sub-feature is determined as a disabled first sub-feature. Therefore, sub-features that have not been updated for a long time and have slow update amplitude characteristics can be effectively eliminated, thereby further reducing the model parameters of the target model that need to be stored in the training parameter server.
[0103] In some optional implementations, the step S103 of determining the first sub-feature to be disabled from among the sub-features of different categories based on the importance level further includes:
[0104] Step c1, obtaining the continuous usage time of the sub-feature for model training of the target model.
[0105] Step c2: if the continuous use time of the sub-feature is greater than the third preset time threshold and the corresponding importance level is less than the second level threshold, the sub-feature is determined as a disabled first sub-feature.
[0106] Specifically, if the first continuous non-update duration of the sub-feature is less than the first preset duration threshold, the continuous use duration of the sub-feature for model training of the target model is obtained. If the continuous use duration of the sub-feature is greater than the third preset duration threshold and the corresponding importance is less than the second degree threshold, the sub-feature is determined as a disabled first sub-feature.
[0107] It should be noted that if the first continuous non-updated duration of the sub-feature is less than or equal to the third preset duration threshold, or the corresponding importance level is greater than or equal to the second level threshold, the sub-feature is determined as a sub-feature in a non-disabled state.
[0108] In the memory data processing method based on model training provided in this embodiment, if the continuous use time of the sub-feature is greater than the third preset time threshold and the corresponding importance is less than the second degree threshold, it indicates that the sub-feature has entered the target model for many days, but the importance is still very low and the update frequency is also relatively low. Therefore, the sub-feature is determined as the first sub-feature, so that the sub-features that have not been updated for a long time and have a particularly low update frequency can be effectively eliminated, thereby further reducing the model parameters of the target model that need to be stored in the training parameter server.
[0109] It should be noted that, in actual operation, the sub-feature satisfies the above steps b1-b2, and steps c1-c2 satisfy one of them, that is, the sub-feature is marked as disabled.
[0110] It can be understood that if the first continuous non-updated time length of the sub-feature is greater than or equal to the first preset time length threshold, the sub-feature is determined to be a disabled first sub-feature. And, if the second continuous non-updated time length of the sub-feature is greater than the second preset time length threshold and the corresponding importance is less than the first degree threshold, the sub-feature is determined to be a disabled first sub-feature. And, if the continuous use time length of the sub-feature is greater than the third preset time length threshold and the corresponding importance is less than the second degree threshold, the sub-feature is determined to be a disabled first sub-feature. Therefore, sub-features that have not been updated for a long time, have a particularly slow update amplitude, and have a particularly low update frequency in the training parameter server can be effectively eliminated, so as to effectively reduce the storage memory of the training parameter server for the model parameters of the target model.
[0111] For example, Figure 2 As shown, for different categories of sub-features, the training parameter server first determines whether the first continuous non-updated duration of the sub-feature is greater than or equal to the first preset duration threshold. If so, the sub-feature is eliminated, that is, memory space is not allocated for the sub-feature, and the sub-feature is marked as disabled. If not, it is determined whether the sub-feature hits any elimination logic, that is, whether the second continuous non-updated duration of the sub-feature is greater than the second preset duration threshold and the corresponding importance is less than the first degree threshold, or whether the continuous use duration of the sub-feature is greater than the third preset duration threshold and the corresponding importance is less than the second degree threshold. If so, memory space is not allocated for the sub-feature, and the sub-feature is marked as disabled. If not, the remaining sub-features are treated as sub-features in a non-disabled state.
[0112] In some optional implementations, the model parameters include feature values of sub-features of different categories. Then, the updating of the model parameters of the target model based on the disabling conditions of sub-features of different categories in the above step S104 includes:
[0113] Step e1, in response to the model training node's instruction to read the feature value of the second sub-feature, if the second sub-feature is in a disabled state, the feature value of the second sub-feature is fed back to the model training node as zero, so that the model training node trains the target model based on the feature value of the second sub-feature.
[0114] It should be noted that if the second sub-feature is in a non-disabled state, the feature value of the second sub-feature is read in the memory space of the training parameter server, and the read feature value is fed back to the model training node, so that the model training node trains the target model based on the feature value of the second sub-feature.
[0115] Step e2, obtaining the training results fed back by the model training node.
[0116] It should be noted that the training result is the gradient of the model loss of the target model corresponding to the input data.
[0117] Step e3, determining the updated third sub-feature of the target among the sub-features of different categories and the updated feature value of the third sub-feature based on the training result.
[0118] Specifically, the feature values of sub-features of different categories are updated according to the gradient of the model loss of the target model corresponding to the input data.
[0119] Step e4: if the third sub-feature is in a non-disabled state, the updated feature value of the third sub-feature is written into the memory space.
[0120] The memory data processing method based on model training provided in this embodiment, if the second sub-feature is in a disabled state, the characteristic value of the second sub-feature is fed back to the model training node as zero, so that the model training node trains the target model based on the characteristic value of the second sub-feature. Therefore, it is possible to reduce the influence of the disabled sub-features on the model parameters during the training process of the target model, thereby reducing the risk of overfitting of the target model. Furthermore, the third sub-feature of the target update in the sub-features of different categories and the characteristic value after the third sub-feature is updated are determined according to the training results fed back by the model training node. If the third sub-feature is in a non-disabled state, the characteristic value after the third sub-feature is updated is written to the memory space. Therefore, it is possible to avoid the training parameter server storing the characteristic values of sub-features with lower importance, and further reduce the memory required to store the model parameters of the target model.
[0121] In some optional implementations, the model training-based memory data processing method disclosed herein further includes: if the third sub-feature is in a disabled state, only the latest access time of the third sub-feature is updated.
[0122] In the memory data processing method based on model training provided in this embodiment, if the third sub-feature is in a disabled state, only the latest access time of the third sub-feature is updated. Therefore, it is possible to avoid writing the feature value of the disabled sub-feature again, thereby further reducing the memory required by the training parameter server to store the model parameters of the target model.
[0123] It is worth noting that even if the memory occupied by the first sub-feature in the memory space of the training parameter server is released, the first sub-feature will still instantly enter the hash table when it appears next time, and will occupy a certain amount of memory again. Therefore, in the memory data processing method based on model training disclosed in the present invention, a disabling mechanism is designed, and the disabled sub-feature can still enter the hash table, but does not occupy the memory space of the training parameter server, but only records its latest access time (i.e., the timestamp of the update) normally, so that the target model can be lossless.
[0124] For example, Figure 3 As shown, Figure 3 This is a flowchart of writing (also called pushing) feature values of a training parameter server. When writing feature values of sub-features of different categories, the training parameter server first determines whether the feature value of the sub-feature to be read is in a disabled state. If the sub-feature is in a disabled state, only the latest access time of the sub-feature is updated. If the sub-feature is in a non-disabled state, the feature value of the sub-feature is written normally.
[0125] In some optional implementations, the memory data processing method based on model training disclosed herein further includes:
[0126] Step f1, in response to a feature value reading instruction for a fourth sub-feature from an online parameter server, obtaining a target deviation and a target latest access time corresponding to the fourth sub-feature.
[0127] Step f2: determining the update status of the feature value of the fourth sub-feature based on the target latest access time.
[0128] Step f3: If the target deviation is zero and the feature value update status indicates that the feature value is not updated, the feature value of the fourth sub-feature is not fed back to the online parameter server.
[0129] Step f4: if the target deviation is not zero or the feature value update status indicates that the feature value has been updated, based on the disabling status of the fourth sub-feature, the feature value of the fourth sub-feature is fed back to the online parameter server.
[0130] Specifically, the above step f4 includes: if the fourth sub-feature is in a disabled state, feeding back the feature value of the fourth sub-feature as a preset feature value to the online parameter server, and the online parameter server is used to release the memory corresponding to the sub-feature whose feature value is the preset feature value.
[0131] Optionally, the preset characteristic value is zero.
[0132] Specifically, if the fourth sub-feature is in a non-disabled state, the feature value of the fourth sub-feature is read from the memory space of the training parameter server, and the feature value of the fourth sub-feature is fed back to the online parameter server.
[0133] The memory data processing method based on model training provided in this embodiment obtains the target deviation and the target latest access time corresponding to the fourth sub-feature in response to the feature value reading instruction of the online parameter server for the fourth sub-feature. Therefore, for sub-features with lower importance, the feature value of the sub-feature is no longer pushed to the online parameter server as zero, thereby further reducing the amount of data of the model parameters of the target model that the online parameter server needs to store. In addition, if the target deviation is not zero or the feature value update situation indicates that the feature value has been updated, the feature value of the fourth sub-feature is fed back to the online parameter server based on the disabled condition of the fourth sub-feature. Therefore, the elimination strategy of the training parameter server can be aligned to the online parameter server, so that the online parameter server eliminates the disabled and eliminated sub-features of the training parameter server, so as to further reduce the model parameter memory required by the online parameter server to store the target model.
[0134] It is worth noting that after the training parameter server adopts the memory data processing method based on model training disclosed in the present invention, each eliminated or disabled sub-feature only needs to be recorded in the hash table, and the feature value of the eliminated or disabled sub-feature does not need to be written in the memory space. Therefore, only 4 bytes of memory are required, which can greatly reduce the memory required for the target model to store model parameters in the training parameter server.
[0135] For example, Figure 4 As shown, Figure 4 This is a flow chart of the feature value of the pull (also known as Fetch) feature of the training parameter server. Taking the preset feature value of zero as an example, when the training parameter server reads the feature values of sub-features of different categories, it first determines whether the feature value of the sub-feature to be read is in a disabled state. If the sub-feature is in a disabled state, the feature value of the feedback sub-feature is zero. If the sub-feature is in a non-disabled state, the feature value of the sub-feature is read normally.
[0136] In this embodiment, another memory data processing method based on model training is provided, which can be used for the above-mentioned online parameter server. Figure 5 is a flow chart of another memory data processing method based on model training according to an embodiment of the present disclosure, such as Figure 5 As shown, the process includes the following steps:
[0137] Step S501: Send a feature value reading instruction for a target sub-feature to a training parameter server.
[0138] Specifically, the online parameter server may determine the feature value of the target sub-feature that needs to be read from the training parameter server according to the online training requirements of the actual target model, and send a feature value reading instruction to the training parameter server according to the target sub-feature.
[0139] Step S502, receiving the target feature value of the target sub-feature fed back by the training parameter server, where the target feature value is fed back by the training parameter server based on the disabling condition of the target sub-feature; wherein the disabling condition is determined by the training parameter server based on the importance of the target sub-feature; the importance is determined by the training parameter server based on the difference in model loss when the target model is trained using the target sub-feature and when the target sub-feature is not used for training.
[0140] Specifically, the step of the training parameter server feeding back the target feature value of the target sub-feature can refer to the above content about the training parameter server executing the memory data processing method based on model training of the present disclosure, which will not be repeated here.
[0141] It should be noted that if the target sub-feature is in a disabled state, the target feature value of the target sub-feature fed back by the training parameter server to the online parameter server is zero. If the target sub-feature is in a non-disabled state, the training parameter server reads the target feature value of the target sub-feature normally and feeds it back to the online parameter server.
[0142] Step S503: If the feature value of the target sub-feature is stored in the memory space of the online parameter server, the feature value of the target sub-feature in the memory space is updated to the target feature value.
[0143] It should be noted that if the feature value of the target sub-feature is not stored in the memory space of the online parameter server, it is necessary to determine whether to write the target feature value of the target sub-feature into the memory space (also called embedding space) of the online parameter server based on the disabling status of the target sub-feature in the training parameter server.
[0144] Step S504: determining the sub-features in a disabled state from among the sub-features of different categories based on the feature values of the sub-features of different categories stored in the memory space.
[0145] Specifically, if the feature values of sub-features of different categories stored in the memory space are feature values representing a disabled state within a preset time period, the sub-feature is determined as a sub-feature in a disabled state.
[0146] Specifically, if the training parameter server feeds back that the target sub-feature is zero when the target sub-feature is in a disabled state, the online parameter server periodically determines whether the feature values corresponding to the sub-features of different categories in its memory space are zero within a preset time length, and if so, determines the sub-feature as a sub-feature in a disabled state. If not, determines the sub-feature as a sub-feature in a non-disabled state.
[0147] Step S505: releasing the memory corresponding to the disabled sub-feature in the memory space.
[0148] In the memory data processing method based on model training provided in this embodiment, if the feature value of the target sub-feature fed back by the training parameter server is stored in the memory space of the online parameter server, the feature value of the target sub-feature in the memory space is updated to the target feature value. And based on the feature values of sub-features of different categories stored in the memory space, sub-features in different categories that are in a disabled state are determined. Therefore, the online parameter server can be aligned with the elimination strategy of the training parameter server, so that the online parameter server eliminates the sub-features disabled by the training parameter server, thereby reducing the model parameters of the target model that the online parameter server needs to store, and effectively compressing the memory of the online parameter server.
[0149] In some optional embodiments, the above-mentioned step S504 includes: based on the feature values of different categories of sub-features stored in the memory space, determining the sub-features in the different categories of sub-features that are in a disabled state, including: if the feature value of any sub-feature in the different categories of sub-features is a preset feature value within a preset time length, then the sub-feature is determined as a sub-feature in a disabled state, and the preset feature value represents the feature value in the disabled state.
[0150] Specifically, the preset characteristic value is zero.
[0151] Optionally, the preset duration is 7 days. In addition, the preset duration can be adaptively adjusted according to actual conditions, and the value of the preset duration is not limited here.
[0152] It should be noted that if the feature value of any sub-feature in different categories of sub-features is a feature value other than the non-preset feature value within the preset time length, it means that the sub-feature is not disabled by the training parameter server due to low importance, long-term non-update or low frequency of use, and the sub-feature is in a non-disabled state.
[0153] In the memory data processing method based on model training provided in this embodiment, if the feature value of any sub-feature in different categories is a preset feature value within a preset time period, the sub-feature is determined as a sub-feature in a disabled state. Therefore, it is possible to avoid the online parameter server from misjudging the sub-feature as a sub-feature in a disabled state, and further ensure that the target model is lossless.
[0154] In some optional embodiments, the model training-based memory data processing method disclosed herein also includes: if the target sub-feature characterizes that the target sub-feature is in a disabled state and the feature value of the target sub-feature is not stored in the memory space, then it is prohibited to write the target feature value of the target sub-feature in the memory space.
[0155] In some optional implementations, if the target sub-feature indicates that the target sub-feature is in a non-disabled state and the feature value of the target sub-feature is not stored in the memory space, the target feature value of the target sub-feature is written into the memory space.
[0156] For example, Figure 6 As shown, taking the preset feature value representing the disabled state as zero as an example, the online parameter server sends a feature value reading instruction for the target sub-feature to the training parameter server. The training parameter server determines the target sub-feature among the sub-features of different categories, and determines whether the target deviation of the target sub-feature is zero and the feature value is not updated. If so, the target feature value of the target sub-feature is not fed back. If not, it is determined whether the target sub-feature is in a disabled state. If the target sub-feature is in a non-disabled state, the training parameter server searches for the target feature value of the target sub-feature in the local memory space and feeds back the target feature value of the target sub-feature normally. If the target sub-feature is in a disabled state, the training parameter server feeds back the target feature value of the target sub-feature as zero. The online parameter server determines whether the target feature value of the target sub-feature fed back by the training parameter server is zero. If not, the target feature value of the target sub-feature is normally written to the local memory space. If yes, it is determined whether the target feature value of the target sub-feature exists in the memory space of the online parameter server. If yes, the online parameter server updates the feature value of the target sub-feature in the memory space to zero. If not, the data is not updated.
[0157] It is worth noting that in the memory data processing method based on model training disclosed in the present invention, the model loss of the target model is subjected to a first-order Taylor expansion, the importance of sub-features of different categories is calculated, and the target model is slimmed down by eliminating sub-features with lower importance, while reducing the memory of the training parameter server. In addition, after reducing the memory of the training parameter server, the elimination strategy of the training parameter server is aligned in the online parameter server, and all zeros are no longer pushed to the online parameter server for sub-features with lower importance, further compressing the memory of the online parameter server. Therefore, the redundant features in the target model can be eliminated, the risk of overfitting can be reduced, and the model effect of the target model can be effectively improved while reducing the occupancy of redundant data.
[0158] It is worth noting that the memory data processing method based on model training disclosed in the present invention is a loss-aware feature elimination processing method. The memory data processing method disclosed in the present invention evaluates the importance of features through model loss. Then, two elimination strategies are designed based on the importance, which can effectively eliminate features with slow update amplitude, low update frequency and long-term non-update. In addition, a disabling mechanism is designed for the feature elimination method based on importance, achieving maximum memory compression.
[0159] As a specific application example, a target application is installed on the training parameter server and the online parameter server respectively, and the target application is used to execute the corresponding memory data processing method based on model training in the present disclosure. The target application deployed by the training parameter server can use the data processing method applicable to the training parameter server of the present disclosure to process the data of different categories of sub-features stored in the training parameter server to eliminate sub-features with lower importance, so as to further slim down the target model and reduce the memory of the training parameter server at the same time. The target application deployed by the online parameter server can use the data processing method applicable to the online parameter server of the present disclosure to align the elimination strategy of the training parameter server to eliminate sub-features with lower importance in the online parameter server to further compress the memory of the online parameter server.
[0160] In this embodiment, a memory data processing device based on model training is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and will not be repeated hereafter. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0161] This embodiment provides a memory data processing device based on model training, which is suitable for training parameter servers, such as Figure 7 As shown, the device comprises:
[0162] The model feature acquisition module 701 is used to acquire sub-features of different categories of target features, where the target feature is the feature corresponding to the feature extraction performed by the target model on the input data;
[0163] An importance calculation module 702, used to determine the importance of the sub-feature based on the model loss difference of the target model between a first training state and a second training state, wherein the first training state is a state in which the target model is trained using the sub-feature, and the second training state is a state in which the target model is not trained using the sub-feature;
[0164] A disabled feature determination module 703, configured to determine a disabled first sub-feature among sub-features of different categories based on importance;
[0165] A parameter memory release module 704, used to release the memory used to store the feature value of the first sub-feature in the memory space of the training parameter server;
[0166] The model parameter updating module 705 is used to update the model parameters of the target model based on the disabling conditions of sub-features of different categories.
[0167] In some optional implementations, the importance calculation module 702 includes:
[0168] A model parameter acquisition unit, used to obtain the weights of the sub-features and the gradient of the model loss of the target model corresponding to the input data;
[0169] A change determination unit, used to determine a model loss change based on the weight and the gradient, where the model loss change is used to characterize a model loss difference of a target model between a first training state and a second training state;
[0170] The importance determination unit is used to determine the importance of the sub-feature based on the change in model loss.
[0171] In some optional implementations, the change amount determination unit includes:
[0172] A first operator unit, used to determine the Cartesian product of the weight and the gradient corresponding to each input data;
[0173] The second operator unit is used to sum the moduli of each Cartesian product to obtain a change in model loss.
[0174] In some optional implementations, the importance determination unit includes:
[0175] A feature dimension acquisition subunit, used to acquire the dimension of a sub-feature;
[0176] The normalization processing subunit is used to normalize the corresponding model loss change based on the dimension to obtain the importance of the sub-feature.
[0177] In some optional implementations, the normalization processing subunit is specifically used to: determine the square root of the dimension; and obtain the importance of the sub-feature based on the ratio of the change in model loss to the corresponding square root.
[0178] In some optional implementations, the in-memory data processing device based on model training of the present disclosure further includes:
[0179] An update duration acquisition module, used to acquire the first continuous non-update duration of a sub-feature;
[0180] The eliminated feature determination module is used to add the sub-feature to the disabled first sub-features if the first continuous non-update time length of the sub-feature is greater than or equal to the first preset time length threshold.
[0181] In some optional implementations, the disabled feature determination module 703 includes:
[0182] An update duration acquisition unit, used to acquire a second continuous non-updated duration of the sub-feature;
[0183] The first feature determination unit is configured to determine the sub-feature as a disabled first sub-feature if a second continuous non-update duration of the sub-feature is greater than a second preset duration threshold and the corresponding importance level is less than a first level threshold.
[0184] In some optional implementations, the disabled feature determination module 703 further includes:
[0185] A usage duration acquisition unit, used to acquire the continuous usage duration of the sub-feature for model training of the target model;
[0186] The second feature determination unit is configured to determine the sub-feature as a disabled first sub-feature if the continuous use time of the sub-feature is greater than a third preset time threshold and the corresponding importance is less than a second importance threshold.
[0187] In some optional implementations, the model parameters include feature values of sub-features of different categories. Then, the model parameter updating module 705 includes:
[0188] A first instruction response unit is used for responding to a feature value reading instruction of the model training node for the second sub-feature, and if the second sub-feature is in a disabled state, feeding back to the model training node that the feature value of the second sub-feature is zero, so that the model training node trains the target model based on the feature value of the second sub-feature;
[0189] A training result acquisition unit, used to acquire the training results fed back by the model training node;
[0190] An update data determination unit, used to determine a third sub-feature of target update among sub-features of different categories and a feature value of the third sub-feature after update based on the training result;
[0191] The feature data updating unit is used to write the updated feature value of the third sub-feature into the memory space if the third sub-feature is in a non-disabled state.
[0192] In some optional implementations, the model parameter updating module 705 further includes:
[0193] The access time updating module is used for updating only the latest access time of the third sub-feature if the third sub-feature is in a disabled state.
[0194] In some optional implementations, the model training-based memory data processing device of the present disclosure further includes an online parameter updating module; wherein the online parameter updating module includes:
[0195] A second instruction response unit, configured to respond to a characteristic value reading instruction of the online parameter server for the fourth sub-characteristic, and obtain a target deviation and a target latest access time corresponding to the fourth sub-characteristic;
[0196] An update status determination unit, used to determine the update status of the feature value of the fourth sub-feature based on the target latest access time;
[0197] A first data processing unit is configured to not feed back the feature value of the fourth sub-feature to the online parameter server if the target deviation is zero and the feature value update status indicates that the feature value is not updated;
[0198] The second data processing unit is used to feed back the characteristic value of the fourth sub-feature to the online parameter server based on the disabling condition of the fourth sub-feature if the target deviation is not zero or the characteristic value update condition indicates that the characteristic value has been updated.
[0199] In some optional implementations, the second data processing unit includes:
[0200] The disabled feature feedback unit is used to feedback the feature value of the fourth sub-feature as zero to the online parameter server if the fourth sub-feature is in a disabled state, and the online parameter server is used to release the memory corresponding to the sub-feature with the feature value of zero.
[0201] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0202] The model-training-based memory data processing device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above-mentioned functions.
[0203] In this embodiment, another memory data processing device based on model training is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and will not be repeated hereafter. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0204] This embodiment provides another memory data processing device based on model training, which is suitable for online parameter servers, such as Figure 8 As shown, the device comprises:
[0205] A read instruction sending module 801 is used to send a feature value read instruction for a target sub-feature to a training parameter server;
[0206] A feedback information receiving module 802 is used to receive a target feature value of a target sub-feature fed back by a training parameter server, where the target feature value is fed back by the training parameter server based on a disabled condition of the target sub-feature; wherein the disabled condition is determined by the training parameter server based on an importance of the target sub-feature; and the importance is determined by the training parameter server based on a difference in model loss when the target model is trained using the target sub-feature and when the target sub-feature is not used for training;
[0207] The feature value updating module 803 is used to update the feature value of the target sub-feature in the memory space to the target feature value if the feature value of the target sub-feature is stored in the memory space of the online parameter server;
[0208] A disabled feature determination module 804, configured to determine a disabled sub-feature from among sub-features of different categories based on feature values of sub-features of different categories stored in the memory space;
[0209] The online memory release module 805 is used to release the memory corresponding to the sub-feature in the disabled state in the memory space.
[0210] In some optional implementations, the disabled feature determination module 804 includes:
[0211] The disabled feature determination unit is used to determine any sub-feature among sub-features of different categories as a sub-feature in a disabled state if the feature value of the sub-feature is a preset feature value within a preset time period, and the preset feature value represents the feature value in the disabled state.
[0212] In some optional implementations, the in-memory data processing device based on model training of the present disclosure further includes:
[0213] The write disabling module is used to prohibit writing the target feature value of the target subfeature in the memory space if the target subfeature characterizes that the target subfeature is in a disabled state and the feature value of the target subfeature is not stored in the memory space.
[0214] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0215] The model-training-based memory data processing device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above-mentioned functions.
[0216] The present disclosure also provides a computer device having the above Figure 7 or Figure 8 An in-memory data processing device based on model training is shown.
[0217] See also Fig. 9 , Fig. 9 is a structural block diagram of a computer device provided by an optional embodiment of the present disclosure, such as Fig. 9 As shown, the computer device includes: one or more processors 901, memory 902, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Each component utilizes different buses to communicate with each other, and can be installed on a common mainboard or installed in other ways as required. The processor can process the instructions executed in the computer device, including instructions stored in the memory or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig. 9 A processor 901 is taken as an example.
[0218] The processor 901 may be a central processing unit, a network processor or a combination thereof. The processor 901 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable logic gate array, a general purpose array logic or any combination thereof.
[0219] The memory 902 stores instructions executable by at least one processor 901 so as to enable at least one processor 901 to implement the method shown in the above embodiment.
[0220] The memory 902 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 902 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 902 may optionally include a memory remotely arranged relative to the processor 901, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0221] The memory 902 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 902 may also include a combination of the above types of memory.
[0222] The computer device also includes a communication interface 903, which is used for the computer device to communicate with other devices or a communication network.
[0223] The embodiments of the present disclosure also provide a computer-readable storage medium. The above-mentioned method according to the embodiments of the present disclosure can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium and downloaded through a network, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0224] A part of the present disclosure may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present disclosure through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in computer-readable media includes, but is not limited to, source files, executable files, installation package files, etc., and accordingly, the way in which computer program instructions are executed by a computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer.
[0225] Although the embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A memory data processing method based on model training, characterized in that: Applicable to training a parameter server, the method comprises: Obtaining sub-features of different categories of target features, where the target features are features corresponding to feature extraction performed by the target model on the input data; Determining the importance of the sub-feature based on a difference in model loss of the target model between a first training state and a second training state, wherein the first training state is a state in which the target model is trained using the sub-feature, and the second training state is a state in which the target model is not trained using the sub-feature; Determining a first sub-feature to be disabled among the sub-features of different categories based on the importance; Releasing memory used to store the feature value of the first sub-feature in the memory space of the training parameter server; The model parameters of the target model are updated based on the disabling conditions of the sub-features of different categories.
2. The method according to claim 1, characterized in that The determining the importance of the sub-feature based on the model loss difference between the target model in the first training state and the second training state includes: Obtaining the weight of the sub-feature and the gradient of the model loss of the target model corresponding to the input data; Based on the weight and the gradient, determine a model loss change amount, where the model loss change amount is used to characterize a model loss difference of the target model between a first training state and a second training state; The importance of the sub-feature is determined based on the change in the model loss.
3. The method according to claim 2, characterized in that The determining the change in model loss based on the weight and the gradient includes: Determine a Cartesian product of the weight and the gradient corresponding to each of the input data; The moduli of each of the Cartesian products are summed to obtain the model loss change.
4. The method according to claim 2, characterized in that: The determining the importance of the sub-feature based on the model loss variation includes: Obtaining the dimension of the sub-feature; The corresponding change in the model loss is normalized based on the dimension to obtain the importance of the sub-feature.
5. The method according to claim 4, characterized in that The normalizing the corresponding model loss variation based on the dimension to obtain the importance of the sub-feature includes: determining a square root of the dimension; The importance of the sub-feature is obtained based on the ratio of the model loss change to the corresponding square root.
6. The method according to claim 1, characterized in that The method further comprises: Obtaining a first continuous non-update duration of the sub-feature; If a first continuous non-update time length of the sub-feature is greater than or equal to a first preset time length threshold, the sub-feature is added to the disabled first sub-feature.
7. The method according to claim 1, characterized in that The step of determining the first sub-feature to be disabled among the sub-features of different categories based on the importance level comprises: Obtaining the second continuous non-updated time length of the sub-feature; If the second continuous non-update time length of the sub-feature is greater than a second preset time length threshold and the corresponding importance level is less than a first importance threshold, the sub-feature is determined as the disabled first sub-feature.
8. The method according to claim 1, characterized in that: The step of determining the first sub-feature to be disabled among the sub-features of different categories based on the importance level further includes: Obtaining a continuous usage time of the sub-feature for model training of the target model; If the continuous use time of the sub-feature is greater than a third preset time threshold and the corresponding importance level is less than a second importance threshold, the sub-feature is determined as the disabled first sub-feature.
9. The method according to claim 1, characterized in that: The model parameters include feature values of the sub-features of different categories; and updating the model parameters of the target model based on the disabling conditions of the sub-features of different categories includes: In response to a feature value reading instruction for a second sub-feature by a model training node, if the second sub-feature is in a disabled state, feeding back to the model training node that the feature value of the second sub-feature is zero, so that the model training node trains the target model based on the feature value of the second sub-feature; Obtaining the training result fed back by the model training node; Determine, based on the training result, a third sub-feature of the target update among the sub-features of different categories, and a feature value of the updated third sub-feature; If the third sub-feature is in a non-disabled state, the updated feature value of the third sub-feature is written into the memory space.
10. The method according to claim 9, characterized in that The method further comprises: If the third sub-feature is in a disabled state, only the latest access time of the third sub-feature is updated.
11. The method according to claim 1, characterized in that: The method further comprises: In response to a feature value reading instruction for a fourth sub-feature from an online parameter server, obtaining a target deviation and a target latest access time corresponding to the fourth sub-feature; Determining an update status of a feature value of the fourth sub-feature based on the target latest access time; If the target deviation is zero and the feature value update condition indicates that the feature value is not updated, the feature value of the fourth sub-feature is not fed back to the online parameter server; If the target deviation is not zero or the feature value update status indicates that the feature value has been updated, based on the disabling status of the fourth sub-feature, the feature value of the fourth sub-feature is fed back to the online parameter server.
12. The method according to claim 11, characterized in that The feeding back the feature value of the fourth sub-feature to the online parameter server based on the disabling condition of the fourth sub-feature includes: If the fourth sub-feature is in a disabled state, the feature value of the fourth sub-feature is fed back to the online parameter server as a preset feature value, and the online parameter server is used to release the memory corresponding to the sub-feature whose feature value is the preset feature value.
13. A memory data processing method based on model training, characterized in that: Applicable to an online parameter server, the method comprises: Sending a feature value reading instruction for the target sub-feature to the training parameter server; Receive a target feature value of the target sub-feature fed back by the training parameter server, where the target feature value is fed back by the training parameter server based on a disabled condition of the target sub-feature; wherein the disabled condition is determined by the training parameter server based on an importance of the target sub-feature; and the importance is determined by the training parameter server based on a difference in model loss when a target model is trained using the target sub-feature and when the target sub-feature is not used for training; If the feature value of the target sub-feature is stored in the memory space of the online parameter server, updating the feature value of the target sub-feature in the memory space to the target feature value; Based on the feature values of the sub-features of different categories stored in the memory space, determining the sub-features in the different categories that are in a disabled state; The memory corresponding to the disabled sub-feature is released in the memory space.
14. The method according to claim 13, characterized in that The determining, based on the feature values of the sub-features of different categories stored in the memory space, the sub-features of different categories that are in a disabled state includes: If the feature value of any sub-feature among the sub-features of different categories is a preset feature value within a preset time period, the sub-feature is determined as the sub-feature in the disabled state, and the preset feature value represents the feature value in the disabled state.
15. A memory data processing device based on model training, characterized in that: Suitable for training parameter servers, the device comprises: A model feature acquisition module is used to acquire different categories of sub-features of a target feature, where the target feature is a feature corresponding to feature extraction performed by the target model on the input data; an importance calculation module, used to determine the importance of the sub-feature based on the difference in model loss of the target model between a first training state and a second training state, wherein the first training state is a state in which the target model is trained using the sub-feature, and the second training state is a state in which the target model is not trained using the sub-feature; a disabled feature determination module, configured to determine a first disabled sub-feature among the sub-features of different categories based on the importance; A parameter memory release module, used to release the memory used to store the feature value of the first sub-feature in the memory space of the training parameter server; A model parameter updating module is used to update the model parameters of the target model based on the disabling conditions of the sub-features of different categories.
16. A memory data processing device based on model training, characterized in that: Applicable to an online parameter server, the device comprises: A read instruction sending module is used to send a feature value read instruction for a target sub-feature to a training parameter server; A feedback information receiving module, used to receive a target feature value of the target sub-feature fed back by the training parameter server, wherein the target feature value is fed back by the training parameter server based on a disabled condition of the target sub-feature; wherein the disabled condition is determined by the training parameter server based on an importance of the target sub-feature; and the importance is determined by the training parameter server based on a difference in model loss when a target model is trained using the target sub-feature and when the target sub-feature is not used for training; A feature value updating module, configured to update the feature value of the target sub-feature in the memory space to the target feature value if the feature value of the target sub-feature is stored in the memory space of the online parameter server; a disabled feature determination module, configured to determine, based on feature values of sub-features of different categories stored in the memory space, sub-features of different categories that are in a disabled state; The online memory release module is used to release the memory corresponding to the sub-feature in the disabled state in the memory space.
17. An electronic device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the memory data processing method based on model training as described in any one of claims 1 to 12, or executes the memory data processing method based on model training as described in any one of claims 13 to 14 by executing the computer instructions.
18. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, which are used to enable a computer to execute the memory data processing method based on model training as described in any one of claims 1 to 12, or to execute the memory data processing method based on model training as described in any one of claims 13 to 14.
19. A computer program product, characterized in that It includes computer instructions, which are used to enable a computer to execute the memory data processing method based on model training as described in any one of claims 1 to 12, or to execute the memory data processing method based on model training as described in any one of claims 13 to 14.
Citation Information
Patent Citations
Intention recognition method and electronic equipment
CN113377899A
Entity recognition model training method and device, equipment and entity recognition method
CN114048737A