Deep learning accelerator performance modeling system, performance testing method and generation method

Through the deep learning accelerator performance modeling system, the unified network model description format and virtual hardware architecture are used to achieve efficient modeling and performance testing of deep learning models, solving the problems of long design cycles and high trial and error costs in traditional technologies, and improving Improve modeling efficiency and accuracy.

CN118657198AActive Publication Date: 2024-09-17ALIBABA DAMO (HANGZHOU) TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410720521.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-04
Publication Date
2024-09-17
Estimated Expiration
2044-06-04

AI Technical Summary

Technical Problem

Traditional computing chips cannot meet the computing needs of deep learning models, resulting in long hardware accelerator design cycles, high trial and error costs, and difficulty in being compatible with different network formats, resulting in low modeling efficiency and large errors.

Method used

Provides a deep learning accelerator performance modeling system that converts the initial network model into an intermediate network model through a unified network model description format, and automatically parses to obtain the target network modeling file that adapts to the performance modeling framework, and analyzes it based on the virtual hardware architecture to achieve Software modeling and end-to-end testing of hardware performance.

Benefits of technology

It shortens the hardware accelerator design cycle, improves modeling efficiency and accuracy, reduces trial and error costs, and solves the problems of format compatibility of different platforms and low efficiency of redundant information processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118657198A
    Figure CN118657198A
Patent Text Reader

Abstract

The invention provides a deep learning accelerator performance modeling system, a performance test method and a generation method, and the system comprises a first input interface which is used for converting an initial network model file into an intermediate network model file by using a unified network model description format, automatically analyzing the intermediate network model file according to network description supported by a deep learning accelerator DLA performance modeling framework to obtain a target network modeling file adaptive to the DLA performance modeling framework; the second input interface is used for inputting a hardware architecture configuration file and processing a network model corresponding to the target network modeling file by using the virtual DLA hardware architecture after the virtual DLA hardware architecture is obtained; and the analysis model is used for analyzing the DLA performance corresponding to the virtual DLA hardware architecture according to a result of processing the network model by the virtual DLA hardware architecture, so that the problems of long design period, high trial and error cost and the like of a hardware accelerator in related technologies are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of modeling, and in particular to a deep learning accelerator performance modeling system, a performance testing method, and a generation method. Background Art

[0002] With the continuous development of artificial intelligence technology, neural network algorithms represented by deep learning have gradually been widely used in artificial intelligence devices. At present, since artificial intelligence requires a lot of computing in model training and reasoning, but is limited by the characteristics of its algorithms and computing itself, traditional computing chips can no longer meet the computing needs, and it is necessary to accelerate the neural network through an accelerator to improve the computing power of the neural network. Deep learning accelerators (DLA) usually use specially customized highly parallel computing units to process specific network models, and use related memory technology and micro-architecture technology to optimize the processing efficiency of the entire accelerator. However, today when neural network models are developing extremely rapidly, the design cycle of hardware accelerators in special fields is too long, the trial and error cost is high, and the product iteration speed is slow. For this technical problem, no effective solution has been proposed in the relevant technology. Summary of the invention

[0003] The embodiments of the present application provide a deep learning accelerator performance modeling system, a performance testing method, and a generation method to solve one or more of the above-mentioned technical problems.

[0004] In a first aspect, an embodiment of the present application provides a deep learning accelerator modeling system, comprising: a first input interface, used to convert an initial network model file into an intermediate network model file using a unified network model description format, and automatically parse the intermediate network model file according to the network description supported by the deep learning accelerator DLA performance modeling framework to obtain a target network modeling file adapted to the DLA performance modeling framework; a second input interface, used to input a hardware architecture configuration file, and after obtaining a virtual DLA hardware architecture, use the virtual DLA hardware architecture to process the network model corresponding to the target network modeling file; an analysis model, used to analyze the DLA performance corresponding to the virtual DLA hardware architecture according to the result of processing the network model according to the virtual DLA hardware architecture.

[0005] In a second aspect, an embodiment of the present application provides a deep learning accelerator performance testing method for executing a target data flow using the above-mentioned deep learning accelerator modeling system; and testing the DLA performance according to the output results of the DLA performance modeling system.

[0006] In a third aspect, an embodiment of the present application provides a deep learning accelerator generation method, including: using the above-mentioned deep learning accelerator performance testing method to test a target DLA; when the performance of the target DLA meets a preset condition, generating a DLA according to a hardware configuration file of the target DLA in the DLA performance modeling system.

[0007] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory, wherein the processor implements any of the above methods when executing the computer program.

[0008] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in any one of the above is implemented.

[0009] In a sixth aspect, an embodiment of the present application provides a computer program product, including computer instructions, which implement any of the methods described above when executed by a processor.

[0010] Compared with the related art, this application has the following advantages:

[0011] The deep learning accelerator performance modeling system provided by the embodiment of the present application includes: a first input interface, which is used to convert the initial network model file into an intermediate network model file using a unified network model description format, and automatically parse the intermediate network model file according to the network description supported by the deep learning accelerator DLA performance modeling framework to obtain a target network modeling file adapted to the DLA performance modeling framework; a second input interface, which is used to input a hardware architecture configuration file, and after obtaining a virtual DLA hardware architecture, use the virtual DLA hardware architecture to process the network model corresponding to the target network modeling file; an analysis model, which is used to analyze the DLA performance corresponding to the virtual DLA hardware architecture according to the result of processing the network model according to the virtual DLA hardware architecture. That is to say, the embodiment of the present application simulates the performance of accelerators with different hardware architectures through a software modeling method, solving the problems of long hardware accelerator design cycle and high trial and error cost. Specifically, in the above-mentioned DLA performance modeling system, a unified network model description format is used as an intermediate format to align original networks from different sources, solving the problem that different format types are used for the same network model on different platforms in the related art, and the modeling framework is difficult to be compatible with all network formats, which leads to the problem that the original model cannot / is inconvenient to process, and the original model has a large amount of redundant information, and the direct processing is very inefficient. In addition, the embodiment of the present application can automatically parse the intermediate network model file to obtain a network modeling file that is adapted to the DLA performance modeling framework, thereby improving the network modeling efficiency, and thereby solving the problem of large errors and low efficiency caused by network modeling through modelable operator nodes of handwritten network models in related technologies.

[0012] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] In the accompanying drawings, unless otherwise specified, the same reference numerals throughout the multiple drawings represent the same or similar parts or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings only depict some embodiments according to the present application and should not be regarded as limiting the scope of the present application.

[0014] Figure 1 A schematic diagram of a scenario of a deep learning accelerator performance modeling system provided in an embodiment of the present application is shown;

[0015] Figure 2 The structure block diagram of the DLA performance modeling system provided in the embodiment of the present application is shown;

[0016] Figure 3The structure block diagram of the DLA performance modeling system provided in the embodiment of the present application is shown (I);

[0017] Figure 4 The structure block diagram of the DLA performance modeling system provided in the embodiment of the present application is shown (II);

[0018] Figure 5 A flow chart of a deep learning accelerator performance testing method provided in an embodiment of the present application is shown;

[0019] Figure 6 A flow chart of a method for generating a deep learning accelerator provided in an embodiment of the present application is shown;

[0020] Figure 7 A structural block diagram of a deep learning accelerator performance testing device provided in an embodiment of the present application is shown;

[0021] Figure 8 A structural block diagram of a deep learning accelerator generation device provided in an embodiment of the present application is shown;

[0022] Fig. 9 A block diagram of an electronic device used to implement an embodiment of the present application is shown. DETAILED DESCRIPTION

[0023] In the following, only some exemplary embodiments are briefly described. As those skilled in the art will appreciate, the described embodiments may be modified in various ways without departing from the concept or scope of the present application. Therefore, the drawings and descriptions are considered to be exemplary in nature and not restrictive.

[0024] To facilitate understanding of the technical solutions of the embodiments of the present application, the following describes the related technologies of the embodiments of the present application. The following related technologies can be combined with the technical solutions of the embodiments of the present application as optional solutions, and they all belong to the protection scope of the embodiments of the present application.

[0025] The application scenarios of deep learning accelerator performance modeling involved in the embodiments of this application include but are not limited to: hardware-friendly development of neural network algorithms, dedicated autonomous driving chip design, artificial intelligence (AI) network model deployment, etc. In the above application scenarios, DLA design is a key step. A good performance modeling system can largely solve the problems of long hardware accelerator design cycle, complex network structure and difficulty in mapping data flow. Among them, DLA performance modeling simulates the hardware execution network model (such as Figure 1As shown), we can get theoretically relatively accurate hardware cost, performance and execution efficiency. Usually, the performance modeling framework runs a "hardware-network-data flow" test case in a very short time. By using appropriate modeling methods, we can get sufficiently reliable accuracy and sufficiently convenient test processes. Among them, efficient modeling of network models is a key area of ​​DLA performance modeling. There are many shortcomings in the methods in related technologies: 1. It is very inconvenient to directly process the original model, because the same network model uses different format types on different platforms, and it is difficult for the modeling framework to be compatible with all network formats; 2. Performance modeling usually does not include all operator types of the original network, so there is a lot of redundant information in the original model, and direct processing will be very inefficient; 3. Some modeling frameworks use network descriptions in a custom format internally, and model the network by handwriting network descriptions. Such methods are difficult to align with the real environment network, resulting in modeling errors.

[0026] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0027] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The several specific embodiments listed can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0028] The present application embodiment provides a deep learning accelerator performance modeling system, such as Figure 2 The figure shows a structural block diagram of a DLA performance modeling system according to an embodiment of the present application, including:

[0029] The first input interface 202 is used to convert the initial network model file into an intermediate network model file using a unified network model description format, and automatically parse the intermediate network model file according to the network description supported by the deep learning accelerator DLA performance modeling framework to obtain a target network modeling file adapted to the DLA performance modeling framework. It should be noted that the first input interface 202 can be an interface of the network modeling end in the DLA performance modeling system. The above network model can be a neural network model. The above unified network model description format can be a concise and clear unified format used to align network models from different sources to adapt to different modeling frameworks. In addition, in an embodiment of the present application, the front end of the unified network description is the initial network, and the back end is the network object modeled inside the framework, which, as a unified intermediate format, forms an end-to-end network modeling, ensuring the reliability and accuracy of the network modeling. Optionally, the above initial network model file may include: Open Neural Network Exchange (ONNX) file, open source Python machine learning library pytorch file, end-to-end open source machine learning platform TensorFlow file, etc. In a possible implementation, the above-mentioned method of converting the initial network model file into the intermediate network model file using the unified network model description format may include: writing the description information included in the initial network model file to the corresponding position according to the requirements of the unified network model description format. The above-mentioned automatic parsing of the intermediate network model file according to the network description supported by the deep learning accelerator DLA performance modeling framework may be to automatically parse the intermediate network model file using a fast algorithm to obtain a target network modeling file adapted to the DLA performance modeling framework, rather than using a handwritten .c, .py or other description file to model the network model in the related art.

[0030] The second input interface 204 is used to input a hardware architecture configuration file. After obtaining the virtual DLA hardware architecture, the virtual DLA hardware architecture is used to process the network model corresponding to the target network modeling file. It should be noted that the second input interface 204 can be an interface of the hardware architecture modeling end. After inputting the hardware architecture configuration file, the second input interface 204 can generate a virtual DLA hardware architecture, and the virtual DLA hardware architecture can process the network model output by the first input interface 202. For example, the network model is accelerated. The hardware architecture configuration file is used to describe the technical details of the entire DLA. Users can customize all the details, or fix the internal configuration information of the DLA. Users can choose several fixed hardware design templates.

[0031] The analysis model 206 is used to analyze the DLA performance corresponding to the virtual DLA hardware architecture based on the result of processing the network model according to the virtual DLA hardware architecture. Optionally, in an embodiment of the present application, the analysis model 206 can analyze the DLA hardware cost, performance, and execution efficiency. That is, the embodiment of the present application can test the network-hardware deployment performance end-to-end.

[0032] pass Figure 2 The system shown includes: a first input interface, which is used to convert the initial network model file into an intermediate network model file using a unified network model description format, and automatically parse the intermediate network model file according to the network description supported by the deep learning accelerator DLA performance modeling framework to obtain a target network modeling file adapted to the DLA performance modeling framework; a second input interface, which is used to input a hardware architecture configuration file, and after obtaining a virtual DLA hardware architecture, use the virtual DLA hardware architecture to process the network model corresponding to the target network modeling file; an analysis model, which is used to analyze the DLA performance corresponding to the virtual DLA hardware architecture according to the result of processing the network model according to the virtual DLA hardware architecture. That is to say, the embodiment of the present application simulates the performance of accelerators with different hardware architectures through a software modeling method, solving the problems of long hardware accelerator design cycle and high trial and error cost. Specifically, the unified network model description format is used as an intermediate format in the above-mentioned DLA performance modeling system, which can align the original networks from different sources, solves the problem that different format types are used for the same network model on different platforms in the related art, and the modeling framework is difficult to be compatible with all network formats, which leads to the problem that the original model cannot / is inconvenient to process, and the original model has a large amount of redundant information, and the direct processing is very inefficient. In addition, the embodiment of the present application can automatically parse the intermediate network model file to obtain a network modeling file that is adapted to the DLA performance modeling framework, thereby improving the network modeling efficiency, and thereby solving the problem of large errors and low efficiency caused by network modeling through modelable operator nodes of handwritten network models in related technologies.

[0033] In one possible implementation, Figure 3As shown, the first input interface 202 may include: a definition module 2022 for defining the unified network model description format. The definition module 2022 is also used to use a Json file to describe the information from the entire network model to the operator according to the hierarchical structure of the divided network layer, wherein the first level of the Json file includes a name list of the input feature graph and a network layer list of the entire network model. JavaScript Object Notation (Json for short) is a lightweight data exchange format that can be used in a variety of programming languages ​​for data transmission, storage and exchange between the front and back ends. Optionally, the name list of the input feature graph contains several strings, each string is the name of an input feature graph, and the network layer list of the entire network model contains each layer of the entire network model, and each layer is represented by a dictionary (the dictionary corresponds to the "attrs" field, which is a dict type data structure). The front end of the unified network model description is the initial network model, and the back end is the network object modeled inside the modeling framework. As a unified intermediate format, it forms an end-to-end network modeling, ensuring the reliability and accuracy of the network modeling.

[0034] A network layer in the network layer list of the entire network model may include: a dictionary, an input list, a network layer name, and an output list. The following describes the included information in detail.

[0035] In the above dictionary, different operator types use corresponding fields to describe the characteristics of this network layer, including the attribute parameters of the operator, where the convolution operator, pooling operator, and deconvolution operator at least include groups(int), strides(list), dilation(list), and padding(list). It should be noted that the attribute parameters of the operator itself are described here, but not every operator has attribute parameters that need to be described.

