WO2022089607A1 - Parameter server node recovery method and recovery system - Google Patents

Parameter server node recovery method and recovery system Download PDF

Info

Publication number
WO2022089607A1
WO2022089607A1 PCT/CN2021/127609 CN2021127609W WO2022089607A1 WO 2022089607 A1 WO2022089607 A1 WO 2022089607A1 CN 2021127609 W CN2021127609 W CN 2021127609W WO 2022089607 A1 WO2022089607 A1 WO 2022089607A1
Authority
WO
WIPO (PCT)
Prior art keywords
level
level storage
module
parameter
hash map
Prior art date
Application number
PCT/CN2021/127609
Other languages
French (fr)
Chinese (zh)
Inventor
陈宬
刘一鸣
杨俊�
王冀
王艺霖
石光川
卢冕
Original Assignee
第四范式(北京)技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 第四范式(北京)技术有限公司 filed Critical 第四范式(北京)技术有限公司
Publication of WO2022089607A1 publication Critical patent/WO2022089607A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1438Restarting or rejuvenating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • G06F11/1469Backup restoration techniques

Definitions

  • the present disclosure relates to the field of computer technology, and more particularly, to a recovery method and recovery system of a parameter server node.
  • Parameter Server is a programming framework used to facilitate the writing of distributed parallel programs, with the emphasis on distributed storage and collaboration support for large-scale parameters.
  • the online parameter server is mainly used to store the trained super-large-scale parameters and provide high-concurrency and high-availability model parameter query services for online services.
  • the traditional parameter server based on DRAM memory has two problems in the deployment process. The first is the increase of the overall hardware cost caused by the huge memory consumption. The second is that when any node in the parameter server cluster fails and goes offline, The recovery process is time-consuming.
  • Exemplary embodiments of the present disclosure may at least partially solve the above-mentioned problems.
  • a system comprising at least one computing device and at least one storage device storing instructions, wherein the instructions, when executed by the at least one computing device, cause the at least one computing device to A method for restoring a parameter server node is executed, wherein the parameter server node is a node in a parameter server cluster, and the parameter server node is a parameter server node based on non-volatile memory, and the non-volatile memory of the parameter server node
  • the model parameters of each model stored in the volatile memory are logically divided into at least one-level storage sub-modules, and the recovery method includes: after the parameter server node restarts
  • the stored first-layer data is obtained from the flexible memory, wherein the first-layer data includes the parameter server node header information, and the first-layer data is used to query the node information of the parameter server node and the first-level storage sub-module information ; Based on the first-layer data, obtain each first-level storage submodule header information in the stored second
  • Model parameters where M is the number of first-level storage submodules stored on the parameter server node; based on the header information of each first-level storage submodule, traverse each first-level storage in the second-level data Submodule hash map information to restore model parameters stored on the parameter server node.
  • a method for restoring a parameter server node wherein the parameter server node is a node in a parameter server cluster, and the parameter server node is a non-volatile memory-based parameter server node, the model parameters of each model stored in the non-volatile memory of the parameter server node are logically divided into at least one-level storage sub-modules, and the recovery method includes: after the parameter server node restarts, The stored first-layer data is obtained from the non-volatile memory of the parameter server node, wherein the first-layer data includes parameter server node header information, and the first-layer data is used to query the parameter server node Node information and first-level storage submodule information; based on the first-level data, obtain each first-level storage submodule in the stored second-level data from the non-volatile memory of the parameter server node Header information, wherein the second-layer data includes M first-level storage submodule header information and M first-level storage sub
  • each first-level storage sub-module where M is the number of first-level storage sub-modules stored on the parameter server node; based on the header information of each first-level storage sub-module, traverse the second
  • Each first level in the layer data stores submodule hash map information to restore model parameters stored on the parameter server node.
  • a system for restoring a parameter server node wherein the parameter server node is a node in a parameter server cluster, and the parameter server node is a non-volatile memory-based parameter server node, the model parameters of each model stored in the non-volatile memory of the parameter server node are logically divided into at least one-level storage sub-modules, and the recovery device includes: a first acquisition device, configured as: After the parameter server node is restarted, the stored first-layer data is acquired from the non-volatile memory of the parameter server node, wherein the first-layer data includes parameter server node header information, and the first-layer data for querying node information and first-level storage submodule information of the parameter server node; a second acquiring device is configured to: based on the first-level data, obtain information from the non-volatile memory of the parameter server node Obtain the header information of each first-level storage submodule in the stored second-level data,
  • the second layer data is used to query the model parameters stored in each first-level storage submodule of the parameter server node, wherein M is the number of first-level storage submodules stored on the parameter server node
  • the recovery device is configured to: based on the header information of each first-level storage sub-module, traverse each first-level storage sub-module hash map information in the second-level data to recover the parameter server node. Stored model parameters.
  • a computer-readable storage medium storing instructions, wherein the instructions, when executed by at least one computing device, cause the at least one computing device to perform a parameter server node's operation according to the present disclosure. recovery method.
  • an electronic device comprising: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the present disclosure The recovery method of the parameter server node.
  • the model parameters are stored on the parameter server based on non-volatile memory instead of the parameter server based on DRAM, which greatly reduces the hardware cost.
  • the model parameter logical storage structure and data physical storage structure are designed, the model parameters are logically hierarchically stored, and the data is stored in two layers on the non-volatile memory. Meet the high concurrency and high availability requirements of the parameter server.
  • the rapid recovery process after restart is designed. According to the data structure of the two-tier storage, all parameters stored on the parameter server node can be easily and quickly queried and restored, achieving the effect of millisecond-level recovery.
  • FIG. 1 is a schematic diagram illustrating a conventional parameter server cluster architecture.
  • FIG. 2 is a schematic diagram illustrating a node failure of a conventional parameter server cluster.
  • FIG. 3 is a flowchart illustrating a storage method of model parameters according to an exemplary embodiment of the present disclosure.
  • FIG. 4 is a schematic diagram illustrating a logical storage structure of model parameters according to an exemplary embodiment of the present disclosure.
  • FIG. 5 is a schematic diagram illustrating a data physical storage structure of a parameter server node according to an exemplary embodiment of the present disclosure.
  • FIG. 6 is a schematic diagram illustrating a data physical storage structure of a parameter server node according to another exemplary embodiment of the present disclosure.
  • FIG. 7 is a schematic diagram illustrating a data physical storage structure of a parameter server node according to another exemplary embodiment of the present disclosure.
  • FIG. 8 is a flowchart illustrating a recovery method of a parameter server node according to an exemplary embodiment of the present disclosure.
  • FIG. 9 is a flowchart illustrating a recovery method of a parameter server node according to an exemplary embodiment of the present disclosure.
  • FIG. 10 is a block diagram illustrating a storage system of model parameters according to an exemplary embodiment of the present disclosure.
  • FIG. 11 is a block diagram illustrating a recovery system of a parameter server node according to an exemplary embodiment of the present disclosure.
  • This type of AI application has two characteristics.
  • the first feature is the super-high dimensionality of the model.
  • Each dimension of the model corresponds to a parameter, a model that can handle massive data, and the dimensions can reach hundreds of millions of dimensions or even a billion dimensions. This also means that we need to store hundreds of millions or even billions of parameters for each model. So we need to use an online parameter server to store these parameters.
  • the second feature is real-time. Taking anti-fraud as an example, it often takes a few milliseconds from the generation of the user's card swiping behavior to the final prediction result given by the model.
  • FIG 1 is a schematic diagram showing the existing parameter server cluster architecture.
  • the storage sub-module Storage 3 of Model 1 (Model 1) can prepare three copies of the same content and store them on three server nodes (PS Node 1, PS Node 2, PS Node 3), this can ensure that online services can still be performed after one or two servers fail to go offline.
  • Another advantage of multiple replicas is that multiple online replicas can share the access pressure, thereby increasing the access bandwidth of the overall parameter server.
  • DRAM-based parameter servers have two pain points during deployment.
  • the first is the increase in overall hardware cost caused by huge memory consumption.
  • the capacity of a single DRAM is limited, generally 16G, or 32G, which also causes the parameter server to store model parameters in a cluster of multiple machines to meet memory requirements.
  • the aforementioned multi-copy mechanism increases the memory overhead and cost.
  • the second pain point is also the pain point of all DRAM-based memory systems.
  • DRAM-based parameter server node recovery requires: 1. Read all parameters from the slow storage HDFS disk, 2. Transfer these parameters to the restarted parameter server node through the network, 3. Rebuild all parameters in DRAM structure, and insert these parameters into the HashMap (hash map) data structure in DRAM.
  • HashMap hash map
  • FIG. 2 is a schematic diagram showing a node failure of a conventional parameter server cluster.
  • the parameter server uses multiple copies to share the access pressure of the system. This also means that when a node (PS Node 2) goes offline and recovers, the overall throughput of the system will also decrease, and the longer the system recovers, the longer the overall throughput of the system will decrease.
  • PS Node 2 a node
  • the present disclosure proposes a novel model parameter storage method and a novel parameter server node recovery method.
  • NVM non-volatile memory
  • DRAM dynamic random access memory
  • the present disclosure proposes that non-volatile memory (NVM) can be used instead of DRAM to realize a method for storing model parameters on a parameter server node based on non-volatile memory. It brings the possibility of rapid recovery of parameter server nodes. This is because, for a parameter server node based on non-volatile memory, all parameters will not be lost after restarting and are still stored in the non-volatile memory. Therefore, the above three-step recovery process can be omitted.
  • NVM generally refers to memory that can store data in the event of a power failure.
  • New-generation NVMs such as STT-RAM, PCM, ReRAM, 3D xPoint, etc.
  • new-generation NVMs and first-generation NVMs such as Flash Memory
  • the present disclosure proposes a storage structure for model parameters in a non-volatile memory in a non-volatile memory-based parameter server node.
  • the model parameters corresponding to each model stored on each parameter server node may be logically divided into at least one level of storage sub-modules.
  • the adjacent upper-level storage sub-modules include at least one lower-level storage sub-module.
  • Hierarchical storage of model parameters is conducive to the management and query of model parameters, to meet the requirements of high concurrent access, and more conducive to traversal and query of model parameters when the parameter server node is restored.
  • the present disclosure also proposes a new data organization form. Specifically, in the non-volatile memory of the parameter server node based on non-volatile memory, the data is divided into two layers of storage, the first layer of data is stored in two layers. The ID information of a single parameter server node and the ID information of all the first-level storage submodules on the parameter server node can be recorded.
  • the second-level data can use a hash map (HashMap) for each first-level storage sub-module to store specific model parameters.
  • the second-level data also includes the first-level storage sub-module header information for query use during fast recovery.
  • the present disclosure also proposes a new recovery process.
  • the parameter server node When the parameter server node restarts, it can quickly traverse the data stored in the parameter server node according to the first layer data and the second layer data stored in the non-volatile memory.
  • the sub-modules are stored at all levels, so that all model parameters stored in the parameter server node can be quickly restored, and the millisecond-level recovery of the parameter server node based on non-volatile memory can be realized.
  • the method and system for storing model parameters and the method and system for restoring parameter server nodes according to the present disclosure will be described in detail below with reference to FIGS. 3 to 11 .
  • FIG. 3 is a flowchart illustrating a storage method of model parameters according to an exemplary embodiment of the present disclosure.
  • model parameters of at least one model may be acquired.
  • the model can be an AI model with high dimensions, for example, a recommendation model, a credit card anti-fraud model, etc.
  • Massive historical data can be put into the offline training system to train the AI model, and the trained AI model can be deployed to the online inference system for use.
  • Each dimension of an AI model corresponds to a parameter.
  • An AI model that can process massive data can reach hundreds of millions of dimensions or even a billion dimensions, so each model may store hundreds of millions or even billions of parameters.
  • the model parameters here can refer to parameters before training or during training, and can also refer to parameters after training is completed.
  • model parameters of the at least one model may be stored in a parameter server cluster, wherein the parameter server cluster includes a plurality of non-volatile memory-based parameter server nodes.
  • the parameter server cluster may be an offline parameter server cluster for training, or an online parameter server cluster for inference.
  • the model parameters of each model in the at least one model may be distributedly stored in the non-volatile memory of the plurality of non-volatile memory-based parameter server nodes medium; for each non-volatile memory-based parameter server node, the model parameters corresponding to each model stored on the parameter server node are logically divided into at least one-level storage sub-modules for storage.
  • the model parameters of each model in the at least one model may be logically divided into a plurality of storage modules (for example, the following first-level storage sub-modules), and the divided storage modules are distributed and stored into the non-volatile memory of the plurality of non-volatile memory-based parameter server nodes.
  • each storage module may be further divided into at least one level of storage sub-modules (for example, the following second level of storage sub-modules). modules, tertiary storage submodules, etc.).
  • FIG. 4 is a schematic diagram illustrating a logical storage structure of model parameters according to an exemplary embodiment of the present disclosure.
  • PS Node X parameter server node
  • FIG. 4 only the model parameter storage structure on one parameter server node (ie, PS Node X) in the parameter server cluster is exemplarily shown, and other parameter server nodes can store model parameters in the same or similar manner .
  • Each model can be logically divided into multiple storage sub-modules (eg, Storage), and these storage sub-modules can be hashed to multiple parameter server nodes.
  • Multiple storage submodules stored in a parameter server node may belong to different models. For example, Storage 1 and Storage 3 in Figure 4 belong to Model 1 (Model 1), and Storage 24 belongs to Model 2 (Model2).
  • Storage storage submodule For a Storage storage submodule, it can also be divided into multiple next-level storage submodules (for example, shards). Each shard is responsible for storing specific model parameters. Value pairs are stored in shards, and each shard only stores a part of the model's parameters to share the load.
  • FIG. 4 only shows that the model parameters are logically divided into two levels of storage sub-modules (Storage and Shard) for storage, but the present disclosure is not limited to this. According to the present disclosure, the model parameters are logically divided into storage sub-modules of any level. module.
  • model parameters can be logically divided into only one-level storage sub-modules (such as Storage), and specific model parameters are stored under each Storage, or model parameters can be logically divided into three-level storage sub-modules, that is, , after Storage and Shard, each shard can be further divided into multiple third-level storage sub-modules, and specific model parameters are stored in each third-level storage sub-module, and so on.
  • storage such as Storage
  • model parameters can be logically divided into three-level storage sub-modules, that is, , after Storage and Shard, each shard can be further divided into multiple third-level storage sub-modules, and specific model parameters are stored in each third-level storage sub-module, and so on.
  • the first-tier data and the second-tier data may be stored in the non-volatile memory of each non-volatile memory-based parameter server node.
  • FIG. 5 is a schematic diagram illustrating a data physical storage structure of a parameter server node according to an exemplary embodiment of the present disclosure.
  • a parameter server node on the non-volatile memory of the parameter server node, there will be two layers of data storage, such as the first layer and the second layer shown in Figure 5).
  • the first-level data for storing the information of the current node
  • M storages in the second-level data for storing M first-level storage sub-nodes respectively.
  • Module specific information The first layer data and the second layer data according to an exemplary embodiment of the present disclosure will be described in detail below.
  • parameter server node header information may be stored for querying the node information and first-level storage sub-module information of the parameter server node.
  • the node information can be the ID information (Node ID) of the parameter server node.
  • the parameter server cluster will assign an ID to each parameter server, and the ID is unique. Therefore, by obtaining the ID information of the parameter server node, it can be determined which parameter server node in the parameter server cluster it is.
  • the first-level storage submodule information may be the ID information list (Storage ID List) of all first-level storage submodules (Storage) stored on the parameter server node.
  • the IDs of the storage submodules eg, Storage ID, Shard ID
  • S1R1 Storage 1, Shard 1
  • Model 2 there will also be S1R1, S1R2, S2R1, S2R2... of Model 2.
  • the first-level storage submodule ID included in the first-level storage submodule ID list may be composed of the model ID and the first-level storage submodule ID in the corresponding model, for example, the first-level storage submodule ID
  • the list of primary storage sub-module IDs can include Model 1Storage 0, Model 1Storage 3, Model 2Storage 1.
  • the first-level storage submodule ID list can be stored in the first-level data in the form of a persistent list, which ensures that model parameters can be inserted into non-volatile memory.
  • the first layer data (ie, parameter server node header information) can be stored in the non-volatile memory of the parameter server node as the root of the storage of the entire non-volatile memory-based parameter server node. Fixed location in the parameter server node to facilitate query when performing fast recovery.
  • M pieces of first-level storage sub-module header information and M pieces of first-level storage sub-module hash map (HashMap) information may be stored.
  • the second-level data can be used to query the model parameters stored in each first-level storage sub-module of the parameter server node. For example, for each first-level storage submodule, a corresponding non-volatile memory storage pool may be newly created in the second-level data storage for separate storage.
  • the first-level storage sub-module header information may be allocated three spaces, which are respectively used to store the first-level storage sub-module ID (Storage ID), the first-level storage sub-module ID The version information (Version) of the model parameters stored in the module, and the pointer (Shard HashMap Pointer) of the first-level storage sub-module to the next-level hash map.
  • Storage ID the first-level storage sub-module ID
  • the version information Version
  • the pointer Shard HashMap Pointer
  • the header information of the first-level storage sub-module points to the hash map of the next level.
  • the pointer may be a Shard HashMap Pointer, but the present disclosure is not limited thereto.
  • the pointer to the next-level hash map in the header information of the first-level storage sub-module may point to the model parameter hash map Pointer (for example, Para HashMap Point).
  • the first-level storage sub-module hash mapping information may include the hash map of each level of storage sub-modules from the second-level to the Nth-level storage sub-module under the first-level storage sub-module.
  • the key of the hash map of each level of storage sub-module is the ID of this level of storage sub-module
  • the value is the pointer to the next level of hash map
  • the key of the model parameter hash map is the parameter name
  • the value is the parameter value
  • the hash map of each level of storage sub-module and the model parameter hash map are linked by the corresponding pointer to the next level of hash map of this level of storage sub-module or the upper-level storage sub-module of this model parameter.
  • the model parameters are divided into secondary storage sub-modules (Storage and Shard) for storage. Therefore, the hash map information of the first-level storage submodule may include the hash map (Shard HashMap) of the second-level storage submodule and the model parameter hash map (Para HashMap) under each second-level storage submodule.
  • the key is the second-level storage sub-module ID (Shard ID)
  • the value is the pointer to the hash map of the model parameters (Para HashMap Point).
  • the key is the parameter name (Para ID) and the value is the parameter value (Value).
  • each level is linked by the pointer of the previous level to the hash map of the next level. That is, the pointer to the next-level hash map in the header information of the first-level storage sub-module points to the second-level storage sub-module hash map, and the pointer in the second-level storage sub-module hash map points to the next level.
  • model parameter hash map under one second-level storage sub-module (Shard 0), but other second-level storage sub-modules also have model parameter hash maps.
  • Shard 0 the model parameter hash map under one second-level storage sub-module
  • FIG. 5 only exemplarily shows the model parameter hash map under one second-level storage sub-module (Shard 0), but other second-level storage sub-modules also have model parameter hash maps.
  • the present disclosure is not limited to the illustration shown in FIG. 5 .
  • FIG. 6 is a schematic diagram illustrating a data physical storage structure of a parameter server node according to another exemplary embodiment of the present disclosure.
  • the hash map information of each first-level storage sub-module includes the model parameter hash map (Par HashMap), the pointer to the next-level hash map in the header information of the first-level storage submodule is the pointer to the model parameter hash map (Para HashMap Point).
  • the first-level storage submodule header information and the model parameter hash map are linked by a pointer to the model parameter hash map.
  • FIG. 7 is a schematic diagram illustrating a data physical storage structure of a parameter server node according to another exemplary embodiment of the present disclosure.
  • the hash map information of each first-level storage sub-module includes each The hash map (Shard HashMap) of the secondary storage sub-module, the hash map (Slice HashMap) of each third-level storage sub-module under each second-level storage sub-module, and the model under each third-level storage sub-module Parameter hash map (Para HashMap).
  • the pointer to the next-level hash map in the header information of the first-level storage sub-module is a pointer to the second-level storage sub-module hash map (Shard HashMap Point), and the pointer in the second-level storage sub-module hash map points to
  • the pointer of the next-level hash map is the pointer to the third-level storage sub-module hash map (Slice HashMap Point)
  • the pointer to the next-level hash map in the third-level storage sub-module hash map is the pointer to the model
  • the pointer to the parameter hash map (Para HashMap Point).
  • each level is pointed to by its previous level
  • the pointers of the next-level hash map are linked, that is, the pointer to the next-level hash map in the header information of the first-level storage sub-module points to the second-level storage sub-module hash map, and the second-level storage sub-module
  • the pointer to the next-level hash map in the hash map points to the third-level storage sub-module hash map, and the pointer to the next-level hash map in the third-level storage sub-module hash map points to the hash map of the model parameters. Hi map.
  • FIG. 7 only exemplarily shows the hash map of the third-level storage sub-module under one second-level storage sub-module (Shard 0) and the hash map of the model parameters under one third-level storage sub-module (Slice0).
  • second-level storage sub-modules also have hash maps of third-level storage sub-modules
  • other third-level storage sub-modules also have hash maps of model parameters.
  • model parameters can be divided into storage sub-modules of any level.
  • model parameters are divided into storage sub-modules of any level, according to the logic of the above examples, the storage and construction of the first One layer of data and second layer of data.
  • a parameter of a specified model in the at least one model can be queried from a non-volatile memory-based parameter server cluster, and a corresponding model estimation service can be provided based on the queried parameter of the specified model .
  • the parameter server node ID of the parameter storage and the storage sub-module ID of each level can be determined, and the parameter server node can be found according to the determined parameter server node ID, and according to the storage sub-module ID of each level, based on finding The second-level data on the parameter server node of , find the parameter value corresponding to the parameter name.
  • the process of parameter query is that the user provides the parameter name (for example, Para0 in the last layer), and the parameter server node will return the process of the value corresponding to Para0.
  • For the corresponding storage in the second-level data find the corresponding shard hash map according to the pointer to the shard hash map in the first-level storage sub-module header signal in the corresponding storage, and in the corresponding shard hash map, according to Shard ID finds the corresponding pointer to the model parameter hash map, finds the corresponding model parameter hash map according to the pointer to the model parameter hash map, and in the model parameter hash map, finds the corresponding parameter value value according to the parameter name Para0 .
  • writing parameters only occurs when a new model comes online.
  • the process of writing parameters is similar to the process of querying parameters, with two differences.
  • the parameters of Para0 When writing a new value of Para0, the parameters of Para0 will be inserted into the new Storage 0 new under Shard 1. in HashMap.
  • the parameter query service will be switched to the new parameters.
  • the backend thread will slowly reclaim the space of the parameters of the old model.
  • the second point is that when the new Para0 is written to the HashMap under Storage 0 new, the CPU instruction (such as clflushopt+mfence) can be used to ensure that the parameter data written each time is written to the NVM instead of the volatile CPU high-speed in the cache.
  • the CPU instruction such as clflushopt+mfence
  • FIG. 8 is a flowchart illustrating a recovery method of a parameter server node according to an exemplary embodiment of the present disclosure.
  • the recovery method of the parameter server node according to the exemplary embodiment of the present disclosure is suitable for the situation that the parameter server node described above with reference to FIG. 3 needs to be restarted due to a failure or the like.
  • the stored first-layer data may be obtained from the non-volatile memory of the parameter server node.
  • the first-level data can parameterize the server node header information, which is used to query the parameter server node's node information and the first-level storage sub-module information.
  • the parameter server node header information may include a parameter server node ID and a list of first-level storage submodule IDs. Therefore, it can be determined which parameter server node in the parameter server cluster the restarted parameter server node is according to the parameter server node ID in the parameter server node header, and the restart can be determined according to the first-level storage submodule ID list in the parameter server node header. All first-level storage submodules included in the parameter server node.
  • the first tier data may be stored at a fixed location in the non-volatile memory of the parameter server node. Therefore, the first layer of data can be read from a fixed location in the non-volatile memory of the parameter server node. In this way, after the parameter server node is restarted, the storage information of the parameter server node can be quickly queried from the parameter server node.
  • the first-level storage submodule IDs included in the first-level storage submodule ID list may be composed of a model ID and a first-level storage submodule ID in a corresponding model.
  • each first-level storage sub-module header information in the stored second-level data may be acquired from the non-volatile memory of the parameter server node based on the first-level data.
  • the second-level data can include M first-level storage sub-module header information and M first-level storage sub-module hash mapping information, and the second-level data is used to query each first-level storage of the parameter server node.
  • the first-level storage sub-module header information may include the first-level storage sub-module ID, version information of model parameters stored by the first-level storage sub-module, and the first-level storage sub-module The module's pointer to the next level hash map. Therefore, after acquiring the first data, all the first-level storage sub-module IDs of the parameter server node can be determined based on the ID list of the first-level storage sub-modules, and then based on the IDs of all the first-level storage sub-module IDs of the parameter server node For each first-level storage sub-module ID, the header information of the first-level storage sub-module with the corresponding first-level storage sub-module ID is acquired. Therefore, the respective first-level storage sub-module header information of all (M) first-level storage sub-modules stored on the parameter server node can be obtained.
  • all (M) first-level storage sub-modules also have respective first-level storage sub-module hash map information.
  • Each first-level storage sub-module may be associated with its first-level storage sub-module hash map information based on a pointer to the next-level hash map in its first-level storage sub-module header information.
  • the hash map information of each first-level storage sub-module may include the hash map of each level of storage sub-modules from the second-level to the N-th level storage sub-module under the first-level storage sub-module, and the hash map of the first-level storage sub-module.
  • Hash mapping of model parameters under each of the Nth-level storage sub-modules under the first-level storage sub-module where N is the number of stages of the storage sub-modules into which the model parameters are divided.
  • the key of the hash map of each level of storage sub-module is the ID of the level of storage sub-module, and the value is a pointer to the next level of hash map.
  • the key of the model parameter hash map is the parameter name and the value is the parameter value.
  • the hash map of each level of storage submodule and the model parameter hash map are linked through the corresponding pointer to the next level of the hash map of this level of storage submodule or the previous level of this model parameter storage submodule, for example, as shown in the figure 5 to Figure 7.
  • step 803 based on the header information of each first-level storage sub-module, the hash map information of each first-level storage sub-module in the second-level data can be traversed to restore the model parameters stored on the parameter server node.
  • the following operations may be performed for each first-level storage sub-module: search the next-level hash map through the corresponding pointer of the previous-level storage sub-module to the next-level hash map until the next-level hash map is searched.
  • the model parameter hash map is searched; based on the model parameter hash map, the model parameters are restored.
  • the hash map information of each first-level storage sub-module includes each second-level storage sub-module under the first-level storage sub-module.
  • the pointer of the next-level hash map is the pointer to the hash map of the second-level storage submodule (Shard HashMap Point)
  • the key of the hash map of each second-level storage submodule is the second-level storage submodule.
  • ID (Shard ID)
  • the value is a pointer (Para HashMap Point) to the model parameter hash map under the second-level storage submodule.
  • the second-level storage submodule When performing recovery, for each first-level storage submodule, the second-level storage submodule can be searched for through the pointer (Shard HashMap Point) in the header information of the first-level storage submodule that points to the hash map of the second-level storage submodule.
  • Shard HashMap for storing submodules. In this regard, it is possible to check whether the hash map data of the second-level storage submodule is complete, and restore all the data of the hash map of the second-level storage submodule.
  • the model parameter hash map under all the second-level storage sub-modules can be searched, thereby restoring All second level stores model parameters under submodules.
  • the hash map information of each first-level storage submodule includes the model parameter hash under the first-level storage submodule.
  • Map (Para HashMap)
  • the pointer to the next-level hash map in the header information of the first-level storage submodule is a pointer to the model parameter hash map (Para HashMap Point).
  • the model parameter hash map (Para HashMap )
  • restoring the model parameters under each first-level storage submodule When performing recovery, for each first-level storage sub-module, the model parameter hash map (Para HashMap ), thereby restoring the model parameters under each first-level storage submodule.
  • the hash map information of each first-level storage sub-module includes each second-level storage sub-module under the first-level storage sub-module.
  • the hash map of the sub-module (Shard HashMap), the hash map of each third-level storage sub-module under each second-level storage sub-module (Slice HashMap), and the model parameter hash under each third-level storage sub-module Map (Para HashMap).
  • the pointer to the next-level hash map in the header information of the first-level storage sub-module is a pointer to the second-level storage sub-module hash map (Shard HashMap Point), and the pointer in the second-level storage sub-module hash map points to
  • the pointer of the next-level hash map is the pointer to the third-level storage sub-module hash map (Slice HashMap Point)
  • the pointer to the next-level hash map in the third-level storage sub-module hash map is the pointer to the model
  • the pointer to the parameter hash map (Para HashMap Point).
  • the second-level storage can be searched through the pointer (Shard HashMap Point) in the header information of the first-level storage submodule to the hash map of the second-level storage submodule.
  • Shard HashMap for submodules. In this regard, it is possible to check whether the hash map data of the second-level storage submodule is complete, and restore all the data of the hash map of the second-level storage submodule.
  • model parameters can be divided into storage sub-modules of any level, and in the case where the model parameters are divided into storage sub-modules of any level, the recovery process can be performed according to the logic of the above examples, analogically Restoration of model parameters.
  • the model parameters stored in the parameter server node are out of date. Therefore, when the model parameter version information in the header information of the first-level storage sub-module in the second-layer data is obtained, it can be determined whether the model parameters stored in the parameter server node are the latest version based on the model parameter version information, and according to the determination The result then decides whether to perform recovery.
  • FIG. 9 is a flowchart illustrating a recovery method of a parameter server node according to an exemplary embodiment of the present disclosure.
  • steps 901 and 902 in FIG. 9 perform the same operations as 801 and 802 in FIG. 8 , and thus will not be repeated here.
  • the version information in the first-level storage sub-module header information and the first-level storage sub-module header information stored on the parameter server cluster metadata node can be Compare the latest version information of the level storage sub-module.
  • the parameter server cluster metadata node is a server that stores global metadata information of the parameter server cluster, such as zoomkeeper.
  • the latest version numbers corresponding to all the first-level storage submodules of each model can be recorded in the metadata node.
  • the version of the first-level storage submodule will be incremented by 1 on the metadata node.
  • step 903 in the case where the model parameter version information in the header information of the first-level storage submodule is consistent with the model parameter version information stored on the metadata node of the parameter server cluster, the recovery is performed, that is, referring to Fig. Step 803 described in 8 will not be repeated here.
  • step 904 in the case where the model parameter version information in the header information of the first-level storage sub-module is inconsistent with the model parameter version information stored on the metadata node of the parameter server cluster, the recovery is not performed, and the back-end storage system Pull the latest version of the model parameters (for example, HDFS) and insert the parameter server node.
  • the backend storage system can store the latest version of the model parameters.
  • FIG. 10 is a block diagram illustrating a storage system of model parameters according to an exemplary embodiment of the present disclosure.
  • a storage system 1000 for model parameters includes an acquisition device 1001 and a storage device 1002 .
  • the obtaining means 1001 can obtain model parameters of at least one model.
  • the model can be an AI model with high dimensions, for example, a recommendation model, a credit card anti-fraud model, etc.
  • Massive historical data can be put into the offline training system to train the AI model, and the trained AI model can be deployed to the online inference system for use.
  • Each dimension of an AI model corresponds to a parameter.
  • An AI model that can process massive data can reach hundreds of millions of dimensions or even a billion dimensions, so each model may store hundreds of millions or even billions of parameters.
  • the model parameters here can refer to parameters before training or during training, and can also refer to parameters after training is completed.
  • the storage device 1002 can store the model parameters of the at least one model in a parameter server cluster, wherein the parameter server cluster includes a plurality of non-volatile memory-based parameter server nodes.
  • the parameter server cluster may be an offline parameter server cluster for training, or an online parameter server cluster for inference.
  • the storage device 1002 may store the model parameters of each model in the at least one model in a distributed manner to the non-volatile memory-based parameter server nodes of the plurality of non-volatile memory-based parameter server nodes.
  • the model parameters corresponding to each model stored on the parameter server node are logically divided into at least one level of storage sub-modules for storage.
  • the storage device 1002 may logically divide the model parameters of each model in the at least one model into a plurality of storage modules (for example, the first-level storage sub-modules described below), and distribute the divided storage modules stored in the non-volatile memory of the plurality of non-volatile memory-based parameter server nodes.
  • each storage module may be further divided into at least one level of storage sub-modules (for example, the following second level of storage sub-modules). modules, tertiary storage submodules, etc.).
  • the storage device 1002 may store the first-tier data and the second-tier data in the non-volatile memory of each non-volatile memory-based parameter server node.
  • the non-volatile memory of the parameter server node there will be two layers of data storage, such as the first layer and the second layer as shown in Figure 5).
  • the first layer and the second layer there may be one storage in the first-level data for storing the information of the current node, and M storages in the second-level data for storing M first-level storage sub-nodes respectively. Module specific information.
  • the first layer data and the second layer data according to an exemplary embodiment of the present disclosure will be described in detail below.
  • parameter server node header information may be stored for querying the node information and first-level storage sub-module information of the parameter server node.
  • the node information can be the ID information of the parameter server node.
  • the parameter server cluster will assign an ID to each parameter server, and the ID is unique. Therefore, by obtaining the ID information of the parameter server node, it can be determined which parameter server node in the parameter server cluster it is.
  • the first-level storage submodule information may be a list of ID information of all first-level storage submodules stored on the parameter server node.
  • the IDs of the storage submodules eg, Storage ID, Shard ID
  • S1R1 Storage 1, Shard 1
  • Model 2 there will also be S1R1, S1R2, S2R1, S2R2... of Model 2.
  • the first-level storage submodule ID included in the first-level storage submodule ID list may be composed of the model ID and the first-level storage submodule ID in the corresponding model, for example, the first-level storage submodule ID
  • the list of primary storage sub-module IDs can include Model 1Storage 0, Model 1Storage 3, Model 2Storage 1.
  • the first-level storage submodule ID list can be stored in the first-level data in the form of a persistent list, which ensures that model parameters can be inserted into non-volatile memory.
  • the first layer data (ie, parameter server node header information) is used as the root of the storage of the entire non-volatile memory-based parameter server node, and the storage device 1002 may store the first layer data in the parameter server node.
  • M pieces of first-level storage sub-module header information and M pieces of first-level storage sub-module hash map (HashMap) information may be stored.
  • the second-level data can be used to query the model parameters stored in each first-level storage sub-module of the parameter server node. For example, for each first-level storage sub-module, the storage device 1002 may newly create a corresponding non-volatile memory storage pool in the second-level data storage for separate storage.
  • the first-level storage sub-module header information may be allocated three spaces for storing the first-level storage sub-module ID (Storage ID), The version information (Version) of the model parameters stored in the first-level storage submodule, and the pointer (Shard HashMap Pointer) of the first-level storage submodule to the next-level hash map.
  • the next level of the first-level storage submodule (Storage) is the second-level storage submodule (Shard). Therefore, the pointer to the next-level hash map in the header information of the first-level storage submodule can be Shard HashMap Pointer , but the present disclosure is not limited thereto.
  • the pointer to the next-level hash map in the header information of the first-level storage sub-module may point to the model parameter hash map Pointer (for example, Para HashMap Point).
  • the first-level storage sub-module hash mapping information may include the hash map of each level of storage sub-modules from the second-level to the Nth-level storage sub-module under the first-level storage sub-module.
  • the key of the hash map of each level of storage sub-module is the ID of this level of storage sub-module
  • the value is the pointer to the next level of hash map
  • the key of the model parameter hash map is the parameter name
  • the value is the parameter value
  • the hash map of each level of storage sub-module and the model parameter hash map are linked by the corresponding pointer to the next level of hash map of this level of storage sub-module or the upper-level storage sub-module of this model parameter.
  • the storage system 1000 may further include a service device (not shown), and the service device may query a parameter of a specified model of the at least one model from the non-volatile memory-based parameter server cluster, And provide the corresponding model estimation service based on the queried parameters of the specified model.
  • the service device can determine the parameter server node ID of the parameter storage and the ID of each level of storage sub-module according to the parameter name of the parameter of the specified model, find the parameter server node according to the determined parameter server node ID, and store the sub-module according to the various levels. ID, based on the second-level data on the found parameter server node, to find the parameter value corresponding to the parameter name.
  • writing parameters only occurs when a new model comes online.
  • the process of writing parameters is similar to the process of querying parameters, with two differences.
  • the storage device 1002 can insert all new model parameters into a brand new storage pool. After all the parameters of the new model are uploaded to the parameter server cluster, the parameter query service will be switched to the new parameters. At the same time, the backend thread will slowly reclaim the space of the parameters of the old model.
  • the second point is that when a new Para0 is written into the HashMap under Storage 0 new, the storage device 1002 can use a CPU instruction (such as clflushopt+mfence) to ensure that the parameter data written each time is written to the NVM instead of volatile in the CPU cache.
  • a CPU instruction such as clflushopt+mfence
  • FIG. 11 is a block diagram illustrating a recovery system of a parameter server node according to an exemplary embodiment of the present disclosure.
  • the recovery system of a parameter server node according to an exemplary embodiment of the present disclosure is adapted to the situation that the parameter server node described above with reference to FIG. 3 needs to be restarted due to a failure or the like.
  • a recovery system 1100 of a parameter server node may include a first acquisition device 1101 , a second acquisition device 1102 , and a recovery device 1103 .
  • the first obtaining means 1101 may obtain the stored first-layer data from the non-volatile memory of the parameter server node.
  • the first-level data can parameterize the server node header information, which is used to query the parameter server node's node information and the first-level storage sub-module information.
  • the parameter server node header information may include a parameter server node ID and a list of first-level storage submodule IDs.
  • the first obtaining device 1101 can determine which parameter server node in the parameter server cluster the restarted parameter server node is according to the parameter server node ID in the parameter server node header, and can determine the parameter server node in the parameter server node
  • the list of module IDs identifies all first-level storage submodules included in the restarted parameter server node.
  • the first tier data may be stored at a fixed location in the non-volatile memory of the parameter server node. Therefore, the first obtaining means 1101 can read the first layer data from a fixed location in the non-volatile memory of the parameter server node. In this way, after the parameter server node is restarted, the storage information of the parameter server node can be quickly queried from the parameter server node.
  • the first-level storage submodule IDs included in the first-level storage submodule ID list may be composed of a model ID and a first-level storage submodule ID in a corresponding model.
  • the second obtaining means 1102 may obtain, based on the first-layer data, the header information of each first-level storage sub-module in the stored second-layer data from the non-volatile memory of the parameter server node.
  • the second-level data can include M first-level storage sub-module header information and M first-level storage sub-module hash mapping information, and the second-level data is used to query each first-level storage of the parameter server node. Model parameters stored in the sub-module, where M is the number of first-level storage sub-modules stored on the parameter server node.
  • the first-level storage sub-module header information may include the first-level storage sub-module ID, version information of model parameters stored by the first-level storage sub-module, and the first-level storage sub-module The module's pointer to the next level hash map.
  • the second acquiring means 1102 may determine all the first-level storage sub-module IDs of the parameter server node based on the first-level storage sub-module ID list, and then based on all the first-level storage sub-module IDs of the parameter server node For each first-level storage sub-module ID in the sub-module ID, the header information of the first-level storage sub-module with the corresponding first-level storage sub-module ID is obtained. Therefore, the second obtaining means 1102 can obtain the respective first-level storage sub-module header information of all (M) first-level storage sub-modules stored on the parameter server node.
  • all (M) first-level storage sub-modules also have respective first-level storage sub-module hash map information.
  • Each first-level storage sub-module may be associated with its first-level storage sub-module hash map information based on a pointer to the next-level hash map in its first-level storage sub-module header information.
  • the hash map information of each first-level storage sub-module may include the hash map of each level of storage sub-modules from the second-level to the N-th level storage sub-module under the first-level storage sub-module, and the hash map of the first-level storage sub-module.
  • Hash mapping of model parameters under each of the Nth-level storage sub-modules under the first-level storage sub-module where N is the number of stages of the storage sub-modules into which the model parameters are divided.
  • the key of the hash map of each level of storage sub-module is the ID of the level of storage sub-module, and the value is a pointer to the next level of hash map.
  • the key of the model parameter hash map is the parameter name and the value is the parameter value.
  • the hash map of each level of storage submodule and the model parameter hash map are linked through the corresponding pointer to the next level of the hash map of this level of storage submodule or the previous level of this model parameter storage submodule, for example, as shown in the figure 5 to Figure 7.
  • the restoration device 1103 may traverse the hash map information of each first-level storage sub-module in the second-level data based on the header information of each first-level storage sub-module, so as to restore the model parameters stored on the parameter server node.
  • the restoring device 1103 may perform the following operation for each first-level storage submodule: search for the next-level hash through the corresponding pointer to the next-level hash map of the previous-level storage submodule Map until the model parameter hash map is searched; based on the model parameter hash map, restore the model parameters.
  • the hash map information of each first-level storage sub-module includes each second-level storage sub-module under the first-level storage sub-module.
  • the pointer of the next-level hash map is the pointer to the hash map of the second-level storage submodule (Shard HashMap Point)
  • the key of the hash map of each second-level storage submodule is the second-level storage submodule.
  • ID (Shard ID)
  • the value is a pointer (Para HashMap Point) to the model parameter hash map under the second-level storage submodule.
  • the first-level storage submodule header information can be used to search for the first-level storage submodule hash map pointer (Shard HashMap Point) in the first-level storage submodule header information.
  • the hash map of the secondary storage submodule (Shard HashMap).
  • the restoration device 1103 may check whether the hash map data of the second-level storage submodule is complete, and restore all the data of the hash map of the second-level storage submodule.
  • the restoration device 1103 may search for the model parameter hash map under all the second-level storage sub-modules according to the pointers to the model parameter hash map of all the second-level storage sub-modules in the hash map of the second-level storage sub-module , thereby restoring the model parameters under all second-level storage submodules.
  • the hash map information of each first-level storage submodule includes the model parameter hash under the first-level storage submodule.
  • Map Para HashMap
  • the pointer to the next-level hash map in the header information of the first-level storage submodule is a pointer to the model parameter hash map (Para HashMap Point).
  • the model parameter hash map can be searched through the pointer to the model parameter hash map (Para HashMap Point) in the header information of the first-level storage sub-module (Para HashMap), thereby restoring the model parameters under each first-level storage submodule.
  • the hash map information of each first-level storage sub-module includes each second-level storage sub-module under the first-level storage sub-module.
  • the hash map of the sub-module (Shard HashMap), the hash map of each third-level storage sub-module under each second-level storage sub-module (Slice HashMap), and the model parameter hash under each third-level storage sub-module Map (Para HashMap).
  • the pointer to the next-level hash map in the header information of the first-level storage sub-module is a pointer to the second-level storage sub-module hash map (Shard HashMap Point), and the pointer in the second-level storage sub-module hash map points to
  • the pointer of the next-level hash map is the pointer to the third-level storage sub-module hash map (Slice HashMap Point)
  • the pointer to the next-level hash map in the third-level storage sub-module hash map is the pointer to the model
  • the pointer to the parameter hash map (Para HashMap Point).
  • the first-level storage submodule header information can be used to search for the first-level storage submodule hash map pointer (Shard HashMap Point) in the first-level storage submodule header information.
  • the hash map of the secondary storage submodule (Shard HashMap).
  • the restoration device 1103 may check whether the hash map data of the second-level storage submodule is complete, and restore all the data of the hash map of the second-level storage submodule.
  • the restoration device 1103 may search all second-level storage submodules according to the pointers (Slice HashMap Point) of all second-level storage submodules of the hash map of the second-level storage submodule to the third-level storage submodule hash map (Slice HashMap Point) Each third level under the submodule stores the hash map of the submodule. For this, the restoration device 1103 can check whether the hash map data of all the third-level storage submodules is complete, and restore all the data of the hash maps of all the third-level storage submodules.
  • the restoring device 1103 may search the model parameter hash map according to the pointer to the model parameter hash map in the hash map of each third-level storage sub-module, thereby restoring the model parameters under all third-level storage sub-modules .
  • model parameters can be divided into storage sub-modules of any level, and in the case where the model parameters are divided into storage sub-modules of any level, the recovery process can be performed according to the logic of the above examples, analogically Restoration of model parameters.
  • the model parameters stored in the parameter server node are out of date. Therefore, when the second acquiring means 1102 acquires the model parameter version information in the header information of the first-level storage sub-module in the second layer data, the restoring means 1103 can determine the model stored in the parameter server node based on the model parameter version information Whether the parameter is the latest version, it is determined whether to perform recovery according to the determined result.
  • the restoring means 1103 may, according to the version information in the first-level storage sub-module header information and the data stored in the parameter server The latest version information of the first-level storage submodule on the cluster metadata node is compared.
  • the parameter server cluster metadata node is a server that stores global metadata information of the parameter server cluster, such as zoomkeeper. In the parameter server cluster, the latest version numbers corresponding to all the first-level storage submodules of each model can be recorded in the metadata node.
  • the version of the first-level storage submodule When the model parameters of the first-level storage submodule are updated, the version of the first-level storage submodule will be incremented by 1 on the metadata node. Every time a parameter server node restarts, you can check the latest version of the current first-level storage submodule.
  • the version number stored on the metadata node is newer than the version number on the restarted parameter server node, it means that the model parameters on the restarted parameter server node are out of date and there is no need to restore them.
  • the version number stored on the metadata node is the same as the version number on the restarted parameter server node, it means that the model parameters on the restarted parameter server node are the latest version and can be restored.
  • the restoring means 1103 can execute restoring.
  • the recovery device 1103 does not perform recovery, and restores the data from the back-end storage system (for example, pull the latest version of the model parameters from HDFS) and insert the parameter server node.
  • the backend storage system can store the latest version of the model parameters.
  • a parameter server cluster includes a plurality of non-volatile memory-based parameter server nodes, the parameter server cluster is used for distributed storage of models of at least one model parameter.
  • Each non-volatile memory-based parameter server node included in the parameter server cluster may have the model parameter logical storage structure described above with reference to FIG. 4, and may have the above described with reference to FIGS. 5-7 or the like.
  • the physical storage structure of the data may be recovered according to the recovery method described in FIG. 8 or FIG. 9 when it is restarted.
  • the nonvolatile memory may include at least one of STT-RAM, PCM, ReRAM, and 3DxPoint.
  • PMEM (3DxPoint product) can be used to realize the parameter server node based on PMEM.
  • the model parameters are stored on the parameter server based on non-volatile memory instead of the parameter server based on DRAM, which greatly improves the Reduced hardware costs.
  • the model parameter logical storage structure and data physical storage structure are designed, the model parameters are logically hierarchically stored, and the data is stored in two layers on the non-volatile memory. Meet the high concurrency and high availability requirements of the parameter server.
  • the rapid recovery process after restart is designed. According to the data structure of the two-tier storage, all parameters stored on the parameter server node can be easily and quickly queried and restored, achieving the effect of millisecond-level recovery.
  • Each device in the model parameter storage system shown in FIG. 10 and the parameter server node recovery system shown in FIG. 11 may be configured as software, hardware, firmware, or any combination of the foregoing to perform specific functions.
  • each device may correspond to a dedicated integrated circuit, may also correspond to pure software code, or may correspond to a module combining software and hardware.
  • one or more functions implemented by each apparatus may also be performed uniformly by components in a physical entity device (eg, a processor, a client or a server, etc.).
  • the method of storing model parameters described with reference to FIG. 3 and the method of restoring parameter server nodes described with reference to FIGS. 8 and 9 may be implemented by programs (or instructions) recorded on a computer-readable storage medium.
  • a computer-readable storage medium storing instructions may be provided that, when executed by at least one computing device, cause the at least one computing device to execute model parameters according to the present disclosure
  • the storage method for the parameter server node or the recovery method for the parameter server node may be provided that, when executed by at least one computing device, cause the at least one computing device to execute model parameters according to the present disclosure.
  • the computer program in the above-mentioned computer-readable storage medium can run in an environment deployed in computer equipment such as a client, a host, an agent device, a server, etc. It should be noted that the computer program can also be used to perform additional steps in addition to the above-mentioned steps or More specific processing is performed when the above steps are performed, and the contents of these additional steps and further processing have been mentioned in the description of the related methods with reference to FIGS.
  • each device in the model parameter storage system and the parameter server node recovery system can completely rely on the running of the computer program to realize the corresponding function, that is, the function of the computer program in each device
  • the architecture corresponds to each step, so that the entire system is invoked through a special software package (eg, lib library) to implement corresponding functions.
  • each device in FIG. 10 and FIG. 11 can also be implemented by hardware, software, firmware, middleware, microcode or any combination thereof.
  • program codes or code segments for performing corresponding operations may be stored in a computer-readable medium such as a storage medium, so that a processor can read and execute the corresponding program by reading code or code segment to perform the corresponding action.
  • exemplary embodiments of the present disclosure may also be implemented as a computing device including a storage component and a processor, the storage component stores a computer-executable instruction set, and when the computer-executable instruction set is executed by the processor, executes the A method of storing model parameters or a method of restoring a parameter server node according to an exemplary embodiment of the present disclosure.
  • the computing device may be deployed in a server or a client, or may be deployed on a node device in a distributed network environment.
  • the computing device may be a PC computer, a tablet device, a personal digital assistant, a smartphone, a web application, or other device capable of executing the set of instructions described above.
  • the computing device does not have to be a single computing device, but can also be any set of devices or circuits capable of individually or jointly executing the above-mentioned instructions (or instruction sets).
  • the computing device may also be part of an integrated control system or system manager, or may be configured as a portable electronic device that interfaces locally or remotely (eg, via wireless transmission).
  • a processor may include a central processing unit (CPU), a graphics processing unit (GPU), a programmable logic device, a special purpose processor system, a microcontroller, or a microprocessor.
  • processors may also include analog processors, digital processors, microprocessors, multi-core processors, processor arrays, network processors, and the like.
  • Some operations described in the method for storing model parameters or the method for restoring parameter server nodes according to the exemplary embodiments of the present disclosure may be implemented by software, some operations may be implemented by hardware, and in addition, some operations may be implemented by software These operations are implemented by means of a combination of hardware.
  • the processor may execute instructions or code stored in one of the storage components, which may also store data. Instructions and data may also be sent and received over a network via a network interface device, which may employ any known transport protocol.
  • the memory component may be integrated with the processor, eg, RAM or flash memory arranged within an integrated circuit microprocessor or the like. Additionally, the storage components may include separate devices, such as external disk drives, storage arrays, or any other storage device that may be used by a database system. The storage component and the processor may be operatively coupled, or may communicate with each other, eg, through I/O ports, network connections, etc., to enable the processor to read files stored in the storage component.
  • the computing device may also include a video display (such as a liquid crystal display) and a user interaction interface (such as a keyboard, mouse, touch input device, etc.). All components of the computing device may be connected to each other via a bus and/or network.
  • a video display such as a liquid crystal display
  • a user interaction interface such as a keyboard, mouse, touch input device, etc.
  • the method for storing model parameters or the method for restoring parameter server nodes may be described as various interconnected or coupled functional blocks or functional diagrams. However, these functional blocks or functional diagrams may be equally integrated into a single logical device or operate along non-precise boundaries.
  • the method for storing model parameters described with reference to FIG. 3 or the method for restoring parameter server nodes described with reference to FIG. 8 or 9 may be implemented by a system including at least one computing device and at least one storage device storing instructions.
  • At least one computing device is a computing device for performing a method for storing model parameters or a method for restoring a parameter server node according to an exemplary embodiment of the present disclosure
  • the storage device stores computer-executable instructions The set, when executed by the at least one computing device, performs a method for storing model parameters or a method for restoring a parameter server node according to the present disclosure.
  • an electronic device comprising: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement a reference
  • the model parameters are stored on the parameter server based on non-volatile memory instead of the parameter server based on DRAM, which greatly reduces the hardware cost.
  • the model parameter logical storage structure and data physical storage structure are designed, the model parameters are logically hierarchically stored, and the data is stored in two layers on the non-volatile memory. Meet the high concurrency and high availability requirements of the parameter server.
  • the rapid recovery process after restart is designed. According to the data structure of the two-tier storage, all parameters stored on the parameter server node can be easily and quickly queried and restored, achieving the effect of millisecond-level recovery.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Provided are a parameter server node recovery method and recovery system. The recovery method comprises: once a parameter server node restarts, acquiring first layer data from a non-volatile memory of the parameter server node, wherein the first layer data comprises parameter server node header information, and the first layer data is used to query node information of the parameter server node and first level storage sub-module information; on the basis of the first layer data, acquiring each piece of first level storage sub-module header information in second layer data from the non-volatile memory of the parameter server node, wherein the second layer data comprises M pieces of first level storage sub-module header information and M pieces of first level storage sub-module hash mapping information, the second layer data is used to query model parameters stored in each first level storage sub-module of the parameter server node; on the basis of each piece of first level storage sub-module header information, traversing each piece of first level storage sub-module hash mapping information in the second layer data to recover model parameters on the parameter server node.

