Model processing method, device, electronic device and computer storage medium

By building a database that hash value to characterize deep learning models and running platforms, the problem of cumbersome speed testing in the deep learning model deployment stage is solved, and the rapid acquisition of model speed information and cross-platform performance query is achieved, and efficiency and reusability are improved.

CN114330668BActive Publication Date: 2024-11-26CHENGDU SENSETIME TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111672855.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-31
Publication Date
2024-11-26
Estimated Expiration
2041-12-31

AI Technical Summary

Technical Problem

The speed testing process of the existing technology in the deep learning model deployment stage is cumbersome and inefficient, which makes it difficult to obtain model speed information, and the deployment process of different hardware platforms is not reusable.

Method used

By building a database, using hash values ​​to characterize deep learning models and running platforms, the speed measurement result mapping relationships can be quickly obtained, and the model speed information can be reduced, and repeated deployments and speed measurement operations can be reduced.

Benefits of technology

It significantly improves the efficiency of model speed information acquisition, reduces the complexity of deployment and speed measurement processes, and realizes cross-platform model performance query and storage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114330668B_ABST
    Figure CN114330668B_ABST
Patent Text Reader

Abstract

The embodiments of the present disclosure propose a model processing method, device, electronic device and computer storage medium, the method comprising: obtaining a deep learning model set and an operating platform set, wherein a hash value is used as an identifier to characterize each deep learning model in the deep learning model set, and each deep learning model includes a network topology structure and attribute information of each operator node; each operating platform in the operating platform set is formed by each deployment tool in an acceleration library being deployed on each hardware in a hardware set; determining a speed measurement result of each deep learning model on each operating platform; and constructing a database based on a mapping relationship between each speed measurement result and the corresponding deep learning model and operating platform.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of deep learning technology, and is related to but not limited to a model processing method, device, electronic device and computer storage medium. Background Art

[0002] Speed ​​testing is a necessary process for deep neural network models during the deployment phase. Since the designs of different hardware platforms are different, the performance of the same model on different hardware platforms is also different, and the running speed can vary greatly.

[0003] At present, the speed performance of the model is related to the implementation and application of the model. After using the deep learning framework to train the corresponding model, if you want to get the speed performance of the model in the deployment environment, you often need to convert the model, apply for the corresponding hardware platform permissions, configure the hardware operating environment and other steps to correctly deploy the model and test the speed performance. This process is very lengthy and complicated, and for different models and different hardware platforms, different deployment processes often need to be tried due to the differences in hardware platform vendor development kits. In some solutions, after obtaining the performance results of the model through manual deployment, manual recording is required, and the deployment experience cannot be reused between different models and different hardware platforms. It can be seen that this method not only makes the speed measurement process cumbersome and prone to errors, but also reduces the efficiency of obtaining the speed information of the model. Summary of the invention

[0004] The embodiments of the present disclosure are intended to provide a model processing method, device, electronic device and computer storage medium, which can relatively quickly obtain the speed information of the neural network model by constructing a database.

[0005] The present disclosure provides a model processing method, the method comprising:

[0006] Acquire a deep learning model set and an operating platform set, wherein a hash value is used as an identifier to characterize each deep learning model in the deep learning model set, and each deep learning model includes a network topology structure and attribute information of each operator node; each operating platform in the operating platform set is formed by each deployment tool in the acceleration library being deployed on each hardware in the hardware set;

[0007] Determine the speed test results of each deep learning model on each operating platform;

[0008] A database is constructed based on the mapping relationship between each of the speed measurement results and the corresponding deep learning model and operating platform.

[0009] The present disclosure also provides a model processing device, the device comprising:

[0010] An acquisition module is used to acquire a deep learning model set and an operating platform set, wherein a hash value is used as an identifier to characterize each deep learning model in the deep learning model set, and each deep learning model includes a network topology structure and attribute information of each operator node; each operating platform in the operating platform set is formed by each deployment tool in the acceleration library being deployed on each hardware in the hardware set; a determination module is used to determine the speed test results of each deep learning model on each operating platform; a construction module is used to construct a database based on the mapping relationship between each speed test result and the corresponding deep learning model and operating platform.

[0011] The present disclosure also provides an electronic device, including a processor and a memory for storing a computer program that can be run on the processor; wherein:

[0012] The processor is used to run the computer program to execute any one of the above-mentioned model processing methods.

[0013] The embodiment of the present disclosure also provides a computer storage medium on which a computer program is stored. When the computer program is executed by a processor, any one of the above-mentioned model processing methods is implemented.

[0014] In the model processing method, device, electronic device and computer storage medium proposed in the embodiments of the present disclosure, the method includes: obtaining a deep learning model set and an operating platform set, wherein a hash value is used as an identifier to characterize each deep learning model in the deep learning model set, and each deep learning model includes a network topology structure and attribute information of each operator node; each operating platform in the operating platform set is formed by each deployment tool in the acceleration library being deployed on each hardware in the hardware set; determining the speed measurement result of each deep learning model on each operating platform; and constructing a database based on the mapping relationship between each speed measurement result and the corresponding deep learning model and operating platform.

[0015] It can be seen that in the embodiment of the present disclosure, after the database is constructed, the database stores the speed test results of each deep learning model on each operating platform; since each deep learning model can be represented by a hash value, when a speed test request for a deep learning model is subsequently received from a user, a deep learning model that matches the first deep learning model can be quickly obtained by comparing the hash value of the deep learning model with the hash value of each deep learning model stored in the database. Furthermore, the speed test result of the matching deep learning model found in the database can be used as the speed test result of the first deep learning model. In this way, the acquisition of the speed information of the model can be accelerated.

