A method and system for updating address translation cache based on RNN recurrent memory neural network
By using the address translation cache update method based on RNN recurrent memory neural network in PCIE storage devices, the problem of address translation cache update algorithm affecting hit rate in the prior art is solved, and higher hit rate and faster IO operations are achieved Speed, strong adaptability.
Patent Information
- Application Number
- CN202410876250.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-02
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-07-02
AI Technical Summary
The prior art address translation cache update algorithm affects the cache hit rate, resulting in a reduced system IO operation speed and difficulty in adapting to changes in complex environments.
The address translation cache update method based on RNN recurrent memory neural network is adopted to optimize the update of address translation cache by obtaining original address data, preprocessing and building data sets, training RNN neural network models and deploying them to the firmware of PCIE storage devices.
It improves the hit rate of address translation cache, improves the IO operation speed of computer systems, reduces the system load pressure, and the neural network model is highly adaptable and can adapt through retraining in a new environment.
Smart Images

Figure CN118642659B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of PCIE storage technology, and in particular to an address translation cache update method and system based on an RNN (recurrent memory neural network). Background Art
[0002] ATS (Address Translation Service) is an address translation service, centered on the CPU. Each device on the PCIe bus can apply to the host for the physical address mapping and other information corresponding to the virtual address through ATS. For some PCIE (Peripheral Component Interconnect Express) devices, before performing IO operations, the physical address corresponding to the virtual address will be first searched in the local address translation cache ATC (Address Translation Cache), and the address translation cache will be updated (translation cache update) when necessary. If the search is successful (i.e., hit), the physical address is used for IO operations. If the search fails, apply for address translation service from the host to obtain the corresponding physical address. Compared with using the hit physical address, it will increase latency and increase the burden on the host. The update algorithm of the address translation cache in the prior art will affect the hit rate of the address translation cache, and further affect the IO operation speed of the system, and it is difficult to adapt to changes in a complex environment. Summary of the invention
[0003] In order to solve the above problems, the present invention proposes an address translation cache update method and system based on RNN recurrent memory neural network.
[0004] In order to achieve the above object, the present invention is implemented by the following technical solutions:
[0005] The present invention provides an address translation memory update method based on RNN recurrent memory neural network, comprising the following operations:
[0006] Get the original address data;
[0007] Preprocess the original address data to obtain a data set;
[0008] Construct a neural network model and use the data set to train the neural network model, where the neural network model is an RNN recurrent memory neural network;
[0009] The trained neural network model is deployed to the firmware of the PCIE storage device to update the address translation cache.
[0010] A further improvement of the present invention is that the original address data is obtained, and the specific operations include:
[0011] In a computer system, multiple applications are randomly used to perform IO access to a PCIE storage device, and the virtual address data generated during the IO access is stored in the original address data in sequence.
[0012] A further improvement of the present invention is that: the original address data is preprocessed to obtain a data set, specifically including: storing the original address data in the address conversion cache in sequence, if the current original address data does not exist in the address conversion cache and the address conversion cache is not full, storing it in sequence; if the current original address data does not exist in the address conversion cache and the address conversion cache is full, updating the address data in the address conversion cache, if the current original address data already exists in the address conversion cache, skipping it; labeling each address data, and storing the address conversion cache data in the data set.
[0013] A further improvement of the present invention is that updating the address data in the address translation cache specifically includes:
[0014] Deleting one or more address data with the least number of appearances in the address translation cache;
[0015] Store the current one or more original address data into the address translation buffer.
[0016] A further improvement of the present invention is to label each address data, and the specific operation includes: after sorting the address data in the address conversion cache according to the number of occurrences, labeling the address data to be deleted as "needs to be updated" and labeling the retained address data as "does not need to be updated".
[0017] A further improvement of the present invention is that the RNN recurrent memory neural network adopts a sigmoid activation function and a cross entropy loss function, and before using a training set in a data set to train the RNN recurrent memory neural network, the address data in the data set is encoded, and the encoding method adopts segmented encoding, and data of a set length is randomly selected from the training set for multiple rounds and input into the RNN recurrent memory neural network for training, and the gradient descent method is used to update the weight parameters of the RNN recurrent memory neural network.
[0018] The present invention discloses an address conversion cache update system based on RNN recurrent memory neural network, the system comprising:
[0019] The original data acquisition module is used to acquire the original address data;
[0020] A data set acquisition module is used to pre-process the original address data to obtain a data set;
[0021] The model building and training module is used to build a neural network model and train the neural network model using a data set, where the neural network model is an RNN recurrent memory neural network;
[0022] The model deployment module is used to deploy the trained neural network model to the firmware of the PCIE storage device for address translation cache update.
[0023] A further improvement of the present invention is that the specific operation of the original data acquisition module includes: in the computer system, randomly using multiple application programs to perform IO access to the PCIE storage device, and storing the virtual address data generated during the IO access process into the original address data in sequence.
[0024] The further improvement of the present invention is that: the specific operation of the data set acquisition module includes: storing the original address data in the address conversion cache in order, if the current original address data does not exist in the address conversion cache and the address conversion cache is not full, storing in order; if the current original address data does not exist in the address conversion cache and the address conversion cache is full, updating the address data in the address conversion cache, if the current original address data already exists in the address conversion cache, skipping; labeling each address data, and storing the address conversion cache data in the data set;
[0025] Wherein, updating the address data in the address translation cache specifically includes:
[0026] Deleting one or more address data with the least number of appearances in the address translation cache;
[0027] Store the current one or more original address data into the address translation buffer;
[0028] The specific operation of labeling each address data includes: after sorting the address data in the address conversion cache according to the number of occurrences, labeling the address data to be deleted as "needs to be updated" and labeling the reserved address data as "does not need to be updated".
[0029] A further improvement of the present invention is that the RNN recurrent memory neural network adopts a sigmoid activation function and a cross entropy loss function, and before using a training set in a data set to train the RNN recurrent memory neural network, the address data in the data set is encoded, and the encoding method adopts segmented encoding, and data of a set length is randomly selected from the training set for multiple rounds and input into the RNN recurrent memory neural network for training, and the gradient descent method is used to update the weight parameters of the RNN recurrent memory neural network.
[0030] The beneficial effects of the present invention are: compared with the traditional ATC update algorithm, the present invention has a higher hit rate, improves the IO operation speed of the computer system, and reduces the load pressure of the computer system.
[0031] The neural network model of the present invention has strong adaptability and can adapt to new environments through retraining. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 It is a schematic diagram of the process of the present invention;
[0033] Figure 2 Schematic diagram of the RNN recurrent memory neural network structure in an embodiment of the present invention;
[0034] Figure 3 It is a schematic diagram of the RNN recurrent memory neural network prediction process in an embodiment of the present invention. DETAILED DESCRIPTION
[0035] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0036] The present invention discloses an address translation cache update method and system based on RNN recurrent memory neural network, which realizes the update of address translation cache of optimized PCIE storage device, and can be applied to NVME storage device with ATS function and PCIE interface, and runs in storage device firmware.
[0037] like Figure 1 The present embodiment is a method for updating an address translation cache based on an RNN recurrent memory neural network, comprising the following operations:
[0038] Step 1, obtain the original address data. In the computer system, multiple applications are randomly used to perform IO access to the PCIE storage device. During the IO access process, the address access of the PCIE storage device will generate a large amount of ordered virtual address data, which is in the billions. The virtual address is stored in the original address data in order.
[0039] Step 2, preprocessing the original address data to obtain a data set. The original address data is stored in the address conversion cache in order. If the current original address data does not exist in the address conversion cache, that is, there is no hit, and the address conversion cache is not full, the original address data is stored in the address conversion cache in order. If the current original address data already exists in the address conversion cache, the original address data is skipped. If the current original address data does not exist in the address conversion cache, and the address conversion cache is full, the address data in the address conversion cache is updated, including: deleting one or more address data with the least number of appearances in the address data in the address conversion cache, wherein no duplicate addresses will appear in the same address conversion cache, and the address cache size is limited; storing the current one or more original address data in the address conversion cache. Among them, the address data in the address conversion cache is sorted according to the number of appearances. While updating the data in the address conversion cache, a label is attached to each address data, and the label is divided into "need to be updated" (address data to be deleted) and "no need to update". And the labeled address conversion cache data is stored in the data set. Repeat the above operation to store a large amount of tagged address translation cache data in the data set in order. The same address data may exist in multiple address translation caches (assuming that each address translation cache contains 2000 address data, and different address translation caches correspond to each other before and after the update. If ten address data are deleted each time, 1990 address data are the same before and after the update), and the same address data may correspond to different labels.
[0040] Step 3: construct a neural network model and use the data set to train the neural network model. In this embodiment, the neural network model uses an RNN recurrent memory neural network. The network structure of the RNN recurrent memory neural network is as follows: Figure 2 As shown, the recurrent unit of the RNN recurrent memory neural network of this embodiment adopts a bidirectional GUR, wherein: is the input data, i.e. the labeled address data, s is the hidden layer output, o is the network output, U is the weight value input to the hidden layer, W is the weight value contributed by the hidden layer to the current hidden layer at the previous moment, and V is the weight value from the hidden layer to the output layer. Figure 3As shown, before the labeled address data in the data set is input into the neural network model, the address data is encoded, and the encoding method adopts segmented encoding. For example, a 32-bit 0x800014A4 address can be encoded as [0x80, 0x0, 0x14, 0xA4], that is, [128, 0, 20, 164], and is converted into an input vector input into the neural network model using an embedded method or onehot method (unique hot encoding). The weight parameters U, W, and V in the neural network model can be set according to the needs of computing power. The network output o corresponds to the update prediction of the address conversion cache, and the result is a floating point number from 0 to 1. A binary classification method is adopted, and 0 represents the need to update, that is, the result is less than 0.5, and 1 represents no update, that is, the result is greater than or equal to 0.5. The neural network model of this embodiment adopts a sigmoid activation function and a cross entropy loss function.
[0041] The data set is divided into a training set and a test set according to a set ratio. Data of a set length is randomly selected from the training set in multiple rounds and input into the neural network model. The model weight parameters are updated using the gradient descent method, and the test set is used for testing. The training is completed when the training loss and the test loss drop to a stable level, that is, when they no longer drop.
[0042] Step 4, deploy the neural network model. Deploy the trained neural network model to the firmware of the PCIE storage device. When the PCIE storage device performs IO operations, address conversion (address translation) is performed, and when the address conversion cache data is to be updated, that is, the address conversion cache is full, some address data needs to be deleted, and the trained neural network model is used for predictive update. The address data predicted as "needs to be updated" is updated, that is, deleted. Among them, if the address data predicted as "needs to be updated" exceeds the number of address data set to be updated, the address data "closer to 0" is updated first.
[0043] In the new environment, repeat the above steps, that is, use the data set obtained in the new environment to train the neural network model again, and deploy the trained neural network model to the new environment.
[0044] The above method is implemented by an address translation cache update system based on an RNN recurrent memory neural network in this embodiment, and the system includes:
[0045] The original data acquisition module is used to acquire the original address data;
[0046] A data set acquisition module is used to pre-process the original address data to obtain a data set;
[0047] Model building and training module, used to build neural network model and train the neural network model using data set;
[0048] The model deployment module is used to deploy the trained neural network model to the firmware of the PCIE storage device for address translation cache update.
[0049] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as those generally understood by those skilled in the art in the art to which the present invention belongs. It should also be understood that terms such as those defined in common dictionaries should be understood to have the same meaning as in the context of the prior art, and will not be interpreted with an idealized or overly formal meaning unless defined similarly here.
[0050] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for updating an address translation cache based on an RNN recurrent memory neural network, characterized in that: The following operations are included: Get the original address data; Preprocess the original address data to obtain a data set; Construct a neural network model and use the data set to train the neural network model, where the neural network model is an RNN recurrent memory neural network; Deploy the trained neural network model to the firmware of the PCIE storage device to update the address translation cache; The preprocessing of the original address data to obtain the data set specifically includes: storing the original address data in the address conversion cache in order, if the current original address data does not exist in the address conversion cache and the address conversion cache is not full, storing in order; if the current original address data does not exist in the address conversion cache and the address conversion cache is full, updating the address data in the address conversion cache, if the current original address data already exists in the address conversion cache, skipping; labeling each address data, and storing the address conversion cache data in the data set; The updating of the address data in the address translation cache specifically includes: Deleting one or more address data with the least number of appearances in the address translation cache; Store the current one or more original address data into the address translation buffer; The specific operation of labeling each address data includes: after sorting the address data in the address translation cache according to the number of occurrences, labeling the address data to be deleted with "need to be updated" and labeling the reserved address data with "no need to be updated".
2. The address translation cache update method based on RNN recurrent memory neural network according to claim 1 is characterized in that: The specific operations of obtaining the original address data include: In a computer system, multiple applications are randomly used to perform IO access to a PCIE storage device, and the virtual address data generated during the IO access is stored in the original address data in sequence.
3. The address translation cache update method based on RNN recurrent memory neural network according to claim 1 is characterized in that: The RNN recurrent memory neural network adopts a sigmoid activation function and a cross entropy loss function. Before using the training set in the data set to train the RNN recurrent memory neural network, the address data in the data set is encoded. The encoding method adopts segmented encoding. Data of a set length is randomly selected from the training set for multiple rounds and input into the RNN recurrent memory neural network for training, and the weight parameters of the RNN recurrent memory neural network are updated using the gradient descent method.
4. An address translation cache update system based on RNN recurrent memory neural network, characterized in that: The system comprises: The original data acquisition module is used to acquire the original address data; A data set acquisition module is used to pre-process the original address data to obtain a data set; The model building and training module is used to build a neural network model and train the neural network model using a data set, where the neural network model is an RNN recurrent memory neural network; A model deployment module is used to deploy the trained neural network model to the firmware of the PCIE storage device to update the address translation cache; The specific operation of the data set acquisition module includes: storing the original address data in the address conversion cache in order, if the current original address data does not exist in the address conversion cache and the address conversion cache is not full, storing it in order; if the current original address data does not exist in the address conversion cache and the address conversion cache is full, updating the address data in the address conversion cache, if the current original address data already exists in the address conversion cache, skipping; labeling each address data, and storing the address conversion cache data in the data set; Wherein, updating the address data in the address translation cache specifically includes: Deleting one or more address data with the least number of appearances in the address translation cache; Store the current one or more original address data into the address translation buffer; The specific operation of labeling each address data includes: after sorting the address data in the address translation cache according to the number of occurrences, labeling the address data to be deleted with "need to be updated" and labeling the reserved address data with "no need to be updated".
5. The address translation cache update system based on RNN recurrent memory neural network according to claim 4 is characterized in that: The specific operation of the original data acquisition module includes: in the computer system, randomly using multiple application programs to perform IO access to the PCIE storage device, and storing the virtual address data generated during the IO access process into the original address data in sequence.
6. The address translation cache update system based on RNN recurrent memory neural network according to claim 4 is characterized in that: The RNN recurrent memory neural network adopts a sigmoid activation function and a cross entropy loss function. Before using the training set in the data set to train the RNN recurrent memory neural network, the address data in the data set is encoded. The encoding method adopts segmented encoding. Data of a set length is randomly selected from the training set for multiple rounds and input into the RNN recurrent memory neural network for training, and the weight parameters of the RNN recurrent memory neural network are updated using the gradient descent method.
Citation Information
Patent Citations
DNN SSD system and method for optimizing performance of solid-state drive using deep neural network
CN110389909A
Cache prefetching method and system based on NVM hybrid memory
CN111143243A