Description

参数服务器节点的恢复方法和恢复系统Parameter server node recovery method and recovery system
本申请要求申请号为202011187099.2,申请日为2020年10月29日,名称为“参数服务器节点的恢复方法和恢复系统”的中国专利申请的优先权,其中,上述申请公开的内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number of 202011187099.2 and the filing date of October 29, 2020, entitled "Recovery Method and Recovery System for Parameter Server Nodes", wherein the content disclosed in the above application is incorporated by reference in in this application.
技术领域technical field
本公开涉及计算机技术领域,更具体地说,涉及一种参数服务器节点的恢复方法和恢复系统。The present disclosure relates to the field of computer technology, and more particularly, to a recovery method and recovery system of a parameter server node.
背景技术Background technique
工业界已经部署上线的机器学习模型,因为线上服务要求非常高的实时性,所以模型参数都需要存储在高速的DRAM(Dynamic Random Access Memory动态随机存取存储器)内存当中。而工业级机器学习模型参数总量巨大,超过了单台机器的存储容量,所以往往需要部署基于DRAM内存的参数服务器集群为在线预测服务提供高并发的参数查询支持。参数服务器(Parameter Server)是一个编程框架,用于方便分布式并行程序的编写,其中重点在于对大规模参数的分布式存储和协同的支持。而线上参数服务器主要用于存储已训练好的超大规模参数,并为线上服务提供高并发,高可用的模型参数查询服务。然而,传统的基于DRAM内存的参数服务器在部署过程中存在两个问题,第一是巨大的内存消耗带来的整体硬件成本的提升,第二是当参数服务器集群中任意节点故障下线后,恢复过程非常耗时。The industry has deployed online machine learning models. Because online services require very high real-time performance, model parameters need to be stored in high-speed DRAM (Dynamic Random Access Memory) memory. However, the total number of parameters of industrial machine learning models is huge, which exceeds the storage capacity of a single machine. Therefore, it is often necessary to deploy parameter server clusters based on DRAM memory to provide high concurrent parameter query support for online prediction services. Parameter Server is a programming framework used to facilitate the writing of distributed parallel programs, with the emphasis on distributed storage and collaboration support for large-scale parameters. The online parameter server is mainly used to store the trained super-large-scale parameters and provide high-concurrency and high-availability model parameter query services for online services. However, the traditional parameter server based on DRAM memory has two problems in the deployment process. The first is the increase of the overall hardware cost caused by the huge memory consumption. The second is that when any node in the parameter server cluster fails and goes offline, The recovery process is time-consuming.
发明内容SUMMARY OF THE INVENTION
本公开的示例性实施例可至少部分地解决上述问题。Exemplary embodiments of the present disclosure may at least partially solve the above-mentioned problems.
根据本公开的第一方面,提供一种包括至少一个计算装置和至少一个存储指令的存储装置的系统,其中,所述指令在被所述至少一个计算装置运行时,促使所述至少一个计算装置执行参数服务器节点的恢复方法,其中,所述参数服务器节点是参数服务器集群中的一个节点,且所述参数服务器节点是基于非易失性内存的参数服务器节点,所述参数服务器节点的非易失性内存中存储的每个模型的模型参数在逻辑上被划分为至少一级存储子模块,所述恢复方法包括:在所述参数服务器节点重启后,从所述参数服务器节点的非易失性内存中获取所存储的第一层数据,其中,第一层数据包括参数服务器节点头信息,所述第一层数据用于查询所述参数服务器节点的节点信息和第一级存储子模块信息;基于所述第一层数据,从所述参数服务器节点的非易失性内存中获取所存储的第二层数据中的每个第一级存储子模块头信息,其中,所述第二层数据包括M个第一级存储子模块头信息和M个第一级存储子模块哈希映射信息,所述第二层数据用于查询该参数服务器节点的各个第一级存储子模块中存储的模型参数,其中,M为该参数服务器节点上存储的第一级存储子模块的数量;基于每个第一级存储子模块头信息,遍历所述第二层数据中的每个第一级存储子模块哈希映射信息,以恢复所述参数服务器节点上存储的模型参数。According to a first aspect of the present disclosure, there is provided a system comprising at least one computing device and at least one storage device storing instructions, wherein the instructions, when executed by the at least one computing device, cause the at least one computing device to A method for restoring a parameter server node is executed, wherein the parameter server node is a node in a parameter server cluster, and the parameter server node is a parameter server node based on non-volatile memory, and the non-volatile memory of the parameter server node The model parameters of each model stored in the volatile memory are logically divided into at least one-level storage sub-modules, and the recovery method includes: after the parameter server node restarts The stored first-layer data is obtained from the flexible memory, wherein the first-layer data includes the parameter server node header information, and the first-layer data is used to query the node information of the parameter server node and the first-level storage sub-module information ; Based on the first-layer data, obtain each first-level storage submodule header information in the stored second-layer data from the non-volatile memory of the parameter server node, wherein the second-layer The data includes M first-level storage sub-module header information and M first-level storage sub-module hash mapping information, and the second-level data is used to query the parameters stored in each first-level storage sub-module of the parameter server node. Model parameters, where M is the number of first-level storage submodules stored on the parameter server node; based on the header information of each first-level storage submodule, traverse each first-level storage in the second-level data Submodule hash map information to restore model parameters stored on the parameter server node.
根据本公开的第二方面,提供一种参数服务器节点的恢复方法,其中,所述参数服务器节点是参数服务器集群中的一个节点,且所述参数服务器节点是基于非易失性内存的参数服务器节点,所述参数服务器节点的非易失性内存中存储的每个模型的模型参数在逻辑上被划分为至少一级存储子模块,所述恢复方法包括:在所述参数服务器节点重启后,从所述参数服务器节点的非易失性内存中获取所存储的第一层数据,其中,第一层数据包括参数服务器节点头信息,所述第一层数据用于查询所述参数服务器节点的节点信息和第 一级存储子模块信息;基于所述第一层数据,从所述参数服务器节点的非易失性内存中获取所存储的第二层数据中的每个第一级存储子模块头信息,其中,所述第二层数据包括M个第一级存储子模块头信息和M个第一级存储子模块哈希映射信息,所述第二层数据用于查询该参数服务器节点的各个第一级存储子模块中存储的模型参数,其中,M为该参数服务器节点上存储的第一级存储子模块的数量;基于每个第一级存储子模块头信息,遍历所述第二层数据中的每个第一级存储子模块哈希映射信息,以恢复所述参数服务器节点上存储的模型参数。According to a second aspect of the present disclosure, a method for restoring a parameter server node is provided, wherein the parameter server node is a node in a parameter server cluster, and the parameter server node is a non-volatile memory-based parameter server node, the model parameters of each model stored in the non-volatile memory of the parameter server node are logically divided into at least one-level storage sub-modules, and the recovery method includes: after the parameter server node restarts, The stored first-layer data is obtained from the non-volatile memory of the parameter server node, wherein the first-layer data includes parameter server node header information, and the first-layer data is used to query the parameter server node Node information and first-level storage submodule information; based on the first-level data, obtain each first-level storage submodule in the stored second-level data from the non-volatile memory of the parameter server node Header information, wherein the second-layer data includes M first-level storage submodule header information and M first-level storage submodule hash mapping information, and the second-layer data is used to query the parameter server node. The model parameters stored in each first-level storage sub-module, where M is the number of first-level storage sub-modules stored on the parameter server node; based on the header information of each first-level storage sub-module, traverse the second Each first level in the layer data stores submodule hash map information to restore model parameters stored on the parameter server node.
根据本公开的第三方面,提供一种参数服务器节点的恢复系统,其中,所述参数服务器节点是参数服务器集群中的一个节点,且所述参数服务器节点是基于非易失性内存的参数服务器节点,所述参数服务器节点的非易失性内存中存储的每个模型的模型参数在逻辑上被划分为至少一级存储子模块,所述恢复装置包括:第一获取装置,被配置为:在所述参数服务器节点重启后,从所述参数服务器节点的非易失性内存中获取所存储的第一层数据,其中,第一层数据包括参数服务器节点头信息,所述第一层数据用于查询所述参数服务器节点的节点信息和第一级存储子模块信息;第二获取装置,被配置为:基于所述第一层数据,从所述参数服务器节点的非易失性内存中获取所存储的第二层数据中的每个第一级存储子模块头信息,其中,所述第二层数据包括M个第一级存储子模块头信息和M个第一级存储子模块哈希映射信息,所述第二层数据用于查询该参数服务器节点的各个第一级存储子模块中存储的模型参数,其中,M为该参数服务器节点上存储的第一级存储子模块的数量;恢复装置,被配置为:基于每个第一级存储子模块头信息,遍历所述第二层数据中的每个第一级存储子模块哈希映射信息,以恢复所述参数服务器节点上存储的模型参数。According to a third aspect of the present disclosure, a system for restoring a parameter server node is provided, wherein the parameter server node is a node in a parameter server cluster, and the parameter server node is a non-volatile memory-based parameter server node, the model parameters of each model stored in the non-volatile memory of the parameter server node are logically divided into at least one-level storage sub-modules, and the recovery device includes: a first acquisition device, configured as: After the parameter server node is restarted, the stored first-layer data is acquired from the non-volatile memory of the parameter server node, wherein the first-layer data includes parameter server node header information, and the first-layer data for querying node information and first-level storage submodule information of the parameter server node; a second acquiring device is configured to: based on the first-level data, obtain information from the non-volatile memory of the parameter server node Obtain the header information of each first-level storage submodule in the stored second-level data, wherein the second-level data includes M first-level storage submodule header information and M first-level storage submodules. Mapping information, the second layer data is used to query the model parameters stored in each first-level storage submodule of the parameter server node, wherein M is the number of first-level storage submodules stored on the parameter server node The recovery device is configured to: based on the header information of each first-level storage sub-module, traverse each first-level storage sub-module hash map information in the second-level data to recover the parameter server node. Stored model parameters.
根据本公开的第四方面,提供一种存储指令的计算机可读存储介质,其中,当所述指令被至少一个计算装置运行时,促使所述至少一个计算装置执行根据本公开的参数服务器节点的恢复方法。According to a fourth aspect of the present disclosure, there is provided a computer-readable storage medium storing instructions, wherein the instructions, when executed by at least one computing device, cause the at least one computing device to perform a parameter server node's operation according to the present disclosure. recovery method.
根据本公开的第五方面,提供一种电子设备,包括:处理器;用于存储所述处理器可执行指令的存储器;其中,所述处理器被配置为执行所述指令,以实现本公开的参数服务器节点的恢复方法。According to a fifth aspect of the present disclosure, there is provided an electronic device, comprising: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the present disclosure The recovery method of the parameter server node.
根据本公开的参数服务器节点的恢复方法和系统,将模型参数存储在基于非易失性内存的参数服务器上,来代替基于DRAM的参数服务器,大大降低了硬件成本。此外,针对基于非易失性内存的参数服务器,设计了模型参数逻辑存储结构和数据物理存储结构,将模型参数在逻辑上分级存储,在非易失性内存上将数据分为两层存储,满足参数服务器的高并发、高可用需求。并且设计重启后的快速恢复流程,根据两层存储的数据结构,可轻松快速地查询并恢复参数服务器节点上存储的所有参数,实现毫秒级恢复的效果。According to the method and system for restoring a parameter server node of the present disclosure, the model parameters are stored on the parameter server based on non-volatile memory instead of the parameter server based on DRAM, which greatly reduces the hardware cost. In addition, for the parameter server based on non-volatile memory, the model parameter logical storage structure and data physical storage structure are designed, the model parameters are logically hierarchically stored, and the data is stored in two layers on the non-volatile memory. Meet the high concurrency and high availability requirements of the parameter server. In addition, the rapid recovery process after restart is designed. According to the data structure of the two-tier storage, all parameters stored on the parameter server node can be easily and quickly queried and restored, achieving the effect of millisecond-level recovery.
附图说明Description of drawings
通过结合附图,从实施例的下面描述中,本公开这些和/或其它方面及优点将会变得清楚,并且更易于理解,其中:These and/or other aspects and advantages of the present disclosure will become apparent, and be more readily understood, from the following description of embodiments, taken in conjunction with the accompanying drawings, wherein:
图1是示出现有的参数服务器集群架构的示意图。FIG. 1 is a schematic diagram illustrating a conventional parameter server cluster architecture.
图2是示出现有的参数服务器集群的节点故障的示意图。FIG. 2 is a schematic diagram illustrating a node failure of a conventional parameter server cluster.
图3是示出根据本公开的示例性实施例的模型参数的存储方法的流程图。FIG. 3 is a flowchart illustrating a storage method of model parameters according to an exemplary embodiment of the present disclosure.
图4是示出根据本公开的示例性实施例的模型参数逻辑存储结构的示意图。FIG. 4 is a schematic diagram illustrating a logical storage structure of model parameters according to an exemplary embodiment of the present disclosure.
图5是示出根据本公开的示例性实施例的参数服务器节点的数据物理存储结构的示意图。FIG. 5 is a schematic diagram illustrating a data physical storage structure of a parameter server node according to an exemplary embodiment of the present disclosure.
图6是示出根据本公开的另一示例性实施例的参数服务器节点的数据物理存储结构的示意图。FIG. 6 is a schematic diagram illustrating a data physical storage structure of a parameter server node according to another exemplary embodiment of the present disclosure.
图7是示出根据本公开的另一示例性实施例的参数服务器节点的数据物理存储结构 的示意图。FIG. 7 is a schematic diagram illustrating a data physical storage structure of a parameter server node according to another exemplary embodiment of the present disclosure.
图8是示出根据本公开的示例性实施例的参数服务器节点的恢复方法的流程图。FIG. 8 is a flowchart illustrating a recovery method of a parameter server node according to an exemplary embodiment of the present disclosure.
图9是示出根据本公开的示例性实施例的参数服务器节点的恢复方法的流程图。FIG. 9 is a flowchart illustrating a recovery method of a parameter server node according to an exemplary embodiment of the present disclosure.
图10是示出根据本公开的示例性实施例的模型参数的存储系统的框图。10 is a block diagram illustrating a storage system of model parameters according to an exemplary embodiment of the present disclosure.
图11是示出根据本公开的示例性实施例的参数服务器节点的恢复系统的框图。11 is a block diagram illustrating a recovery system of a parameter server node according to an exemplary embodiment of the present disclosure.
具体实施方式Detailed ways
提供参照附图的以下描述以帮助对由权利要求及其等同物限定的本公开的实施例的全面理解。包括各种特定细节以帮助理解,但这些细节仅被视为是示例性的。因此,本领域的普通技术人员将认识到在不脱离本公开的范围和精神的情况下,可对描述于此的实施例进行各种改变和修改。此外,为了清楚和简洁,省略对公知的功能和结构的描述。The following description with reference to the accompanying drawings is provided to assist in a comprehensive understanding of embodiments of the present disclosure as defined by the claims and their equivalents. Various specific details are included to aid in that understanding, but are to be regarded as exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted for clarity and conciseness.
在此需要说明的是,在本公开中出现的“若干项之中的至少一项”均表示包含“该若干项中的任意一项”、“该若干项中的任意多项的组合”、“该若干项的全体”这三类并列的情况。在本公开中出现的“和/或”均表示被其连接的前后两项或多项中的至少一项。例如,“包括A和B之中的至少一个”、“包括A和/或B”即包括如下三种并列的情况:(1)包括A;(2)包括B;(3)包括A和B。又例如,“执行步骤一和步骤二之中的至少一个”、“执行步骤一和/或步骤二”即表示如下三种并列的情况:(1)执行步骤一;(2)执行步骤二;(3)执行步骤一和步骤二。也就是说,“A和/或B”也可被表示为“A和B之中的至少一个”,“执行步骤一和/或步骤二”也可被表示为“执行步骤一和步骤二之中的至少一个”。It should be noted here that "at least one of several items" in the present disclosure all means including "any one of the several items", "a combination of any of the several items", The three categories of "the whole of the several items" are juxtaposed. In the present disclosure, "and/or" all means at least one of the preceding two or more items joined by it. For example, "including at least one of A and B" and "including A and/or B" include the following three parallel situations: (1) including A; (2) including B; (3) including A and B . For another example, "execute at least one of step 1 and step 2", "execute step 1 and/or step 2" means the following three parallel situations: (1) execute step 1; (2) execute step 2; (3) Execute step one and step two. That is to say, "A and/or B" can also be expressed as "at least one of A and B", and "execute step 1 and/or step 2" can also be expressed as "execute step 1 and step 2" at least one of".
大数据和AI时代给很多应用比如推荐系统、信用卡反欺诈等带来的空前的挑战和机遇。这一类AI应用有两个特点。第一个特点是模型超高维度。模型的每一个维度对应一个参数,一个能处理海量数据的模型,维度可以达到上亿维甚至十亿维级别。这也意味着我们需要为每个模型存储上亿甚至十亿个参数。所以我们需要用线上参数服务器去存储这些参数。第二个特点是实时性。以反欺诈为例,从用户刷卡行为产生,到最后的模型给出预测结果往往需要在几个毫秒内完成。高实时性的要求也注定了我们需要把海量的模型参数存储在高速的DRAM内存当中。此外,由于参数服务器集群中的单台机器有可能存在单点故障,而线上服务要求7*24小时不中断,所以同一份数据,我们需要做多副本的数据冗余来保证数据安全性。图1是示出现有的参数服务器集群架构的示意图,如图1所示,模型1(Model 1)的存储子模块Storage 3,相同的内容可准备三个副本分别存储在三台服务器节点(PS Node 1、PS Node 2、PS Node 3)上,这可以保证某一台或者某两台服务器故障下线后,线上服务依然可以进行。多副本另外一个好处是多个线上副本可以分摊访问压力,从而提高整体参数服务器的访问带宽。The era of big data and AI brings unprecedented challenges and opportunities to many applications such as recommendation systems and credit card anti-fraud. This type of AI application has two characteristics. The first feature is the super-high dimensionality of the model. Each dimension of the model corresponds to a parameter, a model that can handle massive data, and the dimensions can reach hundreds of millions of dimensions or even a billion dimensions. This also means that we need to store hundreds of millions or even billions of parameters for each model. So we need to use an online parameter server to store these parameters. The second feature is real-time. Taking anti-fraud as an example, it often takes a few milliseconds from the generation of the user's card swiping behavior to the final prediction result given by the model. The requirement of high real-time performance also destined us to store a large number of model parameters in high-speed DRAM memory. In addition, since a single machine in the parameter server cluster may have a single point of failure, and the online service requires 7*24 hours of uninterrupted, we need to make multiple copies of the same data to ensure data security. Figure 1 is a schematic diagram showing the existing parameter server cluster architecture. As shown in Figure 1, the storage sub-module Storage 3 of Model 1 (Model 1) can prepare three copies of the same content and store them on three server nodes (PS Node 1, PS Node 2, PS Node 3), this can ensure that online services can still be performed after one or two servers fail to go offline. Another advantage of multiple replicas is that multiple online replicas can share the access pressure, thereby increasing the access bandwidth of the overall parameter server.
然而,传统的基于DRAM的参数服务器在部署过程中有两个痛点。第一是巨大的内存消耗带来的整体硬件成本的提升。现在单根DRAM的容量有限,一般16G,或32G,这也就造成参数服务器因为满足内存需求需要多台机器的集群去存储模型的参数。与此同时,前面提到的多副本机制更加重了内存的开销和成本。第二个痛点也是所有基于DRAM内存系统的痛点,当参数服务器集群中任意节点故障下线后,需要重启节点,并从HDFS(Hadoop分布式文件系统)中提取参数数据并重新存储到新节点的DRAM中。这个恢复过程非常耗时。具体地说,传统的基于DRAM的参数服务器,所有参数都存储在DRAM中,并在后端慢存储系统(如HDFS)中备份数据。当基于DRAM的参数服务器宕机重启后,DRAM中所有的数据都会丢失。基于DRAM的参数服务器节点恢复需要:1、从慢存储HDFS的磁盘里读出所有参数,2、把这些参数通过网络传输到重启的参数服务器节点,3、把所有的参数在DRAM中重新建立数据结构,并把这些参数插入DRAM中的HashMap(哈希映射)数据结构中。特别是当参数维度上亿维甚至万亿维,上面的每一步都非常费时间。然而,长恢复时间对于参数服务器集群有很明显的一个缺点。图2是示出 现有的参数服务器集群的节点故障的示意图。如图2所示,参数服务器用多副本分摊系统的访问压力。这也意味着当有节点(PS Node 2)下线恢复时,系统的整体吞吐也会随之下降,而系统恢复的时间越长也就意味着系统整体吞吐下降的时间越长。However, traditional DRAM-based parameter servers have two pain points during deployment. The first is the increase in overall hardware cost caused by huge memory consumption. At present, the capacity of a single DRAM is limited, generally 16G, or 32G, which also causes the parameter server to store model parameters in a cluster of multiple machines to meet memory requirements. At the same time, the aforementioned multi-copy mechanism increases the memory overhead and cost. The second pain point is also the pain point of all DRAM-based memory systems. When any node in the parameter server cluster fails and goes offline, the node needs to be restarted, and the parameter data is extracted from HDFS (Hadoop Distributed File System) and stored in the new node. DRAM. This recovery process is time-consuming. Specifically, in traditional DRAM-based parameter servers, all parameters are stored in DRAM, and data is backed up in a back-end slow storage system (such as HDFS). When the DRAM-based parameter server is down and restarted, all data in the DRAM will be lost. DRAM-based parameter server node recovery requires: 1. Read all parameters from the slow storage HDFS disk, 2. Transfer these parameters to the restarted parameter server node through the network, 3. Rebuild all parameters in DRAM structure, and insert these parameters into the HashMap (hash map) data structure in DRAM. Especially when the parameter dimension is hundreds of millions or even trillions of dimensions, each of the above steps is very time-consuming. However, long recovery times have a distinct disadvantage for parameter server clusters. Fig. 2 is a schematic diagram showing a node failure of a conventional parameter server cluster. As shown in Figure 2, the parameter server uses multiple copies to share the access pressure of the system. This also means that when a node (PS Node 2) goes offline and recovers, the overall throughput of the system will also decrease, and the longer the system recovers, the longer the overall throughput of the system will decrease.
为了解决上述现有参数服务器集群存在的问题,本公开提出了一种新颖的模型参数存储方法和一种颖性的参数服务器节点的恢复方法。具体地说,本公开提出可使用非易失性内存(Non-volatile Memory,NVM)来代替DRAM,实现在基于非易失性内存的参数服务器节点上存储模型参数的方法,并且非易失性给参数服务器节点的快速恢复带来了可能性。这是因为,基于非易失性内存的参数服务器节点,重启后所有参数不会丢失,仍然保存在非易失性内存中,因此,上述的3步恢复流程都可省去。此外,基于非易失性内存的数据写入时使用CPU指令保证参数一定在非易失性内存上不会丢失,因此,在恢复过程中,只需要在非易失性内存上做简单的数据结构检查和/或版本检查,就可马上恢复并上线提供服务。这里,NVM泛指可在断电情况下存储数据的内存,可使用新一代NVM(例如,STT-RAM、PCM、ReRAM、3D xPoint等),新一代NVM与第一代NVM(例如,Flash Memory)相比的优点在于:(1)性能大幅提升,更接近用于计算机主存的DRAM;(2)摆脱访问时由于物理特性限制必须要以一个固定大小字节数的倍数(如Flash通常为4KB(4*1024字节)寻址,可按单字节寻址(Byte-addressable)。例如,持久化内存设备(Persistent Memory,PMEM)是一种3D xPoint产品,与传统的DRAM相比,PMEM具有更大的容量和更低价格成本,正好可满足参数服务器集群的高内存使用的需求。因此,一种实现方式可以是将模型参数分布式地存储到由基于PMEM的参数服务器节点构成的参数服务器集群中。In order to solve the above-mentioned problems existing in the existing parameter server clusters, the present disclosure proposes a novel model parameter storage method and a novel parameter server node recovery method. Specifically, the present disclosure proposes that non-volatile memory (NVM) can be used instead of DRAM to realize a method for storing model parameters on a parameter server node based on non-volatile memory. It brings the possibility of rapid recovery of parameter server nodes. This is because, for a parameter server node based on non-volatile memory, all parameters will not be lost after restarting and are still stored in the non-volatile memory. Therefore, the above three-step recovery process can be omitted. In addition, when writing data based on non-volatile memory, CPU commands are used to ensure that the parameters will not be lost in the non-volatile memory. Therefore, during the recovery process, only simple data needs to be written in the non-volatile memory. Structural check and/or version check, you can immediately restore and go live. Here, NVM generally refers to memory that can store data in the event of a power failure. New-generation NVMs (such as STT-RAM, PCM, ReRAM, 3D xPoint, etc.), new-generation NVMs and first-generation NVMs (such as Flash Memory) can be used. ) compared with the advantages of: (1) The performance is greatly improved, and it is closer to the DRAM used for the main memory of the computer; (2) When getting rid of the physical characteristics, it must be a multiple of a fixed size of bytes (such as Flash is usually a multiple of the number of bytes). 4KB (4*1024 bytes) addressable, can be addressed by single byte (Byte-addressable). For example, persistent memory device (Persistent Memory, PMEM) is a 3D xPoint product, compared with traditional DRAM, PMEM has a larger capacity and lower price cost, just to meet the needs of high memory usage of parameter server clusters. Therefore, one implementation can be to store model parameters in a distributed manner, which consists of PMEM-based parameter server nodes. parameter server cluster.
为了实现上述方法,本公开提出了一种在基于非易失性内存的参数服务器节点中的非易失性内存中,模型参数的存储结构。具体地说,可将每个参数服务器节点上存储的每个模型对应的模型参数在逻辑上划分为至少一级存储子模块。当模型参数在逻辑上划分为两级或两级以上的存储子模块时,相邻的上一级存储子模块包括至少一个下一级存储子模块。对模型参数进行分级存储,有利于模型参数的管理和查询,满足高并发访问等需求,更有利于参数服务器节点恢复时对模型参数的遍历查询。此外,本公开还提出一种全新的数据组织形式,具体地说,在基于非易失性内存的参数服务器节点中的非易失性内存中,将数据分为两层存储,第一层数据可记录单个参数服务器节点的ID信息以及该参数服务器节点上所有的第一级存储子模块的ID信息。第二层数据可针对每个第一级存储子模块分别用哈希映射(HashMap)去存储具体的模型参数。此外,第二层数据还包括了第一级存储子模块头信息用于快速恢复时查询使用。此外,本公开还提出一种全新的恢复流程,当参数服务器节点重启时,可根据存储在非易失性内存中的第一层数据和第二层数据,能够快速遍历参数服务器节点中存储的各级存储子模块,从而快速恢复参数服务器节点中存储的所有模型参数,能够实现基于非易失性内存的参数服务器节点的毫秒级恢复。下面将参照图3至图11来具体描述根据本公开的模型参数存储方法和系统以及参数服务器节点的恢复方法和系统。In order to realize the above method, the present disclosure proposes a storage structure for model parameters in a non-volatile memory in a non-volatile memory-based parameter server node. Specifically, the model parameters corresponding to each model stored on each parameter server node may be logically divided into at least one level of storage sub-modules. When the model parameters are logically divided into two or more levels of storage sub-modules, the adjacent upper-level storage sub-modules include at least one lower-level storage sub-module. Hierarchical storage of model parameters is conducive to the management and query of model parameters, to meet the requirements of high concurrent access, and more conducive to traversal and query of model parameters when the parameter server node is restored. In addition, the present disclosure also proposes a new data organization form. Specifically, in the non-volatile memory of the parameter server node based on non-volatile memory, the data is divided into two layers of storage, the first layer of data is stored in two layers. The ID information of a single parameter server node and the ID information of all the first-level storage submodules on the parameter server node can be recorded. The second-level data can use a hash map (HashMap) for each first-level storage sub-module to store specific model parameters. In addition, the second-level data also includes the first-level storage sub-module header information for query use during fast recovery. In addition, the present disclosure also proposes a new recovery process. When the parameter server node restarts, it can quickly traverse the data stored in the parameter server node according to the first layer data and the second layer data stored in the non-volatile memory. The sub-modules are stored at all levels, so that all model parameters stored in the parameter server node can be quickly restored, and the millisecond-level recovery of the parameter server node based on non-volatile memory can be realized. The method and system for storing model parameters and the method and system for restoring parameter server nodes according to the present disclosure will be described in detail below with reference to FIGS. 3 to 11 .
图3是示出根据本公开的示例性实施例的模型参数的存储方法的流程图。FIG. 3 is a flowchart illustrating a storage method of model parameters according to an exemplary embodiment of the present disclosure.
参照图3,在步骤301,可获取至少一个模型的模型参数。模型可以是具有高维度的AI模型,例如,推荐模型、信用卡反欺诈模型等。可将海量的历史数据放入离线训练系统中,对AI模型进行训练,并将训练好的AI模型部署到线上推理系统中进行使用。AI模型的每一个维度对应一个参数,一个能处理海量数据的AI模型,维度可以达到上亿维甚至十亿维级别,因此每个模型可能存储上亿甚至十亿个参数。这里的模型参数可以是指训练前或训练过程中的参数,还可以是指训练完成后的参数。Referring to FIG. 3, in step 301, model parameters of at least one model may be acquired. The model can be an AI model with high dimensions, for example, a recommendation model, a credit card anti-fraud model, etc. Massive historical data can be put into the offline training system to train the AI model, and the trained AI model can be deployed to the online inference system for use. Each dimension of an AI model corresponds to a parameter. An AI model that can process massive data can reach hundreds of millions of dimensions or even a billion dimensions, so each model may store hundreds of millions or even billions of parameters. The model parameters here can refer to parameters before training or during training, and can also refer to parameters after training is completed.
在步骤302,可将所述至少一个模型的模型参数存储到参数服务器集群中,其中,所述参数服务器集群包括多个基于非易失性内存的参数服务器节点。这里,参数服务器集群可以是用于训练的离线参数服务器集群,也可以是用于推理的线上参数服务器集群。In step 302, model parameters of the at least one model may be stored in a parameter server cluster, wherein the parameter server cluster includes a plurality of non-volatile memory-based parameter server nodes. Here, the parameter server cluster may be an offline parameter server cluster for training, or an online parameter server cluster for inference.
根据本公开的示例性实施例,可将所述至少一个模型中的每个模型的模型参数均分布式地存储到所述多个基于非易失性内存的参数服务器节点的非易失性内存中;针对每个基于非易失性内存的参数服务器节点,将该参数服务器节点上存储的每个模型对应的模型参数在逻辑上划分为至少一级存储子模块以进行存储。例如,可将所述至少一个模型中的每个模型的模型参数在逻辑上划分成多个存储模块(例如,下述的第一级存储子模块),将划分出的存储模块分布式地存储到所述多个基于非易失性内存的参数服务器节点的非易失性内存中。此外,在每个基于非易失性内存的参数服务器节点的非易失性内存中,还可将各个存储模块进一步划分成至少一级的存储子模块(例如,下述的第二级存储子模块、第三级存储子模块等)。According to an exemplary embodiment of the present disclosure, the model parameters of each model in the at least one model may be distributedly stored in the non-volatile memory of the plurality of non-volatile memory-based parameter server nodes medium; for each non-volatile memory-based parameter server node, the model parameters corresponding to each model stored on the parameter server node are logically divided into at least one-level storage sub-modules for storage. For example, the model parameters of each model in the at least one model may be logically divided into a plurality of storage modules (for example, the following first-level storage sub-modules), and the divided storage modules are distributed and stored into the non-volatile memory of the plurality of non-volatile memory-based parameter server nodes. In addition, in the non-volatile memory of each non-volatile memory-based parameter server node, each storage module may be further divided into at least one level of storage sub-modules (for example, the following second level of storage sub-modules). modules, tertiary storage submodules, etc.).
图4是示出根据本公开的示例性实施例的模型参数逻辑存储结构的示意图。如图4所示,仅示例性地示出参数服务器集群中的一个参数服务器节点(即,PS Node X)上的模型参数存储结构,其它参数服务器节点可以以相同或相似的方式来存储模型参数。每个模型逻辑上可被分成多个存储子模块(例如,Storage),这些存储子模块可被哈希分配到多个参数服务器节点上。一个参数服务器节点存储的多个存储子模块可属于不同模型,例如,图4中的Storage 1和Storage 3属于模型1(Model 1),Storage 24属于模型2(Model2)。对于一个Storage存储子模块,还可划分为多个下一级存储子模块(例如,Shard),每个Shard负责存储具体的模型参数,模型参数会以“参数名”+“参数值”的键值对存在Shard中,而每个Shard只会存储模型的一部分参数以分担负载。图4仅示出模型参数在逻辑上被划分为两级存储子模块(Storage和Shard)进行存储,但本公开不限于此,根据本公开,模型参数在逻辑上被划分为任何级的存储子模块。例如,模型参数在逻辑上可仅被划分为一级存储子模块(例如Storage),在每个Storage下存储具体模型参数,或者,模型参数在逻辑上可被划分为三级存储子模块,即,在Storage和Shard之后,在每个Shard中还可划分为多个第三级存储子模块,在每个第三级存储子模块中存储具体的模型参数,以此类推。FIG. 4 is a schematic diagram illustrating a logical storage structure of model parameters according to an exemplary embodiment of the present disclosure. As shown in FIG. 4, only the model parameter storage structure on one parameter server node (ie, PS Node X) in the parameter server cluster is exemplarily shown, and other parameter server nodes can store model parameters in the same or similar manner . Each model can be logically divided into multiple storage sub-modules (eg, Storage), and these storage sub-modules can be hashed to multiple parameter server nodes. Multiple storage submodules stored in a parameter server node may belong to different models. For example, Storage 1 and Storage 3 in Figure 4 belong to Model 1 (Model 1), and Storage 24 belongs to Model 2 (Model2). For a Storage storage submodule, it can also be divided into multiple next-level storage submodules (for example, shards). Each shard is responsible for storing specific model parameters. Value pairs are stored in shards, and each shard only stores a part of the model's parameters to share the load. FIG. 4 only shows that the model parameters are logically divided into two levels of storage sub-modules (Storage and Shard) for storage, but the present disclosure is not limited to this. According to the present disclosure, the model parameters are logically divided into storage sub-modules of any level. module. For example, model parameters can be logically divided into only one-level storage sub-modules (such as Storage), and specific model parameters are stored under each Storage, or model parameters can be logically divided into three-level storage sub-modules, that is, , after Storage and Shard, each shard can be further divided into multiple third-level storage sub-modules, and specific model parameters are stored in each third-level storage sub-module, and so on.
返回参照图3,根据本公开的示例性实施例,可在每个基于非易失性内存的参数服务器节点的非易性内存中,存储第一层数据和第二层数据。Referring back to FIG. 3 , according to an exemplary embodiment of the present disclosure, the first-tier data and the second-tier data may be stored in the non-volatile memory of each non-volatile memory-based parameter server node.
例如,图5是示出根据本公开的示例性实施例的参数服务器节点的数据物理存储结构的示意图。参照图5,在参数服务器节点的非易失性内存上,会分两层数据存储,如图5所示的第一层和第二层)。对于一个参数服务器节点来说,在第一层数据中可具有一个存储,用于存储当前节点的信息,在第二层数据中可具有M个存储,分别用于存储M个第一级存储子模块的具体信息。下面将详细描述根据本公开的示例性实施例的第一层数据和第二层数据。For example, FIG. 5 is a schematic diagram illustrating a data physical storage structure of a parameter server node according to an exemplary embodiment of the present disclosure. Referring to Figure 5, on the non-volatile memory of the parameter server node, there will be two layers of data storage, such as the first layer and the second layer shown in Figure 5). For a parameter server node, there may be one storage in the first-level data for storing the information of the current node, and M storages in the second-level data for storing M first-level storage sub-nodes respectively. Module specific information. The first layer data and the second layer data according to an exemplary embodiment of the present disclosure will be described in detail below.
根据本公开的示例性实施例,在第一层数据中,可存储参数服务器节点头信息,用于查询该参数服务器节点的节点信息和第一级存储子模块信息。According to an exemplary embodiment of the present disclosure, in the first-level data, parameter server node header information may be stored for querying the node information and first-level storage sub-module information of the parameter server node.
节点信息可以是参数服务器节点的ID信息(Node ID),参数服务器集群内部会给每一个参数服务器分配一个ID,且ID是唯一的。因此,获取参数服务器节点的ID信息就可确定其是参数服务器集群中的哪个参数服务器节点。The node information can be the ID information (Node ID) of the parameter server node. The parameter server cluster will assign an ID to each parameter server, and the ID is unique. Therefore, by obtaining the ID information of the parameter server node, it can be determined which parameter server node in the parameter server cluster it is.
此外,第一级存储子模块信息可以是参数服务器节点上存储的所有第一级存储子模块(Storage)的ID信息列表(Storage ID List)。根据本公开的示例性实施例,存储子模块的ID(例如,Storage ID,Shard ID)是针对每个模型编号的,例如,对于模型1会有模型1的S1R1(Storage 1,Shard 1)、S1R2、S2R1、S2R2…,对于模型2也会有模型2的S1R1、S1R2、S2R1、S2R2…。因此,为了区分模型之间的存储子模块,第一级存储子模块ID列表中包括的第一级存储子模块ID可由模型ID和对应模型中的第一级存储子模块ID组成,例如,第一级存储子模块ID列表可包括Model 1Storage 0、Model 1Storage 3、Model 2Storage 1…。此外,第一级存储子模块ID列表可在第一层数据中以持久化列表(persistent list)的形式存储,这样可保证模型参数都可插入到非易失性内存中。In addition, the first-level storage submodule information may be the ID information list (Storage ID List) of all first-level storage submodules (Storage) stored on the parameter server node. According to an exemplary embodiment of the present disclosure, the IDs of the storage submodules (eg, Storage ID, Shard ID) are numbered for each model, for example, for model 1 there will be S1R1 (Storage 1, Shard 1), S1R2, S2R1, S2R2..., for Model 2 there will also be S1R1, S1R2, S2R1, S2R2... of Model 2. Therefore, in order to distinguish storage submodules between models, the first-level storage submodule ID included in the first-level storage submodule ID list may be composed of the model ID and the first-level storage submodule ID in the corresponding model, for example, the first-level storage submodule ID The list of primary storage sub-module IDs can include Model 1Storage 0, Model 1Storage 3, Model 2Storage 1…. In addition, the first-level storage submodule ID list can be stored in the first-level data in the form of a persistent list, which ensures that model parameters can be inserted into non-volatile memory.
根据本公开的示例性实施例,第一层数据(即,参数服务器节点头信息)作为整个基于非易性内存的参数服务器节点的存储的根,可存储在参数服务器节点的非易失性内存中的固定位置,以方便参数服务器节点执行快速恢复时查询。According to an exemplary embodiment of the present disclosure, the first layer data (ie, parameter server node header information) can be stored in the non-volatile memory of the parameter server node as the root of the storage of the entire non-volatile memory-based parameter server node. Fixed location in the parameter server node to facilitate query when performing fast recovery.
根据本公开的示例性实施例,在第二层数据中,可存储M个第一级存储子模块头信息和M个第一级存储子模块哈希映射(HashMap)信息。第二层数据可用于查询该参数服务器节点的各个第一级存储子模块中存储的模型参数。例如,对于每个第一级存储子模块,可在第二层数据存储中新创建对应的非易失性内存的存储池进行单独存储。According to an exemplary embodiment of the present disclosure, in the second-level data, M pieces of first-level storage sub-module header information and M pieces of first-level storage sub-module hash map (HashMap) information may be stored. The second-level data can be used to query the model parameters stored in each first-level storage sub-module of the parameter server node. For example, for each first-level storage submodule, a corresponding non-volatile memory storage pool may be newly created in the second-level data storage for separate storage.
根据本公开的示例性实施例,第一级存储子模块头信息(Storage Head)可分配三个空间,分别用于存放该第一级存储子模块ID(Storage ID)、该第一级存储子模块存储的模型参数的版本信息(Version)、该第一级存储子模块的指向下一级哈希映射的指针(Shard HashMap Pointer)。如图5所示,第一级存储子模块(Storage)的下一级是第二级存储子模块(Shard),因此,第一级存储子模块头信息中的指向下一级哈希映射的指针可以是Shard HashMap Pointer,但本公开不限于此。例如,当第一级存储子模块(Storage)的下一级是模型参数本身时,第一级存储子模块头信息中的指向下一级哈希映射的指针可以是指向模型参数哈希映射的指针(例如,Para HashMap Point)。According to an exemplary embodiment of the present disclosure, the first-level storage sub-module header information (Storage Head) may be allocated three spaces, which are respectively used to store the first-level storage sub-module ID (Storage ID), the first-level storage sub-module ID The version information (Version) of the model parameters stored in the module, and the pointer (Shard HashMap Pointer) of the first-level storage sub-module to the next-level hash map. As shown in Figure 5, the next level of the first-level storage sub-module (Storage) is the second-level storage sub-module (Shard). Therefore, the header information of the first-level storage sub-module points to the hash map of the next level. The pointer may be a Shard HashMap Pointer, but the present disclosure is not limited thereto. For example, when the next level of the first-level storage sub-module (Storage) is the model parameter itself, the pointer to the next-level hash map in the header information of the first-level storage sub-module may point to the model parameter hash map Pointer (for example, Para HashMap Point).
根据本公开的示例性实施例,第一级存储子模块哈希映射信息可包括该第一级存储子模块下的各个从第二级至第N级存储子模块中每一级存储子模块的哈希映射、以及该第一级存储子模块下的各个第N级存储子模块下的模型参数哈希映射,其中,N为模型参数被划分的存储子模块的级数。其中,每一级存储子模块的哈希映射的键为该级存储子模块的ID,值为指向下一级哈希映射的指针,模型参数哈希映射的键为参数名,值为参数值,每一级存储子模块的哈希映射和模型参数哈希映射通过该级存储子模块或该模型参数的上一级存储子模块相应的指向下一级哈希映射的指针链接。According to an exemplary embodiment of the present disclosure, the first-level storage sub-module hash mapping information may include the hash map of each level of storage sub-modules from the second-level to the Nth-level storage sub-module under the first-level storage sub-module. The hash map and the model parameter hash map under each of the Nth-level storage sub-modules under the first-level storage sub-module, where N is the number of stages of the storage sub-modules into which the model parameters are divided. Among them, the key of the hash map of each level of storage sub-module is the ID of this level of storage sub-module, the value is the pointer to the next level of hash map, the key of the model parameter hash map is the parameter name, and the value is the parameter value , the hash map of each level of storage sub-module and the model parameter hash map are linked by the corresponding pointer to the next level of hash map of this level of storage sub-module or the upper-level storage sub-module of this model parameter.
如图5所示,模型参数被划分为二级存储子模块(Storage和Shard)进行存储。因此,第一级存储子模块哈希映射信息可包括第二级存储子模块的哈希映射(Shard HashMap)和各个第二级存储子模块下的模型参数哈希映射(Para HashMap)。在第二级存储子模块的哈希映射(Shard HashMap)中,键为第二级存储子模块ID(Shard ID),值为指向模型参数的哈希映射的指针(Para HashMap Point)。在模型参数的哈希映射(Para HashMap)中,键为参数名(Para ID),值为参数值(Value)。在第一级存储子模块头信息、二级存储子模块的哈希映射和模型参数的哈希映射之间,每一级都是通过其上一级的指向下一级哈希映射的指针链接起来的,即,第一级存储子模块头信息中的指向下一级哈希映射的指针指向第二级存储子模块哈希映射,第二级存储子模块哈希映射中的指向下一级哈希映射的指针指向模型参数的哈希映射。另外,图5仅示例性地示出一个第二级存储子模块(Shard 0)下的模型参数哈希映射,但其它第二级存储子模块下也同样具有模型参数哈希映射。当然,本公开不限于图5所示的例示。As shown in Figure 5, the model parameters are divided into secondary storage sub-modules (Storage and Shard) for storage. Therefore, the hash map information of the first-level storage submodule may include the hash map (Shard HashMap) of the second-level storage submodule and the model parameter hash map (Para HashMap) under each second-level storage submodule. In the hash map (Shard HashMap) of the second-level storage sub-module, the key is the second-level storage sub-module ID (Shard ID), and the value is the pointer to the hash map of the model parameters (Para HashMap Point). In the hash map (Para HashMap) of model parameters, the key is the parameter name (Para ID) and the value is the parameter value (Value). Between the header information of the first-level storage sub-module, the hash map of the second-level storage sub-module, and the hash map of model parameters, each level is linked by the pointer of the previous level to the hash map of the next level. That is, the pointer to the next-level hash map in the header information of the first-level storage sub-module points to the second-level storage sub-module hash map, and the pointer in the second-level storage sub-module hash map points to the next level. A pointer to a hashmap to a hashmap of model parameters. In addition, FIG. 5 only exemplarily shows the model parameter hash map under one second-level storage sub-module (Shard 0), but other second-level storage sub-modules also have model parameter hash maps. Of course, the present disclosure is not limited to the illustration shown in FIG. 5 .
例如,图6是示出根据本公开的另一示例性实施例的参数服务器节点的数据物理存储结构的示意图。如图6所示,当模型参数被划分为一级存储子模块(Storage)时,每个第一级存储子模块哈希映射信息包括该第一级存储子模块下的模型参数哈希映射(Para HashMap),第一级存储子模块头信息中的指向下一级哈希映射的指针为指向模型参数哈希映射的指针(Para HashMap Point)。在第一级存储子模块头信息和模型参数哈希映射之间,是通过指向模型参数哈希映射的指针链接起来的。For example, FIG. 6 is a schematic diagram illustrating a data physical storage structure of a parameter server node according to another exemplary embodiment of the present disclosure. As shown in FIG. 6 , when the model parameters are divided into first-level storage sub-modules (Storage), the hash map information of each first-level storage sub-module includes the model parameter hash map ( Para HashMap), the pointer to the next-level hash map in the header information of the first-level storage submodule is the pointer to the model parameter hash map (Para HashMap Point). The first-level storage submodule header information and the model parameter hash map are linked by a pointer to the model parameter hash map.
又例如,图7是示出根据本公开的另一示例性实施例的参数服务器节点的数据物理存储结构的示意图。如图7所示,当模型参数被划分为三级存储子模块(Storage、Shard、Slice)时,每个第一级存储子模块哈希映射信息包括该第一级存储子模块下的各个第二级存储子模块的哈希映射(Shard HashMap)、各个第二级存储子模块下的各个第三级存储子模块的哈希映射(Slice HashMap)、以及各个第三级存储子模块下的模型参数哈希映射(Para HashMap)。第一级存储子模块头信息中的指向下一级哈希映射的指针为指向第二 级存储子模块哈希映射的指针(Shard HashMap Point),第二级存储子模块哈希映射中的指向下一级哈希映射的指针为指向第三级存储子模块哈希映射的指针(Slice HashMap Point),第三级存储子模块哈希映射中的指向下一级哈希映射的指针为指向模型参数哈希映射的指针(Para HashMap Point)。在第一级存储子模块头信息、第二级存储子模块哈希映射、第三级存储子模块哈希映射和模型参数哈希映射之间,每一级都是通过其上一级的指向下一级哈希映射的指针链接起来的,即,第一级存储子模块头信息中的指向下一级哈希映射的指针指向第二级存储子模块哈希映射,第二级存储子模块哈希映射中的指向下一级哈希映射的指针指向第三级存储子模块哈希映射,第三级存储子模块哈希映射中的指向下一级哈希映射的指针指向模型参数的哈希映射。另外,图7仅示例性地示出一个第二级存储子模块(Shard 0)下的第三级存储子模块的哈希映射和一个第三级存储子模块(Slice0)下的模型参数的哈希映射,但其它第二级存储子模块下也同样具有第三级存储子模块的哈希映射,其它第三级存储子模块下也同样具有模型参数的哈希映射。For another example, FIG. 7 is a schematic diagram illustrating a data physical storage structure of a parameter server node according to another exemplary embodiment of the present disclosure. As shown in FIG. 7 , when the model parameters are divided into three-level storage sub-modules (Storage, Shard, Slice), the hash map information of each first-level storage sub-module includes each The hash map (Shard HashMap) of the secondary storage sub-module, the hash map (Slice HashMap) of each third-level storage sub-module under each second-level storage sub-module, and the model under each third-level storage sub-module Parameter hash map (Para HashMap). The pointer to the next-level hash map in the header information of the first-level storage sub-module is a pointer to the second-level storage sub-module hash map (Shard HashMap Point), and the pointer in the second-level storage sub-module hash map points to The pointer of the next-level hash map is the pointer to the third-level storage sub-module hash map (Slice HashMap Point), and the pointer to the next-level hash map in the third-level storage sub-module hash map is the pointer to the model The pointer to the parameter hash map (Para HashMap Point). Between the first-level storage sub-module header information, the second-level storage sub-module hash map, the third-level storage sub-module hash map and the model parameter hash map, each level is pointed to by its previous level The pointers of the next-level hash map are linked, that is, the pointer to the next-level hash map in the header information of the first-level storage sub-module points to the second-level storage sub-module hash map, and the second-level storage sub-module The pointer to the next-level hash map in the hash map points to the third-level storage sub-module hash map, and the pointer to the next-level hash map in the third-level storage sub-module hash map points to the hash map of the model parameters. Hi map. In addition, FIG. 7 only exemplarily shows the hash map of the third-level storage sub-module under one second-level storage sub-module (Shard 0) and the hash map of the model parameters under one third-level storage sub-module (Slice0). However, other second-level storage sub-modules also have hash maps of third-level storage sub-modules, and other third-level storage sub-modules also have hash maps of model parameters.
当然,本公开不限于上述示例,模型参数可被划分为任何级的存储子模块,在模型参数被划分为任何级的存储子模块的情况下,根据上述示例的逻辑,类推地存储和构造第一层数据和第二层数据。Of course, the present disclosure is not limited to the above examples, and the model parameters can be divided into storage sub-modules of any level. In the case where the model parameters are divided into storage sub-modules of any level, according to the logic of the above examples, the storage and construction of the first One layer of data and second layer of data.
根据本公开的示例性实施例,可从基于非易失性内存的参数服务器集群查询所述至少一个模型中的指定模型的参数,并基于查询到的指定模型的参数提供相应的模型预估服务。可根据指定模型的参数的参数名,确定参数存储的参数服务器节点ID以及各级存储子模块ID,并根据确定的参数服务器节点ID找到参数服务器节点,并根据各级存储子模块ID,基于找到的参数服务器节点上的第二级数据,找到与参数名对应的参数值。According to an exemplary embodiment of the present disclosure, a parameter of a specified model in the at least one model can be queried from a non-volatile memory-based parameter server cluster, and a corresponding model estimation service can be provided based on the queried parameter of the specified model . According to the parameter name of the parameter of the specified model, the parameter server node ID of the parameter storage and the storage sub-module ID of each level can be determined, and the parameter server node can be found according to the determined parameter server node ID, and according to the storage sub-module ID of each level, based on finding The second-level data on the parameter server node of , find the parameter value corresponding to the parameter name.
例如,当查询模型X下的参数时,参数查询的过程是用户提供参数名(比如,最后一层的Para0),参数服务器节点会返回Para0对应value的过程。具体地说,首先可根据参数的名称(Para0)计算哈希得到这个参数所在的Storage ID和Shard ID。例如,假设Para0=‘12345’,模型X一共有5个Storage,每个Storage有8个Shard,Para0对应的Storage ID=0(12345mod 5),Shard ID=1(12345mod 8)。当算出Storage ID后,可利用Storage ID与当前的参数服务器集群总共的参数服务器节点的数量相除取余数,得到Storage ID所在的node ID(比如服务器一共3台,Para0对应的Storage ID是0,那Storage 0存储在Node 0上(0 mod 3=0))。至此,通过用户提供的参数名Para0,通过三次计算得到了这个参数存储的Node ID、Storage ID和Shard ID,随后,可根据Node ID找到相应的参数据服务器节点,随后根据Storage ID找到对应的第二层数据中的对应的存储,根据该对应存储中的第一级存储子模块头信号中的指向Shard哈希映射的指针找到对应的Shard哈希映射,在对应的Shard哈希映射中,根据Shard ID找到对应的指向模型参数哈希映射的指针,根据指向模型参数哈希映射的指针找到对应的模型参数哈希映射,在模型参数哈希映射中,根据参数名Para0找到对应的参数值value。For example, when querying parameters under model X, the process of parameter query is that the user provides the parameter name (for example, Para0 in the last layer), and the parameter server node will return the process of the value corresponding to Para0. Specifically, first, the Storage ID and Shard ID where this parameter is located can be obtained by calculating the hash according to the name of the parameter (Para0). For example, assuming Para0='12345', model X has a total of 5 Storages, and each Storage has 8 Shards. After the Storage ID is calculated, you can use the Storage ID to divide the total number of parameter server nodes in the current parameter server cluster and take the remainder to obtain the node ID where the Storage ID is located (for example, there are 3 servers in total, and the Storage ID corresponding to Para0 is 0, That Storage 0 is stored on Node 0 (0 mod 3=0)). So far, through the parameter name Para0 provided by the user, the Node ID, Storage ID and Shard ID stored by this parameter are obtained through three calculations. Then, the corresponding parameter data server node can be found according to the Node ID, and then the corresponding No. 1 node can be found according to the Storage ID. For the corresponding storage in the second-level data, find the corresponding shard hash map according to the pointer to the shard hash map in the first-level storage sub-module header signal in the corresponding storage, and in the corresponding shard hash map, according to Shard ID finds the corresponding pointer to the model parameter hash map, finds the corresponding model parameter hash map according to the pointer to the model parameter hash map, and in the model parameter hash map, finds the corresponding parameter value value according to the parameter name Para0 .
根据本公开的示例性实施例,写参数只有在新模型上线的时候会发生。写参数的流程和查询参数的流程类似,唯一的不同有两点。第一:为了保证在上传新模型参数的过程中,老的模型参数依然可以被访问,所有新的模型参数都会插入全新的存储池中。比如,图5中的第二层存储会重新创建一个空的模型1,Storage 0 new,当写新的Para0的value的时候,Para0的参数会被插入到新的Storage 0 new下Shard 1下的HashMap中。当新模式所有参数都上传到参数服务器集群后,参数查询服务才会被切换到新的参数上,于此同时,后端线程开始慢慢回收旧模型参数的空间。第二点是,当新的Para0写入Storage 0 new下的HashMap时,可使用CPU指令(如clflushopt+mfence)保证每次写入的参数数据都写入NVM而不是在易失性的CPU高速缓存里。According to an exemplary embodiment of the present disclosure, writing parameters only occurs when a new model comes online. The process of writing parameters is similar to the process of querying parameters, with two differences. First: In order to ensure that the old model parameters can still be accessed during the process of uploading new model parameters, all new model parameters will be inserted into a new storage pool. For example, the second layer of storage in Figure 5 will recreate an empty model 1, Storage 0 new. When writing a new value of Para0, the parameters of Para0 will be inserted into the new Storage 0 new under Shard 1. in HashMap. After all the parameters of the new model are uploaded to the parameter server cluster, the parameter query service will be switched to the new parameters. At the same time, the backend thread will slowly reclaim the space of the parameters of the old model. The second point is that when the new Para0 is written to the HashMap under Storage 0 new, the CPU instruction (such as clflushopt+mfence) can be used to ensure that the parameter data written each time is written to the NVM instead of the volatile CPU high-speed in the cache.
图8是示出根据本公开的示例性实施例的参数服务器节点的恢复方法的流程图。根据本公开的示例性实施例的参数服务器节点的恢复方法适应于上述参照图3所述的参数服务器节点在由于故障等原因而需要重启的情况。FIG. 8 is a flowchart illustrating a recovery method of a parameter server node according to an exemplary embodiment of the present disclosure. The recovery method of the parameter server node according to the exemplary embodiment of the present disclosure is suitable for the situation that the parameter server node described above with reference to FIG. 3 needs to be restarted due to a failure or the like.
参照图8,在步骤801,在参数服务器节点重启后,可从参数服务器节点的非易失性内存中获取所存储的第一层数据。如上所述,第一层数据可参数服务器节点头信息,用于查询参数服务器节点的节点信息和第一级存储子模块信息。参数服务器节点头信息可包括参数服务器节点ID和第一级存储子模块ID列表。因此,可根据参数服务器节点头中的参数服务器节点ID确定重启的参数服务器节点是参数服务器集群中的哪个参数服务器节点,并可根据参数服务器节点头中的第一级存储子模块ID列表确定重启的参数服务器节点中包括的所有第一级存储子模块。Referring to FIG. 8, in step 801, after the parameter server node is restarted, the stored first-layer data may be obtained from the non-volatile memory of the parameter server node. As described above, the first-level data can parameterize the server node header information, which is used to query the parameter server node's node information and the first-level storage sub-module information. The parameter server node header information may include a parameter server node ID and a list of first-level storage submodule IDs. Therefore, it can be determined which parameter server node in the parameter server cluster the restarted parameter server node is according to the parameter server node ID in the parameter server node header, and the restart can be determined according to the first-level storage submodule ID list in the parameter server node header. All first-level storage submodules included in the parameter server node.
根据本公开的示例性实施例,第一层数据可被存储在所述参数服务器节点的非易失性内存中的固定位置处。因此,可从参数服务器节点的非易失性内存中的固定位置处读取第一层数据。这样有利于在参数服务器节点重启后,能快速从参数服务器节点中查询该参数服务器节点的存储信息。According to an exemplary embodiment of the present disclosure, the first tier data may be stored at a fixed location in the non-volatile memory of the parameter server node. Therefore, the first layer of data can be read from a fixed location in the non-volatile memory of the parameter server node. In this way, after the parameter server node is restarted, the storage information of the parameter server node can be quickly queried from the parameter server node.
根据本公开的示例性实施例,第一级存储子模块ID列表中包括的第一级存储子模块ID可由模型ID和对应模型中的第一级存储子模块ID组成。According to an exemplary embodiment of the present disclosure, the first-level storage submodule IDs included in the first-level storage submodule ID list may be composed of a model ID and a first-level storage submodule ID in a corresponding model.
在步骤802,可基于第一层数据,从参数服务器节点的非易失性内存中获取所存储的第二层数据中的每个第一级存储子模块头信息。如上所述,第二层数据可M个第一级存储子模块头信息和M个第一级存储子模块哈希映射信息,第二层数据用于查询该参数服务器节点的各个第一级存储子模块中存储的模型参数,其中,M为该参数服务器节点上存储的第一级存储子模块的数量。In step 802, each first-level storage sub-module header information in the stored second-level data may be acquired from the non-volatile memory of the parameter server node based on the first-level data. As mentioned above, the second-level data can include M first-level storage sub-module header information and M first-level storage sub-module hash mapping information, and the second-level data is used to query each first-level storage of the parameter server node. Model parameters stored in the sub-module, where M is the number of first-level storage sub-modules stored on the parameter server node.
根据本公开的示例性实施例,第一级存储子模块头信息可包括该第一级存储子模块ID、该第一级存储子模块存储的模型参数的版本信息、以及该第一级存储子模块的指向下一级哈希映射的指针。因此,在获取第一数据后,可基于第一级存储子模块ID列表,确定参数服务器节点的所有第一级存储子模块ID,随后基于参数服务器节点的所有第一级存储子模块ID中的每个第一级存储子模块ID,获取具有相应第一级存储子模块ID的第一级存储子模块头信息。因此,可获得参数服务器节点上存储的所有(M个)第一级存储子模块的各自的第一级存储子模块头信息。According to an exemplary embodiment of the present disclosure, the first-level storage sub-module header information may include the first-level storage sub-module ID, version information of model parameters stored by the first-level storage sub-module, and the first-level storage sub-module The module's pointer to the next level hash map. Therefore, after acquiring the first data, all the first-level storage sub-module IDs of the parameter server node can be determined based on the ID list of the first-level storage sub-modules, and then based on the IDs of all the first-level storage sub-module IDs of the parameter server node For each first-level storage sub-module ID, the header information of the first-level storage sub-module with the corresponding first-level storage sub-module ID is acquired. Therefore, the respective first-level storage sub-module header information of all (M) first-level storage sub-modules stored on the parameter server node can be obtained.
根据本公开的示例性实施例,所有(M个)第一级存储子模块也具有各自的第一级存储子模块哈希映射信息。每个第一级存储子模块可基于其第一级存储子模块头信息中的指向下一级哈希映射的指针与其第一级存储子模块哈希映射信息相关联。每个第一级存储子模块哈希映射信息可包括该第一级存储子模块下的各个从第二级至第N级存储子模块中每一级存储子模块的哈希映射、以及该第一级存储子模块下的各个第N级存储子模块下的模型参数哈希映射,其中,N为模型参数被划分的存储子模块的级数。每一级存储子模块的哈希映射的键为该级存储子模块的ID,值为指向下一级哈希映射的指针。模型参数哈希映射的键为参数名,值为参数值。每一级存储子模块的哈希映射和模型参数哈希映射通过该级存储子模块或该模型参数的上一级存储子模块相应的指向下一级哈希映射的指针链接,例如,如图5至图7所示。According to an exemplary embodiment of the present disclosure, all (M) first-level storage sub-modules also have respective first-level storage sub-module hash map information. Each first-level storage sub-module may be associated with its first-level storage sub-module hash map information based on a pointer to the next-level hash map in its first-level storage sub-module header information. The hash map information of each first-level storage sub-module may include the hash map of each level of storage sub-modules from the second-level to the N-th level storage sub-module under the first-level storage sub-module, and the hash map of the first-level storage sub-module. Hash mapping of model parameters under each of the Nth-level storage sub-modules under the first-level storage sub-module, where N is the number of stages of the storage sub-modules into which the model parameters are divided. The key of the hash map of each level of storage sub-module is the ID of the level of storage sub-module, and the value is a pointer to the next level of hash map. The key of the model parameter hash map is the parameter name and the value is the parameter value. The hash map of each level of storage submodule and the model parameter hash map are linked through the corresponding pointer to the next level of the hash map of this level of storage submodule or the previous level of this model parameter storage submodule, for example, as shown in the figure 5 to Figure 7.
在步骤803,可基于每个第一级存储子模块头信息,遍历第二层数据中的每个第一级存储子模块哈希映射信息,以恢复参数服务器节点上存储的模型参数。In step 803, based on the header information of each first-level storage sub-module, the hash map information of each first-level storage sub-module in the second-level data can be traversed to restore the model parameters stored on the parameter server node.
根据本公开的示例性实施例,可针对每个第一级存储子模块执行以下操作:通过上一级存储子模块相应的指向下一级哈希映射的指针搜索下一级哈希映射,直到搜索到模型参数哈希映射;基于模型参数哈希映射,恢复模型参数。According to an exemplary embodiment of the present disclosure, the following operations may be performed for each first-level storage sub-module: search the next-level hash map through the corresponding pointer of the previous-level storage sub-module to the next-level hash map until the next-level hash map is searched. The model parameter hash map is searched; based on the model parameter hash map, the model parameters are restored.
例如,如图5所示,在模型参数被划分为两级存储子模块的情况下,每个第一级存储子模块哈希映射信息包括第一级存储子模块下的各个第二级存储子模块的哈希映射(Shard HashMap)以及该第一级存储子模块下的各个第二级存储子模块的模型参数哈希映射(Para HashMap),其中,第一级存储子模块头信息中的指向下一级哈希映射的指针为指向第二级存储子模块的哈希映射的指针(Shard HashMap Point),每个第二级存储子模块的哈希映射的键为该第二级存储子模块ID(Shard ID),值为指向该第二级存储子模 块下的模型参数哈希映射的指针(Para HashMap Point)。当执行恢复时,针对每个第一级存储子模块,可通过第一级存储子模块头信息中的指向指向第二级存储子模块哈希映射的指针(Shard HashMap Point),搜索第二级存储子模块的哈希映射(Shard HashMap)。对此,可检查第二级存储子模块的哈希映射数据是否完整,并恢复第二级存储子模块的哈希映射的所有数据。随后,可根据第二级存储子模块的哈希映射的所有第二级存储子模块的指向模型参数哈希映射的指针,搜索所有第二级存储子模块下的模型参数哈希映射,从而恢复所有第二级存储子模块下的模型参数。For example, as shown in FIG. 5 , when the model parameters are divided into two-level storage sub-modules, the hash map information of each first-level storage sub-module includes each second-level storage sub-module under the first-level storage sub-module. The hash map (Shard HashMap) of the module and the model parameter hash map (Para HashMap) of each second-level storage sub-module under the first-level storage sub-module, wherein the pointer in the header information of the first-level storage sub-module The pointer of the next-level hash map is the pointer to the hash map of the second-level storage submodule (Shard HashMap Point), and the key of the hash map of each second-level storage submodule is the second-level storage submodule. ID (Shard ID), the value is a pointer (Para HashMap Point) to the model parameter hash map under the second-level storage submodule. When performing recovery, for each first-level storage submodule, the second-level storage submodule can be searched for through the pointer (Shard HashMap Point) in the header information of the first-level storage submodule that points to the hash map of the second-level storage submodule. Shard HashMap for storing submodules. In this regard, it is possible to check whether the hash map data of the second-level storage submodule is complete, and restore all the data of the hash map of the second-level storage submodule. Then, according to the pointers to the model parameter hash map of all the second-level storage sub-modules in the hash map of the second-level storage sub-module, the model parameter hash map under all the second-level storage sub-modules can be searched, thereby restoring All second level stores model parameters under submodules.
又例如,如图6所示,在模型参数被划分为一级存储子模块的情况下,每个第一级存储子模块哈希映射信息包括该第一级存储子模块下的模型参数哈希映射(Para HashMap),其中,第一级存储子模块头信息中的指向下一级哈希映射的指针为指向模型参数哈希映射的指针(Para HashMap Point)。当执行恢复时,针对每个第一级存储子模块,可通过第一级存储子模块头信息中的指向模型参数哈希映射的指针(Para HashMap Point),搜索模型参数哈希映射(Para HashMap),从而恢复每个第一级存储子模块下的模型参数。For another example, as shown in FIG. 6 , when the model parameters are divided into first-level storage submodules, the hash map information of each first-level storage submodule includes the model parameter hash under the first-level storage submodule. Map (Para HashMap), wherein the pointer to the next-level hash map in the header information of the first-level storage submodule is a pointer to the model parameter hash map (Para HashMap Point). When performing recovery, for each first-level storage sub-module, the model parameter hash map (Para HashMap ), thereby restoring the model parameters under each first-level storage submodule.
又例如,图7所示,在模型参数被划分为三级存储子模块的情况下,每个第一级存储子模块哈希映射信息包括该第一级存储子模块下的各个第二级存储子模块的哈希映射(Shard HashMap)、各个第二级存储子模块下的各个第三级存储子模块的哈希映射(Slice HashMap)、以及各个第三级存储子模块下的模型参数哈希映射(Para HashMap)。第一级存储子模块头信息中的指向下一级哈希映射的指针为指向第二级存储子模块哈希映射的指针(Shard HashMap Point),第二级存储子模块哈希映射中的指向下一级哈希映射的指针为指向第三级存储子模块哈希映射的指针(Slice HashMap Point),第三级存储子模块哈希映射中的指向下一级哈希映射的指针为指向模型参数哈希映射的指针(Para HashMap Point)。在执行恢复时,针对每个第一级存储子模块,可通过第一级存储子模块头信息中的指向第二级存储子模块哈希映射的指针(Shard HashMap Point),搜索第二级存储子模块的哈希映射(Shard HashMap)。对此,可检查第二级存储子模块的哈希映射数据是否完整,并恢复第二级存储子模块的哈希映射的所有数据。随后,可根据第二级存储子模块的哈希映射的所有第二级存储子模块的指向第三级存储子模块哈希映射的指针(Slice HashMap Point),搜索所有第二级存储子模块下的各个第三级存储子模块的哈希映射。对此,可检查所有第三级存储子模块的哈希映射数据是否完整,并恢复所有第三级存储子模块的哈希映射的所有数据。随后,可根据每个第三级存储子模块的哈希映射中的指向模型参数哈希映射的指针,搜索模型参数哈希映射,从而恢复所有第三级存储子模块下的模型参数。For another example, as shown in FIG. 7 , when the model parameters are divided into three-level storage sub-modules, the hash map information of each first-level storage sub-module includes each second-level storage sub-module under the first-level storage sub-module. The hash map of the sub-module (Shard HashMap), the hash map of each third-level storage sub-module under each second-level storage sub-module (Slice HashMap), and the model parameter hash under each third-level storage sub-module Map (Para HashMap). The pointer to the next-level hash map in the header information of the first-level storage sub-module is a pointer to the second-level storage sub-module hash map (Shard HashMap Point), and the pointer in the second-level storage sub-module hash map points to The pointer of the next-level hash map is the pointer to the third-level storage sub-module hash map (Slice HashMap Point), and the pointer to the next-level hash map in the third-level storage sub-module hash map is the pointer to the model The pointer to the parameter hash map (Para HashMap Point). When performing recovery, for each first-level storage submodule, the second-level storage can be searched through the pointer (Shard HashMap Point) in the header information of the first-level storage submodule to the hash map of the second-level storage submodule. Shard HashMap for submodules. In this regard, it is possible to check whether the hash map data of the second-level storage submodule is complete, and restore all the data of the hash map of the second-level storage submodule. Subsequently, according to the pointers (Slice HashMap Point) of all second-level storage sub-modules of the hash map of the second-level storage sub-modules to the third-level storage sub-module hash map, search all second-level storage sub-modules under the The hash map of each tertiary storage submodule. In this regard, it is possible to check whether the hash map data of all tertiary storage submodules is complete, and restore all data of the hash maps of all tertiary storage submodules. Subsequently, the model parameter hash map can be searched according to the pointer to the model parameter hash map in the hash map of each third-level storage submodule, thereby restoring model parameters under all third-level storage submodules.
当然,本公开不限于上述示例,模型参数可被划分为任何级的存储子模块,在模型参数被划分为任何级的存储子模块的情况下,恢复流程可根据上述示例的逻辑,类推地执行模型参数的恢复。Of course, the present disclosure is not limited to the above examples, the model parameters can be divided into storage sub-modules of any level, and in the case where the model parameters are divided into storage sub-modules of any level, the recovery process can be performed according to the logic of the above examples, analogically Restoration of model parameters.
此外,根据本公开的另一示例性实施例,当参数服务器节点损坏严重,修复时间较长时,在参数服务器节点重启后,存在参数服务器节点中存储的模型参数已过时情况。因此,当获取到第二层数据中的第一级存储子模块头信息中的模型参数版本信息时,可基于模型参数版本信息确定在参数服务器节点中存储的模型参数是否是最新版本,根据确定的结果再决定是否执行恢复。In addition, according to another exemplary embodiment of the present disclosure, when the parameter server node is seriously damaged and the repair time is long, after the parameter server node is restarted, the model parameters stored in the parameter server node are out of date. Therefore, when the model parameter version information in the header information of the first-level storage sub-module in the second-layer data is obtained, it can be determined whether the model parameters stored in the parameter server node are the latest version based on the model parameter version information, and according to the determination The result then decides whether to perform recovery.
例如,图9是示出根据本公开的示例性实施例的参数服务器节点的恢复方法的流程图。For example, FIG. 9 is a flowchart illustrating a recovery method of a parameter server node according to an exemplary embodiment of the present disclosure.
参照图9,图9中的步骤901和902与图8中的801和802执行相同的操作,因此在此不再赘述。Referring to FIG. 9 , steps 901 and 902 in FIG. 9 perform the same operations as 801 and 802 in FIG. 8 , and thus will not be repeated here.
在步骤902获取到第二层数据中的每个第一级存储子模块头信息之后,可根据第一级存储子模块头信息中的版本信息与存储在参数服务器集群元数据节点上的第一级存储 子模块最新的版本信息进行比对。这里,参数服务器集群元数据节点是存储参数服务器集群的一个全局元数据信息的服务器,比如zoomkeeper。在参数服务器集群中,可将每个模型所有第一级存储子模块对应最新的版本号记录在元数据节点中。当第一级存储子模块的模型参数被更新,该第一级存储子模块的版本会在元数据节点上加1。每次有参数服务器节点重启后,都可以去检查当前第一级存储子模块最新的版本。当元数据节点上存储的版本号比重启的参数服务器节点上的版本号更新,说明重启的参数服务器节点上的模型参数已过时,没有恢复的必要。当元数据节点上存储的版本号与重启的参数服务器节点上的版本号一致,说明重启的参数服务器节点上的模型参数是当前最新版本,可执行恢复。After the header information of each first-level storage sub-module in the second-level data is acquired in step 902, the version information in the first-level storage sub-module header information and the first-level storage sub-module header information stored on the parameter server cluster metadata node can be Compare the latest version information of the level storage sub-module. Here, the parameter server cluster metadata node is a server that stores global metadata information of the parameter server cluster, such as zoomkeeper. In the parameter server cluster, the latest version numbers corresponding to all the first-level storage submodules of each model can be recorded in the metadata node. When the model parameters of the first-level storage submodule are updated, the version of the first-level storage submodule will be incremented by 1 on the metadata node. Every time a parameter server node restarts, you can check the latest version of the current first-level storage submodule. When the version number stored on the metadata node is newer than the version number on the restarted parameter server node, it means that the model parameters on the restarted parameter server node are out of date and there is no need to restore them. When the version number stored on the metadata node is the same as the version number on the restarted parameter server node, it means that the model parameters on the restarted parameter server node are the latest version and can be restored.
因此,在步骤903,在第一级存储子模块头信息中的模型参数版本信息与存储在参数服务器集群的元数据节点上的模型参数版本信息一致的情况下,执行恢复,即,可参照图8描述的步骤803,在此不再赘述。Therefore, in step 903, in the case where the model parameter version information in the header information of the first-level storage submodule is consistent with the model parameter version information stored on the metadata node of the parameter server cluster, the recovery is performed, that is, referring to Fig. Step 803 described in 8 will not be repeated here.
在步骤904,在第一级存储子模块头信息中的模型参数版本信息与存储在参数服务器集群的元数据节点上的模型参数版本信息不一致的情况下,不执行恢复,而从后端存储系统(例如,HDFS)中拉取最新版本的模型参数,并插入参数服务器节点。这里,后端存储系统可存储最新版本的模型参数。In step 904, in the case where the model parameter version information in the header information of the first-level storage sub-module is inconsistent with the model parameter version information stored on the metadata node of the parameter server cluster, the recovery is not performed, and the back-end storage system Pull the latest version of the model parameters (for example, HDFS) and insert the parameter server node. Here, the backend storage system can store the latest version of the model parameters.
图10是示出根据本公开的示例性实施例的模型参数的存储系统的框图。10 is a block diagram illustrating a storage system of model parameters according to an exemplary embodiment of the present disclosure.
参照图10,根据本公开的示例性实施例的模型参数的存储系统1000包括获取装置1001和存储装置1002。10 , a storage system 1000 for model parameters according to an exemplary embodiment of the present disclosure includes an acquisition device 1001 and a storage device 1002 .
获取装置1001可获取至少一个模型的模型参数。模型可以是具有高维度的AI模型,例如,推荐模型、信用卡反欺诈模型等。可将海量的历史数据放入离线训练系统中,对AI模型进行训练,并将训练好的AI模型部署到线上推理系统中进行使用。AI模型的每一个维度对应一个参数,一个能处理海量数据的AI模型,维度可以达到上亿维甚至十亿维级别,因此每个模型可能存储上亿甚至十亿个参数。这里的模型参数可以是指训练前或训练过程中的参数,还可以是指训练完成后的参数。The obtaining means 1001 can obtain model parameters of at least one model. The model can be an AI model with high dimensions, for example, a recommendation model, a credit card anti-fraud model, etc. Massive historical data can be put into the offline training system to train the AI model, and the trained AI model can be deployed to the online inference system for use. Each dimension of an AI model corresponds to a parameter. An AI model that can process massive data can reach hundreds of millions of dimensions or even a billion dimensions, so each model may store hundreds of millions or even billions of parameters. The model parameters here can refer to parameters before training or during training, and can also refer to parameters after training is completed.
存储装置1002可将所述至少一个模型的模型参数存储到参数服务器集群中,其中,所述参数服务器集群包括多个基于非易失性内存的参数服务器节点。这里,参数服务器集群可以是用于训练的离线参数服务器集群,也可以是用于推理的线上参数服务器集群。The storage device 1002 can store the model parameters of the at least one model in a parameter server cluster, wherein the parameter server cluster includes a plurality of non-volatile memory-based parameter server nodes. Here, the parameter server cluster may be an offline parameter server cluster for training, or an online parameter server cluster for inference.
根据本公开的示例性实施例,存储装置1002可将所述至少一个模型中的每个模型的模型参数均分布式地存储到所述多个基于非易失性内存的参数服务器节点的非易失性内存中;针对每个基于非易失性内存的参数服务器节点,将该参数服务器节点上存储的每个模型对应的模型参数在逻辑上划分为至少一级存储子模块以进行存储。例如,存储装置1002可将所述至少一个模型中的每个模型的模型参数在逻辑上划分成多个存储模块(例如,下述的第一级存储子模块),将划分出的存储模块分布式地存储到所述多个基于非易失性内存的参数服务器节点的非易失性内存中。此外,在每个基于非易失性内存的参数服务器节点的非易失性内存中,还可将各个存储模块进一步划分成至少一级的存储子模块(例如,下述的第二级存储子模块、第三级存储子模块等)。According to an exemplary embodiment of the present disclosure, the storage device 1002 may store the model parameters of each model in the at least one model in a distributed manner to the non-volatile memory-based parameter server nodes of the plurality of non-volatile memory-based parameter server nodes. In volatile memory; for each parameter server node based on non-volatile memory, the model parameters corresponding to each model stored on the parameter server node are logically divided into at least one level of storage sub-modules for storage. For example, the storage device 1002 may logically divide the model parameters of each model in the at least one model into a plurality of storage modules (for example, the first-level storage sub-modules described below), and distribute the divided storage modules stored in the non-volatile memory of the plurality of non-volatile memory-based parameter server nodes. In addition, in the non-volatile memory of each non-volatile memory-based parameter server node, each storage module may be further divided into at least one level of storage sub-modules (for example, the following second level of storage sub-modules). modules, tertiary storage submodules, etc.).
根据本公开的示例性实施例,存储装置1002可在每个基于非易失性内存的参数服务器节点的非易性内存中,存储第一层数据和第二层数据。在参数服务器节点的非易失性内存上,会分两层数据存储,如图5所示的第一层和第二层)。对于一个参数服务器节点来说,在第一层数据中可具有一个存储,用于存储当前节点的信息,在第二层数据中可具有M个存储,分别用于存储M个第一级存储子模块的具体信息。下面将详细描述根据本公开的示例性实施例的第一层数据和第二层数据。According to an exemplary embodiment of the present disclosure, the storage device 1002 may store the first-tier data and the second-tier data in the non-volatile memory of each non-volatile memory-based parameter server node. On the non-volatile memory of the parameter server node, there will be two layers of data storage, such as the first layer and the second layer as shown in Figure 5). For a parameter server node, there may be one storage in the first-level data for storing the information of the current node, and M storages in the second-level data for storing M first-level storage sub-nodes respectively. Module specific information. The first layer data and the second layer data according to an exemplary embodiment of the present disclosure will be described in detail below.
根据本公开的示例性实施例,在第一层数据中,可存储参数服务器节点头信息,用于查询该参数服务器节点的节点信息和第一级存储子模块信息。According to an exemplary embodiment of the present disclosure, in the first-level data, parameter server node header information may be stored for querying the node information and first-level storage sub-module information of the parameter server node.
节点信息可以是参数服务器节点的ID信息,参数服务器集群内部会给每一个参数服务器分配一个ID,且ID是唯一的。因此,获取参数服务器节点的ID信息就可确定其是 参数服务器集群中的哪个参数服务器节点。The node information can be the ID information of the parameter server node. The parameter server cluster will assign an ID to each parameter server, and the ID is unique. Therefore, by obtaining the ID information of the parameter server node, it can be determined which parameter server node in the parameter server cluster it is.
此外,第一级存储子模块信息可以是参数服务器节点上存储的所有第一级存储子模块的ID信息列表。根据本公开的示例性实施例,存储子模块的ID(例如,Storage ID,Shard ID)是针对每个模型编号的,例如,对于模型1会有模型1的S1R1(Storage 1,Shard 1)、S1R2、S2R1、S2R2…,对于模型2也会有模型2的S1R1、S1R2、S2R1、S2R2…。因此,为了区分模型之间的存储子模块,第一级存储子模块ID列表中包括的第一级存储子模块ID可由模型ID和对应模型中的第一级存储子模块ID组成,例如,第一级存储子模块ID列表可包括Model 1Storage 0、Model 1Storage 3、Model 2Storage 1…。此外,第一级存储子模块ID列表可在第一层数据中以持久化列表(persistent list)的形式存储,这样可保证模型参数都可插入到非易失性内存中。In addition, the first-level storage submodule information may be a list of ID information of all first-level storage submodules stored on the parameter server node. According to an exemplary embodiment of the present disclosure, the IDs of the storage submodules (eg, Storage ID, Shard ID) are numbered for each model, for example, for model 1 there will be S1R1 (Storage 1, Shard 1), S1R2, S2R1, S2R2..., for Model 2 there will also be S1R1, S1R2, S2R1, S2R2... of Model 2. Therefore, in order to distinguish storage submodules between models, the first-level storage submodule ID included in the first-level storage submodule ID list may be composed of the model ID and the first-level storage submodule ID in the corresponding model, for example, the first-level storage submodule ID The list of primary storage sub-module IDs can include Model 1Storage 0, Model 1Storage 3, Model 2Storage 1…. In addition, the first-level storage submodule ID list can be stored in the first-level data in the form of a persistent list, which ensures that model parameters can be inserted into non-volatile memory.
根据本公开的示例性实施例,第一层数据(即,参数服务器节点头信息)作为整个基于非易性内存的参数服务器节点的存储的根,存储装置1002可将第一层数据存储在参数服务器节点的非易失性内存中的固定位置,以方便参数服务器节点执行快速恢复时查询。According to an exemplary embodiment of the present disclosure, the first layer data (ie, parameter server node header information) is used as the root of the storage of the entire non-volatile memory-based parameter server node, and the storage device 1002 may store the first layer data in the parameter server node. A fixed location in the server node's non-volatile memory to facilitate querying when the parameter server node performs a fast recovery.
根据本公开的示例性实施例,在第二层数据中,可存储M个第一级存储子模块头信息和M个第一级存储子模块哈希映射(HashMap)信息。第二层数据可用于查询该参数服务器节点的各个第一级存储子模块中存储的模型参数。例如,对于每个第一级存储子模块,存储装置1002可在第二层数据存储中新创建对应的非易失性内存的存储池进行单独存储。According to an exemplary embodiment of the present disclosure, in the second-level data, M pieces of first-level storage sub-module header information and M pieces of first-level storage sub-module hash map (HashMap) information may be stored. The second-level data can be used to query the model parameters stored in each first-level storage sub-module of the parameter server node. For example, for each first-level storage sub-module, the storage device 1002 may newly create a corresponding non-volatile memory storage pool in the second-level data storage for separate storage.
根据本公开的示例性实施例,如图5所示,第一级存储子模块头信息(Storage Head)可分配三个空间,分别用于存放该第一级存储子模块ID(Storage ID)、该第一级存储子模块存储的模型参数的版本信息(Version)、该第一级存储子模块的指向下一级哈希映射的指针(Shard HashMap Pointer)。第一级存储子模块(Storage)的下一级是第二级存储子模块(Shard),因此,第一级存储子模块头信息中的指向下一级哈希映射的指针可以是Shard HashMap Pointer,但本公开不限于此。例如,当第一级存储子模块(Storage)的下一级是模型参数本身时,第一级存储子模块头信息中的指向下一级哈希映射的指针可以是指向模型参数哈希映射的指针(例如,Para HashMap Point)。According to an exemplary embodiment of the present disclosure, as shown in FIG. 5 , the first-level storage sub-module header information (Storage Head) may be allocated three spaces for storing the first-level storage sub-module ID (Storage ID), The version information (Version) of the model parameters stored in the first-level storage submodule, and the pointer (Shard HashMap Pointer) of the first-level storage submodule to the next-level hash map. The next level of the first-level storage submodule (Storage) is the second-level storage submodule (Shard). Therefore, the pointer to the next-level hash map in the header information of the first-level storage submodule can be Shard HashMap Pointer , but the present disclosure is not limited thereto. For example, when the next level of the first-level storage sub-module (Storage) is the model parameter itself, the pointer to the next-level hash map in the header information of the first-level storage sub-module may point to the model parameter hash map Pointer (for example, Para HashMap Point).
根据本公开的示例性实施例,第一级存储子模块哈希映射信息可包括该第一级存储子模块下的各个从第二级至第N级存储子模块中每一级存储子模块的哈希映射、以及该第一级存储子模块下的各个第N级存储子模块下的模型参数哈希映射,其中,N为模型参数被划分的存储子模块的级数。其中,每一级存储子模块的哈希映射的键为该级存储子模块的ID,值为指向下一级哈希映射的指针,模型参数哈希映射的键为参数名,值为参数值,每一级存储子模块的哈希映射和模型参数哈希映射通过该级存储子模块或该模型参数的上一级存储子模块相应的指向下一级哈希映射的指针链接。According to an exemplary embodiment of the present disclosure, the first-level storage sub-module hash mapping information may include the hash map of each level of storage sub-modules from the second-level to the Nth-level storage sub-module under the first-level storage sub-module. The hash map and the model parameter hash map under each of the Nth-level storage sub-modules under the first-level storage sub-module, where N is the number of stages of the storage sub-modules into which the model parameters are divided. Among them, the key of the hash map of each level of storage sub-module is the ID of this level of storage sub-module, the value is the pointer to the next level of hash map, the key of the model parameter hash map is the parameter name, and the value is the parameter value , the hash map of each level of storage sub-module and the model parameter hash map are linked by the corresponding pointer to the next level of hash map of this level of storage sub-module or the upper-level storage sub-module of this model parameter.
根据本公开的示例性实施例,存储系统1000还可包括服务装置(未示出),服务装置可从基于非易失性内存的参数服务器集群查询所述至少一个模型中的指定模型的参数,并基于查询到的指定模型的参数提供相应的模型预估服务。例如,服务装置可根据指定模型的参数的参数名,确定参数存储的参数服务器节点ID以及各级存储子模块ID,并根据确定的参数服务器节点ID找到参数服务器节点,并根据各级存储子模块ID,基于找到的参数服务器节点上的第二级数据,找到与参数名对应的参数值。According to an exemplary embodiment of the present disclosure, the storage system 1000 may further include a service device (not shown), and the service device may query a parameter of a specified model of the at least one model from the non-volatile memory-based parameter server cluster, And provide the corresponding model estimation service based on the queried parameters of the specified model. For example, the service device can determine the parameter server node ID of the parameter storage and the ID of each level of storage sub-module according to the parameter name of the parameter of the specified model, find the parameter server node according to the determined parameter server node ID, and store the sub-module according to the various levels. ID, based on the second-level data on the found parameter server node, to find the parameter value corresponding to the parameter name.
根据本公开的示例性实施例,写参数只有在新模型上线的时候会发生。写参数的流程和查询参数的流程类似,唯一的不同有两点。第一:为了保证在上传新模型参数的过程中,老的模型参数依然可以被访问,存储装置1002可将所有新的模型参数插入全新的存储池中。当新模式所有参数都上传到参数服务器集群后,参数查询服务才会被切换到新的参数上,于此同时,后端线程开始慢慢回收旧模型参数的空间。第二点是,当新的Para0写入Storage 0 new下的HashMap时,存储装置1002可使用CPU指令(如clflushopt+mfence)保证每次写入的参数数据都写入NVM而不是在易失性的CPU高速缓存里。According to an exemplary embodiment of the present disclosure, writing parameters only occurs when a new model comes online. The process of writing parameters is similar to the process of querying parameters, with two differences. First: in order to ensure that the old model parameters can still be accessed in the process of uploading new model parameters, the storage device 1002 can insert all new model parameters into a brand new storage pool. After all the parameters of the new model are uploaded to the parameter server cluster, the parameter query service will be switched to the new parameters. At the same time, the backend thread will slowly reclaim the space of the parameters of the old model. The second point is that when a new Para0 is written into the HashMap under Storage 0 new, the storage device 1002 can use a CPU instruction (such as clflushopt+mfence) to ensure that the parameter data written each time is written to the NVM instead of volatile in the CPU cache.
图11是示出根据本公开的示例性实施例的参数服务器节点的恢复系统的框图。根据本公开的示例性实施例的参数服务器节点的恢复系统适应于上述参照图3所述的参数服务器节点在由于故障等原因而需要重启的情况。11 is a block diagram illustrating a recovery system of a parameter server node according to an exemplary embodiment of the present disclosure. The recovery system of a parameter server node according to an exemplary embodiment of the present disclosure is adapted to the situation that the parameter server node described above with reference to FIG. 3 needs to be restarted due to a failure or the like.
参照图11,根据本公开的示例性实施例的参数服务器节点的恢复系统1100可包括第一获取装置1101、第二获取装置1102和恢复装置1103。11 , a recovery system 1100 of a parameter server node according to an exemplary embodiment of the present disclosure may include a first acquisition device 1101 , a second acquisition device 1102 , and a recovery device 1103 .
第一获取装置1101在参数服务器节点重启后,可从参数服务器节点的非易失性内存中获取所存储的第一层数据。如上所述,第一层数据可参数服务器节点头信息,用于查询参数服务器节点的节点信息和第一级存储子模块信息。参数服务器节点头信息可包括参数服务器节点ID和第一级存储子模块ID列表。因此,第一获取装置1101可根据参数服务器节点头中的参数服务器节点ID确定重启的参数服务器节点是参数服务器集群中的哪个参数服务器节点,并可根据参数服务器节点头中的第一级存储子模块ID列表确定重启的参数服务器节点中包括的所有第一级存储子模块。After the parameter server node is restarted, the first obtaining means 1101 may obtain the stored first-layer data from the non-volatile memory of the parameter server node. As described above, the first-level data can parameterize the server node header information, which is used to query the parameter server node's node information and the first-level storage sub-module information. The parameter server node header information may include a parameter server node ID and a list of first-level storage submodule IDs. Therefore, the first obtaining device 1101 can determine which parameter server node in the parameter server cluster the restarted parameter server node is according to the parameter server node ID in the parameter server node header, and can determine the parameter server node in the parameter server node The list of module IDs identifies all first-level storage submodules included in the restarted parameter server node.
根据本公开的示例性实施例,第一层数据可被存储在所述参数服务器节点的非易失性内存中的固定位置处。因此,第一获取装置1101可从参数服务器节点的非易失性内存中的固定位置处读取第一层数据。这样有利于在参数服务器节点重启后,能快速从参数服务器节点中查询该参数服务器节点的存储信息。According to an exemplary embodiment of the present disclosure, the first tier data may be stored at a fixed location in the non-volatile memory of the parameter server node. Therefore, the first obtaining means 1101 can read the first layer data from a fixed location in the non-volatile memory of the parameter server node. In this way, after the parameter server node is restarted, the storage information of the parameter server node can be quickly queried from the parameter server node.
根据本公开的示例性实施例,第一级存储子模块ID列表中包括的第一级存储子模块ID可由模型ID和对应模型中的第一级存储子模块ID组成。According to an exemplary embodiment of the present disclosure, the first-level storage submodule IDs included in the first-level storage submodule ID list may be composed of a model ID and a first-level storage submodule ID in a corresponding model.
第二获取装置1102可基于第一层数据,从参数服务器节点的非易失性内存中获取所存储的第二层数据中的每个第一级存储子模块头信息。如上所述,第二层数据可M个第一级存储子模块头信息和M个第一级存储子模块哈希映射信息,第二层数据用于查询该参数服务器节点的各个第一级存储子模块中存储的模型参数,其中,M为该参数服务器节点上存储的第一级存储子模块的数量。The second obtaining means 1102 may obtain, based on the first-layer data, the header information of each first-level storage sub-module in the stored second-layer data from the non-volatile memory of the parameter server node. As mentioned above, the second-level data can include M first-level storage sub-module header information and M first-level storage sub-module hash mapping information, and the second-level data is used to query each first-level storage of the parameter server node. Model parameters stored in the sub-module, where M is the number of first-level storage sub-modules stored on the parameter server node.
根据本公开的示例性实施例,第一级存储子模块头信息可包括该第一级存储子模块ID、该第一级存储子模块存储的模型参数的版本信息、以及该第一级存储子模块的指向下一级哈希映射的指针。因此,在获取第一数据后,第二获取装置1102可基于第一级存储子模块ID列表,确定参数服务器节点的所有第一级存储子模块ID,随后基于参数服务器节点的所有第一级存储子模块ID中的每个第一级存储子模块ID,获取具有相应第一级存储子模块ID的第一级存储子模块头信息。因此,第二获取装置1102可获得参数服务器节点上存储的所有(M个)第一级存储子模块的各自的第一级存储子模块头信息。According to an exemplary embodiment of the present disclosure, the first-level storage sub-module header information may include the first-level storage sub-module ID, version information of model parameters stored by the first-level storage sub-module, and the first-level storage sub-module The module's pointer to the next level hash map. Therefore, after acquiring the first data, the second acquiring means 1102 may determine all the first-level storage sub-module IDs of the parameter server node based on the first-level storage sub-module ID list, and then based on all the first-level storage sub-module IDs of the parameter server node For each first-level storage sub-module ID in the sub-module ID, the header information of the first-level storage sub-module with the corresponding first-level storage sub-module ID is obtained. Therefore, the second obtaining means 1102 can obtain the respective first-level storage sub-module header information of all (M) first-level storage sub-modules stored on the parameter server node.
根据本公开的示例性实施例,所有(M个)第一级存储子模块也具有各自的第一级存储子模块哈希映射信息。每个第一级存储子模块可基于其第一级存储子模块头信息中的指向下一级哈希映射的指针与其第一级存储子模块哈希映射信息相关联。每个第一级存储子模块哈希映射信息可包括该第一级存储子模块下的各个从第二级至第N级存储子模块中每一级存储子模块的哈希映射、以及该第一级存储子模块下的各个第N级存储子模块下的模型参数哈希映射,其中,N为模型参数被划分的存储子模块的级数。每一级存储子模块的哈希映射的键为该级存储子模块的ID,值为指向下一级哈希映射的指针。模型参数哈希映射的键为参数名,值为参数值。每一级存储子模块的哈希映射和模型参数哈希映射通过该级存储子模块或该模型参数的上一级存储子模块相应的指向下一级哈希映射的指针链接,例如,如图5至图7所示。According to an exemplary embodiment of the present disclosure, all (M) first-level storage sub-modules also have respective first-level storage sub-module hash map information. Each first-level storage sub-module may be associated with its first-level storage sub-module hash map information based on a pointer to the next-level hash map in its first-level storage sub-module header information. The hash map information of each first-level storage sub-module may include the hash map of each level of storage sub-modules from the second-level to the N-th level storage sub-module under the first-level storage sub-module, and the hash map of the first-level storage sub-module. Hash mapping of model parameters under each of the Nth-level storage sub-modules under the first-level storage sub-module, where N is the number of stages of the storage sub-modules into which the model parameters are divided. The key of the hash map of each level of storage sub-module is the ID of the level of storage sub-module, and the value is a pointer to the next level of hash map. The key of the model parameter hash map is the parameter name and the value is the parameter value. The hash map of each level of storage submodule and the model parameter hash map are linked through the corresponding pointer to the next level of the hash map of this level of storage submodule or the previous level of this model parameter storage submodule, for example, as shown in the figure 5 to Figure 7.
恢复装置1103可基于每个第一级存储子模块头信息,遍历第二层数据中的每个第一级存储子模块哈希映射信息,以恢复参数服务器节点上存储的模型参数。The restoration device 1103 may traverse the hash map information of each first-level storage sub-module in the second-level data based on the header information of each first-level storage sub-module, so as to restore the model parameters stored on the parameter server node.
根据本公开的示例性实施例,恢复装置1103可针对每个第一级存储子模块执行以下操作:通过上一级存储子模块相应的指向下一级哈希映射的指针搜索下一级哈希映射,直到搜索到模型参数哈希映射;基于模型参数哈希映射,恢复模型参数。According to an exemplary embodiment of the present disclosure, the restoring device 1103 may perform the following operation for each first-level storage submodule: search for the next-level hash through the corresponding pointer to the next-level hash map of the previous-level storage submodule Map until the model parameter hash map is searched; based on the model parameter hash map, restore the model parameters.
例如,如图5所示,在模型参数被划分为两级存储子模块的情况下,每个第一级存 储子模块哈希映射信息包括第一级存储子模块下的各个第二级存储子模块的哈希映射(Shard HashMap)以及该第一级存储子模块下的各个第二级存储子模块的模型参数哈希映射(Para HashMap),其中,第一级存储子模块头信息中的指向下一级哈希映射的指针为指向第二级存储子模块的哈希映射的指针(Shard HashMap Point),每个第二级存储子模块的哈希映射的键为该第二级存储子模块ID(Shard ID),值为指向该第二级存储子模块下的模型参数哈希映射的指针(Para HashMap Point)。当恢复装置1103执行恢复时,针对每个第一级存储子模块,可通过第一级存储子模块头信息中的指向第二级存储子模块哈希映射的指针(Shard HashMap Point),搜索第二级存储子模块的哈希映射(Shard HashMap)。对此,恢复装置1103可检查第二级存储子模块的哈希映射数据是否完整,并恢复第二级存储子模块的哈希映射的所有数据。随后,恢复装置1103可根据第二级存储子模块的哈希映射的所有第二级存储子模块的指向模型参数哈希映射的指针,搜索所有第二级存储子模块下的模型参数哈希映射,从而恢复所有第二级存储子模块下的模型参数。For example, as shown in FIG. 5 , when the model parameters are divided into two-level storage sub-modules, the hash map information of each first-level storage sub-module includes each second-level storage sub-module under the first-level storage sub-module. The hash map (Shard HashMap) of the module and the model parameter hash map (Para HashMap) of each second-level storage sub-module under the first-level storage sub-module, wherein the pointer in the header information of the first-level storage sub-module The pointer of the next-level hash map is the pointer to the hash map of the second-level storage submodule (Shard HashMap Point), and the key of the hash map of each second-level storage submodule is the second-level storage submodule. ID (Shard ID), the value is a pointer (Para HashMap Point) to the model parameter hash map under the second-level storage submodule. When the restoration device 1103 performs restoration, for each first-level storage submodule, the first-level storage submodule header information can be used to search for the first-level storage submodule hash map pointer (Shard HashMap Point) in the first-level storage submodule header information. The hash map of the secondary storage submodule (Shard HashMap). For this, the restoration device 1103 may check whether the hash map data of the second-level storage submodule is complete, and restore all the data of the hash map of the second-level storage submodule. Subsequently, the restoration device 1103 may search for the model parameter hash map under all the second-level storage sub-modules according to the pointers to the model parameter hash map of all the second-level storage sub-modules in the hash map of the second-level storage sub-module , thereby restoring the model parameters under all second-level storage submodules.
又例如,如图6所示,在模型参数被划分为一级存储子模块的情况下,每个第一级存储子模块哈希映射信息包括该第一级存储子模块下的模型参数哈希映射(Para HashMap),其中,第一级存储子模块头信息中的指向下一级哈希映射的指针为指向模型参数哈希映射的指针(Para HashMap Point)。当恢复装置1103执行恢复时,针对每个第一级存储子模块,可通过第一级存储子模块头信息中的指向模型参数哈希映射的指针(Para HashMap Point),搜索模型参数哈希映射(Para HashMap),从而恢复每个第一级存储子模块下的模型参数。For another example, as shown in FIG. 6 , when the model parameters are divided into first-level storage submodules, the hash map information of each first-level storage submodule includes the model parameter hash under the first-level storage submodule. Map (Para HashMap), wherein the pointer to the next-level hash map in the header information of the first-level storage submodule is a pointer to the model parameter hash map (Para HashMap Point). When the restoration device 1103 performs restoration, for each first-level storage sub-module, the model parameter hash map can be searched through the pointer to the model parameter hash map (Para HashMap Point) in the header information of the first-level storage sub-module (Para HashMap), thereby restoring the model parameters under each first-level storage submodule.
又例如,图7所示,在模型参数被划分为三级存储子模块的情况下,每个第一级存储子模块哈希映射信息包括该第一级存储子模块下的各个第二级存储子模块的哈希映射(Shard HashMap)、各个第二级存储子模块下的各个第三级存储子模块的哈希映射(Slice HashMap)、以及各个第三级存储子模块下的模型参数哈希映射(Para HashMap)。第一级存储子模块头信息中的指向下一级哈希映射的指针为指向第二级存储子模块哈希映射的指针(Shard HashMap Point),第二级存储子模块哈希映射中的指向下一级哈希映射的指针为指向第三级存储子模块哈希映射的指针(Slice HashMap Point),第三级存储子模块哈希映射中的指向下一级哈希映射的指针为指向模型参数哈希映射的指针(Para HashMap Point)。在恢复装置1103执行恢复时,针对每个第一级存储子模块,可通过第一级存储子模块头信息中的指向第二级存储子模块哈希映射的指针(Shard HashMap Point),搜索第二级存储子模块的哈希映射(Shard HashMap)。对此,恢复装置1103可检查第二级存储子模块的哈希映射数据是否完整,并恢复第二级存储子模块的哈希映射的所有数据。随后,恢复装置1103可根据第二级存储子模块的哈希映射的所有第二级存储子模块的指向第三级存储子模块哈希映射的指针(Slice HashMap Point),搜索所有第二级存储子模块下的各个第三级存储子模块的哈希映射。对此,恢复装置1103可检查所有第三级存储子模块的哈希映射数据是否完整,并恢复所有第三级存储子模块的哈希映射的所有数据。随后,恢复装置1103可根据每个第三级存储子模块的哈希映射中的指向模型参数哈希映射的指针,搜索模型参数哈希映射,从而恢复所有第三级存储子模块下的模型参数。For another example, as shown in FIG. 7 , when the model parameters are divided into three-level storage sub-modules, the hash map information of each first-level storage sub-module includes each second-level storage sub-module under the first-level storage sub-module. The hash map of the sub-module (Shard HashMap), the hash map of each third-level storage sub-module under each second-level storage sub-module (Slice HashMap), and the model parameter hash under each third-level storage sub-module Map (Para HashMap). The pointer to the next-level hash map in the header information of the first-level storage sub-module is a pointer to the second-level storage sub-module hash map (Shard HashMap Point), and the pointer in the second-level storage sub-module hash map points to The pointer of the next-level hash map is the pointer to the third-level storage sub-module hash map (Slice HashMap Point), and the pointer to the next-level hash map in the third-level storage sub-module hash map is the pointer to the model The pointer to the parameter hash map (Para HashMap Point). When the recovery device 1103 performs recovery, for each first-level storage submodule, the first-level storage submodule header information can be used to search for the first-level storage submodule hash map pointer (Shard HashMap Point) in the first-level storage submodule header information. The hash map of the secondary storage submodule (Shard HashMap). For this, the restoration device 1103 may check whether the hash map data of the second-level storage submodule is complete, and restore all the data of the hash map of the second-level storage submodule. Subsequently, the restoration device 1103 may search all second-level storage submodules according to the pointers (Slice HashMap Point) of all second-level storage submodules of the hash map of the second-level storage submodule to the third-level storage submodule hash map (Slice HashMap Point) Each third level under the submodule stores the hash map of the submodule. For this, the restoration device 1103 can check whether the hash map data of all the third-level storage submodules is complete, and restore all the data of the hash maps of all the third-level storage submodules. Subsequently, the restoring device 1103 may search the model parameter hash map according to the pointer to the model parameter hash map in the hash map of each third-level storage sub-module, thereby restoring the model parameters under all third-level storage sub-modules .
当然,本公开不限于上述示例,模型参数可被划分为任何级的存储子模块,在模型参数被划分为任何级的存储子模块的情况下,恢复流程可根据上述示例的逻辑,类推地执行模型参数的恢复。Of course, the present disclosure is not limited to the above examples, the model parameters can be divided into storage sub-modules of any level, and in the case where the model parameters are divided into storage sub-modules of any level, the recovery process can be performed according to the logic of the above examples, analogically Restoration of model parameters.
此外,根据本公开的另一示例性实施例,当参数服务器节点损坏严重,修复时间较长时,在参数服务器节点重启后,存在参数服务器节点中存储的模型参数已过时情况。因此,当第二获取装置1102获取到第二层数据中的第一级存储子模块头信息中的模型参数版本信息时,恢复装置1103可基于模型参数版本信息确定在参数服务器节点中存储的模型参数是否是最新版本,根据确定的结果再决定是否执行恢复。In addition, according to another exemplary embodiment of the present disclosure, when the parameter server node is seriously damaged and the repair time is long, after the parameter server node is restarted, the model parameters stored in the parameter server node are out of date. Therefore, when the second acquiring means 1102 acquires the model parameter version information in the header information of the first-level storage sub-module in the second layer data, the restoring means 1103 can determine the model stored in the parameter server node based on the model parameter version information Whether the parameter is the latest version, it is determined whether to perform recovery according to the determined result.
例如,在第二获取装置1102获取到第二层数据中的每个第一级存储子模块头信息之后,恢复装置1103可根据第一级存储子模块头信息中的版本信息与存储在参数服务器集群元数据节点上的第一级存储子模块最新的版本信息进行比对。这里,参数服务器集群元数据节点是存储参数服务器集群的一个全局元数据信息的服务器,比如zoomkeeper。在参数服务器集群中,可将每个模型所有第一级存储子模块对应最新的版本号记录在元数据节点中。当第一级存储子模块的模型参数被更新,该第一级存储子模块的版本会在元数据节点上加1。每次有参数服务器节点重启后,都可以去检查当前第一级存储子模块最新的版本。当元数据节点上存储的版本号比重启的参数服务器节点上的版本号更新,说明重启的参数服务器节点上的模型参数已过时,没有恢复的必要。当元数据节点上存储的版本号与重启的参数服务器节点上的版本号一致,说明重启的参数服务器节点上的模型参数是当前最新版本,可执行恢复。For example, after the second obtaining means 1102 obtains the header information of each first-level storage sub-module in the second-layer data, the restoring means 1103 may, according to the version information in the first-level storage sub-module header information and the data stored in the parameter server The latest version information of the first-level storage submodule on the cluster metadata node is compared. Here, the parameter server cluster metadata node is a server that stores global metadata information of the parameter server cluster, such as zoomkeeper. In the parameter server cluster, the latest version numbers corresponding to all the first-level storage submodules of each model can be recorded in the metadata node. When the model parameters of the first-level storage submodule are updated, the version of the first-level storage submodule will be incremented by 1 on the metadata node. Every time a parameter server node restarts, you can check the latest version of the current first-level storage submodule. When the version number stored on the metadata node is newer than the version number on the restarted parameter server node, it means that the model parameters on the restarted parameter server node are out of date and there is no need to restore them. When the version number stored on the metadata node is the same as the version number on the restarted parameter server node, it means that the model parameters on the restarted parameter server node are the latest version and can be restored.
在第一级存储子模块头信息中的模型参数版本信息与存储在参数服务器集群的元数据节点上的模型参数版本信息一致的情况下,恢复装置1103可执行恢复。In the case that the model parameter version information in the header information of the first-level storage sub-module is consistent with the model parameter version information stored on the metadata node of the parameter server cluster, the restoring means 1103 can execute restoring.
在第一级存储子模块头信息中的模型参数版本信息与存储在参数服务器集群的元数据节点上的模型参数版本信息不一致的情况下,恢复装置1103不执行恢复,而从后端存储系统(例如,HDFS)中拉取最新版本的模型参数,并插入参数服务器节点。这里,后端存储系统可存储最新版本的模型参数。In the case where the model parameter version information in the header information of the first-level storage submodule is inconsistent with the model parameter version information stored on the metadata node of the parameter server cluster, the recovery device 1103 does not perform recovery, and restores the data from the back-end storage system ( For example, pull the latest version of the model parameters from HDFS) and insert the parameter server node. Here, the backend storage system can store the latest version of the model parameters.
根据本公开的示例性实施例,提供了一种参数服务器集群,该参数服务器集群包括多个基于非易失性内存的参数服务器节点,该参数服务器集群用于分布式地存储至少一个模型的模型参数。所述参数服务器集群中包括的每个基于非易失性内存的参数服务器节点可具有以上参照图4所描述的模型参数逻辑存储结构,并可具有以上参照图5-7所描述的或其类似的数据物理存储结构。此外,所述参数服务器集群中包括的每个基于非易失性内存的参数服务器节点可在重启时按照如图8或图9所述描述的恢复方法进行恢复。According to an exemplary embodiment of the present disclosure, a parameter server cluster is provided, the parameter server cluster includes a plurality of non-volatile memory-based parameter server nodes, the parameter server cluster is used for distributed storage of models of at least one model parameter. Each non-volatile memory-based parameter server node included in the parameter server cluster may have the model parameter logical storage structure described above with reference to FIG. 4, and may have the above described with reference to FIGS. 5-7 or the like. The physical storage structure of the data. In addition, each non-volatile memory-based parameter server node included in the parameter server cluster can be recovered according to the recovery method described in FIG. 8 or FIG. 9 when it is restarted.
根据本公开的示例性实施例,非易失性内存可包括STT-RAM、PCM、ReRAM和3DxPoint中的至少一个。其中,可使用PMEM(3DxPoint产品)实现基于PMEM的参数服务器节点。According to an exemplary embodiment of the present disclosure, the nonvolatile memory may include at least one of STT-RAM, PCM, ReRAM, and 3DxPoint. Among them, PMEM (3DxPoint product) can be used to realize the parameter server node based on PMEM.
根据本公开的模型参数的存储方法和系统、参数服务器节点的恢复方法和系统、参数服务器集群,将模型参数存储在基于非易失性内存的参数服务器上,来代替基于DRAM的参数服务器,大大降低了硬件成本。此外,针对基于非易失性内存的参数服务器,设计了模型参数逻辑存储结构和数据物理存储结构,将模型参数在逻辑上分级存储,在非易失性内存上将数据分为两层存储,满足参数服务器的高并发、高可用需求。并且设计重启后的快速恢复流程,根据两层存储的数据结构,可轻松快速地查询并恢复参数服务器节点上存储的所有参数,实现毫秒级恢复的效果。According to the method and system for storing model parameters, the method and system for restoring parameter server nodes, and the parameter server cluster of the present disclosure, the model parameters are stored on the parameter server based on non-volatile memory instead of the parameter server based on DRAM, which greatly improves the Reduced hardware costs. In addition, for the parameter server based on non-volatile memory, the model parameter logical storage structure and data physical storage structure are designed, the model parameters are logically hierarchically stored, and the data is stored in two layers on the non-volatile memory. Meet the high concurrency and high availability requirements of the parameter server. In addition, the rapid recovery process after restart is designed. According to the data structure of the two-tier storage, all parameters stored on the parameter server node can be easily and quickly queried and restored, achieving the effect of millisecond-level recovery.
以上已参照图3至图11描述了根据本公开示例性实施例的模型参数的存储方法和系统、参数服务器节点的恢复方法和系统、参数服务器集群。The method and system for storing model parameters, the method and system for restoring parameter server nodes, and the parameter server cluster according to the exemplary embodiments of the present disclosure have been described above with reference to FIGS. 3 to 11 .
图10所示出的模型参数的存储系统和图11所示出的参数服务器节点的恢复系统中的各个装置可被配置为执行特定功能的软件、硬件、固件或上述项的任意组合。例如,各个装置可对应于专用的集成电路,也可对应于纯粹的软件代码,还可对应于软件与硬件相结合的模块。此外,各个装置所实现的一个或多个功能也可由物理实体设备(例如,处理器、客户端或服务器等)中的组件来统一执行。Each device in the model parameter storage system shown in FIG. 10 and the parameter server node recovery system shown in FIG. 11 may be configured as software, hardware, firmware, or any combination of the foregoing to perform specific functions. For example, each device may correspond to a dedicated integrated circuit, may also correspond to pure software code, or may correspond to a module combining software and hardware. In addition, one or more functions implemented by each apparatus may also be performed uniformly by components in a physical entity device (eg, a processor, a client or a server, etc.).
此外,参照图3所描述的模型参数的存储方法和参照图8和9描述的参数服务器节点的恢复方法可通过记录在计算机可读存储介质上的程序(或指令)来实现。例如,根据本公开的示例性实施例,可提供存储指令的计算机可读存储介质,其中,当所述指令被至少一个计算装置运行时,促使所述至少一个计算装置执行根据本公开的模型参数的存储方法或参数服务器节点的恢复方法。In addition, the method of storing model parameters described with reference to FIG. 3 and the method of restoring parameter server nodes described with reference to FIGS. 8 and 9 may be implemented by programs (or instructions) recorded on a computer-readable storage medium. For example, in accordance with exemplary embodiments of the present disclosure, a computer-readable storage medium storing instructions may be provided that, when executed by at least one computing device, cause the at least one computing device to execute model parameters according to the present disclosure The storage method for the parameter server node or the recovery method for the parameter server node.
上述计算机可读存储介质中的计算机程序可在诸如客户端、主机、代理装置、服务 器等计算机设备中部署的环境中运行,应注意,计算机程序还可用于执行除了上述步骤以外的附加步骤或者在执行上述步骤时执行更为具体的处理,这些附加步骤和进一步处理的内容已经在参照图3、8、9进行相关方法的描述过程中提及,因此这里为了避免重复将不再进行赘述。The computer program in the above-mentioned computer-readable storage medium can run in an environment deployed in computer equipment such as a client, a host, an agent device, a server, etc. It should be noted that the computer program can also be used to perform additional steps in addition to the above-mentioned steps or More specific processing is performed when the above steps are performed, and the contents of these additional steps and further processing have been mentioned in the description of the related methods with reference to FIGS.
应注意,根据本公开示例性实施例的模型参数的存储系统和参数服务器节点的恢复系统中的各个装置可完全依赖计算机程序的运行来实现相应的功能,即,各个装置中的计算机程序的功能架构中与各步骤相应,使得整个系统通过专门的软件包(例如,lib库)而被调用,以实现相应的功能。It should be noted that each device in the model parameter storage system and the parameter server node recovery system according to the exemplary embodiment of the present disclosure can completely rely on the running of the computer program to realize the corresponding function, that is, the function of the computer program in each device The architecture corresponds to each step, so that the entire system is invoked through a special software package (eg, lib library) to implement corresponding functions.
另一方面,图10和图11中的各个装置也可以通过硬件、软件、固件、中间件、微代码或其任意组合来实现。当以软件、固件、中间件或微代码实现时,用于执行相应操作的程序代码或者代码段可以存储在诸如存储介质的计算机可读介质中,使得处理器可通过读取并运行相应的程序代码或者代码段来执行相应的操作。On the other hand, each device in FIG. 10 and FIG. 11 can also be implemented by hardware, software, firmware, middleware, microcode or any combination thereof. When implemented in software, firmware, middleware, or microcode, program codes or code segments for performing corresponding operations may be stored in a computer-readable medium such as a storage medium, so that a processor can read and execute the corresponding program by reading code or code segment to perform the corresponding action.
例如,本公开的示例性实施例还可以实现为计算装置,该计算装置包括存储部件和处理器,存储部件中存储有计算机可执行指令集合,当计算机可执行指令集合被处理器执行时,执行根据本公开的示例性实施例的模型参数的存储方法或参数服务器节点的恢复方法。For example, exemplary embodiments of the present disclosure may also be implemented as a computing device including a storage component and a processor, the storage component stores a computer-executable instruction set, and when the computer-executable instruction set is executed by the processor, executes the A method of storing model parameters or a method of restoring a parameter server node according to an exemplary embodiment of the present disclosure.
具体说来,计算装置可以部署在服务器或客户端中,也可以部署在分布式网络环境中的节点装置上。此外,计算装置可以是PC计算机、平板装置、个人数字助理、智能手机、web应用或其他能够执行上述指令集合的装置。Specifically, the computing device may be deployed in a server or a client, or may be deployed on a node device in a distributed network environment. Furthermore, the computing device may be a PC computer, a tablet device, a personal digital assistant, a smartphone, a web application, or other device capable of executing the set of instructions described above.
这里,计算装置并非必须是单个的计算装置,还可以是任何能够单独或联合执行上述指令(或指令集)的装置或电路的集合体。计算装置还可以是集成控制系统或系统管理器的一部分,或者可被配置为与本地或远程(例如,经由无线传输)以接口互联的便携式电子装置。Here, the computing device does not have to be a single computing device, but can also be any set of devices or circuits capable of individually or jointly executing the above-mentioned instructions (or instruction sets). The computing device may also be part of an integrated control system or system manager, or may be configured as a portable electronic device that interfaces locally or remotely (eg, via wireless transmission).
在计算装置中,处理器可包括中央处理器(CPU)、图形处理器(GPU)、可编程逻辑装置、专用处理器系统、微控制器或微处理器。作为示例而非限制,处理器还可包括模拟处理器、数字处理器、微处理器、多核处理器、处理器阵列、网络处理器等。In a computing device, a processor may include a central processing unit (CPU), a graphics processing unit (GPU), a programmable logic device, a special purpose processor system, a microcontroller, or a microprocessor. By way of example and not limitation, processors may also include analog processors, digital processors, microprocessors, multi-core processors, processor arrays, network processors, and the like.
根据本公开示例性实施例的模型参数的存储方法或参数服务器节点的恢复方法中所描述的某些操作可通过软件方式来实现,某些操作可通过硬件方式来实现,此外,还可通过软硬件结合的方式来实现这些操作。Some operations described in the method for storing model parameters or the method for restoring parameter server nodes according to the exemplary embodiments of the present disclosure may be implemented by software, some operations may be implemented by hardware, and in addition, some operations may be implemented by software These operations are implemented by means of a combination of hardware.
处理器可运行存储在存储部件之一中的指令或代码,其中,存储部件还可以存储数据。指令和数据还可经由网络接口装置而通过网络被发送和接收,其中,网络接口装置可采用任何已知的传输协议。The processor may execute instructions or code stored in one of the storage components, which may also store data. Instructions and data may also be sent and received over a network via a network interface device, which may employ any known transport protocol.
存储部件可与处理器集成为一体,例如,将RAM或闪存布置在集成电路微处理器等之内。此外,存储部件可包括独立的装置,诸如,外部盘驱动、存储阵列或任何数据库系统可使用的其他存储装置。存储部件和处理器可在操作上进行耦合,或者可例如通过I/O端口、网络连接等互相通信,使得处理器能够读取存储在存储部件中的文件。The memory component may be integrated with the processor, eg, RAM or flash memory arranged within an integrated circuit microprocessor or the like. Additionally, the storage components may include separate devices, such as external disk drives, storage arrays, or any other storage device that may be used by a database system. The storage component and the processor may be operatively coupled, or may communicate with each other, eg, through I/O ports, network connections, etc., to enable the processor to read files stored in the storage component.
此外,计算装置还可包括视频显示器(诸如,液晶显示器)和用户交互接口(诸如,键盘、鼠标、触摸输入装置等)。计算装置的所有组件可经由总线和/或网络而彼此连接。In addition, the computing device may also include a video display (such as a liquid crystal display) and a user interaction interface (such as a keyboard, mouse, touch input device, etc.). All components of the computing device may be connected to each other via a bus and/or network.
根据本公开示例性实施例的模型参数的存储方法或参数服务器节点的恢复方法可被描述为各种互联或耦合的功能块或功能示图。然而,这些功能块或功能示图可被均等地集成为单个的逻辑装置或按照非确切的边界进行操作。The method for storing model parameters or the method for restoring parameter server nodes according to an exemplary embodiment of the present disclosure may be described as various interconnected or coupled functional blocks or functional diagrams. However, these functional blocks or functional diagrams may be equally integrated into a single logical device or operate along non-precise boundaries.
因此,参照图3所描述的模型参数的存储方法或参照图8或9描述的参数服务器节点的恢复方法可通过包括至少一个计算装置和至少一个存储指令的存储装置的系统来实现。Therefore, the method for storing model parameters described with reference to FIG. 3 or the method for restoring parameter server nodes described with reference to FIG. 8 or 9 may be implemented by a system including at least one computing device and at least one storage device storing instructions.
根据本公开的示例性实施例,至少一个计算装置是根据本公开示例性实施例的用于执行模型参数的存储方法或参数服务器节点的恢复方法的计算装置,存储装置中存储有计 算机可执行指令集合,当计算机可执行指令集合被至少一个计算装置执行时,执行根据本公开的模型参数的存储方法或参数服务器节点的恢复方法。According to an exemplary embodiment of the present disclosure, at least one computing device is a computing device for performing a method for storing model parameters or a method for restoring a parameter server node according to an exemplary embodiment of the present disclosure, and the storage device stores computer-executable instructions The set, when executed by the at least one computing device, performs a method for storing model parameters or a method for restoring a parameter server node according to the present disclosure.
根据本公开的示例性实施例,提供一种电子设备,包括:处理器;用于存储所述处理器可执行指令的存储器;其中,所述处理器被配置为执行所述指令,以实现参照图4所描述的模型参数的存储方法和/或参照图8或9描述的参数服务器节点的恢复方法。According to an exemplary embodiment of the present disclosure, there is provided an electronic device, comprising: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement a reference The storage method of the model parameters described in FIG. 4 and/or the restoration method of the parameter server node described with reference to FIG. 8 or 9 .
以上描述了本公开的各示例性实施例,应理解,上述描述仅是示例性的,并非穷尽性的,本公开不限于所披露的各示例性实施例。在不偏离本公开的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。因此,本公开的保护范围应该以权利要求的范围为准。Various exemplary embodiments of the present disclosure have been described above, and it should be understood that the above description is merely exemplary and not exhaustive, and the present disclosure is not limited to the disclosed exemplary embodiments. Numerous modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of this disclosure. Therefore, the scope of protection of the present disclosure should be determined by the scope of the claims.
工业实用性Industrial Applicability
根据本公开的参数服务器节点的恢复方法和系统,将模型参数存储在基于非易失性内存的参数服务器上,来代替基于DRAM的参数服务器,大大降低了硬件成本。此外,针对基于非易失性内存的参数服务器,设计了模型参数逻辑存储结构和数据物理存储结构,将模型参数在逻辑上分级存储,在非易失性内存上将数据分为两层存储,满足参数服务器的高并发、高可用需求。并且设计重启后的快速恢复流程,根据两层存储的数据结构,可轻松快速地查询并恢复参数服务器节点上存储的所有参数,实现毫秒级恢复的效果。According to the method and system for restoring a parameter server node of the present disclosure, the model parameters are stored on the parameter server based on non-volatile memory instead of the parameter server based on DRAM, which greatly reduces the hardware cost. In addition, for the parameter server based on non-volatile memory, the model parameter logical storage structure and data physical storage structure are designed, the model parameters are logically hierarchically stored, and the data is stored in two layers on the non-volatile memory. Meet the high concurrency and high availability requirements of the parameter server. In addition, the rapid recovery process after restart is designed. According to the data structure of the two-tier storage, all parameters stored on the parameter server node can be easily and quickly queried and restored, achieving the effect of millisecond-level recovery.