[0016] It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used to illustrate the technical solutions of the present disclosure together with the specification.

[0018] Figure 1A A flow chart of a model processing method according to an embodiment of the present disclosure;

[0019] Figure 1B A flowchart of determining a hash value of each deep learning model according to an embodiment of the present disclosure;

[0020] Figure 1C A flowchart of determining a hash value of each operator node in each deep learning model and a hash value of attribute information of each operator node according to an embodiment of the present disclosure;

[0021] Figure 1D Another flowchart of determining the hash value of each deep learning model according to an embodiment of the present disclosure;

[0022] Figure 1E A flowchart of another method of determining a hash value of each deep learning model according to an embodiment of the present disclosure;

[0023] Figure 1F A flowchart of building a database in an embodiment of the present disclosure;

[0024] Figure 1G is a flow chart of determining a speed measurement result of a first deep learning model in an embodiment of the present disclosure;

[0025] Figure 1H This is another flowchart for determining the speed measurement result of the first deep learning model in an embodiment of the present disclosure;

[0026] Fig. 1I This is a flowchart of determining the speed measurement results of each deep learning model on the first operating platform in an embodiment of the present disclosure;

[0027] Figure 1J This is a flowchart of adding the speed measurement results of the first deep learning model on each operating platform to a database in an embodiment of the present disclosure;

[0028] Figure 2 A flowchart of another model processing method according to an embodiment of the present disclosure;

[0029] Figure 3 It is a schematic diagram of the structure of the model processing device according to an embodiment of the present disclosure;

[0030] Figure 4 The figure is a schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0031] The present disclosure is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the embodiments provided herein are only used to explain the present disclosure and are not intended to limit the present disclosure. In addition, the embodiments provided below are partial embodiments for implementing the present disclosure, rather than providing all embodiments for implementing the present disclosure. In the absence of conflict, the technical solutions recorded in the embodiments of the present disclosure can be implemented in any combination.

[0032] It should be noted that, in the embodiments of the present disclosure, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a method or apparatus including a series of elements includes not only the elements explicitly recorded, but also includes other elements not explicitly listed, or also includes elements inherent to the implementation of the method or apparatus. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the presence of other related elements (such as steps in a method or units in a device, for example, a unit may be a part of a circuit, a part of a processor, a part of a program or software, etc.) in the method or apparatus including the element.

[0033] For example, the model processing method provided in the embodiment of the present disclosure includes a series of steps, but the model processing method provided in the embodiment of the present disclosure is not limited to the recorded steps. Similarly, the model processing device provided in the embodiment of the present disclosure includes a series of modules, but the device provided in the embodiment of the present disclosure is not limited to including the modules explicitly recorded, and may also include modules required to obtain relevant information or perform processing based on information.

[0034] The term "and / or" herein is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C can represent including any one or more elements selected from the set consisting of A, B, and C.

[0035] The present disclosure may be implemented based on an electronic device, where the electronic device may be a thin client, a thick client, a handheld or laptop device, a microprocessor-based system, a set-top box, a programmable consumer electronic product, a network personal computer, a small computer system, and the like.

[0036] Electronic devices can implement corresponding functions through the execution of program modules. Generally, program modules can include routines, programs, target programs, components, logic, data structures, etc. They perform specific tasks or implement specific abstract data types. Computer systems can be implemented in distributed cloud computing environments, in which tasks are performed by remote processing devices linked through a communication network. In a distributed cloud computing environment, program modules can be located on local or remote computing system storage media including storage devices.

[0037] In related technologies, some speed testing platforms can assist users in conveniently deploying and testing models. These platforms eliminate the tedious process of manual model deployment and instead utilize the actual deployment experience of multiple platforms to unify the model parsing interface and the backend runtime library interface, and deploy and evaluate the model in a relatively automatic manner. However, each time the model speed information is obtained, it is necessary to go through a complete deployment process of automatic model conversion, model compilation, and remote execution. Therefore, the acquisition of speed information for the same model often requires repeated actual testing on the hardware platform. Since the speed information of the model is related to the implementation and application of the model, how to quickly obtain the speed information of the model is a technical problem that needs to be solved urgently.

[0038] In response to the above technical problems, in some embodiments of the present disclosure, a technical solution for model query is proposed.

[0039] In some embodiments of the present disclosure, the model processing method can be implemented using a processor in a model processing device, and the above-mentioned processor can be at least one of an application specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a central processing unit (CPU), a controller, a microcontroller, and a microprocessor.

[0040] Figure 1A is a flow chart of a model processing method according to an embodiment of the present disclosure, such as Figure 1A As shown, the process may include:

[0041] Step 100: Obtain a deep learning model set and an operating platform set, wherein a hash value is used as an identifier to characterize each deep learning model in the deep learning model set, and each deep learning model includes a network topology structure and attribute information of each operator node; each operating platform in the operating platform set is formed by each deployment tool in the acceleration library being deployed on each hardware in the hardware set.

[0042] Here, there is no limitation on the type of each deep learning model in the deep learning model set. For example, it can be a deep neural network (DNN) model, a recurrent neural network (RNN) model, etc.; wherein, the types of each deep learning model in the deep learning model set can be the same or different.

[0043] In some embodiments, after obtaining the set of deep learning models, it is necessary to determine the hash value of each deep learning model; Figure 1B A flowchart of determining a hash value of each deep learning model according to an embodiment of the present disclosure is shown in FIG. Figure 1B As shown, the process may include the following steps:

[0044] Step 1000: Obtain the network topology structure of each deep learning model and the attribute information of each operator node;

[0045] Step 1001: Determine the hash value of each operator node in each deep learning model and the hash value of the attribute information of each operator node;