[0036] The above input list includes a list of input feature maps of this network layer, wherein the input feature map is described by the dictionary, and the feature map includes list information describing the dimension size, information describing whether the feature map is a constant value, format information describing the dimension, and name information of the feature map. It should be noted that the above dimensions can be one to five dimensions, and the above constant values ​​can be 0 or 1, for example, the weight data can be 0 or 1. The format information describing the dimensions can be a string, for example, the format describing the dimensions can be NCHW, and the dimensions are [1, 30, 20, 20], which means that the sizes of the four dimensions N, C, H, and W are 1, 30, 20, and 20 respectively. Regarding the name information of the above feature map, if the output feature map (output Feature Map, OFM) of the xth layer and the input feature map (Input Feature Map, abbreviated as IFM) of the yth layer have the same name, it means that there is a connection relationship between the two layers.

[0037] The above network layer name at least includes network layer information, wherein the network layer name of the entire network model is different. Optionally, in an embodiment of the present application, the network layer name is represented by a string, and the name needs to contain detailed network layer information, such as parameter quantity, operator library, etc.

[0038] The above-mentioned operator type can be a string that separates the optional description from the operator name by a period, wherein the optional description is used to identify additional information of the operator. Optionally, in an embodiment of the present application, there can be multiple optional descriptions, separated by a period ".", and the last item separated is the operator name, represented by lowercase letters (the optional description field is arbitrary and will not be parsed, but using such a field can identify additional information of the operator, such as operator library information, quantization information, etc.). For example, assuming that the optional description includes optional description a and the operator name is b, then the corresponding operator type can be ab. Assuming that the optional description includes optional descriptions a, b, c, and the operator name is d, then the corresponding operator type can be abcd.

[0039] The above output list includes all output feature maps of this network layer, where the description method of the output feature map is the same as that of the input feature map.

[0040] The network model parser 2024 is used to automatically parse the intermediate network model file according to the network description supported by the DLA performance modeling framework to obtain a target network modeling file adapted to the DLA performance modeling framework. Figure 4As shown, the network model parser 2024 includes: an initialization module 20242, a parsing module 20244, a first traversal module 20246, a second traversal module 20248, and an update module 20250. The internal network modeling object adapted to the modeling framework is obtained through the network model parser 2024, which greatly improves the efficiency of network modeling. In addition, the network model parser 2024 can set the operator types supported by the modeling framework, the mapping data streams of different operator modeling, whether the activation function is fused, etc., to be compatible with different performance modeling frameworks, instead of the modelable operator nodes of the completely handwritten network model in the related technology for network modeling, which is difficult to have a good match with the network model deployed in the real environment, resulting in a large modeling error, and then the evaluation results of the performance modeling lack reliability and credibility. In addition, the manual process lacks efficiency and is time-consuming and laborious when facing large networks.

[0041] Optionally, the above-mentioned initialization module 20242 can be used to obtain the information of each level in the intermediate network model file, input features, description boundaries of the operator layer, intermediate variables required for initializing the processing network model, mapping information (which may include any operator mapping information that needs to be applied in the modeling framework), and setting operator types that cannot be supported by the performance modeling framework (different frameworks have different ranges of supported operators, so they need to be set in the initialization stage), whether the activation function is fused with the previous layer linear operator for modeling (some modeling frameworks support the fusion calculation of the activation function and the previous convolution layer, rather than modeling the activation function as a separate layer).

[0042] The above-mentioned parsing module 20244 can be used to parse the input feature graph of the network model corresponding to the intermediate network model file. Optionally, when the network model has a single input, the feature graph is directly parsed; when the network model has multiple inputs, all feature graphs are extracted, and all information in the feature graph description is parsed in turn to generate an input feature list of the network model.

[0043] The first traversal module 20246 can be used to traverse the network model to obtain the topological structure of the network. Optionally, the first traversal module 20246 can simplify the operators in the network model into multiple input feature map names, operator layer IDs, and multiple output feature map names; if the output feature map of the layer with ID X has the same name as the input feature map of the layer with ID Y, it is determined that the layer X and the layer Y have a front-to-back connection relationship.

[0044] The above-mentioned second traversal module 20248 can be used to traverse the network model again and parse the operator layer that needs to be modeled. Optionally, the second traversal module 20248 can enter the corresponding network model parser for different operator types to complete the parsing of the current operator layer, wherein the parsing information is all entries in a layer in the intermediate network model file, and the information required to parse an operator layer is the corresponding operator information in the intermediate network model file and the mapping information of the current layer; if a fusion activation function is set in the initialization module, the information of the activation function is added to the previous layer of the current layer; for the deconvolution operator, a corresponding parsing entry is set, and a deconvolution operator is parsed into multiple parallel convolution operators and an operator that rearranges the data (such as a contract operator) by disassembling the convolution kernel. Among them, the parsing of the deconvolution operator is relatively special, and the parsing of other operators is one-to-one, for example, convolution is parsed into convolution, and the fully connected layer is parsed into a fully connected layer. A deconvolution operator should be parsed into multiple operators, not one operator. Specifically, the above-mentioned multiple parallel convolution operators can be (x_stride*y_stride) parallel convolution operators, where x_stride and y_stride are one of the properties of the deconvolution operator: the deconvolution step length in the x direction and the y direction.

