Heterogeneous acceleration processor and data computing method

By designing a heterogeneous acceleration processor, combined with a convolutional PE array and a vector calculation control unit, the resource waste problem of traditional neural network processors in logical judgment and scalar/vector calculations is solved, achieving flexible computing and resource saving, and improving Computational efficiency and multi-tasking parallelism capabilities.

CN114595813BActive Publication Date: 2024-09-06TSINGHUA UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210132954.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-14
Publication Date
2024-09-06
Estimated Expiration
2042-02-14

AI Technical Summary

Technical Problem

Traditional neural network processors cannot flexibly process data when performing logical judgments or scalar/vector calculations, resulting in a waste of resources, too many computing arrays and storage resources, and a large area.

Method used

Design a heterogeneous acceleration processor, including a computing module, a storage module RAM and a CPU. The computing module includes a convolutional PE array and a vector computing control unit. The vector computing control unit controls the PE unit to perform vector computing, avoiding the need for an additional general-purpose CPU. Waste of computing resources.

Benefits of technology

It realizes flexible neural network convolution calculation and vector calculation, reduces resource waste, saves chip area and power consumption, and supports multi-task parallel execution, improving computing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114595813B
    Figure CN114595813B
Patent Text Reader

Abstract

The present invention discloses a heterogeneous acceleration processor and a data calculation method, the heterogeneous acceleration processor comprises: a calculation module, comprising a convolution PE array and a vector calculation control unit; a storage module RAM is used to store data; a CPU is used to send a vector calculation instruction to the calculation module; the convolution PE array comprises a plurality of PE units, the PE units are used to perform neural network convolution calculation on the original data; the data sorting and transformation module is used to sort and transform the intermediate data output by the calculation module to obtain result data; the vector calculation control unit is used to control at least one PE unit to perform vector calculation; the PE unit is also used to perform vector calculation on the original data or the intermediate data under the control of the vector calculation control unit; after receiving the vector calculation instruction, the data in the vector calculation instruction is vector calculated. The present invention can flexibly perform neural network convolution calculation and vector calculation, and can avoid waste of resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a heterogeneous acceleration processor and a data computing method. Background Art

[0002] This section is intended to provide a background or context to the embodiments of the invention recited in the claims. No admission is made that the description herein is prior art by inclusion in this section.

[0003] In traditional neural network processors, multiple computing units are controlled in a data-driven manner, and can only perform full or partial parallel array processing. When the neural network processor needs to perform some logical judgments or scalar / vector calculation functions, since the dedicated neural network processor is highly optimized for neural network calculations, the data path and computing array are fixed, and it is often not possible to flexibly move and calculate data. Some general conventional calculations and logical judgments cannot be well supported, and there is room for optimization. Traditional neural network processors have more computing arrays and on-chip storage resources and larger areas. In some application scenarios that do not have strong demand for neural network calculations, more general-purpose CPU computing resources are needed. If an additional CPU general-purpose processor is implemented inside the chip alone, there will be a waste of resources. Summary of the invention

[0004] An embodiment of the present invention provides a heterogeneous acceleration processor for flexibly performing calculations such as neural network convolution calculations and vector calculations, and avoiding waste of resources. The heterogeneous acceleration processor includes:

[0005] A computing module, a storage module RAM, a CPU and a data sorting and transformation module, wherein the computing module includes a convolution PE array and a vector computing control unit;

[0006] The RAM is used to store original data, intermediate data and result data;

[0007] The CPU is used to send the vector calculation instruction to the calculation module;

[0008] The convolution PE array includes a plurality of PE units, and the PE units are used to perform neural network convolution calculations on original data;

[0009] The data sorting and transformation module is used to sort and transform the intermediate data output by the calculation module to obtain result data;

[0010] The vector calculation control unit is used to control at least one PE unit to perform vector calculation;

[0011] The PE unit is also used to perform vector calculation on original data or intermediate data under the control of the vector calculation control unit; after receiving a vector calculation instruction, perform vector calculation on the data in the vector calculation instruction.