[0046] Step 1002: Hash the hash value of each operator node and the hash value of the attribute information of each operator node to obtain the hash value of each deep learning model.

[0047] In an embodiment of the present disclosure, each deep learning model may represent a network model including multiple neural network layers, wherein each neural network layer may include at least one neuron; illustratively, each operator node in each deep learning model corresponds to each neuron included in each deep learning model; based on the connection relationship between each neuron included in each neural network layer, the network topology structure of each deep learning model may be determined.

[0048] Exemplarily, assuming that the deep learning model includes three neural network layers, namely an input layer, a hidden layer and an output layer, and the input layer includes three neurons, the hidden layer includes four neurons, and the output layer includes three neurons, then the ten neurons included in the deep learning model correspond to the ten operator nodes in the model; the connection relationship between these ten operator nodes constitutes the network topology structure of the deep learning model.

[0049] In some embodiments, the attribute information of each operator node may include information such as the weight corresponding to the node, the type of data corresponding to the node, and the function calculation method corresponding to the node (for example, it may be a summation function).

[0050] Exemplarily, the network topology structure of each deep learning model in the deep learning model set and the attribute information of each operator node can be obtained through a graph traversal method.

[0051] In some embodiments, the Figure 1C The steps shown determine the hash value of each operator node in each deep learning model and the hash value of the attribute information of each operator node:

[0052] Step 1003: constructing a directed acyclic graph of each deep learning model based on the network topology structure of each deep learning model and the attribute information of each operator node;

[0053] Step 1004: Determine the hash value of each operator node in each directed acyclic graph and the hash value of the attribute information of each operator node.

[0054] In an embodiment of the present disclosure, after obtaining the network topology structure of each deep learning model in the deep learning model set and the attribute information of each operator node, a corresponding directed acyclic graph can be constructed based on the network topology structure of each deep learning model and the attribute information of each operator node; after obtaining the directed acyclic graph of each deep learning model, the hash value of each operator node in each directed acyclic graph and the hash value of the attribute information of each operator node are determined.

[0055] In some embodiments, after obtaining the hash value of each operator node in each directed acyclic graph and the hash value of the attribute information of each operator node, the following method can be used to obtain the hash value of each operator node: Figure 1D The steps shown determine the hash value for each deep learning model:

[0056] Step 1005: performing hash processing on the hash value of each operator node in each directed acyclic graph and the hash value of the attribute information of each operator node to obtain a unique representation value of each operator node in each directed acyclic graph;

[0057] Step 1006: sorting the unique representation values ​​of each operator node in each directed acyclic graph;

[0058] Step 1007: Perform hash processing on the unique representation value of each sorted operator node to obtain the hash value of each deep learning model.

[0059] Exemplarily, after determining the hash value of each operator node in each directed acyclic graph and the hash value of the attribute information of each operator node, the hash value of each operator node and the hash value of the attribute information are combined through the inverse topological sorting method, and further hash processing is performed to obtain a unique representation value of each operator node in each directed acyclic graph; here, operator nodes with the same hash value have not only the same operator type and the same attribute information, but also the same sub-node topological relationship.

[0060] Furthermore, after obtaining the unique representation value of each operator node in each directed acyclic graph, the unique representation value of each operator node is sorted and further hashed to obtain the hash value of each deep neural network model.

[0061] For example, the following is combined with Figure 1E Describe the process of determining the hash value of each deep learning model, such as Figure 1E As shown, the process may include:

[0062] Step 1008: Delete parameter information of each deep learning model;

[0063] Step 1009: extracting the network topology structure of each deep learning model and the attribute information of each operator node;

[0064] Step 1010: constructing a directed acyclic graph based on the network topology and attribute information of each operator node;

[0065] Step 1011: Determine a unique representation value of each operator node in each directed acyclic graph;

[0066] Step 1012: Determine the hash value of each deep learning model.

[0067] Here, step 1009 is implemented in the same manner as step 1000 , step 1010 is implemented in the same manner as step 1003 , and step 1011 is implemented in the same manner as step 1005 .

[0068] Exemplarily, the hash value of each deep learning model can be determined according to the above processing flow; each deep learning model in the deep learning model set corresponds to a hash value, and the hash values ​​of different deep learning models are different, that is, each deep learning model has a unique hash value corresponding to it, and the hash value uniquely identifies the network topology structure of the deep learning model and the attribute information of each operator node.

[0069] For example, according to Figure 1E It can be seen from the process shown that before obtaining the network topology structure of each deep learning model and the attribute information of each operator node, the parameter information of each deep learning model is deleted.

[0070] In the disclosed embodiment, before obtaining the network topology structure of each deep learning model and the attribute information of each operator node, the format of each deep learning model can be converted into a specific format that can be hashed; here, the type of the specific format is not limited; for example, it can be an open neural network exchange format (Open Neural Network Exchange, ONNX) or other types of conversion formats.

[0071] Furthermore, after obtaining the deep learning model in a specific format, the parameter information of each deep learning model can be deleted first, so that the memory usage of the model data can be reduced.

[0072] In some embodiments, each operating platform in the operating platform set reflects the connection between each hardware in the hardware set and each deployment tool in the acceleration library; it represents the combination of hardware and acceleration library when running the model, which is a many-to-many connection; that is, through different combinations of hardware and acceleration library, a variety of different types of operating platforms can be obtained; here, hardware can represent a hardware platform.

[0073] Step 101: Determine the speed test results of each deep learning model on each operating platform.

[0074] In the disclosed embodiment, after the deep learning model set and the running platform set are obtained, the speed measurement results of each deep learning model in the deep learning model set on each running platform in the running platform set will be determined.

