Data processing method, system, device and storage medium

By building a grouping and cluster structure in the AI ​​accelerator and using data broadcast and parallel computing methods, the storage access delay problem of the AI ​​accelerator when processing deep neural network data is solved, and the data processing efficiency and parallelism are improved.

CN118093201BActive Publication Date: 2025-01-24芯来智融半导体科技(上海)股份有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410487001.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-22
Publication Date
2025-01-24
Estimated Expiration
2044-04-22

AI Technical Summary

Technical Problem

When processing deep neural network data, existing AI accelerators need to frequently access off-chip storage, resulting in increased path delay and extended execution time, thereby reducing data processing efficiency.

Method used

By configuring a controller and multiple acceleration processors into a group, and multiple controllers into a cluster, data to be broadcast is broadcast to the acceleration processor through data broadcasting, and data to be transmitted is transmitted to the acceleration processor to achieve multiple functions. Accelerated processors for parallel computing.

Benefits of technology

It reduces the number of access and path delay of accelerated processors to the outside of the film, improves the speed of data acquisition, enhances the reuse and parallel of data, shortens the data processing time, and improves the efficiency of data processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118093201B_ABST
    Figure CN118093201B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a data processing method, system, device and storage medium, which relates to the field of computer technology. The method includes: a controller obtains data to be processed, identifies the data to be processed, and determines the data to be broadcast and the data to be transmitted; a group is formed with multiple acceleration processors connected through a first bus, and multiple controllers connected through a second bus form a cluster; the data to be broadcast is broadcast to multiple acceleration processors connected to the controller in a data broadcasting manner, and the corresponding data to be transmitted is transmitted to multiple acceleration processors; multiple acceleration processors receive the data to be broadcast and the corresponding data to be transmitted, and calculate the broadcast data and the data to be transmitted in parallel to obtain the calculation results, and transmit the calculation results to the controller; the controller sends the calculation results. This solution reduces the number of accesses and path delays, has good dynamic scalability, shortens data processing time, and improves data processing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and specifically, to a data processing method, system, device and storage medium. Background Art

[0002] With the rapid development of artificial intelligence technology, AI accelerators, as a hardware accelerator that can accelerate the application of artificial intelligence, have been increasingly applied to various fields, especially the Internet of Things and other data-intensive or sensor-driven tasks. Among them, the performance of AI accelerators is related to three major factors: algorithms, data and computing power. Data provides the source of "learning" for algorithms and is also the object of algorithm application; hardware provides computing power support for the actual operation of algorithms. Computing power refers to the ability to process information. In the process of increasing data volume, in order to improve the processing efficiency and performance of massive data, it is particularly important to study how to use accelerator platforms to process data.

[0003] At present, the relevant technology uses a single embedded neural network acceleration processor (Network Accelerator, NACC) to process data. However, as the network structure of the neural network becomes deeper and the number of model parameters increases, each NACC needs to frequently access off-chip storage during data processing, which makes the path delay greater and the execution time longer, resulting in low data processing efficiency. Summary of the invention

[0004] The embodiments of the present application provide a data processing method, system, device and storage medium.

[0005] A first aspect of an embodiment of the present application provides a data processing method, including:

[0006] The controller obtains the data to be processed, identifies the data to be processed, and determines the data to be broadcast and the data to be transmitted; the controller and a plurality of acceleration processors connected via a first bus form a group, and a plurality of the controllers connected via a second bus form a cluster;

[0007] The controller broadcasts the data to be broadcast to multiple acceleration processors connected to the controller in a data broadcasting manner, and transmits the corresponding data to be transmitted to the multiple acceleration processors;

[0008] The plurality of acceleration processors receive the data to be broadcast and the corresponding data to be transmitted, perform parallel calculations on the data to be broadcast and the data to be transmitted to obtain calculation results, and transmit the calculation results to the controller;

[0009] The controller sends the calculation result.

[0010] In an optional embodiment of the present application, the controller identifies and processes the data to be processed to determine the data to be broadcast and the data to be transmitted, including:

[0011] Identify and process the data to be processed to determine data that needs to be shared by multiple acceleration processors;

[0012] The data to be shared is used as the data to be broadcast, and the remaining data in the data to be processed except the data to be broadcast is used as the data to be transmitted.

[0013] In an optional embodiment of the present application, the controller broadcasts the data to be broadcast to multiple acceleration processors connected to the controller in a data broadcasting manner, including:

[0014] Determine, according to the data to be broadcast, a group identifier to which the data to be broadcast belongs and a corresponding acceleration processor identifier;

[0015] Determining the acceleration processor to be broadcasted by the controller based on the group identifier and the acceleration processor identifier;

[0016] The data to be broadcasted is broadcasted to a plurality of acceleration processors connected to the controller.

[0017] In an optional embodiment of the present application, transmitting the corresponding data to be transmitted to the multiple acceleration processors includes:

[0018] The controller determines an accelerator identifier of each acceleration processor and corresponding data to be transmitted;

[0019] The data to be transmitted is transmitted to the acceleration processor corresponding to the accelerator identifier.

[0020] In an optional embodiment of the present application, the data to be broadcast and the data to be transmitted are calculated in parallel to obtain a calculation result, including:

[0021] For each acceleration processor, a convolution operation is performed based on the data to be broadcast and the corresponding data to be transmitted to obtain a sub-computation result;