[0012] The embodiment of the present invention further provides a data calculation method based on a heterogeneous acceleration processor, which is used to flexibly perform calculations such as neural network convolution calculations and vector calculations, and can avoid waste of resources. The method is applied to the aforementioned heterogeneous acceleration processor, and includes:

[0013] After receiving the neural network convolution calculation instruction, the calculation module performs the neural network convolution calculation on the original data stored in the storage module RAM to obtain intermediate data, and the data sorting and transformation module sorts and transforms the intermediate data to obtain result data;

[0014] After receiving the vector calculation instruction, the vector calculation control unit controls the calculation module to perform vector calculation to obtain intermediate data, and the data sorting and transformation module sorts and transforms the intermediate data to obtain result data.

[0015] In an embodiment of the present invention, the computing module includes a convolution PE array and a vector computing control unit; the RAM is used to store original data, intermediate data and result data; the CPU is used to send vector computing instructions to the computing module; the convolution PE array includes multiple PE units, and the PE units are used to perform neural network convolution calculations on the original data; the data sorting and transformation module is used to sort and transform the intermediate data output by the computing module to obtain result data; the vector computing control unit is used to control at least one PE unit to perform vector computing; the PE unit is also used to perform vector computing on the original data or the intermediate data under the control of the vector computing control unit; after receiving the vector computing instruction, the data in the vector computing instruction is vectorized. Compared with the existing technical solutions, while the original data is directly subjected to neural network processing by the PE unit, the PE unit can be controlled by the vector computing control unit to perform vector computing, and the CPU only needs to send vector computing instructions, without more general CPU computing resources, thus avoiding resource waste. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0017] Figure 1Schematic diagram of a heterogeneous acceleration processor in an embodiment of the present invention Figure 1 ;

[0018] Figure 2 Schematic diagram of a heterogeneous acceleration processor in an embodiment of the present invention Figure 2 ;

[0019] Figure 3 Schematic diagram of a heterogeneous acceleration processor in an embodiment of the present invention Figure 3 ;

[0020] Figure 4 The process of the data calculation method based on the heterogeneous acceleration processor in the embodiment of the present invention is as follows Figure 1 ;

[0021] Figure 5 The process of the data calculation method based on the heterogeneous acceleration processor in the embodiment of the present invention is as follows Figure 2 ;

[0022] Figure 6 The process of the data calculation method based on the heterogeneous acceleration processor in the embodiment of the present invention is as follows Figure 3 . DETAILED DESCRIPTION

[0023] To make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings. Here, the exemplary embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.

[0024] First, the terms involved in the embodiments of the present invention are explained.

[0025] AI: Artificial Intelligence is a branch of computer science that attempts to understand the essence of intelligence and produce a new type of intelligent machine that can respond in a similar way to human intelligence.

[0026] PE: Processing Element, processing unit. A computing array (PE array) is composed of a series of PE arrays.

[0027] CPU: central processing unit, as the computing and control core of the computer system, is the final execution unit of information processing and program running.

[0028] GPU: graphics processing unit, a microprocessor that specializes in performing image and graphics-related calculations on a device.

[0029] Neural network processor: neural-network processing unit, a neural network processor, is a microprocessor that is specifically designed to perform neural network-related calculations on the device.

[0030] Multi-core processor: Two or more complete computing engines (cores) are integrated into one processor. In this case, the processor can support multiple processors on the system bus, and all bus control signals and command signals are provided by the bus controller.

[0031] Heterogeneity: Enable collaborative computing and mutual acceleration between computing units using different types of instruction sets and architectures, effectively solving problems such as energy consumption and scalability.

[0032] As the computing and control core of the computer system, the CPU is the final execution unit for information processing and program running. The von Neumann architecture is the foundation of modern computers. Under this architecture, programs and data are stored in a unified manner, instructions and data need to be accessed from the same storage space, transmitted via the same bus, and cannot be executed overlappingly. According to the von Neumann system, the work of the CPU is divided into the following five stages: instruction fetch stage (IF), instruction decoding stage (ID), instruction execution stage (EX), memory access stage (WM) and result write back stage (WB).

