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

The deep learning accelerator performance modeling system automatically generates virtual hardware architecture, which solves the problems of long traditional hardware design cycle and high trial and error cost, achieves fast and efficient modeling and performance analysis, and improves the iteration speed.

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

Patent Information

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

AI Technical Summary

Technical Problem

Traditional deep learning accelerator hardware design cycles are long, trial and error costs are high, and product iterations are slow. Existing technologies cannot effectively solve this problem.

Method used

Provides a deep learning accelerator performance modeling system that automatically generates computing array objects and memory level objects by inputting network model files and hardware description templates to form a virtual hardware architecture, analyze its performance, simplify the hardware design process, and improve modeling speed and efficiency.

Benefits of technology

It greatly improves the speed and efficiency of hardware modeling, simplifies the input complexity of hardware design, reduces trial and error costs, solves the problems of long hardware design cycle and high trial and error costs, and improves modeling flexibility and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118657197A
    Figure CN118657197A
Patent Text Reader

Abstract

The invention provides a deep learning accelerator performance modeling system, a performance testing method and a generation method, and the deep learning accelerator performance modeling system comprises a first input interface which is used for inputting a network model file; the second input interface is used for providing a simplified hardware description template for a user, and after the user inputs a hardware description file according to the hardware description template, automatically generating a computing array object and a memory hierarchy object matched with the DLA performance modeling framework so as to obtain a virtual DLA hardware architecture; processing a network model corresponding to the target network modeling file by using a virtual DLA hardware architecture; and the analysis model is used for analyzing 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. Through the method, the problems of long hardware accelerator design period, high trial and error cost and the like 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 for inputting a network model file; a second input interface for providing a simplified hardware description template to a user, and after the user inputs the hardware description file according to the hardware description template, automatically generating a computing array object and a memory hierarchy object that match the deep learning accelerator DLA performance modeling framework to obtain a virtual DLA hardware architecture, and using the virtual DLA hardware architecture to process the network model corresponding to the target network modeling file, wherein the computing array object corresponds to the computing system of the virtual DLA hardware architecture, and the memory hierarchy object corresponds to the memory system of the virtual DLA hardware architecture; an analysis model for analyzing 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.