[0022] The sub-computation results of each acceleration processor of the group to which the controller belongs are calculated in parallel to obtain a calculation result.

[0023] In an optional embodiment of the present application, before the controller obtains the data to be transmitted, the method further includes:

[0024] The cluster to which the controller belongs obtains original data;

[0025] Identify and process the original data to determine target data and transmission data to be broadcast to the controller;

[0026] The target data is broadcasted to multiple controllers corresponding to the cluster in a data broadcasting manner, and corresponding transmission data is transmitted to the multiple controllers.

[0027] In an optional embodiment of the present application, the data to be broadcast includes feature map data, and the data to be transmitted includes convolution kernel data; or,

[0028] The data to be broadcast includes convolution kernel data, and the data to be transmitted includes the feature map data.

[0029] A second aspect of an embodiment of the present application provides a data processing system, including:

[0030] A cluster, a controller and an acceleration processor, wherein the controller and a plurality of acceleration processors connected via a first bus form a group, and a plurality of the controllers connected via a second bus form a cluster;

[0031] The controller is used to obtain data to be processed, identify the data to be processed, determine data to be broadcast and data to be transmitted, broadcast the data to be broadcast to multiple acceleration processors connected to the controller in a data broadcasting manner, and transmit the corresponding data to be transmitted to the multiple acceleration processors;

[0032] The plurality of acceleration processors are used to receive the data to be broadcast and the corresponding data to be transmitted, perform parallel calculations on the data to be broadcast and the data to be transmitted to obtain calculation results, and transmit the calculation results to the controller;

[0033] The controller is used to send the calculation result.

[0034] According to a third aspect of an embodiment of the present application, a computer device is provided, comprising: a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any of the above methods when executing the computer program.

[0035] A fourth aspect of the embodiments of the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of any of the above methods when executed by a processor.

[0036] In the embodiment of the present application, the controller obtains the data to be processed, identifies the data to be processed, determines the data to be broadcast and the data to be transmitted, and then uses the direction of data broadcasting to broadcast the data to be broadcast to the multiple acceleration processors connected to the controller, and transmits the corresponding data to be transmitted to the multiple acceleration processors. Then, the multiple acceleration processors receive the data to be broadcast and the corresponding data to be transmitted, and perform parallel calculations on the broadcast data and the data to be transmitted to obtain calculation results, and transmit the calculation results to the controller, and finally the controller sends the calculation results. On the one hand, the technical solution in the present application forms a group with the controller and forms a cluster with the multiple controllers, and the controller broadcasts the data to be broadcast to the multiple acceleration processors by means of data broadcasting, so that the multiple acceleration processors do not need to frequently access the off-chip storage during the data acquisition process, and can share the data to be broadcast, ensuring data consistency, and having good dynamic scalability, thereby reducing the number of accesses and path delays, and improving the data acquisition speed. On the other hand, by having multiple acceleration processors perform parallel calculations on broadcast data and data to be transmitted to obtain calculation results, multiple acceleration processors can quickly process massive amounts of data, improve data reusability and parallelism, meet the data transmission needs of multiple acceleration processors, shorten data processing time, and improve data processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0038] Figure 1 A schematic diagram of an application scenario of a data processing method provided by an embodiment of the present application;

[0039] Figure 2 A schematic diagram of the structure of a data processing system provided in one embodiment of the present application;

[0040] Figure 3 A schematic diagram of the structure of a data processing system provided in one embodiment of the present application;

[0041] Figure 4 A schematic diagram of the structure of a computer device provided in one embodiment of the present application;

[0042] Figure 5 A flowchart of a data processing method provided by an embodiment of the present application;

[0043] Figure 6A flowchart of a method for a controller to broadcast data to be broadcast to multiple acceleration processors connected to the controller in a data broadcasting manner provided by an embodiment of the present application;

[0044] Figure 7 A flowchart of a method for transmitting corresponding data to be transmitted to multiple acceleration processors provided in one embodiment of the present application. DETAILED DESCRIPTION

[0045] In the process of implementing the present application, the inventors found that currently each NACC needs to frequently access off-chip storage during data processing, which makes the path delay greater and the execution time longer, resulting in lower data processing efficiency.

[0046] In response to the above problems, the embodiments of the present application provide a data processing method, system, device and storage medium. On the one hand, the technical solution in the present application forms a group with the controller and multiple acceleration processors, and forms a cluster with multiple controllers, and the controller broadcasts the data to be broadcast to multiple acceleration processors in a data broadcasting manner, so that multiple acceleration processors do not need to frequently access the off-chip storage during the data acquisition process, and can share the data to be broadcast, ensuring data consistency, and having good dynamic scalability, thereby reducing the number of accesses and path delays, and improving the data acquisition speed. On the other hand, by using multiple acceleration processors to perform parallel calculations on the broadcast data and the data to be transmitted to obtain calculation results, multiple acceleration processors can quickly process massive data, improve the reusability and parallelism of the data, meet the data transmission needs of multiple acceleration processors, shorten the data processing time, and improve the data processing efficiency. The solution in the embodiments of the present application can be implemented using various hardware description languages, such as hardware description language (Verilog).

[0047] In order to make the technical solutions and advantages in the embodiments of the present application more clearly understood, the exemplary embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than an exhaustive list of all the embodiments. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.