[0033] The CPU is the core component of the computer that is responsible for reading instructions, decoding instructions and executing instructions. The central processing unit mainly consists of two parts, namely the controller and the arithmetic unit, which also includes a cache memory and a data and control bus that realizes the connection between them. The three core components of an electronic computer are the CPU, internal memory, and input / output devices. The functions of the central processing unit are mainly to process instructions, execute operations, control time, and process data. In the computer architecture, the CPU is the core hardware unit that controls and allocates all the hardware resources of the computer (such as memory, input and output units) and performs general operations. The CPU is the computing and control core of the computer. The operations of all software layers in the computer system will eventually be mapped to the operations of the CPU through the instruction set.

[0034] GPU reduces the graphics card's dependence on the CPU and performs some of the work originally done by the CPU. Especially in 3D graphics processing, the core technologies used by GPU include hardware T&L (geometry transformation and lighting processing), cubic environment material mapping and vertex blending, texture compression and bump mapping, dual texture four-pixel 256-bit rendering engine, etc. Hardware T&L technology can be said to be the symbol of GPU.

[0035] Neural network processors, also known as neural network accelerators or computing cards, or deep learning processors, are modules specifically designed to handle large amounts of computing tasks in intelligent applications (other non-computing tasks are still handled by the CPU). Many data processing operations of neural networks involve matrix multiplication and addition. GPUs that work in large numbers in parallel provide a cheap method, but the disadvantage is that GPUs require higher power. FPGAs with built-in DSP modules and local memory are more energy-efficient, but they are generally more expensive. Deep learning refers to multi-layer neural networks and methods of training them. Neural network processors, in layman's terms, refer to learning, judging, and making decisions through deep neural networks that simulate the mechanisms of the human brain.

[0036] An accelerator generally refers to a hardware structure used to accelerate a certain computing mode or process, including specific hardware logic unit optimization and pipeline processing optimization. For a specific computing mode, such as machine learning, traditional computing processors such as CPUs and GPUs need to adopt a general computing architecture and implementation to complete, which often makes it difficult to maximize computing speed and efficiency. The computing accelerator proposed in the present invention designs and optimizes specific computing modes from the hardware bottom layer, which can reduce computing time, increase computing efficiency, and achieve the effect of accelerated computing. For example, an artificial neural network processor using a dedicated computing architecture is often faster than a general-purpose processor in computing speed and better performance, and has more advantages in specific application scenarios.

[0037] A multi-core processor is a processor that integrates two or more complete computing engines (cores) in one processor. In this case, the processor can support multiple processors on the system bus, and the bus controller provides all bus control signals and command signals. The development of multi-core technology stems from the engineers' realization that simply increasing the speed of a single-core chip will generate too much heat and will not bring corresponding performance improvements, as was the case with previous processor products. In previous products, at that rate, the heat generated by the processor would be too high. Even without the heat problem, its cost-effectiveness is unacceptable, and a slightly faster processor is much more expensive. The advantages of multi-core technology in application are two-fold: it brings users more powerful computing performance; more importantly, it can meet the user's requirements for simultaneous multi-tasking and multi-tasking computing environments.

[0038] Commonly used processor chips include CPU, DSP, GPU, FPGA, ASIC, etc. CPU & GPU require software support, while FPGA & ASIC is a hardware-software integrated architecture, where software is hardware. In terms of energy consumption ratio: ASIC>FPGA>GPU>CPU. The fundamental reason for this result is that for computationally intensive algorithms, the higher the data movement and computing efficiency, the higher the energy consumption ratio. ASIC and FPGA are both closer to the underlying IO, so they have high computing efficiency and high data movement, but FPGA has redundant transistors and connections, and its operating frequency is low, so it does not have a high energy consumption ratio of ASIC. GPU and CPU are both general-purpose processors, and both need to perform the process of fetching instructions, decoding instructions, and executing instructions. In this way, the processing of the underlying IO is shielded, making the software and hardware decoupled, but it does not achieve higher efficiency in data movement and computing, so it does not have a high energy consumption ratio of ASIC and FPGA. The difference in energy consumption ratio between GPU and CPU is mainly because most of the transistors in the CPU are used in cache and control logic units. Therefore, compared with GPU, for algorithms that are computationally intensive and low in computational complexity, the redundant transistors of CPU cannot play a role, and the energy consumption ratio of CPU is lower than that of GPU.