Claims (25)

  1. 一种包括至少一个计算装置和至少一个存储指令的存储装置的系统,其中,所述指令在被所述至少一个计算装置运行时,促使所述至少一个计算装置执行参数服务器节点的恢复方法,其中,所述参数服务器节点是参数服务器集群中的一个节点,且所述参数服务器节点是基于非易失性内存的参数服务器节点,所述参数服务器节点的非易失性内存中存储的每个模型的模型参数在逻辑上被划分为至少一级存储子模块,所述恢复方法包括:A system comprising at least one computing device and at least one storage device storing instructions, wherein the instructions, when executed by the at least one computing device, cause the at least one computing device to perform a method of restoring a parameter server node, wherein , the parameter server node is a node in the parameter server cluster, and the parameter server node is a parameter server node based on non-volatile memory, each model stored in the non-volatile memory of the parameter server node The model parameters of are logically divided into at least one-level storage sub-modules, and the recovery method includes:
    在所述参数服务器节点重启后,从所述参数服务器节点的非易失性内存中获取所存储的第一层数据,其中,第一层数据包括参数服务器节点头信息,所述第一层数据用于查询所述参数服务器节点的节点信息和第一级存储子模块信息;After the parameter server node is restarted, the stored first-layer data is acquired from the non-volatile memory of the parameter server node, wherein the first-layer data includes parameter server node header information, and the first-layer data for querying the node information and first-level storage submodule information of the parameter server node;
    基于所述第一层数据,从所述参数服务器节点的非易失性内存中获取所存储的第二层数据中的每个第一级存储子模块头信息,其中,所述第二层数据包括M个第一级存储子模块头信息和M个第一级存储子模块哈希映射信息,所述第二层数据用于查询该参数服务器节点的各个第一级存储子模块中存储的模型参数,其中,M为该参数服务器节点上存储的第一级存储子模块的数量;Based on the first-level data, obtain each first-level storage submodule header information in the stored second-level data from the non-volatile memory of the parameter server node, wherein the second-level data It includes M first-level storage submodule header information and M first-level storage submodule hash mapping information, and the second-level data is used to query the model stored in each first-level storage submodule of the parameter server node parameter, where M is the number of first-level storage submodules stored on the parameter server node;
    基于每个第一级存储子模块头信息,遍历所述第二层数据中的每个第一级存储子模块哈希映射信息,以恢复所述参数服务器节点上存储的模型参数。Based on the header information of each first-level storage sub-module, traverse the hash map information of each first-level storage sub-module in the second-level data to restore the model parameters stored on the parameter server node.
  2. 如权利要求1所述的恢复方法,其中,所述第一层数据被存储在所述参数服务器节点的非易失性内存中的固定位置处;The recovery method of claim 1, wherein the first tier data is stored at a fixed location in a non-volatile memory of the parameter server node;
    其中,从所述参数服务器节点的非易失性内存中获取所存储的第一层数据,包括:Wherein, obtaining the stored first-layer data from the non-volatile memory of the parameter server node includes:
    从所述参数服务器节点的非易失性内存中的固定位置处读取所述第一层数据。The first layer data is read from a fixed location in the non-volatile memory of the parameter server node.
  3. 如权利要求1所述的恢复方法,其中,所述参数服务器节点头信息包括参数服务器节点ID和第一级存储子模块ID列表;The recovery method of claim 1, wherein the parameter server node header information includes a parameter server node ID and a list of first-level storage submodule IDs;
    所述第一级存储子模块头信息包括该第一级存储子模块ID、该第一级存储子模块存储的模型参数的版本信息、以及该第一级存储子模块的指向下一级哈希映射的指针。The first-level storage sub-module header information includes the first-level storage sub-module ID, the version information of the model parameters stored in the first-level storage sub-module, and the pointer to the next-level hash of the first-level storage sub-module Mapped pointer.
  4. 如权利要求3所述的恢复方法,其中,第一级存储子模块ID列表中包括的第一级存储子模块ID由模型ID和对应模型中的第一级存储子模块ID组成。The restoration method of claim 3, wherein the first-level storage sub-module ID included in the first-level storage sub-module ID list consists of a model ID and a first-level storage sub-module ID in the corresponding model.
  5. 如权利要求3所述的恢复方法,其中,基于所述第一层数据,从所述参数服务器节点的非易失性内存中获取所存储的第二层数据中的每个第一级存储子模块头信息,包括:The recovery method of claim 3, wherein, based on the first-tier data, each first-tier storage sub-unit in the stored second-tier data is obtained from a non-volatile memory of the parameter server node Module header information, including:
    基于第一级存储子模块ID列表,确定所述参数服务器节点的所有第一级存储子模块ID;Determine all first-level storage sub-module IDs of the parameter server node based on the first-level storage sub-module ID list;
    基于所述参数服务器节点的所有第一级存储子模块ID中的每个第一级存储子模块ID,获取具有相应第一级存储子模块ID的第一级存储子模块头信息。Based on each of the first-level storage sub-module IDs of all the first-level storage sub-module IDs of the parameter server node, the first-level storage sub-module header information having the corresponding first-level storage sub-module ID is acquired.
  6. 如权利要求3所述的恢复方法,其中,所述第一级存储子模块哈希映射信息包括该第一级存储子模块下的各个从第二级至第N级存储子模块中每一级存储子模块的哈希映射、以及该第一级存储子模块下的各个第N级存储子模块下的模型参数哈希映射,其中,N为模型参数被划分的存储子模块的级数;The recovery method according to claim 3, wherein the first-level storage sub-module hash map information includes each level of each of the second-level to N-th storage sub-modules under the first-level storage sub-module The hash map of the storage submodule and the model parameter hash map under each of the Nth-level storage submodules under the first-level storage submodule, where N is the number of stages of the storage submodules into which the model parameters are divided;
    其中,每一级存储子模块的哈希映射的键为该级存储子模块的ID,值为指向下一级哈希映射的指针,Among them, the key of the hash map of each level of storage sub-module is the ID of this level of storage sub-module, and the value is the pointer to the next level of hash map,
    模型参数哈希映射的键为参数名,值为参数值,The key of the model parameter hash map is the parameter name, the value is the parameter value,
    每一级存储子模块的哈希映射和模型参数哈希映射通过该级存储子模块或该模型参数的上一级存储子模块相应的指向下一级哈希映射的指针链接。The hash map of each level of storage sub-module and the model parameter hash map are linked by the corresponding pointer to the next level of hash map of this level of storage sub-module or the upper-level storage sub-module of the model parameter.
  7. 如权利要求6所述的恢复方法,其中,所述基于每个第一级存储子模块头信息,遍历所述第二层数据中的每个第一级存储子模块哈希映射信息,以恢复所述参数服务器节点上存储的模型参数,包括:The recovery method according to claim 6, wherein, based on the header information of each first-level storage sub-module, traversing the hash map information of each first-level storage sub-module in the second-level data to recover The model parameters stored on the parameter server node include:
    针对每个第一级存储子模块执行以下操作:Do the following for each first-level storage submodule:
    通过上一级存储子模块相应的指向下一级哈希映射的指针搜索下一级哈希映射,直到搜索到模型参数哈希映射;Search the next-level hash map through the pointer to the next-level hash map corresponding to the previous-level storage submodule until the model parameter hash map is searched;
    基于模型参数哈希映射,恢复模型参数。Based on the model parameter hash map, the model parameters are restored.
  8. 如权利要求7所述的恢复方法,其中,在模型参数被划分为一级存储子模块的情况下:每个第一级存储子模块哈希映射信息包括该第一级存储子模块下的模型参数哈希映射,其中,第一级存储子模块头信息中的指向下一级哈希映射的指针为指向模型参数哈希映射的指针;The restoration method according to claim 7, wherein, when the model parameters are divided into first-level storage submodules: the hash map information of each first-level storage submodule includes the model under the first-level storage submodule A parameter hash map, wherein the pointer to the next-level hash map in the header information of the first-level storage submodule is a pointer to the model parameter hash map;
    其中,所述通过上一级存储子模块相应的指向下一级哈希映射的指针搜索下一级哈希映射,直到搜索到模型参数哈希映射,包括:Wherein, searching the next-level hash map through the corresponding pointer of the previous-level storage submodule to the next-level hash map, until the model parameter hash map is searched, including:
    通过第一级存储子模块头信息中的指向模型参数哈希映射的指针,搜索模型参数哈希映射。The model parameter hash map is searched through the pointer to the model parameter hash map in the first-level storage submodule header information.
  9. 如权利要求7所述的恢复方法,其中,在模型参数被划分为两级存储子模块的情况下:每个第一级存储子模块哈希映射信息包括第一级存储子模块下的各个第二级存储子模块的哈希映射以及该第一级存储子模块下的各个第二级存储子模块的模型参数哈希映射,其中,第一级存储子模块头信息中的指向下一级哈希映射的指针为指向第二级存储子模块的哈希映射的指针,每个第二级存储子模块的哈希映射的键为该第二级存储子模块ID,值为指向该第二级存储子模块下的模型参数哈希映射的指针;The restoration method according to claim 7, wherein, when the model parameters are divided into two-level storage sub-modules: the hash map information of each first-level storage sub-module includes each The hash map of the second-level storage sub-module and the model parameter hash map of each second-level storage sub-module under the first-level storage sub-module, wherein the header information of the first-level storage sub-module points to the next level hash map The pointer of the desired map is a pointer to the hash map of the second-level storage submodule, the key of the hash map of each second-level storage submodule is the ID of the second-level storage submodule, and the value points to the second-level storage submodule. A pointer to a hash map of model parameters under the storage submodule;
    其中,所述通过上一级存储子模块相应的指针搜索下一级哈希映射,直到搜索到模型参数哈希映射,包括:Wherein, searching the next-level hash map through the corresponding pointer of the upper-level storage submodule until the model parameter hash map is searched, including:
    通过第一级存储子模块头信息中的指向第二级存储子模块哈希映射的指针,搜索第二级存储子模块的哈希映射;Search the hash map of the second-level storage sub-module through the pointer to the second-level storage sub-module hash map in the first-level storage sub-module header information;
    通过第二级存储子模块的哈希映射中的指向模型参数哈希映射的指针,搜索模型参数哈希映射。The model parameter hash map is searched through the pointer to the model parameter hash map in the hash map of the second-level storage submodule.
  10. 如权利要求3所述的恢复方法,所述指令在被所述至少一个计算装置运行时,促使所述至少一个计算装置还执行以下步骤:The recovery method of claim 3, wherein the instructions, when executed by the at least one computing device, cause the at least one computing device to further perform the following steps:
    在所述第一级存储子模块头信息中的模型参数版本信息与存储在所述参数服务器集群的元数据节点上的模型参数版本信息一致的情况下,执行所述恢复的步骤;Under the condition that the model parameter version information in the header information of the first-level storage sub-module is consistent with the model parameter version information stored on the metadata node of the parameter server cluster, the restoring step is performed;
    在所述第一级存储子模块头信息中的模型参数版本信息与存储在所述参数服务器集群的元数据节点上的模型参数版本信息不一致的情况下,不执行所述恢复的步骤,而从后端存储系统中拉取最新版本的模型参数,并插入所述参数服务器节点;In the case that the model parameter version information in the header information of the first-level storage submodule is inconsistent with the model parameter version information stored on the metadata node of the parameter server cluster, the restoring step is not performed, and the Pull the latest version of the model parameters from the back-end storage system and insert the parameter server node;
    其中,所述参数服务器集群的元数据节点存储模型参数的最新版本号,所述后端存储系统存储最新版本的模型参数。The metadata node of the parameter server cluster stores the latest version number of the model parameter, and the back-end storage system stores the latest version of the model parameter.
  11. 如权利要求1所述的恢复方法,其中,所述非易失性内存包括STT-RAM、PCM、ReRAM和3DxPoint中的至少一个。The recovery method of claim 1, wherein the non-volatile memory includes at least one of STT-RAM, PCM, ReRAM, and 3DxPoint.
  12. 一种参数服务器节点的恢复方法,其中,所述参数服务器节点是参数服务器集群中的一个节点,且所述参数服务器节点是基于非易失性内存的参数服务器节点,所述参数服务器节点的非易失性内存中存储的每个模型的模型参数在逻辑上被划分为至少一级存储子模块,所述恢复方法包括:A method for recovering a parameter server node, wherein the parameter server node is a node in a parameter server cluster, and the parameter server node is a parameter server node based on non-volatile memory, and the parameter server node has a non-volatile memory. The model parameters of each model stored in the volatile memory are logically divided into at least one-level storage sub-modules, and the recovery method includes:
    在所述参数服务器节点重启后,从所述参数服务器节点的非易失性内存中获取所存储的第一层数据,其中,第一层数据包括参数服务器节点头信息,所述第一层数据用于查询所述参数服务器节点的节点信息和第一级存储子模块信息;After the parameter server node is restarted, the stored first-layer data is acquired from the non-volatile memory of the parameter server node, wherein the first-layer data includes parameter server node header information, and the first-layer data for querying the node information and first-level storage submodule information of the parameter server node;
    基于所述第一层数据,从所述参数服务器节点的非易失性内存中获取所存储的第二层数据中的每个第一级存储子模块头信息,其中,所述第二层数据包括M个第一级存储子模块头信息和M个第一级存储子模块哈希映射信息,所述第二层数据用于查询该参数服务器节点的各个第一级存储子模块中存储的模型参数,其中,M为该参数服务器节点上存储的第一级存储子模块的数量;Based on the first-level data, obtain each first-level storage submodule header information in the stored second-level data from the non-volatile memory of the parameter server node, wherein the second-level data It includes M first-level storage submodule header information and M first-level storage submodule hash mapping information, and the second-level data is used to query the model stored in each first-level storage submodule of the parameter server node parameter, where M is the number of first-level storage submodules stored on the parameter server node;
    基于每个第一级存储子模块头信息,遍历所述第二层数据中的每个第一级存储子模块哈希映射信息,以恢复所述参数服务器节点上存储的模型参数。Based on the header information of each first-level storage sub-module, traverse the hash map information of each first-level storage sub-module in the second-level data to restore the model parameters stored on the parameter server node.
  13. 如权利要求12所述的恢复方法,其中,所述第一层数据被存储在所述参数服务器节点的非易失性内存中的固定位置处;The recovery method of claim 12, wherein the first tier data is stored at a fixed location in a non-volatile memory of the parameter server node;
    其中,从所述参数服务器节点的非易失性内存中获取所存储的第一层数据,包括:Wherein, obtaining the stored first-layer data from the non-volatile memory of the parameter server node includes:
    从所述参数服务器节点的非易失性内存中的固定位置处读取所述第一层数据。The first layer data is read from a fixed location in the non-volatile memory of the parameter server node.
  14. 如权利要求12所述的恢复方法,其中,所述参数服务器节点头信息包括参数服务器节点ID和第一级存储子模块ID列表;The recovery method of claim 12, wherein the parameter server node header information includes a parameter server node ID and a list of first-level storage submodule IDs;
    所述第一级存储子模块头信息包括该第一级存储子模块ID、该第一级存储子模块存储的模型参数的版本信息、以及该第一级存储子模块的指向下一级哈希映射的指针。The first-level storage sub-module header information includes the first-level storage sub-module ID, the version information of the model parameters stored in the first-level storage sub-module, and the pointer to the next-level hash of the first-level storage sub-module Mapped pointer.
  15. 如权利要求14所述的恢复方法,其中,第一级存储子模块ID列表中包括的第一级存储子模块ID由模型ID和对应模型中的第一级存储子模块ID组成。The restoration method of claim 14, wherein the first-level storage sub-module ID included in the first-level storage sub-module ID list consists of a model ID and a first-level storage sub-module ID in the corresponding model.
  16. 如权利要求14所述的恢复方法,其中,基于所述第一层数据,从所述参数服务器节点的非易失性内存中获取所存储的第二层数据中的每个第一级存储子模块头信息,包括:15. The recovery method of claim 14, wherein, based on the first-tier data, each first-tier storage subsection of the stored second-tier data is obtained from a non-volatile memory of the parameter server node Module header information, including:
    基于第一级存储子模块ID列表,确定所述参数服务器节点的所有第一级存储子模块ID;Determine all first-level storage sub-module IDs of the parameter server node based on the first-level storage sub-module ID list;
    基于所述参数服务器节点的所有第一级存储子模块ID中的每个第一级存储子模块ID,获取具有相应第一级存储子模块ID的第一级存储子模块头信息。Based on each of the first-level storage sub-module IDs of all the first-level storage sub-module IDs of the parameter server node, the first-level storage sub-module header information having the corresponding first-level storage sub-module ID is acquired.
  17. 如权利要求14所述的恢复方法,其中,所述第一级存储子模块哈希映射信息包括该第一级存储子模块下的各个从第二级至第N级存储子模块中每一级存储子模块的哈希映射、以及该第一级存储子模块下的各个第N级存储子模块下的模型参数哈希映射,其中,N为模型参数被划分的存储子模块的级数;The recovery method according to claim 14, wherein the hash map information of the first-level storage submodule includes each of the second-level to Nth-level storage submodules under the first-level storage submodule The hash map of the storage submodule and the model parameter hash map under each of the Nth-level storage submodules under the first-level storage submodule, where N is the number of stages of the storage submodules into which the model parameters are divided;
    其中,每一级存储子模块的哈希映射的键为该级存储子模块的ID,值为指向下一级哈希映射的指针,Among them, the key of the hash map of each level of storage sub-module is the ID of this level of storage sub-module, and the value is the pointer to the next level of hash map,
    模型参数哈希映射的键为参数名,值为参数值,The key of the model parameter hash map is the parameter name, the value is the parameter value,
    每一级存储子模块的哈希映射和模型参数哈希映射通过该级存储子模块或该模型参数的上一级存储子模块相应的指向下一级哈希映射的指针链接。The hash map of each level of storage sub-module and the model parameter hash map are linked by the corresponding pointer to the next level of hash map of this level of storage sub-module or the upper-level storage sub-module of the model parameter.
  18. 如权利要求17所述的恢复方法,其中,所述基于每个第一级存储子模块头信息,遍历所述第二层数据中的每个第一级存储子模块哈希映射信息,以恢复所述参数服务器节点上存储的模型参数,包括:The recovery method according to claim 17, wherein, based on the header information of each first-level storage sub-module, traversing the hash map information of each first-level storage sub-module in the second-level data to recover The model parameters stored on the parameter server node include:
    针对每个第一级存储子模块执行以下操作:Do the following for each first-level storage submodule:
    通过上一级存储子模块相应的指向下一级哈希映射的指针搜索下一级哈希映射,直到搜索到模型参数哈希映射;Search the next-level hash map through the pointer to the next-level hash map corresponding to the previous-level storage submodule until the model parameter hash map is searched;
    基于模型参数哈希映射,恢复模型参数。Based on the model parameter hash map, the model parameters are restored.
  19. 如权利要求18所述的恢复方法,其中,在模型参数被划分为一级存储子模块的情况下:每个第一级存储子模块哈希映射信息包括该第一级存储子模块下的模型参数哈希映射,其中,第一级存储子模块头信息中的指向下一级哈希映射的指针为指向模型参数哈希映射的指针;The restoration method according to claim 18, wherein, when the model parameters are divided into first-level storage submodules: the hash map information of each first-level storage submodule includes the model under the first-level storage submodule A parameter hash map, wherein the pointer to the next-level hash map in the header information of the first-level storage submodule is a pointer to the model parameter hash map;
    其中,所述通过上一级存储子模块相应的指向下一级哈希映射的指针搜索下一级哈希映射,直到搜索到模型参数哈希映射,包括:Wherein, searching the next-level hash map through the corresponding pointer of the previous-level storage submodule to the next-level hash map, until the model parameter hash map is searched, including:
    通过第一级存储子模块头信息中的指向模型参数哈希映射的指针,搜索模型参数哈希映射。The model parameter hash map is searched through the pointer to the model parameter hash map in the first-level storage submodule header information.
  20. 如权利要求18所述的恢复方法,其中,在模型参数被划分为两级存储子模块的情况下:每个第一级存储子模块哈希映射信息包括第一级存储子模块下的各个第二级存储子模块的哈希映射以及该第一级存储子模块下的各个第二级存储子模块的模型参数哈希 映射,其中,第一级存储子模块头信息中的指向下一级哈希映射的指针为指向第二级存储子模块的哈希映射的指针,每个第二级存储子模块的哈希映射的键为该第二级存储子模块ID,值为指向该第二级存储子模块下的模型参数哈希映射的指针;The restoration method according to claim 18, wherein, when the model parameters are divided into two-level storage sub-modules: the hash map information of each first-level storage sub-module includes each The hash map of the second-level storage sub-module and the model parameter hash map of each second-level storage sub-module under the first-level storage sub-module, wherein the header information of the first-level storage sub-module points to the next level hash map The pointer of the desired map is a pointer to the hash map of the second-level storage submodule, the key of the hash map of each second-level storage submodule is the ID of the second-level storage submodule, and the value points to the second-level storage submodule. A pointer to a hash map of model parameters under the storage submodule;
    其中,所述通过上一级存储子模块相应的指针搜索下一级哈希映射,直到搜索到模型参数哈希映射,包括:Wherein, searching the next-level hash map through the corresponding pointer of the upper-level storage submodule until the model parameter hash map is searched, including:
    通过第一级存储子模块头信息中的指向第二级存储子模块哈希映射的指针,搜索第二级存储子模块的哈希映射;Search the hash map of the second-level storage sub-module through the pointer to the second-level storage sub-module hash map in the first-level storage sub-module header information;
    通过第二级存储子模块的哈希映射中的指向模型参数哈希映射的指针,搜索模型参数哈希映射。The model parameter hash map is searched through the pointer to the model parameter hash map in the hash map of the second-level storage submodule.
  21. 如权利要求14所述的恢复方法,还包括:The recovery method of claim 14, further comprising:
    在所述第一级存储子模块头信息中的模型参数版本信息与存储在所述参数服务器集群的元数据节点上的模型参数版本信息一致的情况下,执行所述恢复的步骤;Under the condition that the model parameter version information in the header information of the first-level storage sub-module is consistent with the model parameter version information stored on the metadata node of the parameter server cluster, the restoring step is performed;
    在所述第一级存储子模块头信息中的模型参数版本信息与存储在所述参数服务器集群的元数据节点上的模型参数版本信息不一致的情况下,不执行所述恢复的步骤,而从后端存储系统中拉取最新版本的模型参数,并插入所述参数服务器节点;In the case that the model parameter version information in the header information of the first-level storage submodule is inconsistent with the model parameter version information stored on the metadata node of the parameter server cluster, the restoring step is not performed, and the Pull the latest version of the model parameters from the back-end storage system and insert the parameter server node;
    其中,所述参数服务器集群的元数据节点存储模型参数的最新版本号,所述后端存储系统存储最新版本的模型参数。The metadata node of the parameter server cluster stores the latest version number of the model parameter, and the back-end storage system stores the latest version of the model parameter.
  22. 如权利要求12所述的恢复方法,其中,所述非易失性内存包括STT-RAM、PCM、ReRAM和3DxPoint中的至少一个。The recovery method of claim 12, wherein the non-volatile memory includes at least one of STT-RAM, PCM, ReRAM, and 3DxPoint.
  23. 一种参数服务器节点的恢复系统,其中,所述参数服务器节点是参数服务器集群中的一个节点,且所述参数服务器节点是基于非易失性内存的参数服务器节点,所述参数服务器节点的非易失性内存中存储的每个模型的模型参数在逻辑上被划分为至少一级存储子模块,所述恢复装置包括:A recovery system for a parameter server node, wherein the parameter server node is a node in a parameter server cluster, and the parameter server node is a parameter server node based on non-volatile memory, and the non-volatile memory of the parameter server node The model parameters of each model stored in the volatile memory are logically divided into at least one-level storage sub-modules, and the recovery device includes:
    第一获取装置,被配置为:在所述参数服务器节点重启后,从所述参数服务器节点的非易失性内存中获取所存储的第一层数据,其中,第一层数据包括参数服务器节点头信息,所述第一层数据用于查询所述参数服务器节点的节点信息和第一级存储子模块信息;a first obtaining device configured to: after the parameter server node restarts, obtain the stored first-layer data from the non-volatile memory of the parameter server node, wherein the first-layer data includes the parameter server node Nodding information, the first-level data is used to query the node information of the parameter server node and the first-level storage sub-module information;
    第二获取装置,被配置为:基于所述第一层数据,从所述参数服务器节点的非易失性内存中获取所存储的第二层数据中的每个第一级存储子模块头信息,其中,所述第二层数据包括M个第一级存储子模块头信息和M个第一级存储子模块哈希映射信息,所述第二层数据用于查询该参数服务器节点的各个第一级存储子模块中存储的模型参数,其中,M为该参数服务器节点上存储的第一级存储子模块的数量;A second obtaining device is configured to: obtain, based on the first-layer data, the header information of each first-level storage submodule in the stored second-layer data from the non-volatile memory of the parameter server node , wherein the second layer data includes M first-level storage sub-module header information and M first-level storage sub-module hash mapping information, and the second layer data is used to query each first-level storage sub-module of the parameter server node. Model parameters stored in the first-level storage submodule, wherein M is the number of first-level storage submodules stored on the parameter server node;
    恢复装置,被配置为:基于每个第一级存储子模块头信息,遍历所述第二层数据中的每个第一级存储子模块哈希映射信息,以恢复所述参数服务器节点上存储的模型参数。A restoration device, configured to: based on the header information of each first-level storage sub-module, traverse the hash map information of each first-level storage sub-module in the second-level data, so as to restore the data stored on the parameter server node model parameters.
  24. 一种存储指令的计算机可读存储介质,其中,当所述指令被至少一个计算装置运行时,促使所述至少一个计算装置执行如权利要求12至22中的任一权利要求所述的参数服务器节点的恢复方法。A computer-readable storage medium storing instructions, wherein the instructions, when executed by at least one computing device, cause the at least one computing device to execute the parameter server of any one of claims 12 to 22 The recovery method of the node.
  25. 一种电子设备,包括:An electronic device comprising:
    处理器;processor;
    用于存储所述处理器可执行指令的存储器;a memory for storing the processor-executable instructions;
    其中,所述处理器被配置为执行所述指令,以实现如权利要求12至22中的任一权利要求所述的参数服务器节点的恢复方法。Wherein, the processor is configured to execute the instructions to implement the method for restoring a parameter server node as claimed in any one of claims 12 to 22.