[0075] Here, the speed test results reflect the connection between each operating platform and the network topology of each deep learning model. Due to the differences in hardware configuration, acceleration library deployment tools and operating environment corresponding to different operating platforms in the operating platform set, the performance of the same deep learning model on different operating platforms is also different, and the running speed will also vary greatly.

[0076] Exemplarily, the implementation method for determining the speed test results of each deep learning model on each operating platform can be: deploy each deep learning model on each operating platform by manual deployment to obtain the speed test results of each deep learning model; it can also be: unify the model parsing interface and the back-end runtime library interface, deploy and evaluate the model in a relatively automatic manner, perform speed test operations on each operating platform through model conversion, model compilation, remote execution and other operations, and obtain the speed test results of each deep learning model.

[0077] It can be understood that in the process of determining the speed test results of each deep learning model on each operating platform, it is possible to determine whether the same deep learning model exists in the deep learning model set based on the hash value of each deep learning model determined in the above steps; if it is determined that the same deep learning model exists in the deep learning model set, then for these same deep learning models, it is only necessary to determine the speed test results of one of the deep learning models on each operating platform; in this way, a certain number of operations can be reduced.

[0078] Step 102: Build a database based on the mapping relationship between each speed measurement result and the corresponding deep learning model and operating platform.

[0079] In an embodiment of the present disclosure, after obtaining the speed test results of each deep learning model on each operating platform according to the above process, a database can be constructed based on the mapping relationship between each speed test result and the corresponding deep learning model and operating platform; at the same time, the model information, operating platform information, speed information, etc. of each deep learning model are stored in the database.

[0080] Here, the model information may include not only the hash value but also the network topology of the model; the operating platform information may include hardware information and acceleration library information; and the speed information indicates each of the above speed test results.

[0081] In the embodiment of the present disclosure, by constructing a database, each deep learning model, as well as related information such as the hash value and speed test results of each deep learning model can be persistently stored in the database. In this way, when a speed test request for a deep learning model is subsequently received from a user, a deep learning model that matches the first deep learning model can be quickly obtained by comparing the hash value of the deep learning model with the hash value of each deep learning model stored in the database. Furthermore, the speed test result of the matching deep learning model found in the database can be used as the speed test result of the first deep learning model. In this way, the acquisition of the speed information of the model can be accelerated.

[0082] Exemplarily, the implementation method for building a database can also be: first, extract the attribute information of entities and connections based on the information to be stored in each deep learning model, and design an entity connection diagram based on the attribute information of entities and connections; the main entities in the entity connection diagram may include network topology structure, hardware, etc., wherein the attribute information of the network topology structure may include serial number, name, hash value, input shape, output shape, attribute topology diagram and other attributes, wherein the hash value, input shape, and output shape can uniquely index a network topology structure; the attribute information of the hardware may include serial number, name, architecture and other attributes, wherein the name of the hardware can uniquely index the hardware.

[0083] For example, the main connections in the entity connection diagram may include operating platform, speed, etc. The operating platform is the connection between hardware and acceleration library, indicating the combination of hardware and acceleration library when running the model, which is a many-to-many connection. Speed ​​is the connection between the operating platform and the network topology structure, indicating the running speed of the model on a specific operating platform. It also includes attribute information such as creation time, memory usage, and number of tests, which is a many-to-many connection. The database can be constructed based on the attribute information of the above entities and connections. The specific implementation method can refer to Figure 1F ; Figure 1F is a flowchart of building a database in an embodiment of the present disclosure, such as Figure 1F As shown, the process may include:

[0084] Step 1013: extracting attribute information of entities and relationships to construct an entity relationship graph;

[0085] Step 1014: Determine the access field and its data representation;

[0086] Step 1015: Build database tables and add, delete, modify, and query interfaces.

[0087] It can be seen that in the disclosed embodiment, first, an entity relationship diagram can be constructed based on the extracted attribute information of each entity and relationship; then, the entity relationship diagram is used to determine the fields of the database table and their data representation, so as to realize the structured storage of the attribute information of each entity and relationship; finally, the corresponding coding can be used to realize data connection, construction of database tables, addition, deletion, modification, query and other operation interfaces, so as to provide certain support for model performance information storage and query services.

[0088] The embodiments of the present disclosure propose a model processing method, device, electronic device and computer storage medium, the method comprising: obtaining a deep learning model set and an operating platform set, wherein a hash value is used as an identifier to characterize each deep learning model in the deep learning model set, and each deep learning model includes a network topology structure and attribute information of each operator node; each operating platform in the operating platform set is formed by each deployment tool in the acceleration library being deployed on each hardware in the hardware set; determining a speed measurement result of each deep learning model on each operating platform; and constructing a database based on the mapping relationship between each speed measurement result and the corresponding deep learning model and operating platform.

[0089] It can be seen that in the embodiment of the present disclosure, after the database is constructed, the database stores the speed test results of each deep learning model on each operating platform; since each deep learning model can be represented by a hash value, when a speed test request for a certain deep learning model is subsequently received from a user, a deep learning model that matches the first deep learning model can be quickly obtained by comparing the hash value of the first deep learning model and the hash value of each deep learning model. Then, the speed test result of the matching deep learning model can be used as the speed test result of the first deep learning model. In this way, the acquisition of the speed information of the model can be accelerated.

[0090] In some embodiments, the Figure 1G The steps shown determine the speed test results of the first deep learning model:

[0091] Step 1016: In response to the first speed measurement request of the user, based on the identifier of the first deep learning model included in the first speed measurement request, determining a hash value of the first deep learning model;