[0039] In the long-term development process of each processor chip, some distinct characteristics of use and market have been formed. There are a large number of open source software and application software in the CPU & GPU field. Any new technology will first use the CPU to implement the algorithm. Therefore, the resources for CPU programming are abundant and easy to obtain, and the development cost is low and the development cycle is long. The implementation of FPGA uses low-level hardware description languages ​​such as Verilog / VHDL, which requires developers to have a deeper understanding of the chip characteristics of FPGA, but its high parallelism characteristics can often improve business performance by orders of magnitude; at the same time, FPGA is dynamically reconfigurable. After being deployed in the data center, different logics can be configured according to the business form to implement different hardware acceleration functions; for example, the FPGA board on the current server deploys image compression logic to serve the QQ business; at this time, real-time advertising prediction needs to be expanded to obtain more FPGA computing resources. Through a simple FPGA reconfiguration process, the FPGA board can be transformed into "new" hardware to serve real-time advertising prediction, which is very suitable for batch deployment. ASIC chips can achieve optimal performance, namely high area utilization, high speed and low power consumption; however, the development of neural network SC is extremely risky and requires a sufficiently large market to guarantee the cost price. In addition, the time cycle from R&D to market is very long, which makes it unsuitable for fields where algorithms such as deep learning CNN are rapidly iterating.

[0040] In the prior art, when the neural network processor needs to perform some logical judgment or scalar / vector calculation functions, it cannot flexibly move and calculate data, and cannot well support some general conventional calculations and logical judgments, so there is room for optimization. In addition, the traditional neural network processor has more computing arrays and on-chip storage resources, and the area is large, which leads to resource waste. Therefore, an embodiment of the present invention proposes a heterogeneous acceleration processor to solve the above problems.

[0041] Figure 1 Schematic diagram of a heterogeneous acceleration processor in an embodiment of the present invention Figure 1 ,include:

[0042] A computing module, a storage module RAM, a CPU and a data sorting and transformation module, wherein the computing module includes a convolution PE array and a vector computing control unit;

[0043] The RAM is used to store original data, intermediate data and result data;

[0044] The CPU is used to send the vector calculation instruction to the calculation module;

[0045] The convolution PE array includes a plurality of PE units, and the PE units are used to perform neural network convolution calculations on original data;

[0046] The data sorting and transformation module is used to sort and transform the intermediate data output by the calculation module to obtain result data;

[0047] The vector calculation control unit is used to control at least one PE unit to perform vector calculation;

[0048] The PE unit is also used to perform vector calculation on original data or intermediate data under the control of the vector calculation control unit; after receiving a vector calculation instruction, perform vector calculation on the data in the vector calculation instruction.

[0049] It should be noted that the above-mentioned neural network convolution calculation includes matrix calculation, logical judgment, etc., and the vector calculation includes scalar calculation, logical judgment, etc.

[0050] There are multiple embodiments of the heterogeneous acceleration processor proposed in the embodiment of the present invention.

[0051] Embodiment 1

[0052] The heterogeneous acceleration processor proposed in the present invention is a new neural network / CPU heterogeneous acceleration processor architecture that integrates convolution / matrix calculation, logical judgment, and scalar / vector calculation functions. It deeply integrates neural network convolution calculation with CPU logic, and all or part of the PE units can be reconstructed into vector calculation units suitable for matching CPUs. When performing neural network convolution calculations, the PE unit is configured as a neural network calculation unit, such as CNN convolution calculations. When used as a CPU calculation, it is configured as a vector calculation unit to perform vector calculations.

[0053] In the above embodiments, two solutions for heterogeneous acceleration processors are provided.

[0054] Solution 1: All PE units can perform neural network convolution calculations, and perform vector calculations on original data or intermediate data under the control of the vector calculation control unit.

[0055] Solution 2: All PE units can perform neural network convolution calculations, and some PE units can perform vector calculations on original data or intermediate data under the control of a vector calculation control unit.