PCT/CN2021/127609 2020-10-29 2021-10-29 Parameter server node recovery method and recovery system WO2022089607A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011187099.2A CN112181732A (en) 2020-10-29 2020-10-29 Recovery method and recovery system of parameter server node
CN202011187099.2 2020-10-29

Publications (1)

Publication Number Publication Date
WO2022089607A1 true WO2022089607A1 (en) 2022-05-05

Family

ID=73916216

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/127609 WO2022089607A1 (en) 2020-10-29 2021-10-29 Parameter server node recovery method and recovery system

Country Status (2)

Country Link
CN (1) CN112181732A (en)
WO (1) WO2022089607A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112181732A (en) * 2020-10-29 2021-01-05 第四范式(北京)技术有限公司 Recovery method and recovery system of parameter server node
CN112306682B (en) * 2020-10-29 2022-08-16 第四范式(北京)技术有限公司 Storage method and system of model parameters and parameter server cluster

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103905540A (en) * 2014-03-25 2014-07-02 浪潮电子信息产业股份有限公司 Object storage data distribution mechanism based on two-sage Hash
US20150127982A1 (en) * 2011-09-30 2015-05-07 Accenture Global Services Limited Distributed computing backup and recovery system
CN107862064A (en) * 2017-11-16 2018-03-30 北京航空航天大学 One high-performance based on NVM, expansible lightweight file system
CN107888657A (en) * 2017-10-11 2018-04-06 上海交通大学 Low latency distributed memory system
CN110169040A (en) * 2018-07-10 2019-08-23 深圳花儿数据技术有限公司 Distributed data storage method and system based on multilayer consistency Hash
CN111641716A (en) * 2020-06-01 2020-09-08 第四范式(北京)技术有限公司 Self-healing method of parameter server, parameter server and parameter service system
CN112181732A (en) * 2020-10-29 2021-01-05 第四范式(北京)技术有限公司 Recovery method and recovery system of parameter server node
CN112306682A (en) * 2020-10-29 2021-02-02 第四范式(北京)技术有限公司 Storage method and system of model parameters and parameter server cluster

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102779097B (en) * 2011-05-13 2015-01-21 上海振华重工(集团)股份有限公司 Memory access method of flow data
CN103456360B (en) * 2013-09-13 2016-08-17 昆腾微电子股份有限公司 The management method of nonvolatile memory and device
CN105608224A (en) * 2016-01-13 2016-05-25 广西师范大学 Orthogonal multilateral Hash mapping indexing method for improving massive data inquiring performance
JP6443572B1 (en) * 2018-02-02 2018-12-26 富士通株式会社 Storage control device, storage control method, and storage control program
CN110807125B (en) * 2019-08-03 2020-12-22 北京达佳互联信息技术有限公司 Recommendation system, data access method and device, server and storage medium
CN110968530B (en) * 2019-11-19 2021-12-03 华中科技大学 Key value storage system based on nonvolatile memory and memory access method

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150127982A1 (en) * 2011-09-30 2015-05-07 Accenture Global Services Limited Distributed computing backup and recovery system
CN103905540A (en) * 2014-03-25 2014-07-02 浪潮电子信息产业股份有限公司 Object storage data distribution mechanism based on two-sage Hash
CN107888657A (en) * 2017-10-11 2018-04-06 上海交通大学 Low latency distributed memory system
CN107862064A (en) * 2017-11-16 2018-03-30 北京航空航天大学 One high-performance based on NVM, expansible lightweight file system
CN110169040A (en) * 2018-07-10 2019-08-23 深圳花儿数据技术有限公司 Distributed data storage method and system based on multilayer consistency Hash
CN111641716A (en) * 2020-06-01 2020-09-08 第四范式(北京)技术有限公司 Self-healing method of parameter server, parameter server and parameter service system
CN112181732A (en) * 2020-10-29 2021-01-05 第四范式(北京)技术有限公司 Recovery method and recovery system of parameter server node
CN112306682A (en) * 2020-10-29 2021-02-02 第四范式(北京)技术有限公司 Storage method and system of model parameters and parameter server cluster