[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 for inputting a network model file; a second input interface for providing a simplified hardware description template to the user, after the user inputs the hardware description file according to the hardware description template, automatically generating a computing array object and a memory hierarchy object matching the deep learning accelerator DLA performance modeling framework to obtain a virtual DLA hardware architecture, and using the virtual DLA hardware architecture to process the network model corresponding to the target network modeling file, wherein the computing array object corresponds to the computing system of the virtual DLA hardware architecture, and the memory hierarchy object corresponds to the memory system of the virtual DLA hardware architecture; an analysis model for analyzing 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 of different hardware architectures through a software modeling method, solving the problems of long hardware accelerator design cycle and high trial and error cost. Specifically, through the second input interface, the user can input simple hardware configuration information, and then automatically generate computing array objects and memory hierarchy objects, and finally obtain a complete hardware modeling object (i.e., virtual DLA hardware architecture). On the hardware modeling side, the modeling speed and efficiency are greatly improved, and the complexity of hardware design input is simplified, thereby solving the technical problem in related technologies that users customize complex hardware configuration files, resulting in inefficient and cumbersome hardware modeling. At the same time, it also solves the technical problem in related technologies that the use of a few fixed hardware design templates leads to low flexibility in hardware modeling.

[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 The structure block diagram of the DLA performance modeling system provided in the embodiment of the present application is shown (III);

[0019] Figure 6 A flowchart of a method for generating a hardware architecture in a DLA performance modeling system provided in an embodiment of the present application is shown;

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

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

[0022] Fig. 9 A structural block diagram of a deep learning accelerator performance testing device provided in an embodiment of the present application is shown;

[0023] Fig.10 A structural block diagram of a deep learning accelerator generation device provided in an embodiment of the present application is shown;

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

[0025] 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.

[0026] 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.

[0027] 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 1 As shown), the theoretically relatively accurate hardware cost, performance and execution efficiency are obtained. Usually, the performance modeling framework runs a "hardware-network-data flow" test sample in a very short time. By using appropriate modeling methods, sufficiently reliable accuracy and sufficiently convenient test processes can be obtained. However, there are many deficiencies in the hardware design modeling interface of the DLA performance modeling system in the related art: 1. Some modeling frameworks support flexible hardware parameter configuration, but correspondingly, the hardware description input is very complex, and it is difficult for users to maintain complex hardware design input. In addition, configuring a new architecture is very cumbersome and inefficient. Inexperienced users cannot obtain available hardware modeling objects when configuring, so the hardware design interface lacks practicality. 2. Some modeling frameworks only support a few fixed template hardware architectures. Although this method of hardware design input is very simple, the actual use environment of the modeling framework requires a large number of architectures with similar configuration parameters for horizontal comparison, so this hardware design input interface lacks universality.

[0028] 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.

[0029] 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.

[0030] 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:

[0031] The first input interface 202 is used to input a network model file. Optionally, the network model file may be a neural network model file. The 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.

[0032] The second input interface 204 is used to provide a simplified hardware description template to the user. After the user inputs the hardware description file according to the hardware description template, the computing array object and the memory hierarchy object matching the deep learning accelerator DLA performance modeling framework are automatically generated to obtain a virtual DLA hardware architecture, and the virtual DLA hardware architecture is used to process the network model corresponding to the target network modeling file, wherein the computing array object corresponds to the computing system of the virtual DLA hardware architecture, and the memory hierarchy object corresponds to the memory system of the virtual DLA hardware architecture. Optionally, the above-mentioned hardware description template can be a predefined (JavaScript Object Notation, referred to as Json) template, which is a lightweight data exchange format that can be used in a variety of programming languages ​​for data transmission, storage and exchange of data between the front and back ends. The above-mentioned hardware description template can be a template with good flexibility and low writing difficulty. The user can generate a virtual DLA hardware architecture with different parameter configurations by inputting simple hardware description information. The processing method of the network model corresponding to the target network modeling file processed by the above-mentioned virtual DLA hardware architecture can be to accelerate the processing of the network model.

[0033] 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 according to the virtual DLA hardware architecture. Optionally, in the embodiment of the present application, the analysis model 206 can analyze the hardware cost, performance, and execution efficiency of different parameters of DLA. That is, the embodiment of the present application can test the network-hardware deployment performance end-to-end.

[0034] pass Figure 2The system shown includes: a first input interface for inputting a network model file; a second input interface for providing a simplified hardware description template to the user, and after the user inputs the hardware description file according to the hardware description template, automatically generating a computing array object and a memory hierarchy object that match the deep learning accelerator DLA performance modeling framework to obtain a virtual DLA hardware architecture, and using the virtual DLA hardware architecture to process the network model corresponding to the target network modeling file, wherein the computing array object corresponds to the computing system of the virtual DLA hardware architecture, and the memory hierarchy object corresponds to the memory system of the virtual DLA hardware architecture; an analysis model for analyzing 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 of different hardware architectures through a software modeling method, solving the problems of long design cycle and high trial and error cost of hardware accelerators. Specifically, through the second input interface, the user can input simple hardware configuration information, and then automatically generate computing array objects and memory hierarchy objects, and finally obtain a complete hardware modeling object (i.e., virtual DLA hardware architecture). On the hardware modeling side, the modeling speed and efficiency are greatly improved, and the complexity of hardware design input is simplified, thereby solving the technical problem in related technologies that users customize complex hardware configuration files, resulting in inefficient and cumbersome hardware modeling. At the same time, it also solves the technical problem in related technologies that the use of a few fixed hardware design templates leads to low flexibility in hardware modeling.

[0035] In one possible implementation, Figure 3As shown, the second input interface includes: a definition module 302, which is used to define the hardware description template, wherein the hardware description template includes a multi-core hardware description template and a single-core hardware description template. The multi-core hardware description template includes multiple single-core descriptions, and the single-core description corresponds to the single-core description template. The single-core hardware description template includes: a computing array, an on-chip local buffer system, an on-chip global buffer, and an off-chip memory, wherein the computing array includes the size, quantity, and expanded dimension information of the spatial parallel dimension (four letters can be used to represent the four dimensions of spatial parallelism, and the size of each dimension is the number behind it. K, C, OX, and OY represent the output feature channel dimension, the input feature channel dimension, the output feature width dimension, and the output feature height dimension, respectively). The above-mentioned on-chip local buffer system includes the number of local buffers, the operands op stored in the local buffers (W refers to weight, I refers to input, O refers to output, and memory sharing is supported), and the capacity of the local buffers (in KB), wherein the on-chip local buffer system includes several local buffers; the on-chip global buffer includes the stored operands op, capacity (in MB), and bandwidth (in bits / clock cycle), wherein the number of the on-chip global buffers is 0 or 1; the off-chip memory is a dynamic random access memory DRAM, which includes the stored operands op, capacity (in GB, which may not be written and defaults to approximately infinity), and bandwidth (in bits / clock cycle), wherein the number of the off-chip memory is 0 or 1. The hardware architecture generator 304 is used to automatically generate computing array objects and memory hierarchy objects that match the DLA performance modeling framework after the user inputs the hardware description file according to the hardware description template to obtain the virtual DLA hardware architecture. Through the above-mentioned definition module 302 and hardware architecture generator 304, hundreds or thousands of hardware configurations with different parameters can be easily written, which is conducive to quickly and conveniently comparing hardware architecture designs under a variety of different parameter configurations.

[0036] The DLA performance modeling system provided in the embodiment of the present application supports multi-core or single-core. Correspondingly, the above-mentioned hardware architecture generator 304 is also used to generate one or more core configuration information according to the hardware description file to call the corresponding core generator to model the local components of the core, obtain the modeling objects of one or more cores, and package the modeling objects of the one or more cores and the inter-core interconnection information to obtain the virtual DLA hardware architecture. The modeling objects of the above-mentioned one or more cores can be the computing array objects and memory hierarchy objects corresponding to the core. Optionally, the embodiment of the present application supports multi-core or single-core, and the multi-core architecture generation supports multiple inter-core interconnections, where the interconnection methods include: bus, switch, ring, and grid.

[0037] like Figure 4As shown, the core generator includes: a first generation module 402, which is used to generate a calculation array object. It should be noted that the calculation array is a matrix array composed of processing elements (PEs). Optionally, the first generation module 402 is also used to set the calculation array parameters, wherein the parameters include input data precision (bits), single calculation energy consumption, and array space parallelism. A second generation module 404 is used to generate a register instance object. The register may include an input feature register, a weight register, and an output feature register, wherein the input feature register and the weight register have the same size (for example, the input feature register and the weight register are fixed to 8 bits, and the output feature register can be configured to 16 bits or 32 bits), the read and write bandwidth and size of the register are the same (this ensures that all data can be throughput in one clock cycle), and in terms of port configuration, the output feature register has two pairs of read and write ports (that is, two read ports and two write ports), the input feature register and the weight register have a pair of read and write ports, and the read and write energy consumption of the input feature register, the weight register, and the output feature register port can be set to no more than 0.03 (for example, the read and write energy consumption of the input feature register and the weight register port is 0.01, and the read and write energy consumption of the output feature register port is 0.03). Configuration module 406 is used to configure the register according to the spatial parallelism of the computing array. The above configuration module 406 is also used to calculate the number of the weight register / the input feature register / the output feature register and the corresponding broadcast number according to the dimensional information of the computing array. The number of weight registers is the product of four dimensions K, C, FX, and FY, the number of input feature registers is the product of four dimensions B, C, OX, and OY, and the number of output feature registers is the product of four dimensions B, K, OX, and OY. For example, if the dimensions of the calculation array are K:8, C:32, OX:2, and OY:2, then the number of weight registers is 8x32=256, and one weight register requires 2x2=4 broadcasts. The matching module 408 is used to match the local buffer bandwidth according to the configured registers. The bandwidth of the local buffer storing operand O should be the number of output feature registers multiplied by the bandwidth of a single output feature register, and the bandwidth of the local buffer storing operand I should be the number of input feature registers multiplied by the bandwidth of a single input feature register. The bandwidth of the local buffer storing operand W should be the number of weight registers multiplied by the bandwidth of a single weight register. The third generation module 410 is used to generate a local buffer instance. Optionally, the third generation module 410 is further configured to obtain the size of the local buffer and the number of stored operations from the core configuration information, and to set the port and the read and write energy consumption of the port.Among them, the size of the local buffer and the number of operands stored are obtained from the core configuration information, the bandwidth size has been calculated in the matching module 408, the port setting is internally fixed, and the read and write energy consumption of the port is estimated using the port energy consumption estimator built into the core generator, and the estimation logic is based on the size and bandwidth of the buffer. The fourth generation module 412 is used to determine whether to provide a global buffer configuration according to the core configuration information and generate a global buffer instance. This part of the logic is similar to the local buffer. The fifth generation module 414 is used to determine whether to provide a DRAM configuration according to the core configuration information and generate a DRAM instance. This part of the logic is similar to the local buffer, but the port energy consumption of the DRAM is fixed. It should be noted that the global buffer or DRAM may not be included. If this part of information is not provided in the core configuration information, no instance is generated. However, the global buffer and DRAM cannot be both absent. That is, the global buffer and DRAM can be both present, or there can be DRAM without a global buffer, or there can be a global buffer without DRAM. The setting module 416 is used to generate a memory hierarchy object based on the interconnection information between the register, the local buffer, the global buffer and / or the DRAM. Optionally, the setting module 416 can generate a first memory hierarchy object (the first memory hierarchy includes on-chip memory and off-chip memory) according to the interconnection information between the register, the local buffer, the global buffer and the DRAM, or generate a second memory hierarchy object (the second memory hierarchy includes on-chip memory) according to the interconnection information between the register, the local buffer and the global buffer, or generate a third memory hierarchy object (the third memory hierarchy includes on-chip memory and off-chip memory) according to the interconnection information between the register, the local buffer and the DRAM. The determination module 418 is used to package the computing array object and the memory hierarchy object to obtain a core modeling object.

[0038] Optionally, the setting module 416 is also used to set the upper and lower levels to be interconnected when the same operand is stored in any upper and lower levels of the register, the local buffer, the global buffer and / or the DRAM. As can be seen from the above, the core generator supports computing power configuration, register array configuration, on-chip local buffer size, bandwidth, port customization, on-chip global buffer parameter configuration, and off-chip DRAM parameter configuration, and has high flexibility and good versatility.

[0039] Since the above core configuration information is converted from the hardware description file input by the user, it is necessary to check the correctness. The embodiment of the present application also provides the following Figure 5 The core generator shown in the figure may also include a checking module 502 for checking the correctness of the core configuration information, for example, discarding an incorrect expression format and giving a prompt message.

[0040] The embodiments of the present application are described below with reference to specific examples.

[0041] This example describes the hardware design input and architecture generator processing flow of the deep learning accelerator performance modeling system as follows:

[0042] The simple hardware description is the hardware configuration information input to the hardware architecture generator, using a predefined json template description. The single core description contains four parts of the design description: computing array, on-chip local buffer system, on-chip global buffer, and off-chip memory. The above computing array contains the size, number, and expanded dimension information of spatial parallel dimensions. In the example, the four letters represent the four dimensions of spatial parallelism, and the size of each dimension is the number behind it. "K, C, OX, OY" represent "output feature channel dimension, input feature channel dimension, output feature width dimension, output feature height dimension" respectively; the on-chip local buffer system includes several local buffers, and the information should include the number of buffers, the number of operands op stored in each buffer (W refers to weight, I refers to input, O refers to output, and memory sharing is supported), and the capacity size (in KB); the on-chip global buffer is a global buffer, the number is fixed to 0 or 1, and the information includes the number of operands op stored, the capacity size (in MB), and the bandwidth size (in bits / clock cycle); the off-chip memory refers to DRAM, the number is fixed to 0 or 1, and the information includes the number of operands op stored, the capacity size (in GB, which can also be left blank, and the default is approximately infinite), and the bandwidth size (in bits / clock cycle). After the user provides the above simple hardware description, the hardware architecture generator generates core configuration information equal to the number of cores according to the user configuration, and then each core configuration information is used as the configuration information input of the core generator to call the core generator. After entering the core generator process, the local components of the core will be modeled in sequence according to the internal logic, and finally a core modeling object will be packaged and given to the hardware architecture generator. Finally, a series of core objects and inter-core interconnection information are packaged together to form a hardware architecture object as the output object of the core generator. The process of the core generator generating a core object based on the configuration information of a single core includes: the core configuration information is converted from a simple hardware description input by the user. First, the legality needs to be checked. For incorrect expression formats, an error is thrown and a prompt message is given. Generate a calculation array. The calculation array is a matrix array composed of computing units PE. The internal default parameters include input data precision (bits), single calculation energy consumption, and array space parallelism. Generate a register instance. The registers are divided into input feature registers (I-reg), weight registers (W-reg), and output feature registers (O-reg). The size of the first two is fixed to 8 bits, and the size of O-reg can be configured to 16 bits or 32 bits. The read and write bandwidth of the register is the same as the size, ensuring that all data can be throughput in one clock cycle. In terms of port configuration, O-reg has two read ports and two write ports respectively; I-reg and W-reg have only one pair of read / write ports. The read and write energy consumption of the port is 0.01 (I / W-reg) and 0.03 (O-reg). The registers are configured according to the spatial parallelism of the calculation array. According to the dimension expansion of the calculation array, the number of W / I / O registers and their broadcast number are calculated.The number of W-regs is the product of the four dimensions of K, C, FX, and FY; the number of I-regs is the product of the four dimensions of B, C, OX, and OY; and the number of O-regs is the product of the four dimensions of B, K, OX, and OY. For example, if the calculation array dimensions are K:8, C:32, OX:2, and OY:2, then the number of W-regs is 8x32=256, and the number of broadcasts required for one W-reg is 2x2=4. According to the configured register array, the bandwidth of the local buffer is matched. The bandwidth of the local buffer storing the operand O should be the number of O-regs multiplied by the bandwidth of a single O-reg, and the same applies to I and W. Generate a local buffer instance. The size of the local buffer and the operands stored are obtained from the core configuration information. The bandwidth size has been calculated in the previous step, and the port is set to be internally fixed. The read and write energy consumption of the port is estimated using the port energy consumption estimator built into the core generator. The estimation logic is based on the size and bandwidth of the buffer. Generate a global buffer instance based on whether the core configuration information provides a global buffer configuration. The logic is similar to that of the local buffer. Global buffer and DRAM can be excluded. If this information is not provided in the kernel configuration information, no instance is generated. Generate DRAM instance based on whether the kernel configuration information provides DRAM configuration. The logic is similar to local buffer, but the port power consumption of DRAM is fixed. Generate interconnection information between memory buffers and connect the above memory instances into memory hierarchy objects. If the upper and lower levels of memory store the same operands, they are considered to have an upper and lower interconnection relationship. Combine the computing array, on-chip memory system and off-chip memory, package them into a kernel object and output. See. Figure 6 Steps S601 to S617.

[0043] In summary, this solution proposes a hardware architecture generator for DLA performance modeling, which optimizes the hardware input interface of the modeling framework and has good hardware design flexibility and convenience. As the hardware description input interface of the performance modeling framework, the hardware architecture generator can generate specified hardware design objects from the simplified hardware configuration prompts input by the user. The simple hardware description has been carefully designed, with large customization space, good flexibility, low writing difficulty, and high fault tolerance. The hardware architecture generator adopts an automated process, has good flexibility and convenience, and its use can greatly improve the modeling efficiency. By standardizing the hardware configuration description input and architecture generator process, this solution simplifies the network-hardware deployment process, simplifies the evaluation process of deployment performance testing in the field of neural network accelerator modeling, improves modeling efficiency, and ensures the reliability and practicality of cost evaluation.

[0044] 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 7The flowchart of a deep learning accelerator performance testing method according to an embodiment of the present application is shown. The method may include:

[0045] S702, using 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 for inputting a network model file. The network model file may be a neural network model file. The above-mentioned 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. A second input interface is used to provide a simplified hardware description template to the user, and after the user inputs the hardware description file according to the hardware description template, automatically generate a computing array object and a memory hierarchy object that match the deep learning accelerator DLA performance modeling framework to obtain a virtual DLA hardware architecture, and use the virtual DLA hardware architecture to process the network model corresponding to the target network modeling file, wherein the computing array object corresponds to the computing system of the virtual DLA hardware architecture, and the memory hierarchy object corresponds to the memory system of the virtual DLA hardware architecture. Optionally, the hardware description template may be a predefined (JavaScript Object Notation, referred to as Json) template. Json is a lightweight data exchange format that can be used in a variety of programming languages ​​for data transmission, storage and data exchange between the front and back ends. The hardware description template may be a template with good flexibility and low writing difficulty. The user can generate a virtual DLA hardware architecture with different parameter configurations by inputting simple hardware description information. The processing method of the network model corresponding to the target network modeling file processed by the virtual DLA hardware architecture may be to accelerate the processing of the network model. 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. Optionally, in an embodiment of the present application, the analysis model can analyze the hardware cost, performance and execution efficiency of different parameters of DLA. That is, the embodiment of the present application can test the network-hardware deployment performance end-to-end. That is, the embodiment of the present application simulates the performance of accelerators of different hardware architectures through a software modeling method, solving the problems of long hardware accelerator design cycle and high trial and error cost. Specifically, through the second input interface, users can input simple hardware configuration information, and then automatically generate computing array objects and memory hierarchy objects, and finally obtain a complete hardware modeling object (i.e., virtual DLA hardware architecture). On the hardware modeling side, the modeling speed and efficiency are greatly improved, and the complexity of hardware design input is simplified, thereby solving the technical problem in related technologies that users customize complex hardware configuration files, resulting in inefficient and cumbersome hardware modeling. At the same time, it also solves the technical problem in related technologies that the use of a few fixed hardware design templates leads to low flexibility in hardware modeling.The target data stream may be hardware configuration data of different parameters.

[0046] S704: Test the DLA performance according to the output result of the DLA performance modeling system.

[0047] Through the above steps S702 to S704, a simple hardware description input is used at the hardware modeling end of the DLA performance modeling system to automatically generate hardware design objects that can be used in the modeling framework, so that the DLA performance of different parameters can be tested. In the field of DLA performance modeling, the evaluation process and time are extremely conveniently shortened, the modeling efficiency is improved, and the reliability and accuracy of the cost evaluation are guaranteed.

[0048] 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 8 The flowchart of a method for generating a deep learning accelerator according to an embodiment of the present application is shown, including:

[0049] S802, testing the target DLA using the deep learning accelerator performance testing method;

[0050] S804, 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 description 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.

[0051] Through the above S802 to S804, 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.

[0052] 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. Fig. 9 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:

[0053] The execution module 902 is used to execute the target data flow using the above-mentioned DLA performance modeling system.

[0054] Optionally, the DLA performance modeling system includes: a first input interface for inputting a network model file. The network model file may be a neural network model file. The 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. A second input interface is used to provide a simplified hardware description template to the user, and after the user inputs the hardware description file according to the hardware description template, automatically generate a computing array object and a memory hierarchy object that match the deep learning accelerator DLA performance modeling framework to obtain a virtual DLA hardware architecture, and use the virtual DLA hardware architecture to process the network model corresponding to the target network modeling file, wherein the computing array object corresponds to the computing system of the virtual DLA hardware architecture, and the memory hierarchy object corresponds to the memory system of the virtual DLA hardware architecture. Optionally, the hardware description template may be a predefined (JavaScript Object Notation, referred to as Json) template, which 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. The hardware description template can be a template with good flexibility and low writing difficulty. The user can generate a virtual DLA hardware architecture with different parameter configurations by inputting simple hardware description information. The processing method of the network model corresponding to the target network modeling file processed by the virtual DLA hardware architecture can be to accelerate the processing of the network model. 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. Optionally, in an embodiment of the present application, the analysis model can analyze the hardware cost, performance and execution efficiency of different parameters of DLA. That is, the embodiment of the present application can test the network-hardware deployment performance end-to-end. In other words, the embodiment of the present application simulates the performance of accelerators of different hardware architectures through a software modeling method, solving the problems of long design cycle and high trial and error cost of hardware accelerators. Specifically, through the second input interface, the user can input simple hardware configuration information, and then automatically generate computing array objects and memory hierarchy objects, and finally obtain a complete hardware modeling object (that is, a virtual DLA hardware architecture). On the hardware modeling side, the modeling speed and efficiency are greatly improved, and the complexity of hardware design input is simplified, thereby solving the technical problem in related technologies that users customize complex hardware configuration files, resulting in inefficient and cumbersome hardware modeling. At the same time, it also solves the technical problem in related technologies that the use of a few fixed hardware design templates leads to low flexibility in hardware modeling. The above target data stream can be hardware configuration data with different parameters.

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

[0056] pass Fig. 9 The device shown uses a simple hardware description input from the hardware modeling end of the DLA performance modeling system to automatically generate hardware design objects that can be used in the modeling framework, and can test the DLA performance of different parameters. In the field of DLA performance modeling, it extremely conveniently shortens the evaluation process and time, improves modeling efficiency, and ensures the reliability and accuracy of cost evaluation.

[0057] 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. Fig.10 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:

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

[0059] Design module 1004 is used to generate 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 description file can 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.

[0060] pass Fig.10 The 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.

[0061] 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.

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

[0063] The electronic device also includes:

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

[0065] If the memory 1101, the processor 1102 and the communication interface 1103 are implemented independently, the memory 1101, the processor 1102 and the communication interface 1103 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.11 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.

[0066] Optionally, in a specific implementation, if the memory 1101, the processor 1102 and the communication interface 1103 are integrated on a chip, the memory 1101, the processor 1102 and the communication interface 1103 can communicate with each other through an internal interface.

[0067] 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.

[0068] 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.

[0069] 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.

[0070] 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.

[0071] 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).