[0056] In one embodiment, the original data includes weight data and feature map data;

[0057] The RAM includes a weight storage module and a feature map storage module;

[0058] The rights storage module is used to store rights data;

[0059] The feature map storage module is used to store feature map data.

[0060] In the above embodiment, the original data is the original data required for the convolution calculation of the neural network.

[0061] In one embodiment, the convolutional PE array further includes a normalization and activation function module and a pooling module;

[0062] The PE unit is specifically used to perform convolutional network matrix calculation on the feature map data using weight data to obtain a first result; or to perform vector calculation on the original data or intermediate data under the control of the vector calculation control unit to obtain a first result; or to perform vector calculation on the data in the vector calculation instruction after receiving the vector calculation instruction to obtain a first result;

[0063] The normalization and activation function module is used to perform batch normalization calculation and function activation on the first result to obtain the second result;

[0064] The pooling module is used to perform pooling calculation on the second result to obtain intermediate data.

[0065] In the above embodiment, the entire calculation module performs convolution network matrix calculation on the feature map data using weight data to implement the convolution layer. The calculation module implements the function of convolution calculation or general matrix calculation in this calculation. The implementation method is mainly to slide multiple sets of weight data on the feature map data in parallel to calculate multiple sets of convolution results.

[0066] Among them, the normalization and activation function module is used for batch normalization (batch norm) and function activation (Activation) implementation. Batch normalization is mainly a multiplication followed by addition operation. In some optimizations, batch normalization calculations are integrated into convolution calculations. Activation functions include commonly used relu, sigmoid, tanh, etc.

[0067] Among them, the pooling module is used for pooling of convolution results. Usually, a feature map with a large dimension is obtained after the convolution layer. The feature map is downsampled, that is, the feature map is evenly cut into multiple regions, and the maximum value or average value in each region is taken to obtain a new feature with a smaller dimension. The most common pooling operations are average pooling and maximum pooling. Average pooling: Calculate the average value of each small area of ​​the feature map as the value after pooling. Maximum pooling: Calculate the maximum value of each small area of ​​the feature map as the value after pooling.

[0068] The data arrangement and transformation module is used for data arrangement and transformation. It contains a feature map buffer, which is used to process the feature map and change its shape or dimension so that the feature map is suitable for the input requirements of the next layer of calculation. The arranged feature map is sent to RAM or off-chip memory.

[0069] In one embodiment, the vector computing unit includes one or any combination of an ALU, a MAC and a vector parallel acceleration unit.

[0070] Among them, the vector parallel acceleration unit is a unit that can provide vector calculations in addition to ALU and MAC.

[0071] In one embodiment, at least one PE unit in the convolution PE array can be reconfigured as a vector computing unit adapted to a CPU;

[0072] The vector calculation unit is used to perform vector calculation on original data or intermediate data; after receiving a vector calculation instruction, the vector calculation is performed on the data in the vector calculation instruction.

[0073] In the above embodiments, two other solutions of heterogeneous acceleration processors are provided.

[0074] Solution 3: All PE units can perform neural network convolution calculations, and when vector calculations are required, all PE units can be reconstructed into vector calculation units. The vector calculation units can perform vector calculations on original data or intermediate data under the control of a vector calculation control unit.

[0075] Solution 4: All PE units can perform neural network convolution calculations, and when vector calculations are required, some PE units can be reconstructed into vector calculation units. The vector calculation units can perform vector calculations on original data or intermediate data under the control of a vector calculation control unit.

[0076] In addition, in the four schemes from scheme 1 to scheme 4, the CPU can send vector calculation instructions to the calculation module because the conventional CPU does not have vector calculation capabilities. The heterogeneous acceleration processor of the present invention combines neural network convolution calculations with the CPU processing flow. Specifically, the CPU sends instructions (vector calculation instructions) after the instruction decoding stage (ID) to the PE unit of the heterogeneous acceleration processor to implement vector calculations. When the reconstructed vector calculation unit of the CPU performs vector calculations, it displays the status of executing vector calculations. In addition, the calculation results of the calculation module will also be transmitted back to the CPU, mainly in the instruction execution stage (EX).

