Data processing method and device of neural network, accelerator, equipment and medium
By setting the correspondence between different convolution methods and data organization methods in the neural network accelerator, and distributing the input feature map data using broadcast, multicast, and unicast methods, the problem of poor versatility of neural network accelerators in the prior art is solved, and efficient computation of multiple convolution methods is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INST OF SEMICONDUCTORS - CHINESE ACAD OF SCI
- Filing Date
- 2023-08-18
- Publication Date
- 2026-07-14
AI Technical Summary
Existing neural network accelerator designs are only designed for one type of convolution, resulting in poor versatility and an inability to adapt to the computational needs of multiple convolution methods.
By determining the correspondence between different convolution methods and data organization methods, the input feature map data is distributed to multiple convolutional computation units in the neural network accelerator using broadcast, multicast, and unicast methods, thereby realizing computation under different convolution methods.
It improves the versatility of neural network accelerators, enabling them to adapt to the computational needs of various convolution methods, and enhances computational efficiency and flexibility.
Smart Images

Figure CN117273078B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence chip technology, and in particular to a data processing method, apparatus, accelerator, device and medium for neural networks. Background Technology
[0002] Currently, neural networks are widely used in applications such as image classification, object detection, and natural language processing. To accelerate neural network computation, hardware acceleration can be implemented using neural network accelerators. However, in existing technologies, neural network accelerators are often designed specifically for a single convolution method, resulting in poor versatility. Summary of the Invention
[0003] This invention provides a data processing method, apparatus, accelerator, device, and medium for neural networks, which addresses the shortcomings of existing technologies that design neural network accelerators specifically for only one type of convolution, resulting in poor versatility, and improves the versatility of neural network accelerators.
[0004] This invention provides a data processing method for neural networks, comprising:
[0005] Obtain the input feature map data and the corresponding convolution method;
[0006] Based on the correspondence between convolution methods and data organization methods, the data organization method required for the convolution method corresponding to the input feature map data is determined; the data organization method represents the way the input feature map data is distributed to M convolutional computation units in the neural network accelerator, where M is a positive integer greater than 1;
[0007] Using the determined data organization method, the input feature map data is distributed to the M convolutional computation units; the M convolutional computation units are used to calculate and obtain the output feature map data under the convolution mode corresponding to the input feature map data.
[0008] According to a neural network data processing method provided by the present invention, when the convolution mode corresponding to the input feature map data is standard convolution, the determined data organization mode is broadcast mode;
[0009] The step of distributing the input feature map data to the M convolutional computation units using the determined data organization method includes:
[0010] In the broadcast mode, the input feature map data is broadcast and distributed to each of the convolutional computation units.
[0011] According to a neural network data processing method provided by the present invention, when the convolution mode corresponding to the input feature map data is group convolution, the determined data organization mode is multicast mode;
[0012] The step of distributing the input feature map data to the M convolutional computation units using the determined data organization method includes:
[0013] In the multicast mode, the input feature map data is divided into N data groups, and the M convolutional computation units are divided into N convolutional computation unit groups, wherein the N convolutional computation unit groups correspond one-to-one with the N data groups, and N is a positive integer. Each data group is broadcast and distributed to each convolutional computation unit in the corresponding convolutional computation unit group.
[0014] According to a neural network data processing method provided by the present invention, when the convolution mode corresponding to the input feature map data is depthwise separable convolution, the determined data organization mode is unicast mode;
[0015] The step of distributing the input feature map data to the M convolutional computation units using the determined data organization method includes:
[0016] In the unicast mode, the input feature map data is divided into M data groups, wherein the M convolutional computation units correspond one-to-one with the M data groups, and each data group is unicasted to the corresponding convolutional computation unit.
[0017] According to a data processing method for a neural network provided by the present invention, the neural network accelerator includes K clusters of convolutional computation units, each cluster of convolutional computation units includes L convolutional computation units, where K and L are positive integers, and the number of convolutional computation units in the neural network accelerator is L*K.
[0018] Before obtaining the input feature map data and the corresponding convolution method, the process also includes:
[0019] Obtain multiple sets of input feature map data;
[0020] From the K clusters of convolutional computation units, determine the cluster of convolutional computation units that needs to be sent to each of the input feature map data.
[0021] According to a data processing method for a neural network provided by the present invention, the convolutional computation unit or the cluster of convolutional computation units can be used for accelerated computation tasks of one or more neural networks.
[0022] The present invention also provides a data processing apparatus for a neural network, comprising:
[0023] The acquisition module is used to acquire the input feature map data and the corresponding convolution method;
[0024] The determination module is used to determine the data organization method required for the convolution method corresponding to the input feature map data based on the correspondence between the convolution method and the data organization method; the data organization method represents the way the input feature map data is distributed to M convolution computing units in the neural network accelerator, where M is a positive integer greater than 1;
[0025] The distribution module is used to distribute the input feature map data to the M convolutional computation units using the determined data organization method; the M convolutional computation units are used to calculate and obtain the output feature map data under the convolution mode corresponding to the input feature map data.
[0026] The present invention also provides a neural network accelerator, which includes a data processing device for a neural network as described in any of the above embodiments and M convolutional computation units.
[0027] The present invention also provides an electronic device including a neural network accelerator as described in any of the above embodiments.
[0028] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements a data processing method for a neural network as described above.
[0029] The neural network data processing method provided by this invention sets a corresponding data organization method for each convolution method. Under different data organization methods, the way the input feature map data is distributed to the M convolutional computation units in the neural network accelerator is different. Based on the correspondence between the convolution method and the data organization method, the data organization method required for the convolution method corresponding to the input feature map data is determined. Using the determined data organization method, the input feature map data is distributed to the M convolutional computation units. By adjusting the data organization method, the M convolutional computation units are adapted to different convolution methods, thereby calculating and obtaining the output feature map data under the convolution method corresponding to the input feature map data. In this way, the versatility of the neural network accelerator is improved by using a data processing method for multiple convolution methods. Attached Figure Description
[0030] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0031] Figure 1This is one of the flowcharts illustrating the neural network data processing method provided by the present invention;
[0032] Figure 2 This is the second flowchart of the neural network data processing method provided by the present invention;
[0033] Figure 3 This is the third flowchart of the neural network data processing method provided by the present invention;
[0034] Figure 4 This is the fourth flowchart of the neural network data processing method provided by the present invention;
[0035] Figure 5 This is a schematic diagram of the structure of the neural network data processing device provided by the present invention. Detailed Implementation
[0036] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0037] The following is combined with Figures 1 to 4 The present invention describes a data processing method for a neural network.
[0038] like Figure 1 As shown, this embodiment provides a data processing method for a neural network, including:
[0039] Step 101: Obtain the input feature map data and the corresponding convolution method.
[0040] Step 102: Based on the correspondence between convolution mode and data organization mode, determine the data organization mode required for the convolution mode corresponding to the input feature map data; the data organization mode represents the way the input feature map data is distributed to M convolutional computing units in the neural network accelerator, where M is a positive integer greater than 1.
[0041] Step 103: Distribute the input feature map data to the M convolutional computation units using the determined data organization method; the M convolutional computation units are used to calculate and obtain the output feature map data under the convolution mode corresponding to the input feature map data.
[0042] The solution in this embodiment is applied to an artificial intelligence neural network acceleration computing chip in the field of image processing to achieve accelerated inference computing of artificial intelligence neural networks.
[0043] The input feature map data refers to the feature map data of the image required to obtain the output feature map data. In practical applications, different input feature map data may require different convolution methods, which can include standard convolution, grouped convolution, and depthwise separable convolution. In existing technologies, neural network accelerators are often designed specifically for one convolution method, resulting in poor versatility. To address this, this invention proposes a data processing method accommodating multiple convolution methods. By utilizing a fixed set of M convolution computation units in the hardware design of the neural network accelerator, different convolution methods can be implemented, thereby enabling the implementation of multiple convolution methods on the same neural network accelerator to improve versatility.
[0044] Each convolutional computation unit performs convolution calculations through multiplication and addition. Different convolutional computation units can use different convolutional kernels.
[0045] In this embodiment, a corresponding data organization method is set for each convolution method. Under different data organization methods, the way the input feature map data is distributed to the M convolutional computation units in the neural network accelerator is different. Based on the correspondence between convolution methods and data organization methods, the data organization method required for the convolution method corresponding to the input feature map data is determined. Using the determined data organization method, the input feature map data is distributed to the M convolutional computation units. By adjusting the data organization method, the M convolutional computation units are adapted to different convolution methods, thereby calculating the output feature map data under the convolution method corresponding to the input feature map data. In this way, the versatility of the neural network accelerator is improved by using a data processing method that is oriented towards multiple convolution methods.
[0046] In implementation, the identifiers of the convolution mode and the data organization mode corresponding to the input feature map data can be set, and the convolution mode and the data organization mode corresponding to the input feature map data can be obtained by combining the identifiers of the convolution mode and the data organization mode.
[0047] In practical applications, for the three different convolution methods—standard convolution, grouped convolution, and depthwise separable convolution—input feature map data can be distributed to the corresponding convolutional computation units for convolution calculation through different data organization methods. This adapts to different convolution methods, and the data organization methods can include broadcast, multicast, and unicast. Correspondingly, the correspondence between convolution methods and data organization methods includes the correspondence between standard convolution and broadcast, grouped convolution and multicast, and depthwise separable convolution and unicast. The following sections will provide a detailed introduction to each of the three convolution methods.
[0048] In an exemplary embodiment, when the convolution mode corresponding to the input feature map data is standard convolution, the determined data organization mode is broadcast mode;
[0049] Distributing the input feature map data to the M convolutional computation units using the determined data organization method may include:
[0050] In the broadcast mode, the input feature map data is broadcast and distributed to each of the convolutional computation units.
[0051] Standard convolution is the basic convolution method. In standard convolution, each convolutional unit outputs a feature map, which is obtained by calculating all the data from the input feature map. The input feature map data can be broadcast to each convolutional unit, meaning each unit receives all the data from the input feature map. For example... Figure 2 As shown, four convolutional computation units are illustrated, denoted as PE0, PE1, PE2, and PE3. The input feature map data consists of four parts: part D1, part D2, part D3, and part D4. The input feature map data is broadcast to each convolutional computation unit, so each unit receives D1, D2, D3, and D4. Each convolutional computation unit can then perform convolutional computation on the input feature map data using its corresponding convolutional kernel. The output feature map data obtained by PE0, PE1, PE2, and PE3 includes the computation result S0 from PE0, S1 from PE1, S2 from PE2, and S3 from PE3.
[0052] In this embodiment, each convolutional computation unit has a different convolutional kernel. By using multiple convolutional computation units, different convolutional computations can be performed on the input feature map data in parallel, which greatly improves computational efficiency.
[0053] In an exemplary embodiment, when the convolution mode corresponding to the input feature map data is group convolution, the determined data organization mode is multicast mode;
[0054] The step of distributing the input feature map data to the M convolutional computation units using the determined data organization method includes:
[0055] In the multicast mode, the input feature map data is divided into N data groups, and the M convolutional computation units are divided into N convolutional computation unit groups, wherein the N convolutional computation unit groups correspond one-to-one with the N data groups, and N is a positive integer. Each data group is broadcast and distributed to each convolutional computation unit in the corresponding convolutional computation unit group.
[0056] Grouped convolution is a method that divides the input feature map data into groups and then performs convolution on each group. In grouped convolution, the feature map output by each convolutional unit can be calculated from a portion of the input feature map data. The input feature map data can be multicast to the corresponding convolutional units, meaning each convolutional unit receives a portion of the input feature map data. For example... Figure 3 As shown, four convolutional computation units are illustrated, denoted as PE0, PE1, PE2, and PE3. The input feature map data comprises four parts: part D1, part D2, part D3, and part D4. The input feature map data is divided into two data groups: the first data group includes D1 and D2, and the second data group includes D3 and D4. Similarly, the four convolutional computation units are also divided into two groups: the first group includes PE0 and PE1, corresponding to the first data group, and the second group includes PE2 and PE3, corresponding to the second data group. Based on this, the input feature map data can be multicast to multiple convolutional computation units. For example, the first data group is broadcast to each convolutional computation unit in the first group, as follows: Figure 3 As shown, PE0 in the first convolutional computation unit group receives D1 and D2 of the first data group, and PE1 in the same group also receives D1 and D2. The second data group is broadcast and distributed to each convolutional computation unit in the second convolutional computation unit group, as follows: Figure 3 As shown, PE2 in the second convolutional computation unit group receives D3 and D4 from the second data group, and PE3 in the same group also receives D3 and D4. Each convolutional computation unit can perform convolutional computation using its corresponding convolutional kernel. The output feature map data obtained by PE0, PE1, PE2, and PE3 include the computation result S0 output by PE0, the computation result S1 output by PE1, the computation result S2 output by PE2, and the computation result S3 output by PE3.
[0057] In this embodiment, multiple convolutional computation unit groups can perform corresponding convolutional computations on each data group of the input feature map data in parallel, thereby greatly improving computational efficiency.
[0058] In an exemplary embodiment, when the convolution mode corresponding to the input feature map data is depthwise separable convolution, the determined data organization mode is unicast.
[0059] Distributing the input feature map data to the M convolutional computation units using the determined data organization method may include:
[0060] In the unicast mode, the input feature map data is divided into M data groups, wherein the M convolutional computation units correspond one-to-one with the M data groups, and each data group is unicasted to the corresponding convolutional computation unit.
[0061] In depthwise separable convolution, the output of a convolutional computation unit requires a portion of the input feature map data for computation. This can be achieved by dividing the input feature map data into M data groups and unicasting them to the corresponding convolutional computation units. Each convolutional computation unit can receive a portion of the input feature map data. For example... Figure 4 As shown, four convolutional computation units are illustrated, denoted as PE0, PE1, PE2, and PE3. The input feature map data consists of four parts: part D1, part D2, part D3, and part D4. The input feature map data is divided into four data groups: the first group includes D1, the second group includes D2, the third group includes D3, and the fourth group includes D4. Based on this, each data group in the input feature map data can be distributed to multiple convolutional computation units via unicast. For example, the first data group is unicasted to the first convolutional computation unit PE0, which receives the first data group D1. The second data group is unicasted to the second convolutional computation unit PE1, which receives the second data group D2. The third data group is unicasted to the third convolutional computation unit PE2, which receives the third data group D3. The fourth data group is unicasted to the fourth convolutional computation unit PE3, which receives the fourth data group D4. Each convolutional computation unit can perform convolutional computation using its corresponding convolutional kernel. The output feature map data obtained by PE0, PE1, PE2, and PE3 includes the computation result S0 output by PE0, the computation result S1 output by PE1, the computation result S2 output by PE2, and the computation result S3 output by PE3.
[0062] In this embodiment, multiple convolutional computation units can perform corresponding convolutional computations on each data group of the input feature map data in parallel, thereby greatly improving computational efficiency.
[0063] In an exemplary embodiment, the neural network accelerator includes K clusters of convolutional computation units, each cluster of convolutional computation units includes L convolutional computation units, where K and L are positive integers, and the number of convolutional computation units in the neural network accelerator is L*K.
[0064] Before obtaining the input feature map data and the corresponding convolution method, the process also includes:
[0065] Obtain multiple sets of input feature map data;
[0066] From the K clusters of convolutional computation units, determine the cluster of convolutional computation units that needs to be distributed for each input feature map data. The convolutional computation units contained in the clusters of convolutional computation units that need to be distributed are the aforementioned M convolutional computation units.
[0067] In practical applications, neural network accelerators can be configured with multiple convolutional computation unit clusters, each containing multiple convolutional computation units. During data distribution, data is distributed unit by convolutional computation unit cluster. For example, if multiple input feature map data are acquired, each input feature map data can be distributed to its corresponding convolutional computation unit cluster. For instance, if three input feature map data are acquired, and each input feature map data requires a separate convolutional computation unit cluster for convolutional computation, then the three input feature map data can be distributed one-to-one to the three corresponding convolutional computation unit clusters, with each cluster receiving the corresponding input feature map data.
[0068] This allows the input feature map data to be more compact and regular, reducing hardware wiring and facilitating hardware design.
[0069] In an exemplary embodiment, the convolutional computation unit or the cluster of convolutional computation units can be used for accelerated computation tasks of one or more neural networks.
[0070] In practical applications, the data processing method for multiple convolution methods provided in this embodiment can also be used for multi-task training, that is, different convolutional computation units or clusters of convolutional computation units are used for the accelerated computation tasks of one or more neural networks, thus having a wider range of applications.
[0071] The neural network data processing apparatus provided by the present invention is described below. The neural network data processing apparatus described below and the neural network data processing method described above can be referred to in correspondence.
[0072] like Figure 5 As shown, this embodiment provides a data processing device for a neural network, including:
[0073] The acquisition module 501 is used to acquire the input feature map data and the corresponding convolution method;
[0074] The determining module 502 is used to determine the data organization method required by the convolution method corresponding to the input feature map data based on the correspondence between the convolution method and the data organization method; the data organization method represents the way the input feature map data is distributed to M convolution computing units in the neural network accelerator, where M is a positive integer greater than 1;
[0075] The distribution module 503 is used to distribute the input feature map data to the M convolutional calculation units using the determined data organization method; the M convolutional calculation units are used to calculate and obtain the output feature map data under the convolution mode corresponding to the input feature map data.
[0076] In an exemplary embodiment, when the convolution mode corresponding to the input feature map data is standard convolution, the determined data organization mode is broadcast mode;
[0077] Distribution module 503 is specifically used for:
[0078] In the broadcast mode, the input feature map data is broadcast and distributed to each of the convolutional computation units.
[0079] In an exemplary embodiment, when the convolution mode corresponding to the input feature map data is group convolution, the determined data organization mode is multicast mode;
[0080] Distribution module 503 is specifically used for:
[0081] In the multicast mode, the input feature map data is divided into N data groups, and the M convolutional computation units are divided into N convolutional computation unit groups, wherein the N convolutional computation unit groups correspond one-to-one with the N data groups, and N is a positive integer. Each data group is broadcast and distributed to each convolutional computation unit in the corresponding convolutional computation unit group.
[0082] In an exemplary embodiment, when the convolution mode corresponding to the input feature map data is depthwise separable convolution, the determined data organization mode is unicast.
[0083] Distribution module 503 is specifically used for:
[0084] In the unicast mode, the input feature map data is divided into M data groups, wherein the M convolutional computation units correspond one-to-one with the M data groups, and each data group is unicasted to the corresponding convolutional computation unit.
[0085] In an exemplary embodiment, the neural network accelerator includes K clusters of convolutional computation units, each cluster of convolutional computation units includes L convolutional computation units, where K and L are positive integers, and the number of convolutional computation units in the neural network accelerator is L*K.
[0086] It also includes a cell cluster determination module, used for:
[0087] Obtain multiple sets of input feature map data;
[0088] From the K clusters of convolutional computation units, determine the cluster of convolutional computation units that needs to be sent to each of the input feature map data.
[0089] In an exemplary embodiment, the convolutional computation unit or the cluster of convolutional computation units can be used for accelerated computation tasks of one or more neural networks.
[0090] The present invention also provides a neural network accelerator, which includes a data processing device for the neural network and M convolution calculation units provided in any of the above embodiments.
[0091] The specific implementation of the neural network accelerator provided by this invention can be referred to the embodiments of the neural network data processing device described above, and will not be repeated here.
[0092] The present invention also provides an electronic device including a neural network accelerator as described in the above embodiments.
[0093] The specific implementation of the electronic device provided by the present invention can be referred to the embodiment of the neural network accelerator described above, and will not be repeated here.
[0094] On the other hand, the present invention also provides a computer program product, the computer program product including a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions, when the program instructions are executed by a computer, the computer is able to execute the neural network data processing method provided by the above methods, the method including: acquiring input feature map data and corresponding convolution mode;
[0095] Based on the correspondence between convolution methods and data organization methods, the data organization method required for the convolution method corresponding to the input feature map data is determined; the data organization method represents the way the input feature map data is distributed to M convolutional computation units in the neural network accelerator, where M is a positive integer greater than 1;
[0096] Using the determined data organization method, the input feature map data is distributed to the M convolutional computation units; the M convolutional computation units are used to calculate and obtain the output feature map data under the convolution mode corresponding to the input feature map data.
[0097] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform the data processing methods of the neural networks provided above, the method comprising: acquiring input feature map data and the corresponding convolution method;
[0098] Based on the correspondence between convolution methods and data organization methods, the data organization method required for the convolution method corresponding to the input feature map data is determined; the data organization method represents the way the input feature map data is distributed to M convolutional computation units in the neural network accelerator, where M is a positive integer greater than 1;
[0099] Using the determined data organization method, the input feature map data is distributed to the M convolutional computation units; the M convolutional computation units are used to calculate and obtain the output feature map data under the convolution mode corresponding to the input feature map data.
[0100] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0101] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0102] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A data processing method for a neural network, characterized in that, include: Obtain the input feature map data and the corresponding convolution method; Based on the correspondence between convolution methods and data organization methods, the data organization method required for the convolution method corresponding to the input feature map data is determined; the data organization method represents the way the input feature map data is distributed to M convolutional computation units in the neural network accelerator, where M is a positive integer greater than 1; the correspondence between the convolution method and the data organization method includes the correspondence between standard convolution and broadcast, the correspondence between group convolution and multicast, or the correspondence between depthwise separable convolution and unicast. Using the determined data organization method, the input feature map data is distributed to the M convolutional computation units; the M convolutional computation units are used to calculate and obtain the output feature map data under the convolution mode corresponding to the input feature map data.
2. The neural network data processing method according to claim 1, characterized in that, When the convolution method corresponding to the input feature map data is the standard convolution, the determined data organization method is the broadcast method; The step of distributing the input feature map data to the M convolutional computation units using the determined data organization method includes: In the broadcast mode, the input feature map data is broadcast and distributed to each of the convolutional computation units.
3. The neural network data processing method according to claim 1, characterized in that, When the convolution method corresponding to the input feature map data is the grouped convolution, the determined data organization method is the multicast method; The step of distributing the input feature map data to the M convolutional computation units using the determined data organization method includes: In the multicast mode, the input feature map data is divided into N data groups, and the M convolutional computation units are divided into N convolutional computation unit groups, wherein the N convolutional computation unit groups correspond one-to-one with the N data groups, and N is a positive integer. Each data group is broadcast and distributed to each convolutional computation unit in the corresponding convolutional computation unit group.
4. The neural network data processing method according to claim 1, characterized in that, When the convolution method corresponding to the input feature map data is the depthwise separable convolution, the determined data organization method is the unicast method; The step of distributing the input feature map data to the M convolutional computation units using the determined data organization method includes: In the unicast mode, the input feature map data is divided into M data groups, wherein the M convolutional computation units correspond one-to-one with the M data groups, and each data group is unicasted to the corresponding convolutional computation unit.
5. The data processing method for a neural network according to any one of claims 1 to 4, characterized in that, The neural network accelerator includes K clusters of convolutional computation units, each cluster of convolutional computation units includes L convolutional computation units, where K and L are positive integers, and the number of convolutional computation units in the neural network accelerator is L*K. Before obtaining the input feature map data and the corresponding convolution method, the process also includes: Obtain multiple sets of input feature map data; From the K clusters of convolutional computation units, determine the cluster of convolutional computation units that needs to be sent to each of the input feature map data.
6. The neural network data processing method according to claim 5, characterized in that, The convolutional computation unit or the cluster of convolutional computation units can be used for accelerated computation tasks of one or more neural networks.
7. A data processing device for a neural network, characterized in that, include: The acquisition module is used to acquire the input feature map data and the corresponding convolution method; The determination module is used to determine the data organization method required for the convolution method corresponding to the input feature map data based on the correspondence between convolution methods and data organization methods; the data organization method represents the way the input feature map data is distributed to M convolutional computation units in the neural network accelerator, where M is a positive integer greater than 1; the correspondence between the convolution method and the data organization method includes the correspondence between standard convolution and broadcast, the correspondence between group convolution and multicast, or the correspondence between depthwise separable convolution and unicast. The distribution module is used to distribute the input feature map data to the M convolutional computation units using the determined data organization method; the M convolutional computation units are used to calculate and obtain the output feature map data under the convolution mode corresponding to the input feature map data.
8. A neural network accelerator, characterized in that, The neural network accelerator includes the data processing device for the neural network as described in claim 7 and M convolutional computation units.
9. An electronic device, characterized in that, Including the neural network accelerator as described in claim 8.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the data processing method of the neural network as described in any one of claims 1 to 6.