[0092] Step 1017: Based on the hash value of the first deep learning model, search in the database to obtain the speed measurement result of the first deep learning model.

[0093] Exemplarily, if a user wants to query the speed test results of a first deep learning model specified by him / her, he / she can send a first speed test request including the identifier of the first deep learning model to the running platform; after the running platform receives the user's first speed test request, the system service backend corresponding to the running platform will obtain the network topology structure of the first deep learning model and the attribute information of each operator node according to the identifier of the first deep learning model in the first speed test request. In this way, the hash value of the model can be determined based on the network topology structure of the first deep learning model and the attribute information of each operator node; here, the implementation method of determining the hash value of the deep learning model through the attribute information and topology structure of each node has been correspondingly explained in the aforementioned recorded content and will not be repeated here.

[0094] Exemplarily, after obtaining the hash value of the first deep learning model, the hash value of the first deep learning model is compared with the hash value of each deep learning model stored in the database to obtain a comparison result; here, there is no limitation on the method of comparing the hash values ​​of the two, for example, a one-by-one comparison method or a simultaneous comparison method can be adopted.

[0095] Furthermore, if it is determined based on the comparison results that a deep learning model with the same hash value as the first deep learning model is stored in the database, it means that a deep learning model with the same hash value as the first deep learning model has been found, that is, the network topology structure of the first deep learning model is the same as the found deep learning model. At this time, the speed test results of the found deep learning model on each running platform can be used as the speed test results of the first deep learning model.

[0096] In the related art, when it is necessary to determine whether the network topology structures of two deep learning models are the same, since the deep learning model is an interconnected operator graph structure, the identity of the deep model is generally determined based on a graph isomorphism algorithm, but the algorithm is based on a depth-first search strategy. For deep learning models containing multiple nodes, this method is too slow and difficult to meet actual requirements. However, compared with the related art, in the embodiment of the present disclosure, by comparing the hash values ​​of the two deep learning models, it is possible to quickly determine whether the two deep learning models have the same network topology structure; effectively improve the efficiency of determining the identity of the two models. Furthermore, since the deep learning model with the same hash value as the first deep learning model can be directly found from the database, the speed test result of the found deep learning model can be used as the speed test result of the first deep learning model; it can be seen that the embodiment of the present disclosure does not need to repeatedly deploy the first deep learning model on the running platform to obtain the speed test result, which effectively improves the efficiency of obtaining the speed test result.

[0097] In some embodiments, the first speed measurement request also includes an identifier of the target operating platform; for a hash value based on the first deep learning model, a search is performed in the database to obtain a speed measurement result of the first deep learning model, which can be referred to as Figure 1H Steps shown:

[0098] Step 1018: Find in the database a second deep learning model having the same hash value as the first deep learning model and the same identifier of the target operating platform;

[0099] Step 1019: Determine the speed measurement result of the second deep learning model on the target operating platform as the speed measurement result of the first deep learning model on the target operating platform.

[0100] In some embodiments, the first speed test request may also include the hardware corresponding to the first deep learning model and the deployment tools in the acceleration library. In this way, the target operating platform corresponding to the first deep learning model can be determined based on the hardware corresponding to the first deep learning model and the deployment tools in the acceleration library.

[0101] Exemplarily, after determining the hash value of the first deep learning model and the target operating platform according to the first speed test request, if a second deep learning model with the same hash value and the identifier of the target operating platform as the first deep learning model is found in the database, the speed test result of the second deep learning model on the target operating platform can be determined as the speed test result of the first deep learning model on the target operating platform.

[0102] Exemplarily, assume that the hash value of the first deep learning model is 111, and the identifier of the target operating platform of the first deep learning model is 3; if the deep learning models stored in the database include deep learning models 1 to deep learning model 3, and the corresponding hash values ​​are 101, 110 and 111 respectively, if the identifier of the operating platform of deep learning model 1 is 1, the identifier of the operating platform of deep learning model 2 is 3, and the identifiers of the operating platform of deep learning model 3 are 1 and 3; at this time, it can be determined that the hash value of the first deep learning model is the same as the hash value of deep learning model 3, and the identifier of the operating platform corresponding to the first deep learning model is also the same as the identifier of the operating platform corresponding to deep learning model 3; that is, the speed test result of deep learning model 3 on the operating platform corresponding to identifier 3 can be used as the speed test result of the first deep learning model on the target operating platform.

[0103] For example, after determining the hash value of the first deep learning model, a query operation can be performed on the hash value based on the operation interface of the database to obtain the deep learning model with the same hash value from the database. It can be seen that the use of database technology can realize the storage and retrieval of relevant information such as the structure and performance of the deep learning model.

[0104] In some embodiments, the process of determining the speed measurement results of each deep learning model on the first operating platform can be referred to as follows: Fig. 1I Steps shown:

[0105] Step 1020: In response to the user's third speed measurement request, based on the identifier of the first operation platform included in the third speed measurement request, searching in the database for a second operation platform having the same identifier as the first operation platform;

[0106] Step 1021: Based on the speed test results of each deep learning model in the database on the second operating platform, determine the speed test results of each deep learning model on the first operating platform.

[0107] Exemplarily, if a user wants to query the speed test results of each deep learning model in the database on the first operating platform, a third speed test request including the identifier of the first operating platform can be sent to the operating platform; after the operating platform receives the user's third speed test request, the system service backend corresponding to the operating platform will search for a second operating platform with the same identifier as the first operating platform from the database based on the identifier of the first operating platform in the first speed test request; if the second operating platform is found, the speed test results of each deep learning model in the database on the second operating platform will be used to determine the speed test results of each deep learning model on the first operating platform.