[0045] The above-mentioned update module 20250 can be used to update the connection relationship between operators to obtain the target network modeling file. Optionally, the update module 20250 can add inter-layer interconnection information to each layer of the target network modeling file; delete operators not supported by the performance modeling framework and maintain the overall topological structure of the intermediate network model file; update the layer ID information in the target network modeling file so that the target network modeling file is in a sequential state in the topological sorting.

[0046] In summary, the embodiments of the present application propose to integrate a universal network modeling interface (i.e., the first input interface mentioned above) in the system-level performance modeling of a deep learning accelerator, so as to integrate the initial network model and the performance modeling framework end-to-end. The network modeling interface can align the original network models from different sources, and at the same time can be compatible with different performance modeling frameworks. It has good compatibility and versatility, and performs network modeling in an end-to-end manner, eliminating the shortcomings of poor reliability and low accuracy in manually controlled network modeling. The unified network model description provides a unified network description format in the field of performance modeling. Different original network types can be aligned to this intermediate description format during modeling, which provides an effective solution for network modeling in complex situations. The unified neural network parser uses an algorithm to quickly parse the network model description, thereby improving the efficiency of network modeling.

[0047] Corresponding to the application scenario and system of the system provided in the embodiment of the present application, the embodiment of the present application also provides a deep learning accelerator performance testing method. Figure 5 The flowchart of a deep learning accelerator performance testing method according to an embodiment of the present application is shown. The method may include:

[0048] S502, use the above-mentioned DLA performance modeling system to execute the target data flow. Optionally, the above-mentioned DLA performance modeling system includes: a first input interface 202, which is used to convert the initial network model file into an intermediate network model file using a unified network model description format, and automatically parse the intermediate network model file according to the network description supported by the deep learning accelerator DLA performance modeling framework to obtain a target network modeling file adapted to the DLA performance modeling framework. It should be noted that the first input interface 202 can be an interface of the network modeling end in the DLA performance modeling system. The above-mentioned network model can be a neural network model. The above-mentioned unified network model description format can be a concise and clear unified format used to align network models from different sources to adapt to different modeling frameworks. In addition, in an embodiment of the present application, the front end of the unified network description is the initial network, and the back end is the network object modeled inside the framework. As a unified intermediate format, it forms end-to-end network modeling, which ensures the reliability and accuracy of network modeling. Optionally, the initial network model file may include: an Open Neural Network Exchange (ONNX) file, an open source Python machine learning library pytorch file, an end-to-end open source machine learning platform TensorFlow file, etc. In a possible implementation, the method of converting the initial network model file into an intermediate network model file using a unified network model description format may include: writing the description information included in the initial network model file to a corresponding position according to the requirements of the unified network model description format. The automatic parsing of the intermediate network model file according to the network description supported by the deep learning accelerator DLA performance modeling framework may be to automatically parse the intermediate network model file using a fast algorithm to obtain a target network modeling file adapted to the DLA performance modeling framework, rather than using a handwritten .c, .py or other description file in the related art to model the network model. The second input interface 204 is used to input a hardware architecture configuration file, and after obtaining the virtual DLA hardware architecture, the virtual DLA hardware architecture is used to process the network model corresponding to the target network modeling file. It should be noted that the second input interface 204 may be an interface of the hardware architecture modeling end. After inputting the hardware architecture configuration file, the second input interface 204 can generate a virtual DLA hardware architecture, and the virtual DLA hardware architecture can process the network model output by the first input interface 202. For example, the network model is accelerated. The hardware architecture configuration file is used to describe the technical details of the entire DLA. The user can customize all the details, or fix the internal configuration information of the DLA. The user can select several fixed hardware design templates. The analysis model 206 is used to analyze the DLA performance corresponding to the virtual DLA hardware architecture according to the result of processing the network model by the virtual DLA hardware architecture.Optionally, in the embodiment of the present application, the analysis model 206 can analyze the DLA hardware cost, performance, and execution efficiency, etc. That is, the embodiment of the present application can test the network-hardware deployment performance end-to-end.

[0049] S504: Test the DLA performance according to the output result of the DLA performance modeling system.

[0050] Through the above S502~S504, the unified network model description format is used as an intermediate format to align the original networks from different sources, which solves the problem that different format types are used for the same network model on different platforms in the related art, and the modeling framework is difficult to be compatible with all network formats, which leads to the problem that the original model cannot / is inconvenient to process, and the original model has a large amount of redundant information, and the direct processing is very inefficient. In addition, the embodiment of the present application can automatically parse the intermediate network model file to obtain a network modeling file adapted to the DLA performance modeling framework, thereby improving the network modeling efficiency, and thus solving the problem of large errors and low efficiency caused by network modeling through modelable operator nodes of handwritten network models in the related art. In addition, the embodiment of the present application can test the network-hardware deployment performance end-to-end, which can easily shorten the evaluation process and time in the field of deep learning accelerator performance modeling, improve the modeling efficiency, and ensure the reliability and accuracy of cost evaluation.