[0048] The following is a brief description of the application environment of the data processing method of the computer device provided in the embodiment of the present application:

[0049] See also Figure 1, a data processing system of a computer device provided in an embodiment of the present application, the data processing system includes a cluster 10, a controller and an acceleration processor, the controller and a plurality of acceleration processors connected via a first bus 20 constitute a group, and a plurality of controllers connected via a second bus 30 constitute a cluster. The plurality of acceleration processors, for example, include a first acceleration processor, a second acceleration processor ... an nth acceleration processor, and the plurality of groups, for example, include group 1 and group 2.

[0050] The controller can be a DMA controller, the acceleration processor can be an embedded neural network acceleration processor, the first bus can be the same as the second bus, both are BUS buses, or they can be different. The second bus can have a higher data transmission rate or a larger data transmission volume than the first bus. The relationship between the controller and the acceleration processor is established through the first bus, and the relationship between the cluster and multiple controllers is established through the second bus. The system can also include memory DDR40 for providing data storage space. The controller is used to adopt a broadcast transmission mode to transmit data to multiple NACCs connected to the bus through a shared bus. Among them, NACC is a processor specially used for network application data packets, adopting the architecture of "data-driven parallel computing".

[0051] As a possible implementation, see Figure 2 As shown, taking the acceleration processor as NACC, the controller as DMA controller, and the second bus as BUS as an example, the system includes multiple Groups, multiple Clusters, and DDRs. Each Group includes multiple Clusters, specifically multiple DMA controllers, and each DMA controller is connected via BUS. Each Cluster includes a DMA controller and a NACC connected to the DMA controller. Figure 2 The system includes two clusters, namely the first cluster Cluster0 and the second cluster Cluster1. Each cluster includes a DMA controller and multiple NACCs.

[0052] As another possible implementation, see Figure 3 As shown, taking the acceleration processor as NACC, the controller as DMA controller, and the second bus as BUS as an example, the system includes a Group, a first group Cluster, and DDR, the Group includes a group Cluster, and a Cluster includes a DMA controller and multiple NACCs.

[0053] When a new NACC needs to be added, only the number of Clusters and Groups needs to be expanded without modifying the DMA transmission core mechanism, so it can be expanded dynamically. The above DMA controller is embedded with registers and logic devices for Cluster and Group identification and transmission control, so that the DMA controller can identify the Cluster ID and Group ID to which each NACC belongs through the device.

[0054] In this system, the DMA internal bus and the NACC inter-bus arbitration control are set to achieve accurate packet broadcast transmission. Compared with the existing technology, this solution improves transmission efficiency, simplifies transmission control, ensures data consistency, has good dynamic scalability, and meets the needs of efficient data transmission of multiple NACCs.

[0055] like Figure 4 As shown, in addition to the acceleration processor connected through the system bus, the computer device may also include other internal memories, network interfaces, display screens and input devices. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium may be, for example, a disk. The non-volatile storage medium stores files (which may be files to be processed or files after processing), operating systems and computer programs, etc. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a data processing method is implemented. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covered on the display screen, or a key, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.

[0056] See also Figure 5 The following embodiments take the above-mentioned computer device as the execution subject, and apply the data processing method provided in the embodiment of the present application to the above-mentioned computer device to perform instruction processing as an example for specific description. The data processing method provided in the embodiment of the present application includes the following steps 201 to 204:

[0057] Step 201: The controller obtains data to be processed, identifies the data to be processed, and determines data to be broadcast and data to be transmitted; the controller and multiple acceleration processors connected via a first bus form a group, and multiple controllers connected via a second bus form a cluster.

[0058] It should be noted that the data to be processed is data that needs to be processed, the data to be broadcast is data that needs to be broadcasted, that is, data shared by multiple acceleration processors; the data to be transmitted is data that needs to be transmitted and processed without using the broadcast transmission mode, that is, data required by multiple acceleration processors. The data to be broadcast can be obtained from the memory DDR.

[0059] Optionally, in the process of obtaining the data to be processed, the data may be transmitted to the controller by the cluster Group to which the controller belongs through broadcasting, or may be imported from other external devices, or may be obtained from the memory DDR, or may be obtained through a database or blockchain, which is not limited in this embodiment.

[0060] After acquiring the data to be processed, the controller may identify the data to be processed, and determine the data to be broadcast that needs to be transmitted in the broadcast transmission mode and the data to be transmitted that needs to be transmitted in other transmission modes.

[0061] In this embodiment, the controller obtains the data to be processed and identifies the data to be processed, so that the data to be broadcast and the data to be transmitted can be accurately determined, so as to facilitate subsequent targeted data broadcasting, thereby improving data transmission efficiency.

[0062] Step 202: The controller broadcasts the data to be broadcast to multiple acceleration processors connected to the controller in a data broadcasting manner, and transmits the corresponding data to be transmitted to the multiple acceleration processors.

[0063] After determining the data to be broadcast and the data to be transmitted, the controller can broadcast the data to be broadcast to multiple acceleration processors connected to the controller in a data broadcasting manner, and then determine the data to be transmitted corresponding to each acceleration processor, and transmit the corresponding data to be transmitted to the multiple acceleration processors. The data to be broadcast corresponding to each acceleration processor is the same, that is, the data to be broadcast is shared, and the data to be transmitted corresponding to each acceleration processor is different.