[0108] In some embodiments, the process of adding the speed measurement results of the first deep learning model on each operating platform to the database can be referred to as follows: Figure 1J Steps shown:

[0109] Step 1022: In response to failing to find the hash value of the first deep learning model in the database, speed testing the first deep learning model on each operating platform in the first thread to obtain speed test results of the first deep learning model on each operating platform;

[0110] Step 1023: Add the speed test results of the first deep learning model on each operating platform to the database.

[0111] For example, if the hash value of the first deep learning model cannot be found in the database, it means that the hash value of the first deep learning model is different from the hash value of each deep learning model stored in the database. At this time, the speed test result of the first deep learning model cannot be obtained from the database. In this case, the system service backend corresponding to the operating platform needs to initiate the actual speed test task for the first deep learning model; that is, it is necessary to perform speed test operations on each actual operating platform through operations such as model conversion, model compilation, and remote execution to obtain the speed test results of the first deep learning model on each operating platform.

[0112] Here, after the speed test task for the first deep learning model is completed, the returned speed test results are checked. If the speed test is determined to be successful based on the speed test results, the performance records such as the model structure information, the operating platform information, and the speed information are stored in the database, that is, the speed test results of the first deep learning model on each operating platform are added to the database; conversely, if the speed test is determined to have failed based on the speed test results, an error message is returned.

[0113] In some embodiments, the above method may further include: while testing the speed of the first deep learning model in the first thread, responding to a second speed test request from the user in the second thread.

[0114] For example, since the actual speed measurement process is relatively slow, the system service backend can initiate a speed measurement task in a separate thread (i.e., the first thread) and wait for the speed measurement results. This method will not block the service backend from receiving the user's second speed measurement request for other deep learning models in the second thread, thereby increasing the parallelism of the system service; here, the first thread and the second thread represent two threads that perform different tasks.

[0115] It can be seen that in the embodiments of the present disclosure, only the performance query tasks of deep learning models with different network topologies need to be deployed and evaluated on the actual hardware platform; for the performance query tasks of deep learning models with the same network structure, there is no need to repeatedly perform deployment and evaluation on the actual hardware platform each time, thereby accelerating the acquisition of model performance data.

[0116] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.

[0117] In order to better reflect the purpose of the present disclosure, further description is given on the basis of the above embodiments of the present disclosure.

[0118] Figure 2 FIG. 1 is a flow chart of another model processing method according to an embodiment of the present disclosure. Figure 2 As shown, the process may include:

[0119] Step 200: Receive a speed measurement request from a first deep learning model.

[0120] Exemplarily, a speed measurement request for a first deep learning model specified by a user is received; here, the speed measurement request may include first deep learning model information, hardware platform information, acceleration information, etc.

[0121] Step 201: Query the database.

[0122] Exemplarily, after receiving a speed measurement request for a first deep learning model specified by a user, a hash value of the first deep learning model is determined based on the first deep learning model information included in the speed measurement request, and a performance record corresponding to the hash value is stored in a database, where the performance record includes speed information of the model.

[0123] Step 202: Determine whether performance records are found.

[0124] Exemplarily, since the database pre-stores the hash value of each deep learning model among the multiple deep learning models and related information such as the speed test results on each operating platform; at this time, according to the hash value of the first deep learning model, it is possible to query the database whether there is a performance record corresponding to the deep learning model with the same hash value as the first deep learning model; if so, execute step 208, otherwise, execute step 203.

[0125] Step 203: Determine whether the same speed measurement task has been submitted.

[0126] Exemplarily, determine whether the system service backend corresponding to the operating platform has submitted a model speed measurement task with the same hash value as the first deep learning model; if so, execute step 207, otherwise, execute step 204.

[0127] Step 204: Test the speed of the first deep learning model on the running platform.

[0128] Exemplarily, if the system service backend does not submit a model speed test task with the same hash value as the first deep learning model, the system service backend initiates an actual speed test task for the first deep learning model; that is, the speed test operation is performed on the first deep learning model on the actual running platform to obtain the speed test result.

[0129] Step 205: Determine whether the speed measurement is successful.

[0130] Exemplarily, if it is determined according to the speed measurement result of step 204 that the speed measurement is successful, step 206 is executed, otherwise, step 208 is executed.

[0131] Step 206: Insert relevant performance records into the database.

[0132] Exemplarily, when it is determined that the speed measurement is successful according to step 205, relevant performance records of the first deep learning model, such as model structure information, operating platform information, speed information and other performance records are stored in the database, and step 208 is executed.

[0133] Step 207: Wait for the speed measurement task to be completed and return the speed measurement result.

[0134] Exemplarily, after determining according to step 203 that a model speed measurement task having the same hash value as the first deep learning model has been submitted, the execution of the model speed measurement task is waited for to be completed, and a speed measurement result corresponding to the model speed measurement task is returned.

[0135] Step 208: Return relevant performance records or error information.

[0136] Exemplarily, when it is determined according to step 205 that the speed measurement fails, an error message is returned; if it is determined according to step 206 that the relevant performance records are stored in the database, when the database is queried, the relevant performance records stored in the database are returned.

[0137] It can be seen that the database is used in the embodiment of the present disclosure to persistently store the network structure, platform information, speed information and other related performance records of the deep learning model, which can reduce the repeated deployment and evaluation of models with the same network structure and accelerate the model performance query process.

[0138] Based on the model processing method proposed in the above-mentioned embodiment, the embodiment of the present disclosure proposes a model processing device.

[0139] Figure 3 FIG. 1 is a schematic diagram of the structure of the model processing device according to an embodiment of the present disclosure. Figure 3 As shown, the device may include:

[0140] The acquisition module 300 is used to obtain a deep learning model set and an operating platform set, wherein a hash value is used as an identifier to characterize each deep learning model in the deep learning model set, and each deep learning model includes a network topology structure and attribute information of each operator node; each operating platform in the operating platform set is formed by each deployment tool in the acceleration library being deployed on each hardware in the hardware set; the determination module 301 is used to determine the speed test results of each deep learning model on each operating platform; the construction module 302 is used to construct a database based on the mapping relationship between each speed test result and the corresponding deep learning model and operating platform.

[0141] In some embodiments, after obtaining the deep learning model set, the acquisition module 300 is further used to: obtain the network topology structure of each deep learning model and the attribute information of each operator node;

[0142] The determination module 301 is used to: determine the hash value of each operator node in each deep learning model and the hash value of the attribute information of each operator node; perform hash processing on the hash value of each operator node and the hash value of the attribute information of each operator node to obtain the hash value of each deep learning model.

[0143] In some embodiments, the determination module 301 is used to determine the hash value of each operator node in each deep learning model and the hash value of the attribute information of each operator node, including: constructing a directed acyclic graph of each deep learning model based on the network topology structure of each deep learning model and the attribute information of each operator node; determining the hash value of each operator node in each directed acyclic graph and the hash value of the attribute information of each operator node.

[0144] In some embodiments, the determination module 301 is used to perform hash processing on the hash values ​​of the operator nodes and the hash values ​​of the attribute information of the operator nodes to obtain the hash value of each of the deep learning models, including: performing hash processing on the hash values ​​of the operator nodes in each of the directed acyclic graphs and the hash values ​​of the attribute information of the operator nodes to obtain a unique representation value of each of the operator nodes in the directed acyclic graphs; sorting the unique representation values ​​of each of the operator nodes in each of the directed acyclic graphs; and hashing the sorted unique representation values ​​of each of the operator nodes to obtain the hash value of each of the deep learning models.

[0145] In some embodiments, the acquisition module 300 is further used to: delete the parameter information of each deep learning model before acquiring the network topology structure of each deep learning model and the attribute information of each operator node.

[0146] In some embodiments, the device also includes a query module, which is used to: in response to a user's first speed measurement request, determine the hash value of the first deep learning model based on the identifier of the first deep learning model included in the first speed measurement request; based on the hash value of the first deep learning model, search in the database to obtain the speed measurement result of the first deep learning model.

[0147] In some embodiments, the first speed measurement request also includes an identifier of a target operating platform, and the query module is used to search in the database based on the hash value of the first deep learning model to obtain a speed measurement result of the first deep learning model, including: finding in the database a second deep learning model that is the same as the hash value of the first deep learning model and the identifier of the target operating platform; and determining the speed measurement result of the second deep learning model on the target operating platform as the speed measurement result of the first deep learning model on the target operating platform.

[0148] In some embodiments, the first speed measurement request also includes the hardware corresponding to the first deep learning model and the deployment tools in the acceleration library, and the query module is further used to determine the target operating platform corresponding to the first deep learning model based on the hardware corresponding to the first deep learning model and the deployment tools in the acceleration library.

[0149] In some embodiments, the query module is also used to: in response to not finding the hash value of the first deep learning model in the database, perform speed testing on the first deep learning model on each operating platform in a first thread to obtain the speed test results of the first deep learning model on each operating platform; and add the speed test results of the first deep learning model on each operating platform to the database.

[0150] In some embodiments, the query module is further used to: while measuring the speed of the first deep learning model in the first thread, respond to the user's second speed measurement request in the second thread.

[0151] In some embodiments, the query module is also used to: respond to a third speed test request from a user, and based on the identifier of the first operating platform included in the third speed test request, search in the database for a second operating platform with the same identifier as the first operating platform; and determine the speed test results of each deep learning model on the first operating platform based on the speed test results of each deep learning model in the database on the second operating platform.

[0152] In actual applications, the acquisition module 300, the determination module 301, the construction module 302 and the query module can all be implemented using a processor in an electronic device, and the above processor can be at least one of an ASIC, a DSP, a DSPD, a PLD, a FPGA, a CPU, a controller, a microcontroller, and a microprocessor.

[0153] In addition, each functional module in this embodiment can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or software functional modules.

[0154] If the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment is essentially or the part that contributes to the prior art or the whole or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.

[0155] Specifically, the computer program instructions corresponding to a model processing method in this embodiment can be stored on a storage medium such as a CD, a hard disk, or a U disk. When the computer program instructions corresponding to a model processing method in the storage medium are read or executed by an electronic device, any model processing method in the aforementioned embodiments is implemented.

[0156] Based on the same technical concept as the above embodiments, see Figure 4 , which shows an electronic device 4 provided by an embodiment of the present disclosure, which may include: a memory 401 and a processor 402; wherein,

[0157] The memory 401 is used to store computer programs and data;

[0158] The processor 402 is used to execute the computer program stored in the memory to implement any one of the model processing methods in the aforementioned embodiments.

[0159] In practical applications, the memory 401 may be a volatile memory, such as RAM; or a non-volatile memory, such as ROM, flash memory, hard disk drive (HDD) or solid-state drive (SSD); or a combination of the above types of memory, and provide instructions and data to the processor 402.

[0160] The processor 402 may be at least one of ASIC, DSP, DSPD, PLD, FPGA, CPU, controller, microcontroller, and microprocessor. It is understandable that for different devices, the electronic device used to implement the processor function may also be other, which is not specifically limited in the embodiments of the present disclosure.

[0161] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0162] The above description of the various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other. For the sake of brevity, this article will not repeat them.