[0051] Corresponding to the application scenario and system of the system provided in the embodiment of the present application, the embodiment of the present application also provides a method for generating a deep learning accelerator. Figure 6 The flowchart of a method for generating a deep learning accelerator according to an embodiment of the present application is shown, including:

[0052] S602, testing the target DLA using the above-mentioned deep learning accelerator performance testing method;

[0053] S604, when the performance of the target DLA meets the preset conditions, generate a DLA according to the hardware configuration file of the target DLA in the DLA performance modeling system. Optionally, in an embodiment of the present application, the preset conditions may be that the delay is within a specified range or the power consumption is within a specified range, etc. In an embodiment of the present application, when the performance of the above-mentioned target DLA does not meet the preset conditions, the hardware architecture configuration file may be re-input through the second input interface of the deep learning accelerator performance modeling system, and after obtaining a new virtual DLA hardware architecture, the network model is processed using the new virtual DLA hardware architecture, and the performance analysis results are obtained by analyzing the analysis model to determine whether the new hardware architecture meets the preset conditions.

[0054] Through the above S602 to S604, the target DLA is tested using the DLA performance modeling system provided in the embodiment of the present application. When the performance of the target DLA meets the preset conditions, the DLA can be generated according to the hardware configuration file of the target DLA in the DLA performance modeling system, that is, the design of the hardware DLA is implemented, thereby solving the technical problems in the related art that the design cycle of hardware accelerators in special fields is too long, the trial and error cost is high, and the product iteration speed is slow.

[0055] Corresponding to the application scenario and method of the method provided in the embodiment of the present application, the embodiment of the present application also provides a deep learning accelerator performance testing device. Figure 7 The figure shows a structural block diagram of a deep learning accelerator performance test device according to an embodiment of the present application, and the device may include:

[0056] An execution module 702 is used to execute the target data flow using the above-mentioned DLA performance modeling system. Optionally, the above-mentioned DLA performance modeling system includes: a first input interface 202, which is used to convert the initial network model file into an intermediate network model file using a unified network model description format, and automatically parse the intermediate network model file according to the network description supported by the deep learning accelerator DLA performance modeling framework to obtain a target network modeling file adapted to the DLA performance modeling framework. It should be noted that the first input interface 202 can be an interface of the network modeling end in the DLA performance modeling system. The above-mentioned network model can be a neural network model. The above-mentioned unified network model description format can be a concise and clear unified format used to align network models from different sources to adapt to different modeling frameworks. In addition, in an embodiment of the present application, the front end of the unified network description is the initial network, and the back end is the network object modeled inside the framework. As a unified intermediate format, it forms end-to-end network modeling, which ensures the reliability and accuracy of network modeling. Optionally, the initial network model file may include: an Open Neural Network Exchange (ONNX) file, an open source Python machine learning library pytorch file, an end-to-end open source machine learning platform TensorFlow file, etc. In a possible implementation, the method of converting the initial network model file into an intermediate network model file using a unified network model description format may include: writing the description information included in the initial network model file to a corresponding position according to the requirements of the unified network model description format. The automatic parsing of the intermediate network model file according to the network description supported by the deep learning accelerator DLA performance modeling framework may be to automatically parse the intermediate network model file using a fast algorithm to obtain a target network modeling file adapted to the DLA performance modeling framework, rather than using a handwritten .c, .py or other description file in the related art to model the network model. The second input interface 204 is used to input a hardware architecture configuration file, and after obtaining the virtual DLA hardware architecture, the virtual DLA hardware architecture is used to process the network model corresponding to the target network modeling file. It should be noted that the second input interface 204 may be an interface of the hardware architecture modeling end. After inputting the hardware architecture configuration file, the second input interface 204 can generate a virtual DLA hardware architecture, and the virtual DLA hardware architecture can process the network model output by the first input interface 202. For example, the network model is accelerated. The hardware architecture configuration file is used to describe the technical details of the entire accelerator. The user can customize all the details, or fix the internal configuration information of the accelerator. The user can select several fixed hardware design templates. The analysis model 206 is used to analyze the DLA performance corresponding to the virtual DLA hardware architecture according to the result of processing the network model by the virtual DLA hardware architecture.Optionally, in the embodiment of the present application, the analysis model 206 can analyze the DLA hardware cost, performance, and execution efficiency, etc. That is, the embodiment of the present application can test the network-hardware deployment performance end-to-end.

[0057] The first testing module 704 is used to test the DLA performance according to the output result of the DLA performance modeling system.

[0058] pass Figure 7 The device shown uses a unified network model description format as an intermediate format, which can align original networks from different sources, solving the problem in the related art that different format types are used for the same network model on different platforms, and the modeling framework is difficult to be compatible with all network formats, which leads to the problem that the original model cannot / is inconvenient to process, and the original model has a large amount of redundant information, which is very inefficient to directly process. In addition, the embodiment of the present application can automatically parse the intermediate network model file to obtain a network modeling file adapted to the DLA performance modeling framework, thereby improving the network modeling efficiency, and thus solving the problem of large errors and low efficiency caused by network modeling through modelable operator nodes of handwritten network models in the related art. In addition, the embodiment of the present application can test the network-hardware deployment performance end-to-end, which can easily shorten the evaluation process and time in the field of deep learning accelerator performance modeling, improve the modeling efficiency, and ensure the reliability and accuracy of cost evaluation.