[0077] In Plans 1 to 4, the deep integration of neural network convolution computing array resources and CPU computing and logic functions is achieved to further improve the computing speed and reduce overall power consumption.

[0078] Embodiment 2

[0079] In this embodiment, the heterogeneous acceleration processor proposed in the present invention simultaneously integrates and reuses RAM resources to form a new type of heterogeneous acceleration processor that integrates CPU vector calculations and neural network convolution calculations and shares RAM resources. The RAM is divided into multiple groups, each group containing the cache or RAM required by each CPU. After the RAM resources are deeply shared by the CPU, the data results obtained by the neural network calculation can be stored in the RAM. The CPU processing directly uses the results obtained by the neural network convolution processing, and there is no need to move data through the bus again to achieve sharing of the calculation results with the neural network processor for collaborative calculation.

[0080] Figure 2 Schematic diagram of heterogeneous processing in an embodiment of the present invention Figure 2 In one embodiment, the RAM includes a plurality of RAM groups, each RAM group includes a weight storage module and a feature map storage module.

[0081] In the above embodiment, when performing a neural network convolution calculation mode, the above RAM grouping supports the simultaneous use of resources of each RAM grouping.

[0082] In one embodiment, the RAM includes an instruction RAM and a data RAM;

[0083] The instruction RAM is used to store instructions; the data RAM is used to store original data, intermediate data and result data;

[0084] The CPU is also used to read instructions from the instruction RAM and read data from the data RAM.

[0085] In the above embodiment, in the CPU vector calculation mode, the existing RAM can be reconstructed into instruction RAM (Data RAM, IRAM) and data RAM (Instruction RAM, DRAM).

[0086] The instructions stored in the instruction RAM may be instructions of the vector calculation control unit. Vector calculation is performed on the data according to the read instructions. The data may be the result of calculation in the neural network convolution calculation mode, including the original result and the intermediate result. In this way, the CPU directly uses the data already stored in the DRAM to perform vector and logic judgment operations. In this way, the CPU can share the calculation results with the convolution PE unit that performs the neural network convolution calculation without moving the data through the bus again, and perform collaborative calculation.

[0087] Embodiment 3

[0088] The embodiment of the present invention proposes to fuse multiple groups of single heterogeneous acceleration processors to form a new type of multi-core heterogeneous acceleration processor that integrates the computational fusion and storage sharing of multi-core CPUs and multi-core neural network processors. The heterogeneous acceleration processors for parallel computing are grouped and fused to form a design scheme that is suitable for both vector computing and neural network convolution computing. Among them, multiple groups of vector computing units (convolution PE units reconstructed by convolution PE units or controlled by vector computing control units to perform vector computing) and RAM are added to the CPU instruction pipeline logic to design a multi-core CPU processor integrated architecture. In this way, a multi-core CPU vector computing structure can be formed when a multi-core CPU is required, such as a robot autonomous navigation scenario, and when neural network computing is required, it is configured as a neural network convolution computing mode to perform CNN, DNN computing, etc.

[0089] Figure 3 Schematic diagram of a heterogeneous acceleration processor in an embodiment of the present invention Figure 3 In one embodiment, there are multiple computing modules, and the multiple computing modules can perform neural network convolution calculations or vector calculations in parallel.

[0090] A plurality of heterogeneous acceleration processors constitute a many-core heterogeneous acceleration processor array, wherein each heterogeneous acceleration processor can perform the solutions of the first embodiment and the second embodiment.

[0091] When large-scale parallel convolution or matrix calculation of the neural network is required, multiple heterogeneous acceleration processors perform neural network convolution calculations, such as pipeline calculations of convolution, batchnorm, ativatioin, and pooling operations.

[0092] When performing vector calculations, each RAM is reconstructed into IRAM and DRAM, and each computing module is reconstructed into a computing module containing a vector computing unit adapted to the CPU. Multi-core vector calculations are performed on the convolution calculation results of the neural network to achieve the purpose of multi-task parallel execution.

[0093] In summary, the heterogeneous acceleration processor proposed in the embodiment of the present invention has the following beneficial effects:

[0094] First, the convolution PE array of the traditional neural network processor is deeply integrated with the vector computing unit adapted to the CPU. According to different computing requirements, the neural network convolution computing mode and the CPU vector computing mode are adopted respectively. This can reduce the waste of area and power consumption caused by the traditional separate neural network processor computing array and CPU vector design and implementation.

[0095] Second, the RAM on-chip resources are deeply integrated and shared, and configured as corresponding storage modes in different computing modes. Compared with the RAM of independent neural network processors and the RAM of CPU general processors, it saves chip area and reduces chip power consumption.

[0096] Third, a multi-core heterogeneous acceleration processor array has been realized, which can integrate the computing fusion and storage sharing of multi-core CPUs and multi-core neural network processors, and can perform multiple tasks in parallel to achieve the effects of increased running speed and reduced power consumption in multi-tasking scenarios for specific scenarios.

[0097] The present invention also provides a data calculation method based on a heterogeneous acceleration processor, as described in the following embodiments. Since the principle of solving the problem by this method is similar to that of a heterogeneous acceleration processor, the implementation of this method can refer to the implementation of a heterogeneous acceleration processor, and the repeated parts will not be repeated.

[0098] Figure 4 The process of the data calculation method based on the heterogeneous acceleration processor in the embodiment of the present invention is as follows Figure 1 ,include:

[0099] Step 401, after receiving the neural network convolution calculation instruction, the calculation module performs the neural network convolution calculation on the original data stored in the RAM to obtain intermediate data, and the data sorting and transformation module sorts and transforms the intermediate data to obtain result data;

[0100] Step 402, after receiving the vector calculation instruction, the vector calculation control unit controls the calculation module to perform vector calculation to obtain intermediate data, and the data sorting and transformation module sorts and transforms the intermediate data to obtain result data.

[0101] In one embodiment, a neural network convolution calculation is performed on the original data stored in the RAM by a computing module to obtain intermediate data, including:

[0102] Perform convolutional network matrix calculation on the feature graph data using weight data to obtain a first result;

[0103] Perform batch normalization calculation and function activation on the first result to obtain a second result;

[0104] Perform pooling calculation on the second result to obtain intermediate data.

[0105] In one embodiment, the vector calculation control unit controls the calculation module to perform vector calculation to obtain intermediate data, including:

[0106] Under the control of the vector calculation control unit, vector calculation is performed on the original data or the intermediate data to obtain a first result; or after receiving the vector calculation instruction, vector calculation is performed on the data in the vector calculation instruction to obtain the first result;

[0107] Perform batch normalization calculation and function activation on the first result to obtain a second result;

[0108] Perform pooling calculation on the second result to obtain intermediate data.

[0109] Figure 5 The process of the data calculation method based on the heterogeneous acceleration processor in the embodiment of the present invention is as follows Figure 2 In one embodiment, the method further comprises:

[0110] Step 501, after receiving a vector calculation instruction, reconstruct at least one PE unit in the convolution PE array into a vector calculation unit adapted to the CPU;

[0111] Step 502: The vector calculation control unit controls the vector calculation unit in the calculation module to perform vector calculation to obtain intermediate data.

[0112] Figure 6 The process of the data calculation method based on the heterogeneous acceleration processor in the embodiment of the present invention is as follows Figure 3 In one embodiment, the method further comprises:

[0113] Step 601, after receiving a neural network convolution calculation instruction, performing neural network convolution calculation in parallel through multiple heterogeneous acceleration processors;

[0114] Step 602: After receiving the vector calculation instruction, the vector calculation is performed in parallel by multiple heterogeneous acceleration processors.

[0115] In summary, the data calculation method based on the heterogeneous acceleration processor proposed in the embodiment of the present invention has the following beneficial effects:

[0116] First, the convolution PE array of the traditional neural network processor is deeply integrated with the vector computing unit adapted to the CPU. According to different computing requirements, the neural network convolution computing mode and the CPU vector computing mode are adopted respectively. This can reduce the waste of area and power consumption caused by the traditional separate neural network processor computing array and CPU vector design and implementation.