[0064] The data to be broadcasted may be convolution kernel data or feature map data. When the data to be broadcasted is convolution kernel data, the data to be transmitted may be feature map data. When the data to be broadcasted is feature map data, the data to be transmitted may be convolution kernel data. The number of the convolution kernel data may be one, two or more. The number of the feature map data may be one, two or more.

[0065] It should be noted that when the controller performs data transmission, it uses cluster as a unit for group transmission, and different transmission priorities, transmission times, sequences, etc. can be used to differentiate and control different NACC groups.

[0066] Optionally, the above-mentioned broadcasting of the data to be broadcast to multiple acceleration processors by data broadcasting can be at the same time node as the time node of transmitting the data to be transmitted to multiple acceleration processors, that is, the two data transmission methods are processed in parallel. It can also be said that the broadcasting of the data to be broadcast to multiple acceleration processors by data broadcasting can be at a different time node from the time node of transmitting the data to be transmitted to multiple acceleration processors. For example, the data to be broadcast is first broadcasted to multiple acceleration processors by data broadcasting, and then the data to be transmitted is transmitted to multiple acceleration processors; or the data to be transmitted is first transmitted to multiple acceleration processors, and then the data to be broadcast is broadcasted to multiple acceleration processors by data broadcasting.

[0067] In this embodiment, the controller uses data broadcasting to broadcast the data to be broadcast to multiple acceleration processors connected to the controller. There is no need for each acceleration processor to request data one by one. This makes it easy for multiple acceleration processors to share unified data and ensure data consistency. It has good dynamic scalability and meets the needs of efficient data transmission of multiple acceleration processors.

[0068] Step 203: Multiple acceleration processors receive the data to be broadcast and the corresponding data to be transmitted, perform parallel calculations on the data to be broadcast and the data to be transmitted to obtain calculation results, and transmit the calculation results to the controller.

[0069] Specifically, after the controller sends the data to be broadcast to the multiple acceleration processors by means of data broadcast, the multiple acceleration processors receive the data to be broadcast, and after the controller transmits the corresponding data to be transmitted to the multiple acceleration processors, the acceleration processors obtain the corresponding data to be transmitted. The time nodes at which the acceleration processor receives the data to be broadcast and the corresponding data to be transmitted may be the same or different. When they are different, they may be determined according to the time node at which the controller transmits data or broadcasts data to the acceleration processor.

[0070] For each acceleration processor, after obtaining the data to be broadcast and the corresponding data to be transmitted, a preset convolution algorithm can be used to parallelly calculate the data to be broadcast and the data to be transmitted to obtain a calculation result, and then the calculation result is transmitted to the controller.

[0071] In this step, the acceleration processor performs parallel computing on the broadcast data and the data to be transmitted, so that the computing results can be obtained quickly, which makes it easier for the controller to send the computing results.

[0072] Step 204: The controller sends the calculation result.

[0073] After the accelerated processor performs parallel computing on the broadcast data and the data to be transmitted and obtains the computing results, the computing results can be sent to the controller so that the controller sends the computing results to the memory DDR, and can also send the computing results to other devices.

[0074] In the embodiment of the present application, the controller obtains the data to be processed, identifies the data to be processed, determines the data to be broadcast and the data to be transmitted, and then uses the direction of data broadcasting to broadcast the data to be broadcast to the multiple acceleration processors connected to the controller, and transmits the corresponding data to be transmitted to the multiple acceleration processors. Then, the multiple acceleration processors receive the data to be broadcast and the corresponding data to be transmitted, and perform parallel calculations on the broadcast data and the data to be transmitted to obtain calculation results, and transmit the calculation results to the controller, and finally the controller sends the calculation results. On the one hand, the technical solution in the present application forms a group with the controller and forms a cluster with the multiple controllers, and the controller broadcasts the data to be broadcast to the multiple acceleration processors by means of data broadcasting, so that the multiple acceleration processors do not need to frequently access the off-chip storage during the data acquisition process, and can share the data to be broadcast, ensuring data consistency, and having good dynamic scalability, thereby reducing the number of accesses and path delays, and improving the data acquisition speed. On the other hand, by having multiple acceleration processors perform parallel calculations on broadcast data and data to be transmitted to obtain calculation results, multiple acceleration processors can quickly process massive amounts of data, improve data reusability and parallelism, meet the data transmission needs of multiple acceleration processors, shorten data processing time, and improve data processing efficiency.

[0075] In an optional embodiment of the present application, the controller identifies and processes the data to be processed, and determines the data to be broadcast and the data to be transmitted, which may include the following method steps:

[0076] Identify and process the data to be processed, and determine the data that needs to be shared by multiple acceleration processors;

[0077] The data to be shared is taken as the data to be broadcasted, and the remaining data in the data to be processed except the data to be broadcasted is taken as the data to be transmitted.

[0078] As an implementable method, the processing fields of the data to be broadcast and the data to be transmitted are different. After acquiring the data to be processed, the controller can identify the processing field of the data to be processed. For example, the processing field of the common data is the first field, and the processing field that cannot be shared is the second field. The data to be processed corresponding to the first field is determined as data that needs to be shared by multiple acceleration processors, and then the data that needs to be shared is used as the data to be broadcast, and the data to be processed corresponding to the second field is determined as the data to be transmitted.