[0072] 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.

[0073] 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.

[0074] 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.

[0075] 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.

[0076] 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.

[0077] 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.

[0078] 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.

[0079] 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, comprising: The first input interface is used to input the network model file; A second input interface is used to provide a simplified hardware description template to a user, and after the user inputs a hardware description file according to the hardware description template, automatically generate a computing array object and a memory hierarchy object that match the deep learning accelerator DLA performance modeling framework to obtain a virtual DLA hardware architecture, and use the virtual DLA hardware architecture to process the network model corresponding to the target network modeling file, wherein the computing array object corresponds to the computing system of the virtual DLA hardware architecture, and the memory hierarchy object corresponds to the memory system of the virtual DLA hardware architecture; 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, wherein: The second input interface comprises: A definition module, used to define the hardware description template, wherein the hardware description template includes a multi-core hardware description template and a single-core hardware description template; A hardware architecture generator is used to automatically generate computing array objects and memory hierarchy objects matching the DLA performance modeling framework after the user inputs a hardware description file according to the hardware description template, so as to obtain the virtual DLA hardware architecture.

3. The system according to claim 2, wherein: The single-core hardware description template includes: a computing array, an on-chip local buffer system, an on-chip global buffer, and an off-chip memory, wherein: The computing array includes the size, quantity, and expanded dimension information of the spatial parallel dimension; The on-chip local buffer system includes the number of local buffers, the number of operands op stored in the local buffers, and the capacity of the local buffers, wherein the on-chip local buffer system includes a plurality of local buffers; The on-chip global buffer includes a stored operand op, a capacity, and a bandwidth, wherein the number of the on-chip global buffers is 0 or 1; The off-chip memory is a dynamic random access memory DRAM, which contains stored operands OP, capacity, and bandwidth. The number of the off-chip memories is 0 or 1.