[0059] Corresponding to the application scenario and method of the method provided in the embodiment of the present application, the embodiment of the present application also provides a deep learning accelerator generation device. Figure 8 The figure shows a structural block diagram of a deep learning accelerator generation device according to an embodiment of the present application, and the device may include:

[0060] A second testing module 802 is used to test the target DLA using the above-mentioned deep learning accelerator performance testing method;

[0061] The design module 804 is used to generate a DLA according to the hardware configuration file of the target DLA in the DLA performance modeling system when the performance of the target DLA meets the preset conditions. Optionally, in an embodiment of the present application, the preset conditions may be that the delay is within a specified range or the power consumption is within a specified range, etc. In an embodiment of the present application, when the performance of the above-mentioned target DLA does not meet the preset conditions, the hardware architecture configuration file may be re-input through the second input interface of the deep learning accelerator performance modeling system, and after obtaining a new virtual DLA hardware architecture, the network model is processed using the new virtual DLA hardware architecture, and the performance analysis results are obtained by analyzing the analysis model to determine whether the new hardware architecture meets the preset conditions.

[0062] pass Figure 8The device shown uses the DLA performance modeling system provided in the embodiment of the present application to test the target DLA. When the performance of the target DLA meets the preset conditions, the DLA can be generated according to the hardware configuration file of the target DLA in the DLA performance modeling system, that is, the design of the hardware DLA is implemented, thereby solving the technical problems in the related art that the design cycle of hardware accelerators in special fields is too long, the trial and error cost is high, and the product iteration speed is slow.

[0063] The functions of each module in each device and system in the embodiment of the present application can be referred to the corresponding description in the above method, and have corresponding beneficial effects, which will not be repeated here.

[0064] Fig. 9 FIG. 1 is a block diagram of an electronic device used to implement an embodiment of the present application. Fig. 9 As shown, the electronic device includes: a memory 901 and a processor 902. The memory 901 stores a computer program that can be run on the processor 902. When the processor 902 executes the computer program, the method in the above embodiment is implemented. The number of the memory 901 and the processor 902 can be one or more.

[0065] The electronic device also includes:

[0066] The communication interface 903 is used to communicate with external devices and perform data exchange transmission.

[0067] If the memory 901, the processor 902 and the communication interface 903 are implemented independently, the memory 901, the processor 902 and the communication interface 903 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig. 9 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0068] Optionally, in a specific implementation, if the memory 901, the processor 902 and the communication interface 903 are integrated on a chip, the memory 901, the processor 902 and the communication interface 903 can communicate with each other through an internal interface.

[0069] An embodiment of the present application provides a computer-readable storage medium storing a computer program, which implements the method provided in the embodiment of the present application when the program is executed by a processor.

[0070] An embodiment of the present application also provides a chip, which includes a processor for calling and executing instructions stored in the memory from the memory, so that a communication device equipped with the chip executes the method provided by the embodiment of the present application.

[0071] An embodiment of the present application also provides a chip, including: an input interface, an output interface, a processor and a memory, wherein the input interface, the output interface, the processor and the memory are connected via an internal connection path, and the processor is used to execute the code in the memory. When the code is executed, the processor is used to execute the method provided in the embodiment of the application.

[0072] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. It is worth noting that the processor may be a processor supporting the Advanced RISC Machines (ARM) architecture.

[0073] Further, optionally, the above-mentioned memory may include a read-only memory and a random access memory. The memory may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory. Among them, the non-volatile memory may include a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may include a random access memory (RAM), which is used as an external cache. By way of exemplary but not limiting description, many forms of RAM are available. For example, static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct memory bus random access memory (DR RAM).

[0074] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.

[0075] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification and the features of different embodiments or examples, unless they are contradictory.

[0076] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0077] Any process or method described in the flow chart or otherwise described herein can be understood as a module, fragment or portion of a code representing one or more executable instructions for implementing the steps of a specific logical function or process. And the scope of the preferred embodiment of the present application includes other implementations, in which the functions may not be performed in the order shown or discussed, including in a substantially simultaneous manner or in a reverse order according to the functions involved.

[0078] The logic and / or steps described in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, which can be specifically implemented in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or used in combination with these instruction execution systems, devices or apparatuses.

[0079] It should be understood that the various parts of the present application can be implemented with hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented with software or firmware stored in a memory and executed by a suitable instruction execution system. All or part of the steps of the above embodiment method can be completed by instructing the relevant hardware through a program, which can be stored in a computer-readable storage medium, and when the program is executed, it includes one of the steps of the method embodiment or a combination thereof.

[0080] In addition, each functional unit in each embodiment of the present application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. If the above-mentioned integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. The storage medium can be a read-only memory, a disk or an optical disk, etc.