[0079] As another feasible method, after acquiring the data to be processed, the controller can determine the data to be processed corresponding to the first field as data that needs to be shared by multiple acceleration processors, and then use the data that needs to be shared as data to be broadcast, and then use the remaining data in all the data to be processed except the data to be broadcast as data to be transmitted.

[0080] Among them, the above-mentioned data to be transmitted may correspond to different acceleration processors, that is, different acceleration processors correspond to different data to be transmitted. The data to be transmitted may be data of different types, data of different byte lengths, or data of different data volumes.

[0081] In this embodiment, the data to be processed is identified and processed, and the data to be broadcast and the data to be transmitted are determined, so as to facilitate the subsequent targeted transmission of data to the acceleration processor, improve the transmission efficiency, and transmit data to multiple NACCs at the same time, avoiding the time overhead caused by transmission one by one, thereby greatly improving the data throughput.

[0082] In an optional embodiment of the present application, see Figure 6 As shown, in the above step 202, the controller broadcasts the data to be broadcast to multiple acceleration processors connected to the controller in a data broadcasting manner, including the following method steps:

[0083] Step 301: Determine the group identifier and the corresponding acceleration processor identifier to which the data to be broadcast belongs according to the data to be broadcast.

[0084] Step 302: Based on the group identifier and the acceleration processor identifier, determine the acceleration processor to be broadcasted by the controller.

[0085] Step 303: broadcast the data to be broadcast to multiple acceleration processors connected to the controller.

[0086] It should be noted that the above group identifier can be understood as the identity information of the group to which the data to be broadcast belongs. The acceleration processor is used to uniquely represent the identity information of the acceleration processor. When the accelerator is a NACC, the accelerator identifier can be a NACC id. The data to be broadcast can include multiple data types or one data type.

[0087] After acquiring the data to be broadcast, the controller can determine the group identifier to which the data to be broadcast belongs and the multiple acceleration processors connected to the controller in the group, and then determine the acceleration processor identifier corresponding to each of the multiple acceleration processors. Based on the group identifier and the acceleration processor identifier, the controller determines the acceleration processor to be broadcasted, and then the controller generates a broadcast instruction based on the data to be broadcast, and broadcasts the broadcast instruction to the multiple acceleration processors connected to the controller using a broadcast transmission method.

[0088] Among them, the method of broadcasting data for a grouped Cluster can be understood as: there are C NACCs with the DMA controller and the shared bus, and the C NACCs share the data to be broadcast of a DMA controller. As an implementable method, when the data to be broadcast is feature map FM data, during the convolution calculation process, the feature map FM data can be reused, and the feature map data can be broadcast to the SRAM of C NACCs in the cluster at the same time through the DMA controller, and then the convolution kernel data is determined as multiple different convolution kernels K, and the multiple different convolution kernels K are transmitted to the SRAM of multiple NACCs through the DMA controller. Finally, multiple NACCs perform parallel calculations in SRAM based on the feature map data and convolution kernel data to obtain calculation results, and transmit the calculation results through the DMA controller.

[0089] As another feasible method, when the data to be broadcast is convolution kernel data, the convolution kernel can be reused during the convolution calculation process, and the convolution kernel data can be simultaneously broadcast to the SRAM of C NACCs in the cluster through the DMA controller, and then the feature map data is determined as multiple rows of different feature map data, and the multiple rows of different feature map data are respectively transmitted to the SRAM of multiple NACCs through the DMA controller. Finally, multiple NACCs perform parallel calculations in SRAM based on the feature map data and convolution kernel data to obtain calculation results, and transmit the calculation results through the DMA controller.

[0090] It should be noted that SRAM (Static RAM) is a commonly used type of random access memory (RAM) that stores data in a static manner and does not require regular refresh. It is also called static random access memory.

[0091] Exemplarily, when the Cluster includes a DMA controller and two NACCs sharing a bus, for example, the first NACC and the second NACC, the DMA controller can first determine the group identifier, and then determine the accelerator identifiers of the first NACC and the second NACC based on the group identifier, and based on the group identifier and the accelerator identifiers of the first NACC and the second NACC, determine that the acceleration processors to be broadcast by the controller are the first NACC and the second NACC, and then broadcast the data to be broadcast to the first NACC and the second NACC connected to the DMA controller.

[0092] In this embodiment, the group identifier and the accelerated processor identifier are determined, and the accelerated processor to be broadcast can be determined in a finer granularity, so as to more accurately broadcast the data to be broadcast to multiple accelerated processors, simplify the transmission operation, so that the DMA controller only needs to perform one data transmission operation to achieve data acquisition, and does not need to perform multiple independent configurations for each NACC, which simplifies the transmission control logic. In addition, compared with the operation of performing data transmission one by one, the DMA controller and bus only need to work once in the broadcast mode, which can reduce the number of transmission actions, reduce overhead and power consumption.

[0093] In an optional embodiment of the present application, see Figure 7 As shown, the above step 202, transmitting the corresponding data to be transmitted to multiple acceleration processors, includes the following method steps:

[0094] Step 401: The controller determines the accelerator identifier of each acceleration processor and the corresponding data to be transmitted.

[0095] Step 402: Transmit the data to be transmitted to the acceleration processor corresponding to the accelerator identifier.

