Neural network model conversion acceleration method and device, computing equipment and storage medium
The ONNX model is processed through grouping and caching technology, which solves the problem of long conversion time of TensorRT Engine, realizes efficient conversion of neural network models, and accelerates user experience.
Patent Information
- Application Number
- CN202411019869.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-29
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2044-07-29
AI Technical Summary
In the existing technology, the process of converting ONNX models to TensorRT Engine takes a long time, especially when multiple models need to be processed, seriously affecting usage efficiency and user experience.
By receiving the neural network model to be processed, grouping it and sending it to the preset parsing device, loading the layer information cache file, parsing the model group based on the file, and storing the parsing results to reduce repeated calculations and improve conversion efficiency.
It greatly improves model conversion efficiency, reduces user waiting time, and shortens subsequent model conversion time by 5-10 times.
Smart Images

Figure CN118550713A
Abstract
Description
Technical Field
[0001] The present application relates to the field of machine learning technology, and in particular to a neural network model conversion acceleration method. The present application also relates to a neural network model conversion acceleration device, a computing device, and a computer-readable storage medium. Background Art
[0002] In the field of deep learning, there are many neural network frameworks, such as TensorFlow, PyTorch, and PaddlePaddle. After training the model using these frameworks, the model will be converted to a unified, framework-independent ONNX format.
[0003] NVIDIA TensorRT is a framework for high-performance deep learning reasoning on NVIDIA GPU devices. It mainly consists of two parts: model parser and reasoning engine. To use TensorRT to reason about ONNX models, you must first use the TensorRT ONNX parser to convert the ONNX model to TensorRT Engine. TensorRT Engine is a model that is specifically optimized for reasoning on specified CUDA devices. Then use TensorR TEngine for model reasoning.
[0004] The process of converting ONNX models to TensorRT Engine is very time-consuming. In actual use scenarios, different graphics cards take different amounts of time, and sometimes a model can take up to 10 minutes. In order to avoid time-consuming each time the program is started, a common practice is to serialize the TensorRT Engine to get the TensorRT Plan when it is first obtained, and save the TensorRT Plan to the local disk. In subsequent use, the TensorRT Plan can be directly deserialized to get the TensorRT Engine, and loaded onto the GPU for model inference.
[0005] However, some scenarios will use as many as a dozen different models, and it takes hundreds of minutes for TensorRT to convert the ONNX model to the TensorRT Engine, which seriously affects the usage efficiency and user experience. Summary of the invention
[0006] In view of this, the embodiment of the present application provides a neural network model conversion acceleration method to solve the technical defects existing in the prior art. The embodiment of the present application also provides a neural network model conversion acceleration device, a computing device, and a computer-readable storage medium.
[0007] According to a first aspect of an embodiment of the present application, a neural network model conversion acceleration method is provided, comprising: S10: receiving at least one neural network model to be processed; S20: grouping the at least one neural network model to be processed, and sending the at least one neural network model group to be processed obtained by grouping to at least one preset parsing device; S30: Loading layer information cache file; S40: Based on the layer information cache file, the corresponding neural network model group to be processed is parsed through the at least one parsing device, and the parsing result is stored in the layer information cache file.
[0008] Optionally, in step S20, grouping the at least one neural network model to be processed includes: S21: Determine the number of groups and the number of group devices according to the number of devices of the at least one parsing device and the number of models of the at least one neural network model to be processed; S22: sorting the at least one neural network model to be processed according to model size to obtain a sequence of neural network models to be processed; S23: According to the sequence of neural network models to be processed, the number of groups and the number of group devices, the at least one neural network model to be processed is grouped to obtain the at least one neural network model group to be processed.
[0009] Optionally, the step S23 includes: S231: Alternately selecting the neural network models to be processed from the sequence of neural network models to be processed from beginning to end; S232: Add the selected neural network model to be processed to the current group of neural network models to be processed, until the number of models in the current group of neural network models to be processed is equal to the number of devices in the group, and select the next group of neural network models to be processed until all the neural network models to be processed are selected, thus obtaining all the groups of neural network models to be processed.
[0010] Optionally, the step S30 includes: Determine whether the layer information cache file exists on the local device; If so, loading the layer information cache file; If not, create and load an empty cache file of the layer information.
[0011] Optionally, the step S40 includes: In the process of parsing the corresponding neural network model group to be processed by the at least one parsing device, query the layer information cache file to determine whether the layer information cache file contains the layer file of the neural network model to be processed currently being parsed; If so, the corresponding layer file is used as the layer parsing result of the neural network model to be processed currently being parsed; If not, parse the neural network model currently being parsed and store the parsing results in the layer information cache file. According to a second aspect of an embodiment of the present application, a neural network model conversion acceleration device is provided, comprising: A receiving module, configured to receive at least one neural network model to be processed; A grouping module, configured to group the at least one neural network model to be processed, and send the at least one neural network model group to be processed obtained by grouping to at least one preset parsing device; A loading module is configured to load a layer information cache file; The parsing module is configured to parse the corresponding neural network model group to be processed based on the layer information cache file through the at least one parsing device, and store the parsing results in the layer information cache file.
[0012] According to a third aspect of an embodiment of the present application, a computing device is provided, including: Memory and processor; The memory is used to store computer-executable instructions, and the processor implements the steps of the neural network model conversion acceleration method when executing the computer-executable instructions.
[0013] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the neural network model conversion acceleration method are implemented.
[0014] According to a fifth aspect of an embodiment of the present application, a chip is provided, which stores a computer program, and when the computer program is executed by the chip, the steps of the neural network model conversion acceleration method are implemented.
[0015] The neural network model conversion acceleration method provided in the present application includes: S10: receiving at least one neural network model to be processed; S20: grouping the at least one neural network model to be processed, and sending the at least one neural network model group to be processed obtained by grouping to at least one preset parsing device; S30: loading the layer information cache file; S40: parsing the corresponding neural network model group to be processed through the at least one parsing device based on the layer information cache file, and storing the parsing result in the layer information cache file. The hardware performance is fully utilized, the model conversion efficiency is greatly improved, and the user waiting time is reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0017] Figure 1 It is a flow chart of a neural network model conversion acceleration method provided by an embodiment of the present application; Figure 2 It is a model grouping schematic diagram of a neural network model conversion acceleration method provided by an embodiment of the present application; Figure 3 It is a single model conversion flow chart of a neural network model conversion acceleration method provided by an embodiment of the present application; Figure 4 It is a structural schematic diagram of a neural network model conversion acceleration device provided in one embodiment of the present application; Figure 5 It is a structural block diagram of a computing device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0018] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application, so the present application is not limited by the specific implementation disclosed below.
[0019] The terms used in one or more embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of the present application. The singular forms of "a", "said" and "the" used in one or more embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of the present application refers to and includes any or all possible combinations of one or more associated listed items.
[0020] It should be understood that, although the terms first, second, etc. may be used to describe various information in one or more embodiments of the present application, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present application, the first may also be referred to as the second, and similarly, the second may also be referred to as the first.
[0021] First, the terms involved in one or more embodiments of the present invention are explained.
[0022] ONNX: Open Neural Network Exchange, is an open neural network exchange format designed to facilitate model conversion and communication between different deep learning frameworks.
[0023] TensorRT: A high-performance deep learning inference engine provided by NVIDIA. It is designed for deployment in production environments to improve the inference speed and efficiency of deep learning models running on NVIDIA GPUs.
[0024] CUDA: Compute Unified Device Architecture, is a computing platform launched by graphics card manufacturer NVIDIA.
[0025] TensorRT Engine: A model that has been optimized specifically for TensorRT and is used to perform inference.
[0026] In the present application, a neural network model conversion acceleration method is provided. The present application also relates to a neural network model conversion acceleration device, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.
[0027] Figure 1 A flowchart of a neural network model conversion acceleration method provided according to an embodiment of the present application is shown, which specifically includes the following steps: Step S10: receiving at least one neural network model to be processed; Step S20: grouping the at least one neural network model to be processed, and sending the at least one neural network model group to be processed obtained by grouping to at least one preset parsing device; Step S30: Loading layer information cache file; Step S40: Based on the layer information cache file, the corresponding neural network model group to be processed is parsed through the at least one parsing device, and the parsing result is stored in the layer information cache file.
[0028] Among them, the neural network model to be processed is a model in ONNX format; the parsing device is various types of GPUs, etc. It should be noted that the type of the parsing device is not fixed, and the specific type of parsing device used is determined by the actual usage scenario, which is not limited in this embodiment. In addition, in actual usage scenarios, the parsing device is more often chosen as a GPU.
[0029] Based on this, in actual usage scenarios, for multi-graphics card devices, multi-threading technology is used to designate different graphics cards to be responsible for processing multiple neural network models to be processed, thereby improving hardware utilization, and placing multiple neural network models to be processed in multi-threaded tasks for simultaneous processing, greatly reducing the total time required for model conversion. If the number of devices for parsing is dev_num, then the time required is reduced to 1 / dev_num of the original time required.
[0030] In addition, when converting the pending neural network model in ONNX format to TensorRTEngine in actual usage scenarios, TensorRT will calculate an optimal strategy for each layer of the ONNX model to achieve the fastest reasoning, which is the most time-consuming step. The conversion information of each layer of the pending neural network model is saved by means of layer information caching. If there are other layers with the same IO tensor configuration and layer parameters as the layer information cache in the layer information cache file, the layer information cache can be directly referenced. This avoids repeated conversion of repeated layers for the conversion process of the pending neural network model, reduces repeated and redundant calculation processes, and improves conversion efficiency.
[0031] Furthermore, in step S20, the process of grouping at least one neural network model to be processed is specifically implemented as follows in this embodiment: S21: Determine the number of groups and the number of group devices according to the number of devices of the at least one parsing device and the number of models of the at least one neural network model to be processed; S22: Sort the at least one neural network model to be processed according to model size to obtain a sequence of neural network models to be processed; S23: Group the at least one neural network model to be processed according to the sequence of neural network models to be processed, the number of groups and the number of group devices to obtain the at least one neural network model group to be processed.
[0032] If the number of devices is dev_num and the number of models is model_num, then we can determine that the number of groups is equal to the number of devices, and then divide the number of models by the number of devices, that is , get the quotient and remainder, and then determine that each thread is responsible for converting at least quotient models, and the first remainder threads process one more model, that is, the number of group devices for the first remainder groups is quotient+1, and the number of group devices for the remaining groups is quotient. It should be noted that one parsing device corresponds to one group, that is, one thread.
[0033] Based on this, all the neural network models to be processed are sorted according to the model size, and in the sorted sequence of neural network models to be processed, the neural network models to be processed in each group are selected, that is, the neural network models to be processed that need to be converted and analyzed by each analysis device are determined.
[0034] Further, in step S23, at least one neural network model to be processed is grouped according to the sequence of neural network models to be processed, the number of groups and the number of group devices to obtain at least one neural network model group to be processed. In this embodiment, the specific implementation process is as follows: S231: Alternately select the neural network models to be processed in the sequence of neural network models to be processed from beginning to end; S232: Add the selected neural network models to be processed to the current group of neural network models to be processed, until the number of models in the current group of neural network models to be processed is equal to the number of devices in the group, and select the next group of neural network models to be processed, until all the neural network models to be processed are selected, and obtain all the groups of neural network models to be processed.
[0035] Among them, the number of neural network model groups to be processed is equal to the number of groups; after obtaining the sequence of neural network models to be processed, each thread will select the model it is responsible for processing from the sorted model array in turn. Specifically, the first group corresponding to the first parsing device will first select the model from the starting position of the sequence, and then select from the end of the sequence, and so on alternately until the first group meets the number of group devices corresponding to itself. After that, the second group will operate from the remaining models in the sequence according to the same alternating selection principle until all groups are successfully assigned to the models they need to process.
[0036] Based on this, because the model size and conversion time are positively correlated, the total model size of each group divided in the above way should be as close as possible to ensure that the time consumption of each thread is close, and ultimately ensure that the total time consumption is minimized.
[0037] Specifically, Figure 2 The model grouping diagram of a neural network model conversion acceleration method provided is shown in the following figure. If there are 5 neural network models to be processed, the sequence of neural network models to be processed obtained after sorting according to the model size is shown in the model list. The 5 neural network models to be processed are models 1-5. If there are 3 analysis devices, there will be 3 groups, that is, there will be 3 working threads, namely working threads 1-3. The grouping results are shown in the following figure. Figure 2 shown.
[0038] Furthermore, in step S30, the process of loading the layer information cache file is specifically implemented as follows in this embodiment: Determine whether the layer information cache file exists in the local device; if so, load the layer information cache file; if not, create and load an empty layer information cache file.
[0039] Specifically, Figure 3 As shown in the single model conversion flowchart of the provided neural network model conversion acceleration method, the ONNX model is input, that is, the neural network model to be processed is sent to the parsing device, and then it is determined whether there is a cache file locally, that is, whether there is a layer information cache file. If so, the cache file is loaded, and if not, an empty cache is created.
[0040] Further, in step S40, based on the layer information cache file, the corresponding neural network model group to be processed is parsed by at least one parsing device, and the parsing result is stored in the layer information cache file. In this embodiment, the specific implementation method is as follows: During the process of parsing the corresponding group of neural network models to be processed through the at least one parsing device, the layer information cache file is queried to determine whether the layer information cache file contains the layer file of the neural network model to be processed currently being parsed; if so, the corresponding layer file is used as the layer parsing result of the neural network model to be processed currently being parsed; if not, the neural network model to be processed currently being parsed is parsed, and the parsing result is stored in the layer information cache file.
[0041] Among them, for the neural network models to be processed, many model structures may be similar. For example, the license plate detection model and the vehicle detection model are both target detection models. The structures of these two models are the same, and the only difference is the data. After TensorRT conversion, the optimal strategies calculated by the same layers in the two models are consistent. Repeated parsing and conversion will cause repeated redundant calculation processes.
[0042] Therefore, by caching the layer information during the conversion of the ONNX model to the TensorRT Engine, for the same ONNX layer, the optimal strategy can be obtained directly by reading the cache, thereby accelerating the model conversion process. In other words, for the same model layer, TensorRT does not need to search for the optimal operator, but directly selects the operator based on the information in the cache file. The model compilation process is greatly accelerated, and the layer information cache file will be updated after any model compilation is completed, so that the cache information of the model layer will increase, and the subsequent model compilation time will be further shortened. The more models there are, the more obvious the acceleration effect will be. According to the measured data, the subsequent single model time will be reduced by 5-10 times.
[0043] Specifically, Figure 3 As shown in the single model conversion flowchart of the provided neural network model conversion acceleration method, the cache is added to the TensorRT configuration so that the parsing device can call the data in the layer information cache file, and then perform the model conversion and update the layer information cache. That is, after completing the current pending neural network model conversion, the parsing result is stored in the layer information cache file, and finally the layer information cache is saved locally to facilitate the direct call of the layer information cache file during the next execution of the pending neural network model conversion.
[0044] Corresponding to the above method embodiment, the present application also provides a neural network model conversion acceleration device embodiment, Figure 4 FIG. 1 is a schematic diagram showing the structure of a neural network model conversion acceleration device provided by an embodiment of the present application. Figure 4 As shown, the device comprises: A receiving module 402 is configured to receive at least one neural network model to be processed; The grouping module 404 is configured to group the at least one neural network model to be processed, and send the at least one neural network model group to be processed obtained by grouping to at least one preset parsing device; A loading module 406 is configured to load a layer information cache file; The parsing module 408 is configured to parse the corresponding neural network model group to be processed based on the layer information cache file through the at least one parsing device, and store the parsing results in the layer information cache file.
[0045] In an optional embodiment, the grouping module 404 is further configured to: Determine the number of groups and the number of group devices according to the number of devices of the at least one parsing device and the number of models of the at least one neural network model to be processed; sort the at least one neural network model to be processed according to model size to obtain a sequence of neural network models to be processed; group the at least one neural network model to be processed according to the sequence of neural network models to be processed, the number of groups and the number of group devices to obtain the at least one neural network model group to be processed.
[0046] In an optional embodiment, the grouping module 404 is further configured to: Alternately selecting the neural network models to be processed in the sequence of neural network models to be processed from the beginning to the end; adding the selected neural network models to be processed to the current group of neural network models to be processed, until the number of models in the current group of neural network models to be processed is equal to the number of devices in the group, and selecting the next group of neural network models to be processed, until all the neural network models to be processed are selected, and all the groups of neural network models to be processed are obtained.
[0047] In an optional embodiment, the loading module 406 is further configured to: Determine whether the layer information cache file exists in the local device; if so, load the layer information cache file; if not, create and load an empty layer information cache file.
[0048] In an optional embodiment, the parsing module 408 is further configured to: During the process of parsing the corresponding group of neural network models to be processed through the at least one parsing device, the layer information cache file is queried to determine whether the layer information cache file contains the layer file of the neural network model to be processed currently being parsed; if so, the corresponding layer file is used as the layer parsing result of the neural network model to be processed currently being parsed; if not, the neural network model to be processed currently being parsed is parsed, and the parsing result is stored in the layer information cache file.
[0049] The neural network model conversion acceleration device provided by the present application receives at least one neural network model to be processed; groups the at least one neural network model to be processed, and sends the at least one neural network model group to be processed obtained by grouping to at least one preset parsing device; loads the layer information cache file; based on the layer information cache file, the corresponding neural network model group to be processed is parsed through the at least one parsing device, and the parsing result is stored in the layer information cache file. The hardware performance is fully utilized, the model conversion efficiency is greatly improved, and the user waiting time is reduced.
[0050] The above is a schematic scheme of a neural network model conversion acceleration device of the present embodiment. It should be noted that the technical scheme of the neural network model conversion acceleration device and the technical scheme of the neural network model conversion acceleration method mentioned above belong to the same concept. For the details not described in detail in the technical scheme of the neural network model conversion acceleration device, please refer to the description of the technical scheme of the neural network model conversion acceleration method mentioned above. In addition, each component in the device embodiment should be understood as a functional module that must be established to implement each step of the program flow or each step of the method, and each functional module is not an actual functional division or separation definition. The device claim defined by such a group of functional modules should be understood as a functional module architecture that mainly implements the solution through the computer program recorded in the specification, and should not be understood as a physical device that mainly implements the solution through hardware.
[0051] Figure 5 The block diagram of a computing device 500 provided according to an embodiment of the present application is shown. The components of the computing device 500 include but are not limited to a memory 510 and a processor 520. The processor 520 is connected to the memory 510 via a bus 530, and the database 550 is used to store data.
[0052] The computing device 500 also includes an access device 540 that enables the computing device 500 to communicate via one or more networks 560. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 540 may include one or more of any type of network interface (e.g., a network interface card (NIC)) that is wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.
[0053] In one embodiment of the present application, the above components of the computing device 500 and Figure 5 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 5 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as needed.
[0054] Computing device 500 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. Computing device 500 may also be a mobile or stationary server.
[0055] Among them, the processor 520 is used to execute computer executable instructions of each step of the neural network model conversion acceleration method.
[0056] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above-mentioned neural network model conversion acceleration method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be found in the description of the technical scheme of the above-mentioned neural network model conversion acceleration method.
[0057] An embodiment of the present application also provides a computer-readable storage medium storing computer instructions, which, when executed by a processor, are used to execute the steps of the neural network model conversion acceleration method.
[0058] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above-mentioned neural network model conversion acceleration method belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be found in the description of the technical scheme of the above-mentioned neural network model conversion acceleration method.
[0059] An embodiment of the present application also provides a chip, which stores a computer program, and when the computer program is executed by the chip, the steps of the neural network model conversion acceleration method are implemented.
[0060] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0061] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0062] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0063] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0064] The preferred embodiments of the present application disclosed above are only used to help explain the present application. The optional embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the present application. The present application selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present application, so that those skilled in the art can understand and use the present application well. The present application is only limited by the claims and their full scope and equivalents.
Claims
1. A neural network model conversion acceleration method, It is characterized in that include: S10: receiving at least one neural network model to be processed; S20: grouping the at least one neural network model to be processed, and sending the at least one neural network model group to be processed obtained by grouping to at least one preset parsing device; S30: Loading layer information cache file; S40: Based on the layer information cache file, the corresponding neural network model group to be processed is parsed through the at least one parsing device, and the parsing result is stored in the layer information cache file.
2. The method according to claim 1, It is characterized in that In step S20, grouping the at least one neural network model to be processed includes: S21: Determine the number of groups and the number of group devices according to the number of devices of the at least one parsing device and the number of models of the at least one neural network model to be processed; S22: sorting the at least one neural network model to be processed according to model size to obtain a sequence of neural network models to be processed; S23: According to the sequence of neural network models to be processed, the number of groups and the number of group devices, the at least one neural network model to be processed is grouped to obtain the at least one neural network model group to be processed.
3. The method according to claim 2, It is characterized in that The step S23 comprises: S231: Alternately selecting the neural network models to be processed from the sequence of neural network models to be processed from beginning to end; S232: Add the selected neural network model to be processed to the current group of neural network models to be processed, until the number of models in the current group of neural network models to be processed is equal to the number of devices in the group, and select the next group of neural network models to be processed until all the neural network models to be processed are selected, thus obtaining all the groups of neural network models to be processed.
4. The method according to claim 1, It is characterized in that The step S30 includes: Determine whether the layer information cache file exists on the local device; If so, loading the layer information cache file; If not, create and load an empty cache file of the layer information.
5. The method according to claim 1, It is characterized in that The step S40 includes: In the process of parsing the corresponding neural network model group to be processed by the at least one parsing device, query the layer information cache file to determine whether the layer information cache file contains the layer file of the neural network model to be processed currently being parsed; If so, the corresponding layer file is used as the layer parsing result of the neural network model to be processed currently being parsed; If not, the neural network model to be processed that is currently being parsed is parsed, and the parsing result is stored in the layer information cache file.
6. A neural network model conversion acceleration device, It is characterized in that include: A receiving module, configured to receive at least one neural network model to be processed; A grouping module, configured to group the at least one neural network model to be processed, and send the at least one neural network model group to be processed obtained by grouping to at least one preset parsing device; A loading module is configured to load a layer information cache file; The parsing module is configured to parse the corresponding neural network model group to be processed based on the layer information cache file through the at least one parsing device, and store the parsing results in the layer information cache file.
7. A computing device, It is characterized in that include: Memory and processor; The memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions to implement the steps of the neural network model conversion acceleration method described in any one of claims 1 to 5.
8. A computer-readable storage medium storing computer instructions, It is characterized in that When the instruction is executed by the processor, the steps of the neural network model conversion acceleration method described in any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Neural network model reasoning method and device, electronic equipment and readable medium
CN110796242A
Device operation neural network test method and device
CN111178512A
Model processing method and related equipment
CN111753948A
Deep neural network multi-model parallel reasoning method based on graphics processor
CN114004730A
Neural network data processing method and device and storage medium
CN114118389A