[0117] Second, the RAM on-chip resources are deeply integrated and shared, and configured as corresponding storage modes in different computing modes. Compared with the RAM of independent neural network processors and the RAM of CPU general processors, it saves chip area and reduces chip power consumption.

[0118] Third, a multi-core heterogeneous acceleration processor array has been realized, which can integrate the computing fusion and storage sharing of multi-core CPUs and multi-core neural network processors, and can perform multiple tasks in parallel to achieve the effects of increased running speed and reduced power consumption in multi-tasking scenarios for specific scenarios.

[0119] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A heterogeneous acceleration processor, characterized in that: include: A computing module, a storage module RAM, a CPU and a data sorting and transformation module, wherein the computing module includes a convolution PE array and a vector computing control unit; The storage module RAM is used to store original data, intermediate data and result data; The CPU is used to send the vector calculation instruction to the calculation module; The convolution PE array includes a plurality of PE units, and the PE units are used to perform neural network convolution calculations on original data; The data sorting and transformation module is used to sort and transform the intermediate data output by the calculation module to obtain result data; The vector calculation control unit is used to control at least one PE unit to perform vector calculation; The PE unit is also used to perform vector calculation on the original data or intermediate data under the control of the vector calculation control unit; after receiving the vector calculation instruction, perform vector calculation on the data in the vector calculation instruction; The convolution PE array also includes a normalization and activation function module and a pooling module; The PE unit is specifically used to perform convolutional network matrix calculation on the feature map data using weight data to obtain a first result; or to perform vector calculation on the original data or intermediate data under the control of the vector calculation control unit to obtain a first result; or to perform vector calculation on the data in the vector calculation instruction after receiving the vector calculation instruction to obtain a first result; The normalization and activation function module is used to perform batch normalization calculation and function activation on the first result to obtain the second result; The pooling module is used to perform pooling calculation on the second result to obtain intermediate data.

2. The heterogeneous acceleration processor according to claim 1, wherein: The original data includes weight data and feature map data; The RAM includes a weight storage module and a feature map storage module; The rights storage module is used to store rights data; The feature map storage module is used to store feature map data.

3. The heterogeneous acceleration processor according to claim 1, wherein: The vector calculation control unit includes one or any combination of an ALU, a MAC and a vector parallel acceleration unit.

4. The heterogeneous acceleration processor according to claim 1, wherein: At least one PE unit in the convolution PE array can be reconstructed into a vector computing unit adapted to the CPU; The vector calculation unit is used to perform vector calculation on original data or intermediate data; after receiving a vector calculation instruction, the vector calculation is performed on the data in the vector calculation instruction.

5. The heterogeneous acceleration processor according to claim 2, wherein: The RAM includes a plurality of RAM groups, each of which includes a weight storage module and a feature map storage module.

6. The heterogeneous acceleration processor according to claim 1, wherein: The RAM includes an instruction RAM and a data RAM; The instruction RAM is used to store instructions; the data RAM is used to store original data, intermediate data and result data; The CPU is also used to read instructions from the instruction RAM and read data from the data RAM.

7. The heterogeneous acceleration processor according to claim 1, wherein: There are multiple computing modules, and the multiple computing modules can perform neural network convolution calculations or vector calculations in parallel.

8. A data computing method based on a heterogeneous acceleration processor, characterized in that: The heterogeneous acceleration processor according to any one of claims 1 to 7 comprises: After receiving the neural network convolution calculation instruction, the calculation module performs the neural network convolution calculation on the original data stored in the storage module RAM to obtain intermediate data, and the data sorting and transformation module sorts and transforms the intermediate data to obtain result data; After receiving the vector calculation instruction, the vector calculation control unit controls the calculation module to perform vector calculation to obtain intermediate data, and the data sorting and transformation module sorts and transforms the intermediate data to obtain result data.

9. The method according to claim 8, characterized in that Also includes: After receiving the vector calculation instruction, reconstructing at least one PE unit in the convolution PE array into a vector calculation unit adapted to the CPU; The vector calculation control unit controls the vector calculation unit in the calculation module to perform vector calculations to obtain intermediate data.