[0096] Specifically, the controller may obtain multiple acceleration processor identifiers of the same cluster to which the controller belongs and the data to be transmitted corresponding to the accelerator identifiers, and then transmit the data to be transmitted to the acceleration processor corresponding to the accelerator identifier.

[0097] Exemplarily, when the Cluster includes a DMA controller and two NACCs sharing a bus, such as the first NACC and the second NACC, the DMA controller can first determine the accelerator identifiers of the first NACC and the second NACC and the corresponding data to be transmitted, the data to be transmitted corresponding to the first NACC is data 1, and the data to be transmitted corresponding to the second NACC is data 2, and then transmit data 1 to the first NACC and transmit data 2 to the second NACC.

[0098] Optionally, when transmitting the data to be transmitted to the acceleration processor corresponding to the accelerator identifier, it can be executed after the controller broadcasts the data to be broadcast to multiple acceleration processors connected to the controller by data broadcasting, or it can be executed before the controller broadcasts the data to be broadcast to multiple acceleration processors connected to the controller by data broadcasting, or it can be executed in parallel when the controller broadcasts the data to be broadcast to multiple acceleration processors connected to the controller by data broadcasting.

[0099] In this embodiment, the controller determines the accelerator identifier and corresponding data to be transmitted of each acceleration processor, and transmits the data to be transmitted to the acceleration processor corresponding to the accelerator identifier, so as to facilitate subsequent accurate calculation of the calculation result based on the data to be transmitted and the data to be broadcasted by the broadcast transmission.

[0100] In an optional embodiment of the present application, the above-mentioned parallel calculation of the broadcast data and the data to be transmitted to obtain the calculation result includes the following method steps:

[0101] For each acceleration processor, a convolution operation is performed based on the data to be broadcast and the corresponding data to be transmitted to obtain a sub-computation result;

[0102] The sub-computation results of each acceleration processor of the group to which the controller belongs are calculated in parallel to obtain the calculation result.

[0103] It should be noted that the convolution operation can be understood as translating the convolution kernel on the feature map with a specific step size, and multiplying and summing the convolution kernel and the data block of the same size as the convolution kernel on the feature map to obtain the output of a unit point on the output feature map. The function of the convolution kernel is to extract different features by performing convolution operations on different positions of the input data. For example, in image processing tasks, the convolution kernel can detect edges, colors, textures, etc. in images.

[0104] Exemplarily, taking a 3×3×2 feature map and a 2×2×2×2 convolution kernel as an example, the calculation operation can be: expand the data of channel 1 and channel 2 participating in the convolution calculation in each cycle by rows and columns, with channel 1 at the top and channel 2 at the bottom in a column. Since four calculations are required, the feature map matrix is ​​expanded to represent an 8×4 matrix. Similarly, the convolution kernel W and the convolution kernel G are expanded by rows and columns, respectively, with channel 1 in front and channel 2 in the back to expand into 1 row. Since there are two convolution kernels, the two rows of expanded convolution kernels are spliced ​​into a 2×8 matrix by row, which is used as the convolution kernel matrix. Perform matrix multiplication on the feature map matrix and the convolution kernel matrix to obtain a 2×4 output matrix, in which each row represents an output feature map.

[0105] As an implementable method, when the data to be broadcast is feature map data and the data to be transmitted is multiple different convolution kernels K, during the convolution calculation process, the acceleration processor can perform matrix operations on the feature map data and each different convolution kernel K to obtain sub-calculation results, and then calculate the sub-calculation results in parallel to obtain the calculation results, and transmit the calculation results through the DMA controller.

[0106] As another feasible method, when the data to be broadcast is convolution kernel data and the data to be transmitted is multiple rows of different feature map data, during the convolution calculation process, the acceleration processor can perform matrix operations on the convolution kernel data and the multiple rows of different feature map data to obtain sub-calculation results, and then calculate the sub-calculation results in parallel to obtain the calculation results, and transmit the calculation results through the DMA controller.

[0107] Compared with the prior art, the present embodiment enables multiple NACCs to receive the same data at the same time, ensuring data consistency, making data distribution more uniform during parallel processing, and facilitating rapid parallel computing based on data to be broadcast and data to be transmitted, thereby achieving the effect of improving the processing frequency of the entire architecture.

[0108] In an optional embodiment of the present application, before the controller obtains the data to be transmitted, the embodiment of the present application further includes the following method steps:

[0109] The cluster to which the controller belongs obtains original data; identifies and processes the original data to determine target data and transmission data to be broadcast to the controller; broadcasts the target data to multiple controllers corresponding to the cluster in a data broadcasting manner, and transmits corresponding transmission data to multiple controllers.

[0110] It should be noted that multiple groups Cluster are combined into a cluster Group. The target data is the data that the cluster Group needs to broadcast to multiple controllers, and the transmission data is the remaining data in the original data except the target data.

[0111] Specifically, the cluster Group can obtain the original data, identify the data field of the original data, determine the target data to be broadcast to the controller of the shared bus according to the data field, and then use other data in the original data as transmission data. Generate a broadcast instruction according to the target data, and then broadcast the broadcast instruction to multiple controllers corresponding to the cluster in a data broadcasting manner, and transmit the corresponding transmission data to the multiple controllers.