[0163] The methods disclosed in the various method embodiments provided in the present disclosure may be arbitrarily combined without conflict to obtain new method embodiments.

[0164] The features disclosed in the various product embodiments provided in the present disclosure can be arbitrarily combined without conflict to obtain new product embodiments.

[0165] The features disclosed in the various method or device embodiments provided in the present disclosure may be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.

[0166] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present disclosure, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present disclosure.

[0167] The embodiments of the present disclosure are described above in conjunction with the accompanying drawings, but the present disclosure is not limited to the above-mentioned specific implementation modes. The above-mentioned specific implementation modes are merely illustrative and not restrictive. Under the guidance of the present disclosure, ordinary technicians in this field can also make many forms without departing from the scope of protection of the purpose of the present disclosure and the claims, which are all within the protection of the present disclosure.

Claims

1. A model processing method, characterized in that: The method comprises: Acquire a deep learning model set and an operating platform set, wherein a hash value is used as an identifier to characterize each deep learning model in the deep learning model set, and each deep learning model includes a network topology structure and attribute information of each operator node; each operating platform in the operating platform set is formed by each deployment tool in the acceleration library being deployed on each hardware in the hardware set; Determine the speed test results of each deep learning model on each operating platform; Building a database based on the mapping relationship between each of the speed measurement results and the corresponding deep learning model and operating platform; After obtaining the deep learning model set, the method further includes: Obtaining the network topology structure of each deep learning model and the attribute information of each operator node; Based on the network topology structure of each deep learning model and the attribute information of each operator node, construct a directed acyclic graph of each deep learning model; Determine a hash value of each operator node in each of the directed acyclic graphs and a hash value of attribute information of each operator node; Performing hash processing on the hash value of each operator node in each directed acyclic graph and the hash value of the attribute information of each operator node to obtain a unique representation value of each operator node in each directed acyclic graph; Sorting the unique representation values ​​of each operator node in each directed acyclic graph; The unique representation value of each sorted operator node is hashed to obtain a hash value of each of the deep learning models.

2. The method according to claim 1, characterized in that The method further comprises: Before obtaining the network topology structure of each deep learning model and the attribute information of each operator node, the parameter information of each deep learning model is deleted.

3. The method according to any one of claim 1, characterized in that: The method further comprises: In response to a first speed measurement request from a user, determining a hash value of the first deep learning model based on an identifier of the first deep learning model included in the first speed measurement request; Based on the hash value of the first deep learning model, a search is performed in the database to obtain a speed measurement result of the first deep learning model.

4. The method according to claim 3, characterized in that The first speed measurement request also includes an identifier of a target operating platform, and the hash value based on the first deep learning model is searched in the database to obtain a speed measurement result of the first deep learning model, including: Finding in the database a second deep learning model having the same hash value as the first deep learning model and the same identifier as the target operating platform; The speed measurement result of the second deep learning model on the target operating platform is determined as the speed measurement result of the first deep learning model on the target operating platform.

5. The method according to claim 3, characterized in that: The first speed measurement request also includes hardware corresponding to the first deep learning model and a deployment tool in an acceleration library. The method further includes: Based on the hardware corresponding to the first deep learning model and the deployment tools in the acceleration library, determine the target operating platform corresponding to the first deep learning model.

6. The method according to any one of claims 3 to 5, characterized in that: The method further comprises: In response to failing to find the hash value of the first deep learning model in the database, speed testing the first deep learning model on each operating platform in a first thread to obtain speed test results of the first deep learning model on each operating platform; The speed measurement results of the first deep learning model on each operating platform are added to the database.

7. The method according to claim 6, characterized in that The method further comprises: While the speed of the first deep learning model is being measured in the first thread, a second speed measurement request of the user is responded to in the second thread.

8. The method according to any one of claims 3 to 5, characterized in that: The method further comprises: In response to a third speed measurement request from the user, based on the identifier of the first operation platform included in the third speed measurement request, searching in the database for a second operation platform having the same identifier as the first operation platform; Based on the speed test results of each deep learning model in the database on the second operating platform, the speed test results of each deep learning model on the first operating platform are determined.

9. A model processing device, characterized in that: The device comprises: An acquisition module is used to acquire a deep learning model set and an operation platform set, wherein a hash value is used as an identifier to characterize each deep learning model in the deep learning model set, and each deep learning model includes a network topology structure and attribute information of each operator node; each operation platform in the operation platform set is formed by each deployment tool in the acceleration library being deployed on each hardware in the hardware set; The acquisition module is further used to acquire the network topology structure of each deep learning model and the attribute information of each operator node; A determination module, used to determine the speed test results of each deep learning model on each operating platform; The determination module is used to construct a directed acyclic graph of each deep learning model based on the network topology structure of each deep learning model and the attribute information of each operator node; determine the hash value of each operator node in each directed acyclic graph and the hash value of the attribute information of each operator node; The determination module is used to perform hash processing on the hash value of each operator node in each directed acyclic graph and the hash value of the attribute information of each operator node to obtain a unique representation value of each operator node in each directed acyclic graph; sort the unique representation values ​​of each operator node in each directed acyclic graph; perform hash processing on the unique representation values ​​of each operator node after sorting to obtain a hash value of each deep learning model; A construction module is used to construct a database based on the mapping relationship between each of the speed measurement results and the corresponding deep learning model and operating platform.

10. An electronic device, characterized in that: comprising a processor and a memory for storing a computer program capable of running on the processor; wherein, The processor is used to run the computer program to execute the model processing method according to any one of claims 1 to 8.

11. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the model processing method according to any one of claims 1 to 8 is implemented.