Model loading method, device and equipment, medium and program product
By using the historical loading information of the non-volatile storage and computing integrated device to automatically load the weight data of the neural network model when the volatile storage and computing integrated device is started, the low model loading efficiency is solved when the volatile storage and computing integrated device is powered off and restarted. problem, realizing automatic loading of models and improving efficiency.
Patent Information
- Application Number
- CN202410245960.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-05
- Publication Date
- 2024-10-18
AI Technical Summary
In the existing technology, the volatile storage and computing integrated equipment has low model loading efficiency when it is powered off and restarted, requiring manual reloading of weight data, resulting in low efficiency.
By using the historical loading information of the non-volatile storage and computing integrated device to obtain the weight data of the neural network model when the volatile storage and computing integrated device is started, and automatically loading it to the volatile storage and computing integrated device, including analyzing the historical loading information , determine the storage location of the weight data, obtain and load the weight data, and perform location and accuracy verification.
It realizes automatic loading of models, reduces model loading complexity and user operation frequency, improves model loading efficiency, and avoids frequent manual loading operations due to power outages of volatile storage and computing integrated equipment.
Smart Images

Figure CN118796549A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of storage-computing integrated equipment, and in particular to a model loading method, device, equipment, medium and program product. Background Art
[0002] The integrated storage and computing technology can effectively overcome the problems of insufficient computing power, low memory access efficiency, and high power consumption of the von Neumann architecture. The current mainstream integrated storage and computing technology is based on SRAM (Static Random Access Memory) to achieve large-scale parallel computing applications, such as inference scenarios of artificial intelligence models. Before reasoning, the weight data of the model needs to be pre-loaded into the SRAM. However, SRAM is a volatile integrated storage and computing device, and it cannot effectively save data after power failure and restart. Therefore, each restart requires manual reloading of the weight data before the upper-level application can perform subsequent calculation operations, which results in low model loading efficiency. Summary of the invention
[0003] The technical solution of the present invention aims to provide a model loading method, device, equipment, medium and program product, which are used to solve the problem of low model loading efficiency when a volatile storage and computing integrated device is powered off and restarted in the prior art.
[0004] To achieve the above object, the present invention is achieved by:
[0005] In a first aspect, an embodiment of the present invention provides a model loading method, comprising:
[0006] When the volatile storage-computing integrated device is started, the weight data of the neural network model is obtained according to the historical loading information of the neural network model stored in the non-volatile storage-computing integrated device, wherein the historical loading information is obtained by the non-volatile storage-computing integrated device each time the neural network model is loaded into the volatile storage-computing integrated device;
[0007] The weight data is loaded into the volatile storage and computing integrated device.
[0008] Optionally, the model loading method, wherein the weight data of the neural network model is obtained according to the historical loading information of the neural network model stored in the non-volatile storage and computing integrated device, comprises:
[0009] Parsing the historical loading information to obtain a first mark bit;
[0010] Determining a storage location of the weight data according to the first flag bit;
[0011] If the storage location is the non-volatile storage-computing integrated device, acquiring the weight data according to the weight path information in the historical loading information;
[0012] If the storage location is a cloud device, the weight data is obtained by sending a weight acquisition request to the cloud device. The weight acquisition request carries the model parameters in the historical loading information, which is used to instruct the cloud device to send the corresponding weight data according to the model parameters.
[0013] Optionally, the model loading method, wherein the weight data is loaded into the volatile storage and computing integrated device, comprises:
[0014] The weight data is converted through circuits and loaded into corresponding array units of the volatile storage and computing integrated device according to weight arrangement information in the historical loading information. The weight arrangement information is arrangement information of the weight data mapped onto the array units of the volatile storage and computing integrated device.
[0015] Optionally, the model loading method further includes:
[0016] Based on the loading position verification results and the loading accuracy verification results of the weight data, the result of loading the weight data into the volatile storage and computing integrated device is evaluated.
[0017] Optionally, the model loading method further includes:
[0018] The loading position of the weight data is compared with the weight arrangement information in the historical loading information to obtain the loading position verification result.
[0019] Optionally, the model loading method further includes:
[0020] Acquiring voltage level data of an array unit of the volatile storage-computing integrated device;
[0021] The voltage level data is converted by a circuit to obtain weight data to be verified;
[0022] The loading accuracy verification result is obtained based on the weight data to be verified and the weight data of the neural network model.
[0023] Optionally, the model loading method further includes:
[0024] At least one of the following items in the historical loading information is updated:
[0025] Model identification code;
[0026] Model name;
[0027] Model version number;
[0028] Model verification information, used to indicate the loading accuracy result of the weight data;
[0029] The second flag is used to indicate that the weight data has completed accuracy verification;
[0030] Number of times the model has been loaded.
[0031] Optionally, the model loading method further includes:
[0032] The updated historical loading information is saved to the non-volatile storage and computing integrated device.
[0033] In a second aspect, an embodiment of the present invention further provides a model loading device, including a processor, wherein the processor is used to:
[0034] When the volatile storage-computing integrated device is started, the weight data of the neural network model is obtained according to the historical loading information of the neural network model stored in the non-volatile storage-computing integrated device, wherein the historical loading information is obtained by the non-volatile storage-computing integrated device each time the neural network model is loaded into the volatile storage-computing integrated device;
[0035] The weight data is loaded into the volatile storage and computing integrated device.
[0036] In a third aspect, an embodiment of the present invention further provides a model loading device, comprising:
[0037] A first acquisition module is used to acquire weight data of the neural network model according to historical loading information of the neural network model stored in the non-volatile storage and computing integrated device when the volatile storage and computing integrated device is started, wherein the historical loading information is obtained by the non-volatile storage and computing integrated device each time the neural network model is loaded into the volatile storage and computing integrated device;
[0038] A loading module is used to load the weight data into the volatile storage and computing integrated device.
[0039] In a fourth aspect, an embodiment of the present invention further provides a model loading device, comprising: a processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the model loading method as described in the first aspect.
[0040] In a fifth aspect, an embodiment of the present invention further provides a readable storage medium, on which a program is stored, and when the program is executed by a processor, the model loading method as described in the first aspect is implemented.
[0041] In a sixth aspect, an embodiment of the present invention further provides a computer program product, comprising computer instructions, which, when executed by a processor, implement the model loading method as described in the first aspect.
[0042] The beneficial effects of the above technical solution of the present invention are as follows:
[0043] By adopting the model loading method described in the embodiment of the present invention, when the volatile storage and computing integrated device is started, the weight data of the neural network model is obtained according to the historical loading information of the neural network model stored in the non-volatile storage and computing integrated device, and the historical loading information is obtained by the non-volatile storage and computing integrated device each time the neural network model is loaded into the volatile storage and computing integrated device; the weight data is loaded into the volatile storage and computing integrated device, so that the weight data can be automatically loaded according to the historical loading information, thereby decoupling the model loading from the application operation, avoiding the user from frequently performing manual loading operations due to power failure of the volatile storage and computing integrated device, realizing automatic loading, and effectively improving the model loading efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 A schematic diagram of a flow chart of a model loading method according to an embodiment of the present invention;
[0045] Figure 2 A schematic diagram of a flow chart of one implementation of the method described in an embodiment of the present invention;
[0046] Figure 3 It is a structural schematic diagram of one implementation mode of the model loading device according to an embodiment of the present invention;
[0047] Figure 4 It is a structural schematic diagram of the model loading device according to an embodiment of the present invention;
[0048] Figure 5 It is a structural schematic diagram of another implementation manner of the model loading device described in an embodiment of the present invention. DETAILED DESCRIPTION
[0049] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.
[0050] In order to solve the problem of low model loading efficiency when a volatile storage and computing integrated device is powered off and restarted in the prior art, an embodiment of the present invention provides a model loading method. When the volatile storage and computing integrated device is started, the weight data of the neural network model is obtained according to the historical loading information of the neural network model stored in the non-volatile storage and computing integrated device, and the historical loading information is obtained by the non-volatile storage and computing integrated device each time the neural network model is loaded into the volatile storage and computing integrated device; the weight data is loaded into the volatile storage and computing integrated device. Therefore, by adopting this implementation, the automatic loading of the weight data can be completed according to the historical loading information, and the complexity of model loading is effectively reduced, thereby decoupling the model loading from the application operation, avoiding the user from frequently performing manual loading operations due to power failure of the volatile storage and computing integrated device, realizing automatic loading, and effectively improving the model loading efficiency.
[0051] The embodiment of the present invention, as Figure 1 As shown, a model loading method is provided, including:
[0052] Step 101, when the volatile storage and computing integrated device is started, the weight data of the neural network model is obtained according to the historical loading information of the neural network model stored in the non-volatile storage and computing integrated device, wherein the historical loading information is obtained by the non-volatile storage and computing integrated device each time the neural network model is loaded into the volatile storage and computing integrated device.
[0053] Among them, the non-volatile storage and computing integrated device is the main device of the volatile storage and computing integrated device, and the volatile storage and computing integrated device is connected to the non-volatile storage and computing integrated device. For example, the non-volatile storage and computing integrated device is a computer, and the volatile storage and computing integrated device is SRAM.
[0054] The startup of the volatile storage-computing integrated device refers to the restart of the volatile storage-computing integrated device every time it loses power.
[0055] In this step, every time the volatile storage and computing integrated device is powered off and restarted, the historical loading information of the neural network model corresponding to the volatile storage and computing integrated device stored in the non-volatile storage and computing integrated device can be parsed to obtain the weight data of the neural network model.
[0056] It is understandable that if the non-volatile storage and computing device does not store the historical record information of the neural network model of the volatile storage and computing device, it means that the volatile storage and computing device does not have a historical model loading record and this is the first time the model is loaded.
[0057] It should be noted that each time the neural network model is loaded into the volatile storage and computing integrated device, the non-volatile storage and computing integrated device needs to update the historical loading information once.
[0058] When the neural network model is loaded into the volatile storage and computing device for the first time, the non-volatile storage and computing device needs to store the loading information for the first time, and then update it based on the loading information each time it is loaded to obtain historical loading information.
[0059] The steps of loading the neural network model into the volatile storage and computing device for the first time include:
[0060] Analyze the neural network model and obtain model parameters;
[0061] The weight data of the neural network model is mapped and arranged with the array unit of the volatile storage and computing integrated device to obtain the weight arrangement information;
[0062] The weight data is converted through the circuit and loaded into the corresponding array unit of the volatile storage and computing device according to the weight arrangement information.
[0063] It should also be noted that an embodiment of the present invention provides a runtime system, which can be understood as a middleware that can build an effective communication mechanism between the application layer and the hardware to execute the model loading method. The runtime system can effectively reduce the complexity of model loading and development costs.
[0064] Each time the neural network model is loaded into the volatile storage and computing integrated device, the runtime system (runtime) can first collect model parameters, weight arrangement information and model loading times, and set the first flag bit, which is used to indicate whether the weight data is stored in the non-volatile storage and computing integrated device. If the weight data is stored in the non-volatile storage and computing integrated device, the runtime system also needs to collect weight path information to indicate the path where the weight data is stored in the non-volatile storage and computing integrated device. Then the runtime system also needs to save the collected information in the non-volatile storage and computing integrated device.
[0065] Each time the volatile storage and computing device is powered off and restarted, the runtime system is synchronously initialized and obtains the historical loading information of the neural network model from the non-volatile storage and computing device, thereby obtaining the weight data of the neural network model based on the historical loading information.
[0066] Optionally, the historical loading information includes at least one of the following:
[0067] Model parameters;
[0068] The first marker position;
[0069] Weight path information;
[0070] Weight arrangement information;
[0071] Model loading times, used to indicate the number of times the neural network model is loaded on the volatile storage and computing device.
[0072] The model parameters include at least one of the following:
[0073] Model identification code;
[0074] Model name;
[0075] Model version number;
[0076] Model structure information.
[0077] Step 102, loading the weight data into the volatile storage and computing integrated device.
[0078] In this step, the weight data is loaded into a volatile storage and computing device, thereby realizing the loading of the neural network model, and effectively reducing the complexity of model loading, improving model management efficiency and user-friendliness.
[0079] In one implementation mode, optionally, step 101 includes:
[0080] Parsing the historical loading information to obtain a first mark bit;
[0081] Determining a storage location of the weight data according to the first flag bit;
[0082] If the storage location is the non-volatile storage-computing integrated device, acquiring the weight data according to the weight path information in the historical loading information;
[0083] If the storage location is a cloud device, the weight data is obtained by sending a weight acquisition request to the cloud device. The weight acquisition request carries the model parameters in the historical loading information, which is used to instruct the cloud device to send the corresponding weight data according to the model parameters.
[0084] It should be noted that the weight data of the neural network model can be stored in a non-volatile storage and computing device or a cloud device. The embodiment of the present invention uses a first flag bit to indicate whether the weight data of the neural network model is stored in a non-volatile storage and computing device.
[0085] In the embodiment of the present invention, the historical loading information is parsed to obtain a first mark bit, and a judgment is made based on the first mark bit to determine the storage location of the weight data.
[0086] If the first mark bit indicates that the weight data of the neural network model is stored in a non-volatile storage and computing device, it means that the storage location is a non-volatile storage and computing device. Further, based on the weight path information in the historical loading information, the path where the weight data is stored in the non-volatile storage and computing device is determined, thereby obtaining the weight data from the path.
[0087] If the first flag bit indicates that the weight data of the neural network model is not stored in the non-volatile storage and computing device, it means that the weight data is stored in the cloud device, and a weight acquisition request is further sent to the cloud device. The cloud device matches the weight data corresponding to the model parameters in the neural network model library based on the model parameters carried in the weight acquisition request. Further, the weight data can be downloaded from the cloud device.
[0088] In one implementation mode, optionally, step 102 includes:
[0089] The weight data is converted through circuits and loaded into corresponding array units of the volatile storage and computing integrated device according to weight arrangement information in the historical loading information. The weight arrangement information is arrangement information of the weight data mapped onto the array units of the volatile storage and computing integrated device.
[0090] In the embodiment of the present invention, the weight data is converted through a circuit according to the weight arrangement information and reloaded one by one to the specific positions of the array units.
[0091] It should be noted that the historical loading information may also include calculation control flow information, which is used to indicate the calculation order of each layer of the neural network model. Step 102 also includes loading the calculation control flow information to the control unit of the volatile storage and computing integrated device, so that when the volatile storage and computing integrated device performs the model reasoning task, the control unit can control the calculation order of the array unit.
[0092] In one embodiment, optionally, the method further comprises:
[0093] Based on the loading position verification results and the loading accuracy verification results of the weight data, the result of loading the weight data into the volatile storage and computing integrated device is evaluated.
[0094] It should be noted that in the process of loading the weight data of the neural network model into the volatile storage and computing integrated device, due to the characteristics of the volatile storage and computing integrated device, writing errors may occur, so the loading results of the weight data need to be evaluated.
[0095] In the embodiment of the present invention, the following formula is used to evaluate the result of loading the weight data into the volatile storage and computing integrated device:
[0096] threshold=α*condition_1+β*condition_2
[0097] Among them, condition_1 represents the loading position verification result of the weight data; condition_2 represents the loading accuracy verification result; α, β and threshold are all empirical values.
[0098] It can be understood that if the loading position verification result and the loading accuracy verification result of the weight data satisfy the above formula, it means that the evaluation is passed.
[0099] In one embodiment, optionally, the method further comprises:
[0100] The loading position of the weight data is compared with the weight arrangement information in the historical loading information to obtain the loading position verification result.
[0101] In the embodiment of the present invention, the loading position of the weight data is the position information where the weight data is actually loaded into the array unit of the volatile storage and computing integrated device, such as the coordinates of the array unit.
[0102] After the weight data is loaded into the volatile storage and computing integrated device, the loading position is compared with the weight arrangement information to obtain the loading position verification result.
[0103] In one embodiment, optionally, the method further comprises:
[0104] Acquiring voltage level data of an array unit of the volatile storage-computing integrated device;
[0105] The voltage level data is converted by a circuit to obtain weight data to be verified;
[0106] The loading accuracy verification result is obtained based on the weight data to be verified and the weight data of the neural network model.
[0107] In the embodiment of the present invention, after the weight data is loaded into the volatile storage-computing integrated device, the weight data actually loaded into the volatile storage-computing integrated device, that is, the weight data to be verified, is obtained.
[0108] The voltage level data of the array unit of the volatile storage and computing integrated device is read and the voltage level data is converted through a circuit to obtain the weight data to be verified.
[0109] Further, according to the weight data to be verified and the weight data determined according to the historical loading information of the neural network model, the loading accuracy verification result is obtained. Specifically, the loading accuracy verification result is obtained using the following formula:
[0110]
[0111] Among them, (i, j) represents the coordinates of the array unit of the volatile storage and computing integrated device; m, n represent the sizes of the array unit of the volatile storage and computing integrated device; A(i, j) represents the weight data to be verified corresponding to (i, j); B(i, j) represents the weight data in the historical loading information corresponding to (i, j).
[0112] In one embodiment, optionally, the method further comprises:
[0113] At least one of the following items in the historical loading information is updated:
[0114] Model identification code;
[0115] Model name;
[0116] Model version number;
[0117] Model verification information, used to indicate the loading accuracy result of the weight data;
[0118] The second flag is used to indicate that the weight data has completed accuracy verification;
[0119] Number of times the model has been loaded.
[0120] In an embodiment of the present invention, after the weight data is loaded into the volatile storage and computing integrated device, and the weight data loading position verification result and the loading accuracy verification result are evaluated and passed, at least one of the above-mentioned historical loading information is updated. In this way, when it is necessary to parse the historical loading information, it can be determined whether the weight data has completed the accuracy verification and the number of times the neural network model has been loaded based on the second flag bit.
[0121] Furthermore, the upper-level application or user can query the current historical loading information through the runtime system to check whether the model has been loaded, whether the model verification has been completed, and the accuracy of the model verification. When it is confirmed that the model has been loaded, the user can start executing the application based on the model.
[0122] In one embodiment, optionally, the method further comprises:
[0123] The updated historical loading information is saved to the non-volatile storage and computing integrated device.
[0124] In an embodiment of the present invention, the updated historical loading information is saved to a non-volatile storage and computing integrated device. In this way, when the volatile storage and computing integrated device is started, the weight data can be obtained according to the updated historical loading information, so that the model can be loaded based on the weight data.
[0125] like Figure 2The figure is a flow chart of one implementation of the model loading method according to the embodiment of the present invention.
[0126] Using this implementation, the model loading method includes the following steps:
[0127] Step 201, the volatile storage and computing integrated device is restarted.
[0128] Step 202, obtaining historical loading information of the neural network model.
[0129] Step 203, determine whether the non-volatile storage and computing integrated device stores historical loading information.
[0130] If the judgment result of step 203 is no, then enter step 204 to confirm that the current volatile storage and computing integrated device does not store the historical loading information of the neural network model corresponding to the volatile storage and computing integrated device.
[0131] If the judgment result of step 203 is yes, then the process proceeds to step 205 to parse the historical loading information.
[0132] Step 206, determine whether there is weight data in the non-volatile storage and computing device.
[0133] If the judgment result of step 206 is no, then proceed to step 207 to send a weight acquisition request to the cloud device to obtain the corresponding weight data.
[0134] If the judgment result of step 206 is yes, or after step 207, the process proceeds to step 208 to load the weight data into the volatile storage and computing integrated device according to the weight arrangement information in the historical loading information.
[0135] Step 209, verifying the loading position and loading accuracy.
[0136] Step 210: if the verification in step 209 passes, update the historical loading information.
[0137] In summary, the model loading method described in the embodiment of the present invention is adopted to address the characteristic that volatile storage and computing devices are easily lost when power is off. The historical loading information of the corresponding neural network model is stored in a non-volatile storage and computing device, and the weight data is automatically loaded. This decouples model loading from application operations, reduces user manual operations, improves model loading efficiency, and effectively reduces model loading complexity, thereby improving model management efficiency.
[0138] One embodiment of the present invention also provides a model loading device, such as Figure 3 As shown, the model loading device 300 includes a processor 301, wherein the processor 301 is used for:
[0139] When the volatile storage-computing integrated device is started, the weight data of the neural network model is obtained according to the historical loading information of the neural network model stored in the non-volatile storage-computing integrated device, wherein the historical loading information is obtained by the non-volatile storage-computing integrated device each time the neural network model is loaded into the volatile storage-computing integrated device;
[0140] The weight data is loaded into the volatile storage and computing integrated device.
[0141] Optionally, in the model loading device, the processor 301 is specifically configured to:
[0142] Parsing the historical loading information to obtain a first mark bit;
[0143] Determining a storage location of the weight data according to the first flag bit;
[0144] If the storage location is the non-volatile storage-computing integrated device, acquiring the weight data according to the weight path information in the historical loading information;
[0145] If the storage location is a cloud device, the weight data is obtained by sending a weight acquisition request to the cloud device. The weight acquisition request carries the model parameters in the historical loading information, which is used to instruct the cloud device to send the corresponding weight data according to the model parameters.
[0146] Optionally, in the model loading device, the processor 301 is specifically configured to:
[0147] The weight data is converted through circuits and loaded into corresponding array units of the volatile storage and computing integrated device according to weight arrangement information in the historical loading information. The weight arrangement information is arrangement information of the weight data mapped onto the array units of the volatile storage and computing integrated device.
[0148] Optionally, in the model loading device, the processor 301 is further configured to:
[0149] Based on the loading position verification results and the loading accuracy verification results of the weight data, the result of loading the weight data into the volatile storage and computing integrated device is evaluated.
[0150] Optionally, in the model loading device, the processor 301 is further configured to:
[0151] The loading position of the weight data is compared with the weight arrangement information in the historical loading information to obtain the loading position verification result.
[0152] Optionally, in the model loading device, the processor 301 is further configured to:
[0153] Acquiring voltage level data of an array unit of the volatile storage-computing integrated device;
[0154] The voltage level data is converted by a circuit to obtain weight data to be verified;
[0155] The loading accuracy verification result is obtained based on the weight data to be verified and the weight data of the neural network model.
[0156] Optionally, in the model loading device, the processor 301 is further configured to:
[0157] At least one of the following items in the historical loading information is updated:
[0158] Model identification code;
[0159] Model name;
[0160] Model version number;
[0161] Model verification information, used to indicate the loading accuracy result of the weight data;
[0162] The second flag is used to indicate that the weight data has completed accuracy verification;
[0163] Number of times the model has been loaded.
[0164] Optionally, in the model loading device, the processor 301 is further configured to:
[0165] The updated historical loading information is saved to the non-volatile storage and computing integrated device.
[0166] like Figure 4 As shown, an embodiment of the present invention further provides a model loading device, comprising:
[0167] A first acquisition module 401 is used to acquire weight data of the neural network model according to historical loading information of the neural network model stored in the non-volatile storage and computing integrated device when the volatile storage and computing integrated device is started, wherein the historical loading information is obtained by the non-volatile storage and computing integrated device each time the neural network model is loaded into the volatile storage and computing integrated device;
[0168] A loading module is used to load the weight data into the volatile storage and computing integrated device.
[0169] Optionally, in the model loading device, the first acquisition module 401 is specifically used to:
[0170] Parsing the historical loading information to obtain a first mark bit;
[0171] Determining a storage location of the weight data according to the first flag bit;
[0172] If the storage location is the non-volatile storage-computing integrated device, acquiring the weight data according to the weight path information in the historical loading information;
[0173] If the storage location is a cloud device, the weight data is obtained by sending a weight acquisition request to the cloud device. The weight acquisition request carries the model parameters in the historical loading information, which is used to instruct the cloud device to send the corresponding weight data according to the model parameters.
[0174] Optionally, in the model loading device, the loading module 402 is specifically used for:
[0175] The weight data is converted through circuits and loaded into corresponding array units of the volatile storage and computing integrated device according to weight arrangement information in the historical loading information. The weight arrangement information is arrangement information of the weight data mapped onto the array units of the volatile storage and computing integrated device.
[0176] Optionally, the model loading device further comprises:
[0177] An evaluation module is used to evaluate the result of loading the weight data into the volatile storage and computing integrated device according to the loading position verification result and the loading accuracy verification result of the weight data.
[0178] Optionally, the model loading device further comprises:
[0179] The second acquisition module is used to compare the loading position of the weight data with the weight arrangement information in the historical loading information to obtain the loading position verification result.
[0180] Optionally, the model loading device further comprises:
[0181] A third acquisition module is used to acquire voltage level data of the array unit of the volatile storage and computing integrated device;
[0182] A fourth acquisition module, used for converting the voltage level data through a circuit to obtain weight data to be verified;
[0183] The fifth acquisition module is used to obtain the loading accuracy verification result based on the weight data to be verified and the weight data of the neural network model.
[0184] Optionally, the model loading device further comprises:
[0185] An updating module, configured to update at least one of the following items in the historical loading information:
[0186] Model identification code;
[0187] Model name;
[0188] Model version number;
[0189] Model verification information, used to indicate the loading accuracy result of the weight data;
[0190] The second flag is used to indicate that the weight data has completed accuracy verification;
[0191] Number of times the model has been loaded.
[0192] Optionally, the model loading device further comprises:
[0193] A saving module is used to save the updated historical loading information to the non-volatile storage and computing integrated device.
[0194] like Figure 5 As shown, an embodiment of the present invention also provides a model loading device, including: a processor 501; and a memory 502 connected to the processor 501 through a bus interface, the memory 502 is used to store programs and data used by the processor 501 when performing operations, and the processor 501 calls and executes the programs and data stored in the memory 502.
[0195] The model loading device further includes a transceiver 503, which is connected to the bus interface and is used to receive and send data under the control of the processor 501;
[0196] Specifically, the processor 501 executes the following process:
[0197] When the volatile storage-computing integrated device is started, the weight data of the neural network model is obtained according to the historical loading information of the neural network model stored in the non-volatile storage-computing integrated device, wherein the historical loading information is obtained by the non-volatile storage-computing integrated device each time the neural network model is loaded into the volatile storage-computing integrated device;
[0198] The weight data is loaded into the volatile storage and computing integrated device.
[0199] Optionally, in the model loading device, the processor 501 performs the following process:
[0200] Parsing the historical loading information to obtain a first mark bit;
[0201] Determining a storage location of the weight data according to the first flag bit;
[0202] If the storage location is the non-volatile storage-computing integrated device, acquiring the weight data according to the weight path information in the historical loading information;
[0203] If the storage location is a cloud device, the weight data is obtained by sending a weight acquisition request to the cloud device. The weight acquisition request carries the model parameters in the historical loading information, which is used to instruct the cloud device to send the corresponding weight data according to the model parameters.
[0204] Optionally, in the model loading device, the processor 501 performs the following process:
[0205] The weight data is converted through circuits and loaded into corresponding array units of the volatile storage and computing integrated device according to weight arrangement information in the historical loading information. The weight arrangement information is arrangement information of the weight data mapped onto the array units of the volatile storage and computing integrated device.
[0206] Optionally, in the model loading device, the processor 501 further performs the following process:
[0207] Based on the loading position verification results and the loading accuracy verification results of the weight data, the result of loading the weight data into the volatile storage and computing integrated device is evaluated.
[0208] Optionally, in the model loading device, the processor 501 further performs the following process:
[0209] The loading position of the weight data is compared with the weight arrangement information in the historical loading information to obtain the loading position verification result.
[0210] Optionally, in the model loading device, the processor 501 further performs the following process:
[0211] Acquiring voltage level data of an array unit of the volatile storage-computing integrated device;
[0212] The voltage level data is converted by a circuit to obtain weight data to be verified;
[0213] The loading accuracy verification result is obtained based on the weight data to be verified and the weight data of the neural network model.
[0214] Optionally, in the model loading device, the processor 501 further performs the following process:
[0215] At least one of the following items in the historical loading information is updated:
[0216] Model identification code;
[0217] Model name;
[0218] Model version number;
[0219] Model verification information, used to indicate the loading accuracy result of the weight data;
[0220] The second flag is used to indicate that the weight data has completed accuracy verification;
[0221] Number of times the model has been loaded.
[0222] Optionally, in the model loading device, the processor 501 further performs the following process:
[0223] The updated historical loading information is saved to the non-volatile storage and computing integrated device.
[0224] Among them, Figure 5 In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically linking together various circuits of one or more processors represented by processor 501 and memory represented by memory 502. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides a user interface 504. The transceiver 503 may be a plurality of components, i.e., including a transmitter and a receiver, providing a unit for communicating with various other devices on a transmission medium. The processor 501 is responsible for managing the bus architecture and general processing, and the memory 502 may store data used by the processor 501 when performing operations.
[0225] A specific embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps in the above-mentioned model loading method are implemented and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0226] Specifically, the readable storage medium is applied to the above-mentioned model loading device. When applied to the model loading device, the execution steps in the corresponding model loading method are described in detail above and will not be repeated here.
[0227] In addition, an embodiment of the present invention further provides a computer program product, including computer instructions, which, when executed by a processor, implement the above Figure 1 The various processes of the method embodiment shown can achieve the same technical effect, and will not be described again here to avoid repetition.
[0228] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0229] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may be physically included separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0230] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform some steps of the sending and receiving method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store program codes.
[0231] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A model loading method, characterized in that: include: When the volatile storage-computing integrated device is started, the weight data of the neural network model is obtained according to the historical loading information of the neural network model stored in the non-volatile storage-computing integrated device, wherein the historical loading information is obtained by the non-volatile storage-computing integrated device each time the neural network model is loaded into the volatile storage-computing integrated device; The weight data is loaded into the volatile storage and computing integrated device.
2. The model loading method according to claim 1, characterized in that: According to the historical loading information of the neural network model stored in the non-volatile storage and computing integrated device, the weight data of the neural network model is obtained, including: Parsing the historical loading information to obtain a first mark bit; Determining a storage location of the weight data according to the first flag bit; If the storage location is the non-volatile storage-computing integrated device, acquiring the weight data according to the weight path information in the historical loading information; If the storage location is a cloud device, the weight data is obtained by sending a weight acquisition request to the cloud device. The weight acquisition request carries the model parameters in the historical loading information, which is used to instruct the cloud device to send the corresponding weight data according to the model parameters.
3. The model loading method according to claim 1, characterized in that: Loading the weight data into the volatile storage and computing device includes: The weight data is converted through circuits and loaded into corresponding array units of the volatile storage and computing integrated device according to weight arrangement information in the historical loading information. The weight arrangement information is arrangement information of the weight data mapped onto the array units of the volatile storage and computing integrated device.
4. The model loading method according to claim 1, characterized in that: Also includes: Based on the loading position verification results and the loading accuracy verification results of the weight data, the result of loading the weight data into the volatile storage and computing integrated device is evaluated.
5. The model loading method according to claim 4, characterized in that: Also includes: The loading position of the weight data is compared with the weight arrangement information in the historical loading information to obtain the loading position verification result.
6. The model loading method according to claim 4, characterized in that: Also includes: Acquiring voltage level data of an array unit of the volatile storage-computing integrated device; The voltage level data is converted by a circuit to obtain weight data to be verified; The loading accuracy verification result is obtained based on the weight data to be verified and the weight data of the neural network model.
7. The model loading method according to claim 1, characterized in that: Also includes: At least one of the following items in the historical loading information is updated: Model identification code; Model name; Model version number; Model verification information, used to indicate the loading accuracy result of the weight data; The second flag is used to indicate that the weight data has completed accuracy verification; Number of times the model has been loaded.
8. The model loading method according to claim 7, characterized in that: Also includes: The updated historical loading information is saved to the non-volatile storage and computing integrated device.
9. A model loading device, characterized in that: comprising a processor configured to: When the volatile storage-computing integrated device is started, the weight data of the neural network model is obtained according to the historical loading information of the neural network model stored in the non-volatile storage-computing integrated device, wherein the historical loading information is obtained by the non-volatile storage-computing integrated device each time the neural network model is loaded into the volatile storage-computing integrated device; The weight data is loaded into the volatile storage and computing integrated device.
10. A model loading device, characterized in that: include: A first acquisition module is used to acquire weight data of the neural network model according to historical loading information of the neural network model stored in the non-volatile storage and computing integrated device when the volatile storage and computing integrated device is started, wherein the historical loading information is obtained by the non-volatile storage and computing integrated device each time the neural network model is loaded into the volatile storage and computing integrated device; A loading module is used to load the weight data into the volatile storage and computing integrated device.
11. A model loading device, characterized in that: include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the model loading method according to any one of claims 1 to 8.
12. A readable storage medium, characterized in that: The readable storage medium stores a program, and when the program is executed by the processor, the model loading method according to any one of claims 1 to 8 is implemented.
13. A computer program product, characterized in that The method comprises computer instructions, which, when executed by a processor, implement the model loading method according to any one of claims 1 to 8.