[0112] Among them, the corresponding transmission data can be transmitted to multiple controllers while broadcasting broadcast instructions to multiple controllers corresponding to the cluster by data broadcasting, or the instructions can be broadcast to multiple controllers corresponding to the cluster by data broadcasting first, and then the corresponding transmission data can be transmitted to the multiple controllers; or the corresponding transmission data can be transmitted to multiple controllers first, and then the above-mentioned broadcast instructions can be broadcast to the multiple controllers corresponding to the cluster by data broadcasting.

[0113] The way of broadcasting data for a cluster Group can be understood as follows: the Group includes G clusters and G DMA controllers, each DMA controller is connected to multiple NACCs, and the convolution kernel data can be evenly divided and transmitted to the NACC of the corresponding cluster through the G DMA controllers respectively, and then the feature map data is shared, and the feature map data is broadcast to the NACC of the corresponding cluster through the G DMA controllers, so that multiple NACCs share the feature map data, and multiple NACCs perform parallel calculations based on the feature map data and convolution kernel data, and the calculation results are sent out through their respective DMA controllers.

[0114] Among them, for the same data feature graph (broadcast allocation) or different data convolution kernels (merged allocation), the DMA controller determines the NACC of the cluster to which it belongs, that is, which NACC of which cluster it comes from, by identifying the ID number of each NACC during the process of allocating transmission.

[0115] In this embodiment, the cluster unifies the data distribution operation, so that multiple NACCs can receive the same data at the same time, ensuring data consistency and making data distribution more uniform during parallel processing.

[0116] In an optional embodiment of the present application, the data to be broadcast includes feature map data, and the data to be transmitted includes convolution kernel data; or, the data to be broadcast includes convolution kernel data, and the data to be transmitted includes feature map data.

[0117] Among them, when the data to be broadcast is convolution kernel data, the convolution kernel can be reused during the convolution calculation process, and then the feature map data is determined as multiple rows of different feature map data, and the different feature map data is used as the data to be transmitted. The convolution kernel data can be broadcasted to the SRAM of C NACCs in the cluster at the same time through the DMA controller, and multiple rows of different feature map data can be transmitted to the SRAM of multiple NACCs through the DMA controller.

[0118] When the data to be broadcast is feature map data, the feature map data can be reused during the convolution calculation process, and then the convolution kernel data is determined as multiple different convolution kernels K, and the different convolution kernels K are used as the data to be transmitted. The feature map data can be broadcasted to the SRAM of C NACCs in the cluster at the same time through the DMA controller, and the multiple different convolution kernels K are transmitted to the SRAM of multiple NACCs through the DMA controller.

[0119] In this embodiment, by determining the data to be broadcast and the data to be transmitted, the broadcast mode can be used to transmit data to multiple NACCs, and the concepts of cluster and group are introduced for transmission, which effectively improves the problem of uneven data distribution of multiple NACCs, solves the inefficiency of traditional one-by-one configuration, and solves the problem of poor scalability. And improves scalability, when it is necessary to add NACCs, it only needs to join the broadcast domain, and there is no need to modify the DMA transmission mechanism, making the system more scalable and improving data processing efficiency.

[0120] It should be understood that, although the various steps in the flow chart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the figure may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.

[0121] On the other hand, an embodiment of the present application provides a data processing system, including:

[0122] A cluster, a controller and an acceleration processor, wherein the controller and a plurality of acceleration processors connected via a first bus form a group, and a plurality of controllers connected via a second bus form a cluster;

[0123] The controller is used to obtain the data to be processed, identify the data to be processed, determine the data to be broadcast and the data to be transmitted, broadcast the data to be broadcast to multiple acceleration processors connected to the controller in a data broadcasting manner, and transmit the corresponding data to be transmitted to the multiple acceleration processors;

[0124] The plurality of acceleration processors are used for receiving the data to be broadcast and the corresponding data to be transmitted, performing parallel calculations on the data to be broadcast and the data to be transmitted to obtain calculation results, and transmitting the calculation results to the controller;

[0125] The controller is used to send the calculation results.

[0126] For the specific definition of the above-mentioned data processing system, please refer to the definition of the data processing method above, which will not be repeated here. Each module in the above-mentioned instruction processing device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0127] In one embodiment, a computer device is provided, the internal structure diagram of which can be as follows: Figure 4 As shown. The computer device includes a processor, a memory, a network interface and a database connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a data processing method as described above is implemented. It includes: a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, any step in the data processing method as described above is implemented.

[0128] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, any step in the above data processing method can be implemented.

[0129] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0130] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0131] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0132] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0133] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.