4. The system according to claim 3, wherein: The multi-core hardware description template includes multiple single-core descriptions, and the single-core descriptions correspond to the single-core description template.

5. The system according to claim 4, wherein: The hardware architecture generator is also used to generate one or more core configuration information according to the hardware description file, so as to call the corresponding core generator to model the local components of the core, obtain the modeling objects of one or more cores, and after packaging the modeling objects of the one or more cores and the interconnection information between the cores, obtain the virtual DLA hardware architecture.

6. The system according to claim 5, wherein: The core generator comprises: A first generating module, used for generating a calculation array object; A second generation module, used for generating a register instance object; A configuration module, configured to configure the register according to the spatial parallelism of the computing array; A matching module, for matching a local buffer bandwidth according to a configured register; A third generation module, used to generate a local buffer instance; a fourth generating module, configured to determine whether to provide a global buffer configuration according to the core configuration information, and to generate a global buffer instance; A fifth generating module, used to determine whether to provide DRAM configuration according to the core configuration information, and generate a DRAM instance; A setting module, configured to generate a memory hierarchy object according to interconnection information between the register, the local buffer, the global buffer and / or the DRAM; A determination module is used to package the computing array object and the memory hierarchy object to obtain a core modeling object.

7. The system according to claim 6, wherein: The core generator further includes: a checking module, configured to check the correctness of the core configuration information.

8. The system according to claim 6, wherein: The first generation module is also used to set the calculation array parameters, wherein the parameters include input data accuracy, single calculation energy consumption, and array space parallelism; The register includes an input feature register, a weight register, and an output feature register, wherein the input feature register and the weight register have the same size, the read and write bandwidth and size of the registers are the same, the output feature register has two pairs of read and write ports, the input feature register and the weight register have a pair of read and write ports, and the read and write energy consumption of the input feature register, the weight register, and the output feature register ports is set to be no more than 0.03; The configuration module is further used to calculate the number of the weight registers / the input feature registers / the output feature registers and the corresponding broadcast number according to the dimension information of the expanded computing array; The third generation module is further used to obtain the size of the local buffer and the stored operands from the core configuration information, and to set the port and the read and write energy consumption of the port.

9. The system according to claim 8, wherein: The setting module is also used to set an interconnection relationship between any two levels in the register, the local buffer, the global buffer and / or the DRAM when the same operand is stored in any two levels.

10. A deep learning accelerator performance testing method, comprising: 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, comprising: 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

  • Discovering hardware characteristics of deep learning accelerator via compiler for optimization

    CN116601645A

  • Performance prediction apparatus and performance model generation method

    JP2015141552A