[0081] The above is only an exemplary embodiment of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various changes or substitutions within the technical scope recorded in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A deep learning accelerator performance modeling system, include: A first input interface is used to convert an initial network model file into an intermediate network model file using a unified network model description format, and automatically parse the intermediate network model file according to a network description supported by a deep learning accelerator DLA performance modeling framework to obtain a target network modeling file adapted to the DLA performance modeling framework; A second input interface is used to input a hardware architecture configuration file, and after obtaining a virtual DLA hardware architecture, use the virtual DLA hardware architecture to process the network model corresponding to the target network modeling file; The analysis model is used to analyze the DLA performance corresponding to the virtual DLA hardware architecture according to the result of processing the network model by the virtual DLA hardware architecture.

2. The system according to claim 1, in, The first input interface comprises: A definition module, used to define the unified network model description format; A network model parser is used to automatically parse the intermediate network model file according to the network description supported by the DLA performance modeling framework to obtain a target network modeling file adapted to the DLA performance modeling framework.

3. The system according to claim 2, in, The definition module is also used to use a Json file to describe information from the entire network model to the operator according to the hierarchical structure of the divided network layers, wherein the first level of the Json file includes a name list of the input feature graph and a network layer list of the entire network model.

4. The system according to claim 3, in, A network layer in the network layer list of the entire network model includes: A dictionary, in which different operator types use corresponding fields to describe the characteristics of this network layer, including the attribute parameters of the operator. The convolution operator, pooling operator, and deconvolution operator at least include grouping, stride list, hole list, and padding list; An input list, including an input feature map list of this network layer, wherein the input feature map is described by the dictionary, and the feature map includes list information describing the dimension size, information describing whether the feature map is a constant value, format information describing the dimension, and name information of the feature map; A network layer name, including at least network layer information, wherein the network layer names of the entire network model are different; Operator type, a string that separates the optional description from the operator name with a period. The optional description is used to identify additional information about the operator. The output list includes all output feature maps of this network layer, where the output feature maps are described in the same way as the input feature maps.

5. The system according to claim 4, in, The network model parser includes: an initialization module, a parsing module, a first traversal module, a second traversal module, and an update module, wherein: The initialization module is used to obtain the information of each level in the intermediate network model file, input features, description boundaries of the operator layer, the intermediate variables and mapping information required for initializing the processing network model, and to set the operator type that cannot be supported by the performance modeling framework, and whether the activation function is fused with the linear operator of the previous layer for modeling; The parsing module is used to parse the input feature graph of the network model corresponding to the intermediate network model file; The first traversal module is used to traverse the network model to obtain the topological structure of the network; The second traversal module is used to traverse the network model again and parse the operator layer that needs to be modeled; The updating module is used to update the connection relationship between operators to obtain the target network modeling file.

6. According to the system of claim 5, the analysis module is also used for When the network model has a single input, directly parsing the feature map; When the network model has multiple inputs, all feature graphs are extracted, and all information in the feature graph description is parsed in sequence to generate an input feature list of the network model.

7. The system according to claim 5, wherein the first traversal module is further configured to: Simplifying the operators in the network model into multiple input feature map names, operator layer IDs, and multiple output feature map names; If the output feature map of the layer with ID X has the same name as the input feature map of the layer with ID Y, it is determined that the layer X and the layer Y have a front-to-back connection relationship.

8. The system according to claim 5, wherein the second traversal module is further configured to: For different operator types, enter the corresponding network model parser to complete the parsing of the current operator layer. in, The parsed information is all entries in a layer in the intermediate network model file, and the information required to parse an operator layer is the corresponding operator information in the intermediate network model file and the mapping information of the current layer; If a fusion activation function is set in the initialization module, the information of the activation function is added to the previous layer of the current layer; For the deconvolution operator, set the corresponding parsing entry, and use the method of disassembling the convolution kernel to parse a deconvolution operator into multiple parallel convolution operators and an operator that rearranges the data.

9. The system according to claim 5, wherein the update module is further used to Adding inter-layer interconnection information to each layer of the target network modeling file; Deleting operators not supported by the performance modeling framework and maintaining the overall topology of the intermediate network model file; The layer ID information in the target network modeling file is updated so that the target network modeling file is in a sequential state in the topological sorting.

10. A deep learning accelerator performance testing method, include: Using the DLA performance modeling system according to any one of claims 1 to 9, executing a target data flow; The DLA performance is tested according to the output results of the DLA performance modeling system.

11. A method for generating a deep learning accelerator, include: Testing the target DLA using the performance testing method of claim 10; When the performance of the target DLA meets a preset condition, a DLA is generated according to a hardware configuration file of the target DLA in the DLA performance modeling system.

12. An electronic device comprising a memory, a processor and a computer program stored in the memory, wherein the processor implements the method according to any one of claims 10 to 11 when executing the computer program.

13. A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the method according to any one of claims 10 to 11 is implemented.

14. A computer program product, comprising computer instructions, wherein when the computer instructions are executed by a processor, the method according to any one of claims 10 to 11 is implemented.

Citation Information

Patent Citations

  • System for evaluating reasoning performance of convolutional neural network on accelerator

    CN114861871A

  • Method and apparatus for co-optimizing neural network and neural network-specific hardware

    CN117787389A

  • Platform-aware transformer-based performance prediction

    US20230306083A1