[0134] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A data processing method, characterized in that: Applied to a data processing system, the data processing system comprises a cluster, a controller and an acceleration processor, the controller and a plurality of acceleration processors connected via a first bus form a group, and a plurality of controllers connected via a second bus form a cluster; The acceleration processor is an embedded neural network acceleration processor, the second bus has a higher data transmission rate or a larger data transmission volume than the first bus; the controller is used to adopt a broadcast transmission mode to transmit data to multiple NACCs connected to the bus and using a data-driven parallel computing architecture through a shared bus; the method includes: The controller obtains the data to be processed, identifies the data to be processed, and determines the data to be broadcast and the data to be transmitted; wherein the controller identifies the data to be processed, and determines the data to be broadcast and the data to be transmitted, including: identifying and processing the data to be processed, and determining the data to be shared by multiple acceleration processors; using the data to be shared as the data to be broadcast, and using the remaining data in the data to be processed except the data to be broadcast as the data to be transmitted; wherein the data to be broadcast includes feature map data, and the data to be transmitted includes convolution kernel data; The controller broadcasts the data to be broadcast to multiple acceleration processors connected to the controller in a data broadcasting manner, and transmits the corresponding data to be transmitted to the multiple acceleration processors, including: determining the group identifier and the corresponding acceleration processor identifier to which the data to be broadcast belongs according to the data to be broadcast; determining the acceleration processor to be broadcasted by the controller based on the group identifier and the acceleration processor identifier; broadcasting the data to be broadcast to the multiple acceleration processors connected to the controller; The plurality of acceleration processors receive the data to be broadcast and the corresponding data to be transmitted, perform parallel calculations on the data to be broadcast and the data to be transmitted to obtain calculation results, and transmit the calculation results to the controller; wherein the parallel calculations on the data to be broadcast and the data to be transmitted to obtain calculation results include: for each acceleration processor, performing a convolution operation based on the data to be broadcast and the corresponding data to be transmitted to obtain a sub-calculation result; performing parallel calculations on the sub-calculation results of each acceleration processor of the group to which the controller belongs to obtain a calculation result; wherein: When the data to be broadcast is feature map FM data, during the convolution calculation process, the feature map data can be simultaneously broadcast to the SRAMs of C NACCs in the cluster through the DMA controller, and the convolution kernel data is determined as multiple different convolution kernels K, and the multiple different convolution kernels K are respectively transmitted to the SRAMs of multiple NACCs through the DMA controller; multiple NACCs perform parallel calculations in the SRAM based on the feature map data and the convolution kernel data to obtain calculation results, and transmit the calculation results through the DMA controller; The controller sends the calculation result.

2. The method according to claim 1, characterized in that Transmitting the corresponding data to be transmitted to the multiple acceleration processors includes: The controller determines an accelerator identifier of each acceleration processor and corresponding data to be transmitted; The data to be transmitted is transmitted to the acceleration processor corresponding to the accelerator identifier.

3. The method according to claim 1, characterized in that Before the controller acquires the data to be transmitted, the method further includes: The cluster to which the controller belongs obtains original data; Identify and process the original data to determine target data and transmission data to be broadcast to the controller; The target data is broadcasted to multiple controllers corresponding to the cluster in a data broadcasting manner, and corresponding transmission data is transmitted to the multiple controllers.

4. A data processing system, characterized in that: include: A cluster, a controller and an acceleration processor, wherein the controller and a plurality of acceleration processors connected via a first bus form a group, and a plurality of the controllers connected via a second bus form a cluster; the acceleration processor is an embedded neural network acceleration processor, and the data transmission rate or data transmission volume of the second bus is greater than that of the first bus; the controller is used to adopt a broadcast transmission mode to transmit data to a plurality of NACCs connected to the bus and adopting a data-driven parallel computing architecture through a shared bus; The controller is used to obtain data to be processed, identify the data to be processed, determine data to be broadcast and data to be transmitted, broadcast the data to be broadcast to multiple acceleration processors connected to the controller in a data broadcasting manner, and transmit the corresponding data to be transmitted to the multiple acceleration processors, including: determining the group identifier and the corresponding acceleration processor identifier to which the data to be broadcast belongs according to the data to be broadcast; determining the acceleration processor to be broadcast by the controller based on the group identifier and the acceleration processor identifier; broadcasting the data to be broadcast to multiple acceleration processors connected to the controller; wherein the controller identifies the data to be processed and determines the data to be broadcast and data to be transmitted, including: identifying and processing the data to be processed to determine the data that needs to be shared by multiple acceleration processors; using the data that needs to be shared as the data to be broadcast, and using the remaining data in the data to be processed except the data to be broadcast as the data to be transmitted; wherein the data to be broadcast includes feature map data, and the data to be transmitted includes convolution kernel data; The plurality of acceleration processors are used to receive the data to be broadcast and the corresponding data to be transmitted, perform parallel calculations on the data to be broadcast and the data to be transmitted to obtain calculation results, and transmit the calculation results to the controller; wherein the parallel calculations on the data to be broadcast and the data to be transmitted to obtain calculation results include: for each acceleration processor, performing a convolution operation based on the data to be broadcast and the corresponding data to be transmitted to obtain a sub-calculation result; performing parallel calculations on the sub-calculation results of each acceleration processor of the group to which the controller belongs to obtain a calculation result; wherein: When the data to be broadcast is feature map FM data, during the convolution calculation process, the feature map data can be simultaneously broadcast to the SRAMs of C NACCs in the cluster through the DMA controller, and the convolution kernel data is determined as multiple different convolution kernels K, and the multiple different convolution kernels K are respectively transmitted to the SRAMs of multiple NACCs through the DMA controller; multiple NACCs perform parallel calculations in the SRAM based on the feature map data and the convolution kernel data to obtain calculation results, and transmit the calculation results through the DMA controller; The controller is used to send the calculation result.

5. A computer device comprising: A memory and a processor, wherein the memory stores a computer program, and wherein the processor implements the steps of the method according to any one of claims 1 to 3 when executing the computer program.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 3 are implemented.

Citation Information

Patent Citations

  • Parallel computing accelerator and embedded system

    CN112306663A

  • Convolution calculation data reusing method based on multi-tensor core processor

    CN116028384A