Also Published As

Publication number Publication date
CN112181732A (en) 2021-01-05

Similar Documents

Publication Publication Date Title
US11269884B2 (en) Dynamically resizable structures for approximate membership queries
WO2022089560A1 (en) Model parameter storage method and system, and parameter server cluster
US20230267054A1 (en) Using Mirrored Copies For Data Availability
US11822807B2 (en) Data replication in a storage system
US9619351B2 (en) Clustered RAID assimilation management
US20230325282A1 (en) Metadata-Based Recovery Of A Dataset
US11893023B2 (en) Deterministic searching using compressed indexes
US20210303522A1 (en) Copying a File System
US20210303519A1 (en) Optimizing a Transfer of a File System
TWI709864B (en) Memory system, method and device for utilizing a deduplication process
US11662909B2 (en) Metadata management in a storage system
US10929046B2 (en) Identifying and relocating hot data to a cache determined with read velocity based on a threshold stored at a storage device
WO2022089607A1 (en) Parameter server node recovery method and recovery system
US11704035B2 (en) Unified storage on block containers
US11620075B2 (en) Providing application aware storage
US20210303523A1 (en) Replicating a File System
US20210011623A1 (en) Generating tags for data allocation
US20220236904A1 (en) Using data similarity to select segments for garbage collection
US20230055389A1 (en) Tiered caching of data in a storage system
US20210303528A1 (en) Managing Directory-Tree Operations in File Storage
US20220147490A1 (en) Replica transitions for file storage
US20210303511A1 (en) Cloning a Managed Directory of a File System
WO2024099448A1 (en) Memory release method and apparatus, memory recovery method and apparatus, and computer device and storage medium
US11403043B2 (en) Efficient data compression by grouping similar data within a data segment
US11775189B2 (en) Segment level heterogeneity

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21885333

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21885333

Country of ref document: EP

Kind code of ref document: A1