Data collaborative processing method and device for multiple processing units

By establishing communication connections between neural network processing units, using signals to determine the end of operations and automatically executing operations, the problem of long data processing time caused by frequent communication between processing units in the prior art is solved, and the efficiency of neural network operations is improved.

CN114610457BActive Publication Date: 2024-10-11BEIJING HORIZON ROBOTICS TECH RES & DEV CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202210227643.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-08
Publication Date
2024-10-11
Estimated Expiration
2042-03-08

AI Technical Summary

Technical Problem

Multiple existing neural network acceleration processing units need to frequently communicate with the central processing unit when processing data, resulting in long data processing time.

Method used

By establishing communication connections between processing units, collaborative calculations of neural network calculations can be completed without a central processing unit, and the first signal and the second signal are used to determine whether the target sub-network has completed the calculation and automatically perform further operations.

Benefits of technology

It saves the time of communication with the main processing unit, improves the efficiency of neural network operations, realizes automatic coordination of each operation stage, and reduces the need for coordination of the main processing unit.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114610457B_ABST
    Figure CN114610457B_ABST
Patent Text Reader

Abstract

The disclosed embodiment discloses a data collaborative processing method, device, computer-readable storage medium and electronic device for multiple processing units, wherein the method includes: operating a first processing unit in the multiple processing units on a first set of data corresponding to a target subnetwork in a preset neural network to obtain operation result data; generating a first signal for sending a prompt to at least one second processing unit to indicate the end of this operation; detecting a second signal generated by each second processing unit indicating that each second processing unit has completed the operation of the second set of data corresponding to the target subnetwork; and generating instructions instructing the first processing unit to further operate on the neural network based on the position of the target subnetwork in the neural network. The disclosed embodiment realizes automatic coordination of various operation stages during the execution of neural network operation tasks by multiple processing units, thereby improving the efficiency of neural network operations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a method, device, computer-readable storage medium, and electronic device for collaborative data processing of multiple processing units. Background Art

[0002] A heterogeneous multi-core processor is a computer system built with two types of processors: a main processor and an accelerator. By using processing units with different performance and structures in a coordinated manner, different computing needs can be met to achieve accelerated computing in a way that achieves maximum overall performance. Since neural networks have complex structures and large amounts of data to calculate, neural network acceleration processing units specifically designed for neural network computing can be designed. Multiple neural network acceleration processing units integrated in the same chip can perform computing tasks of the same neural network in parallel, thereby increasing the speed of neural network computing. When multiple neural network acceleration processing units process the same frame of data, the processing tasks for the frame can be divided into multiple processing stages, and between each stage, the CPU (central processing unit) and multiple neural network acceleration processing units need to send instructions to complete the coordinated operation of each neural network acceleration processing unit. Summary of the invention

[0003] Embodiments of the present disclosure provide a method, device, computer-readable storage medium, and electronic device for collaborative data processing of multiple processing units.

[0004] An embodiment of the present disclosure provides a method for collaborative data processing of multiple processing units, the method comprising: performing an operation on a first set of data corresponding to a target subnetwork in a preset neural network by a first processing unit in the multiple processing units to obtain operation result data; generating a first signal for sending a prompt to at least one second processing unit included in the multiple processing units to prompt the end of this operation; detecting a second signal generated by each second processing unit in the at least one second processing unit indicating that the operation of the second set of data corresponding to the target subnetwork by each second processing unit has been completed; and generating instructions for instructing the first processing unit to further operate on the neural network based on the position of the target subnetwork in the neural network.

[0005] According to another aspect of an embodiment of the present disclosure, there is provided a data collaborative processing device for multiple processing units, the device comprising: an operation module, for operating a first group of data corresponding to a target subnetwork in a preset neural network by a first processing unit in the multiple processing units to obtain operation result data; a first generation module, for generating a first signal for prompting the completion of this operation to at least one second processing unit included in the multiple processing units; a detection module, for detecting a second signal generated by each second processing unit in the at least one second processing unit indicating the completion of the operation of each second processing unit on the second group of data corresponding to the target subnetwork; and a second generation module, for generating instructions for instructing the first processing unit to further operate on the neural network based on the position of the target subnetwork in the neural network.

[0006] According to another aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program for executing the above-mentioned data collaborative processing method for multiple processing units.

[0007] According to another aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a processor; a memory for storing processor executable instructions; a processor for reading executable instructions from the memory and executing the instructions to implement the above-mentioned data collaborative processing method for multiple processing units.

[0008] Based on the data collaborative processing method, device, computer-readable storage medium and electronic device for multiple processing units provided by the above embodiments of the present disclosure, the first processing unit determines the target sub-network to be run from the neural network, and operates the first group of data corresponding to the target sub-network to obtain the operation result data, and then sends a first signal to at least one second processing unit to prompt the end of this operation. When the second signal generated by each second processing unit indicating that each second processing unit has completed the operation of the second group of data corresponding to the target sub-network is detected, based on the position of the target sub-network in the neural network, an instruction for further operation of the neural network is generated. Thus, during the period when multiple processing units execute the operation task of the neural network, each processing unit determines whether the current target sub-network has completed the operation through the first signal and the second signal, and automatically executes further operation of the neural network when the operation task of the target sub-network is completed, and then each operation stage can be automatically coordinated without coordination through the main processing unit, thereby saving the time spent on communication with the main processing unit and improving the efficiency of neural network operation.

[0009] The technical solution of the present disclosure is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] The above and other purposes, features and advantages of the present disclosure will become more apparent by describing the embodiments of the present disclosure in more detail in conjunction with the accompanying drawings. The accompanying drawings are used to provide a further understanding of the embodiments of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the present disclosure and do not constitute a limitation of the present disclosure. In the drawings, the same reference numerals generally represent the same components or steps.

[0011] Figure 1 is a system diagram to which the present disclosure is applicable.

[0012] Figure 2 It is a flowchart of a data collaborative processing method for multiple processing units provided by an exemplary embodiment of the present disclosure.

[0013] Figure 3 It is a flowchart of a data collaborative processing method for multiple processing units provided by another exemplary embodiment of the present disclosure.

[0014] Figure 4 It is an exemplary schematic diagram of a first connection line and a second connection line of a data collaborative processing method for multiple processing units according to an embodiment of the present disclosure.

[0015] Figure 5 It is a flowchart of a data collaborative processing method for multiple processing units provided by another exemplary embodiment of the present disclosure.

[0016] Figure 6 It is a structural diagram of a data collaborative processing device for multiple processing units provided by an exemplary embodiment of the present disclosure.

[0017] Figure 7 It is a structural diagram of a data collaborative processing device for multiple processing units provided by another exemplary embodiment of the present disclosure.

[0018] Figure 8 is a structural diagram of an electronic device provided by an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0019] Below, the exemplary embodiments according to the present disclosure will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all the embodiments of the present disclosure, and it should be understood that the present disclosure is not limited to the exemplary embodiments described here.

[0020] It should be noted that the relative arrangement of components and steps, the numerical expressions and numerical values ​​set forth in these embodiments do not limit the scope of the present disclosure unless specifically stated otherwise.

[0021] Those skilled in the art can understand that the terms "first" and "second" in the embodiments of the present disclosure are only used to distinguish different steps, devices or modules, etc., and neither represent any specific technical meaning nor indicate the necessary logical order between them.

[0022] It should also be understood that in the embodiments of the present disclosure, “plurality” may refer to two or more than two, and “at least one” may refer to one, two, or more than two.

[0023] It should also be understood that any component, data or structure mentioned in the embodiments of the present disclosure can generally be understood as one or more, unless explicitly limited or otherwise indicated in the context.

[0024] In addition, the term "and / or" in the present disclosure is only a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in the present disclosure generally indicates that the associated objects before and after are in an "or" relationship.

[0025] It should also be understood that the description of the various embodiments in the present disclosure focuses on the differences between the various embodiments, and the same or similar aspects thereof can be referenced to each other, and for the sake of brevity, they will not be described one by one.

[0026] At the same time, it should be understood that for the convenience of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship.

[0027] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application, or uses.

[0028] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered as part of the specification.

[0029] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0030] Application Overview

[0031] When multiple neural network acceleration processing units currently process a frame of data, they usually divide the complete neural network processing task into multiple parts. Each part is processed by a corresponding processing unit that obtains corresponding data, and the central processing unit coordinates the calculation process of each neural network acceleration processing unit.

[0032] For example, if the chip includes two neural network acceleration processing units and one central processing unit, the two neural network acceleration processing units can each take on half of the computing workload of the neural network. After calculating one layer of the neural network, they wait for further instructions from the central processing unit, thereby enabling the two neural network acceleration processing units to run synchronously.

[0033] However, since each neural network acceleration processing unit needs to communicate with the central processing unit multiple times during the processing of a frame of data, the data processing takes a long time. In order to solve this problem, the embodiment of the present disclosure establishes a communication connection between the various processing units used for performing neural network calculations, thereby achieving collaborative calculations of the various processing units used for performing neural network calculations without going through the central processing unit.

[0034] Exemplary Systems

[0035] Figure 1 An exemplary system architecture 100 is shown to which a method for collaborative data processing for multiple processing units or an apparatus for collaborative data processing for multiple processing units according to an embodiment of the present disclosure can be applied.

[0036] like Figure 1 As shown, the system architecture 100 may include a first processing unit 101, at least one second processing unit 102, a main processing unit 103, and a shared memory 104. The first processing unit 101, at least one second processing unit 102, the main processing unit 103, and the shared memory 104 may be integrated into one chip, or may be set in different chips or circuit boards, and data communication links may be established between these chips or circuit boards.

[0037] The first processing unit 101 and the at least one second processing unit 102 are used to perform neural network calculations. Generally, the first processing unit 101 and the at least one second processing unit 102 can collaboratively run different parts of the same neural network to process the same frame of data. The first processing unit 101 and the at least one second processing unit 102 can establish a communication connection between each other to send a first signal to the other processing units indicating that the current operation has ended and a second signal indicating that the current operation of the other processing units has ended.

[0038] The main processing unit 103 can manage the operation process of the first processing unit 101 and the at least one second processing unit 102. For example, various instructions (such as instructions for instructing the first processing unit 101 and the at least one second processing unit 102 to start neural network operations, instructions for instructing the first processing unit 101 and the at least one second processing unit 102 to end operations, etc.) are sent to the first processing unit 101 and the at least one second processing unit 102, and notifications sent by the first processing unit 101 and the at least one second processing unit 102 are received.

[0039] The shared memory 104 is used to store the operation result data output by the first processing unit 101 and the at least one second processing unit 102, and can also store the original data to be processed, the parameters of the neural network, etc. The first processing unit 101 and the at least one second processing unit 102 can read the data to be operated from the shared memory, and store the operation results in the shared memory 104. The main processing unit 103 can read the operation result data output by the first processing unit 101 and the at least one second processing unit 102 from the shared memory.

[0040] It should be noted that the functions of the first processing unit 101 and the at least one second processing unit 102 are the same, that is, they are used to perform data operations on different parts of the same neural network. Therefore, Figure 1 Each of the first processing unit 101 and the at least one second processing unit 102 shown can execute the data collaborative processing method for multiple processing units, and accordingly, each processing unit can be provided with the data collaborative processing device for multiple processing units. For any one of the multiple processing units that execute the same neural network operation, the processing unit is the first processing unit, and the other processing units are the second processing units.

[0041] It should be understood that Figure 1 The number of the first processing unit 101, the second processing unit 102 and the main processing unit 103 is only illustrative. According to the implementation requirements, there can be any number of the first processing unit 101, the second processing unit 102 and the main processing unit 103.

[0042] Exemplary Methods

[0043] Figure 2 FIG. 1 is a flow chart of a method for collaborative data processing of multiple processing units provided by an exemplary embodiment of the present disclosure. Figure 1 On the first processing unit 101 shown, as Figure 2 As shown, the method comprises the following steps:

[0044] Step 201, a first processing unit in a multi-processing unit operates on a first set of data corresponding to a target sub-network in a preset neural network to obtain operation result data.

[0045] In this embodiment, the first processing unit 101 can operate on the first set of data corresponding to the target sub-network to obtain operation result data. The above neural network can include multiple sub-networks. For example, each convolution layer included in the neural network can be used as a sub-network. The target sub-network is the sub-network currently to be run among the sub-networks in the neural network.

[0046] Each sub-network in a neural network usually performs computational tasks in a certain order. According to this order, the sub-network that is about to run is the target sub-network.

[0047] Typically, before executing step 201, the first processing unit 101 and the Figure 1 At least one second processing unit 102 shown in FIG. 1 may execute instructions required by the data collaborative processing method in advance. Figure 1 In the shared memory 104 shown, the first processing unit 101 and the at least one second processing unit 102 respectively read the corresponding instructions from the shared memory 104, and based on the read instructions, the first processing unit 101 and the at least one second processing unit 102 respectively execute the steps in the data collaborative processing method. The above instructions can be generated by compiling the program of the data collaborative processing method written in advance by a compiler.

[0048] The first set of data includes a portion of the data to be processed that is input into the target sub-network and a portion of the calculation parameters corresponding to the target sub-network.

[0049] For example, the target subnetwork is a convolution layer in the above-mentioned neural network, and the convolution layer is used to perform a convolution operation on the data to be processed input therein using its corresponding convolution kernel (i.e., calculation parameters). The first processing unit 101 can be pre-configured to bear part (e.g., half) of the convolution operation of the target subnetwork. The first processing unit 101 can obtain the corresponding data to be processed and the parameters included in the convolution kernel, and perform a convolution operation on this part of the data to obtain the operation result data.

[0050] Typically, the first set of data may be stored in a shared memory outside the first processing unit 101 (eg Figure 1When the first unit starts to execute the operation of the target sub-network, the first processing unit 101 can read the first set of data from the shared memory and save it to the cache (e.g., SRAM (Static Random-Access Memory) type cache) in the first processing unit 101. After the operation is completed, the first processing unit 101 stores the operation result data in the shared memory.

[0051] Step 202: Generate a first signal for sending a prompt to at least one second processing unit included in the multi-processing units to indicate the end of the current operation.

[0052] In this embodiment, the first processing unit 101 may generate a Figure 1 At least one second processing unit 102 shown sends a first signal prompting the end of this operation. The first signal can be a signal in various forms, such as a high or low level signal, a digital signal, etc. The first processing unit can directly send the first signal through the connection between the at least one second processing unit 102, or can indirectly send the first signal through other devices.

[0053] Step 203: Detect a second signal generated by each second processing unit in at least one second processing unit, indicating that each second processing unit has completed operation on the second group of data corresponding to the target sub-network.

[0054] In this embodiment, the first processing unit 101 may detect a second signal generated by each second processing unit in the at least one second processing unit 102, indicating that each second processing unit has completed operating the second group of data corresponding to the target sub-network.

[0055] The data processed by each second processing unit is referred to as the second group of data. As an example, when there is one second processing unit, the second processing unit processes half of the full amount of data processed by the target subnetwork, and this half of the data is the second group of data. Correspondingly, the first processing unit 101 processes the other half of the full amount of data processed by the target subnetwork, and this half of the data is the first group of data.

[0056] When a second processing unit completes the operation on the second set of data, it sends a second signal to the first processing unit 101. When the first processing unit 101 receives the second signals sent by all second processing units, it determines that the current operation on the target sub-network is completed.

[0057] Step 204: Based on the position of the target sub-network in the neural network, generate instructions for instructing the first processing unit to further operate the neural network.

[0058] In this embodiment, the first processing unit 101 may generate instructions for instructing the first processing unit 101 to further operate on the neural network based on the position of the target sub-network in the neural network.

[0059] Among them, each sub-network in the above neural network has a certain position order in the neural network, and the first processing unit 101 performs the computing tasks of each sub-network in sequence. If the first processing unit 101 and at least one second processing unit 102 complete the computing tasks of the target sub-network, an instruction to continue to perform subsequent data processing tasks can be further generated according to the order of each sub-network, and subsequent data processing tasks can be performed based on the instruction.

[0060] The method provided by the above-mentioned embodiment of the present disclosure determines the target sub-network to be currently run from the neural network through the first processing unit, and operates the first group of data corresponding to the target sub-network to obtain the operation result data, and then sends a first signal to at least one second processing unit to prompt the end of this operation, and when the second signal generated by each second processing unit indicating that each second processing unit has completed the operation of the second group of data corresponding to the target sub-network is detected, based on the position of the target sub-network in the neural network, generates further instructions for the operation of the neural network. Thereby, during the period when multiple processing units execute the operation task of the neural network, each processing unit determines whether the current target sub-network has completed the operation through the first signal and the second signal, and automatically executes further operations of the neural network when the operation task of the target sub-network is completed, and then each operation stage can be automatically coordinated without the need for coordination through the main processing unit, thereby saving the time spent on communication with the main processing unit and improving the efficiency of the neural network operation.

[0061] In some optional implementations, step 204 may include:

[0062] In response to determining that the target sub-network is not the last-level sub-network in the neural network, a first instruction is generated, and a first set of data corresponding to the target sub-network to be run is reacquired according to the first instruction.

[0063] As an example, if the neural network includes three convolutional layers, each convolutional layer is a subnetwork. The three convolutional layers are marked as C1, C2, and C3 in order. If the subnetwork that has completed the current computing task is C1 (or C2), a first instruction is generated, and the first group of data corresponding to the next-level subnetwork C2 (or C3) as the target subnetwork is re-acquired according to the first instruction. The first processing unit 101 executes the above steps 201-204 again until all subnetworks have completed the computing tasks.

[0064] By looping through steps 201 to 204, this embodiment allows each sub-network included in the neural network to automatically perform collaborative operations with the first processing unit and at least one second processing unit during the execution of a computing task, thereby improving the speed at which the entire neural network processes data.

[0065] In some optional implementations, step 204 may include:

[0066] In response to determining that the target sub-network is the last level sub-network in the neural network, a second instruction is generated, and a third signal indicating that the neural network has completed execution is sent to a main processing unit included in the multi-processing unit according to the second instruction.

[0067] Specifically, if the target sub-network is the last level sub-network in the neural network, it means that the operation task of the neural network currently executed by the first processing unit 101 and at least one second processing unit 102 is completed, and at this time, the target sub-network can be sent to the following example: Figure 1 The main processing unit 103 shown sends a third signal. After receiving the third signal, the main processing unit 103 can read the calculation result data corresponding to the target subnetwork from the shared memory 104, or read the calculation result data corresponding to other subnetworks, and then use the read calculation result data for subsequent processing (such as classification, outputting information for display, etc.).

[0068] This embodiment notifies the main processing unit of the completion of the operation when the first processing unit 101 and the at least one second processing unit 102 automatically collaborate to execute the neural network operation task, thereby achieving the goal of only needing to communicate with the main processing unit once when the neural network operation is completed. While improving the speed of the neural network operation, it can greatly reduce the time for the main processing unit to communicate with the first processing unit 101 and the at least one second processing unit 102, thereby improving the operating efficiency of the main processing unit.

[0069] In some optional implementations, such as Figure 3 As shown, step 202 includes:

[0070] Step 2021: Set the level on the first connection line between each second processing unit in at least one second processing unit to a first level representing the first signal.

[0071] The first level can be set arbitrarily, such as a high level. Accordingly, during the period when the first processing unit 101 executes the computing task of the target sub-network, the first connection line maintains a low level.

[0072] Based on this, the above step 203 includes:

[0073] Step 2031, detecting whether the level on the second connection line between each second processing unit in at least one second processing unit is the first level, and if it is the first level, determining that the second signal is detected.

[0074] As an example, Figure 4 As shown, the first processing unit 101 is connected to the second processing units 1021 and 1022 through the first connection lines 4011 and 4012, and is connected to the second processing units 1021 and 1022 through the second connection lines 4021 and 4022. When the first processing unit 101 completes the operation task of executing the target sub-network using the first set of data, the level on the first connection lines 4011 and 4012 is set high (i.e., the first level). If it is detected that the level on the second connection lines 4021 and 4022 is low at this time, it waits until it is detected that the levels on the second connection lines 4021 and 4022 are both high levels indicating the second signal, and then it is determined that the second processing units 1021 and 1022 complete the operation task of executing the target sub-network using the corresponding second set of data.

[0075] On the other hand, if the first processing unit 101 detects that the second line 4021 or 4022 is at a high level while executing a calculation task, it continues to execute the calculation task until the current calculation is completed, and sets the level on the first lines 4011 and 4012 to high to notify the second processing units 1021 and 1022 that the current calculation is completed.

[0076] This embodiment detects whether the first processing unit and the second processing unit have completed the computing task of the target sub-network by setting the levels on the first connection line and the second connection line between the first processing unit and the second processing unit, thereby enabling the first processing unit and at least one second processing unit to coordinate computing based on level detection without the need for complex signal receiving and sending operations, thereby improving the efficiency of the coordinated computing of each processing unit.

[0077] In some optional implementations, such as Figure 3 As shown, after step 2031, the method further includes:

[0078] Step 2032, setting the level on the second line to a second level.

[0079] The second level is different from the first level. For example, the first level is a high level, and the second level is a low level.

[0080] In this embodiment, the first processing unit 101 sets the level on the second line to the second level as long as it detects that the level on the second line is the first level, and waits for the second processing unit to set the level on the second line to the first level again when the next operation is completed.

[0081] This embodiment can automatically prepare for the next collaborative operation by setting the level on the second line to the second level when the first level is detected on the second line, thereby further improving the efficiency of the collaborative operation of each processing unit.

[0082] In some optional implementations, after step 201, the method further includes:

[0083] The result data is stored in Figure 1 The shared memory 104 corresponding to the multiple processing units shown.

[0084] Among them, the shared memory 104 is used to store the operation result data output by the first processing unit 101 and at least one second processing unit 102, and can also store the original data to be processed, the parameters of the neural network, etc.

[0085] By setting up shared memory, the calculation result data output by each processing unit can be temporarily stored in the shared memory, which makes it easier for the main processing unit to extract the calculation result data from the shared memory, reduces the time spent on data exchange with the main processing unit, and helps to further improve the efficiency of neural network calculations.

[0086] In some optional implementations, such as Figure 5 As shown, step 201 may include:

[0087] Step 2011, in response to determining that the target subnetwork is not the first-level subnetwork included in the neural network, obtain the preset parameters processed by the first processing unit corresponding to the target subnetwork and the operation result data output by the previous-level subnetwork of the target subnetwork from the shared memory as the first group of data, and operate on the first group of data to obtain the operation result data.

[0088] That is, when the target sub-network is not a first-level sub-network, the first processing unit 101 needs to use the operation result data output by the upper-level sub-network of the target sub-network for operation. Since the operation result data output by the upper-level sub-network is stored in the shared memory, the first set of data can be directly read from the shared memory. After the operation is completed, the current operation result data is stored in the shared memory so that the lower-level sub-network or the main processing unit can read the operation result data from the shared memory.

[0089] Step 2012, in response to determining that the target subnetwork is a first-level subnetwork included in the neural network, obtain the preset parameters and preset input data processed by the first processing unit corresponding to the target subnetwork from the shared memory as the first group of data, and operate on the first group of data to obtain operation result data.

[0090] That is, when the target subnetwork is a first-level subnetwork, the first processing unit 101 can read the first set of pre-stored data from the shared memory. After the operation is completed, the current operation result data is stored in the shared memory for the lower-level subnetwork or the main processing unit to read the operation result data from the shared memory. The parameters and corresponding operation data of each stage are obtained, so that each processing unit can automatically complete the data access in the entire operation process of the neural network, thereby improving the data processing efficiency of the neural network.

[0091] Exemplary Devices

[0092] Figure 6 FIG. 1 is a schematic diagram of a data collaborative processing device for multiple processing units provided by an exemplary embodiment of the present disclosure. Figure 1 On the first processing unit 101 shown, as Figure 6 As shown, the data collaborative processing device for multiple processing units includes: an operation module 601, which is used to operate a first group of data corresponding to a target subnetwork in a preset neural network through a first processing unit in the multiple processing units to obtain operation result data; a first generation module 602, which is used to generate a first signal for prompting the end of this operation to at least one second processing unit included in the multiple processing units; a detection module 603, which is used to detect a second signal generated by each second processing unit in at least one second processing unit, indicating that each second processing unit has completed the operation of the second group of data corresponding to the target subnetwork; a second generation module 604, which is used to generate instructions for instructing the first processing unit to further operate on the neural network based on the position of the target subnetwork in the neural network.

[0093] In this embodiment, the operation module 601 can operate on the first set of data corresponding to the target sub-network to obtain the operation result data. The above neural network can include multiple sub-networks. For example, each convolution layer included in the neural network can be used as a sub-network. The target sub-network is the sub-network currently to be run among the sub-networks in the neural network.

[0094] Each sub-network in a neural network usually performs computational tasks in a certain order. According to this order, the sub-network that is about to run is the target sub-network.

[0095] The first set of data includes a portion of the data to be processed that is input into the target sub-network and a portion of the calculation parameters corresponding to the target sub-network.

[0096] For example, the target subnetwork is a convolution layer in the above-mentioned neural network, and the convolution layer is used to perform a convolution operation on the data to be processed input therein using its corresponding convolution kernel (i.e., calculation parameters). The first processing unit 101 can be pre-configured to bear part (e.g., half) of the convolution operation of the target subnetwork. The first processing unit 101 can obtain the corresponding data to be processed and the parameters included in the convolution kernel, and perform a convolution operation on this part of the data to obtain the operation result data.

[0097] Typically, the first set of data may be stored in a shared memory outside the first processing unit 101 (eg Figure 1 When the first unit starts to execute the operation of the target sub-network, the first processing unit 101 can read the first set of data from the shared memory and save it to the cache (e.g., SRAM (Static Random-Access Memory) type cache) in the first processing unit 101. After the operation is completed, the first processing unit 101 stores the operation result data in the shared memory.

[0098] In this embodiment, the first generating module 602 can generate Figure 1 At least one second processing unit 102 shown sends a first signal prompting the end of this operation. The first signal can be a signal in various forms, such as a high or low level signal, a digital signal, etc. The first processing unit can directly send the first signal through the connection between the at least one second processing unit 102, or can indirectly send the first signal through other devices.

[0099] In this embodiment, the detection module 603 may detect a second signal generated by each second processing unit in the at least one second processing unit 102, indicating that each second processing unit has completed the operation of the second group of data corresponding to the target sub-network.

[0100] The data processed by each second processing unit is referred to as the second group of data. As an example, when there is one second processing unit, the second processing unit processes half of the full amount of data processed by the target subnetwork, and this half of the data is the second group of data. Correspondingly, the first processing unit 101 processes the other half of the full amount of data processed by the target subnetwork, and this half of the data is the first group of data.

[0101] When a second processing unit completes the operation on the second set of data, it sends a second signal to the first processing unit 101. When the first processing unit 101 receives the second signals sent by all second processing units, it determines that the current operation on the target sub-network is completed.

[0102] In this embodiment, the second generating module 604 may generate instructions for instructing the first processing unit 101 to further operate on the neural network based on the position of the target sub-network in the neural network.

[0103] Among them, each sub-network in the above neural network has a certain position order in the neural network, and the first processing unit 101 performs the computing tasks of each sub-network in sequence. If the first processing unit 101 and at least one second processing unit 102 complete the computing tasks of the target sub-network, an instruction to continue to perform subsequent data processing tasks can be further generated according to the order of each sub-network, and subsequent data processing tasks can be performed based on the instruction.

[0104] Reference Figure 7 , Figure 7 It is a structural diagram of a data collaborative processing device for multiple processing units provided by another exemplary embodiment of the present disclosure.

[0105] In some optional implementations, the second generation module 604 is further used to: in response to determining that the target subnetwork is not the last level subnetwork in the neural network, generate a first instruction, and reacquire a first set of data corresponding to the target subnetwork to be run currently according to the first instruction.

[0106] In some optional implementations, the second generation module 604 is further used to: in response to determining that the target subnetwork is the last-level subnetwork in the neural network, generate a second instruction, and send a third signal indicating that the neural network has completed execution to a main processing unit included in the multi-processing unit according to the second instruction.

[0107] In some optional implementations, the first generation module 602 is further used to: set the level on the first connection line between each second processing unit in at least one second processing unit to a first level representing the first signal; the detection module 603 includes: a first detection unit 6031, used to detect whether the level on the second connection line between each second processing unit in at least one second processing unit is the first level, and if it is the first level, determine that the second signal is detected.

[0108] In some optional implementations, the detection module 603 further includes: a second detection unit 6032, configured to set the level on the second line to a second level.

[0109] In some optional implementations, the device further includes: a storage module 605, configured to store the operation result data in a shared memory corresponding to the multiple processing units.

[0110] In some optional implementations, the operation module 601 includes: a first operation unit 6011, which is used to obtain the preset parameters processed by the first processing unit corresponding to the target subnetwork and the operation result data output by the upper-level subnetwork of the target subnetwork from the shared memory as the first group of data in response to determining that the target subnetwork is not the first-level subnetwork included in the neural network, and operate on the first group of data to obtain the operation result data; a second operation unit 6012, which is used to obtain the preset parameters processed by the first processing unit and the preset input data corresponding to the target subnetwork as the first group of data in response to determining that the target subnetwork is the first-level subnetwork included in the neural network, and operate on the first group of data to obtain the operation result data.

[0111] The data collaborative processing device for multiple processing units provided in the above embodiment of the present disclosure determines the current target sub-network to be run from the neural network through the first processing unit, and operates the first group of data corresponding to the target sub-network to obtain the operation result data, and then sends a first signal to at least one second processing unit to prompt the end of this operation. When the second signal generated by each second processing unit indicating that each second processing unit has completed the operation of the second group of data corresponding to the target sub-network is detected, based on the position of the target sub-network in the neural network, an instruction for further operation of the neural network is generated. Thus, during the period when multiple processing units execute the operation task of the neural network, each processing unit determines whether the current target sub-network has completed the operation through the first signal and the second signal, and automatically executes further operation of the neural network when the operation task of the target sub-network is completed, and then each operation stage can be automatically coordinated without coordination through the main processing unit, thereby saving the time spent on communication with the main processing unit and improving the efficiency of neural network operation.

[0112] Exemplary Electronic Devices

[0113] Below, reference Figure 8 An electronic device according to an embodiment of the present disclosure is described. Figure 8 A block diagram of an electronic device according to an embodiment of the present disclosure is illustrated.

[0114] like Figure 8 As shown, the electronic device 800 includes at least two processing units 801 for collaboratively running a neural network, and a memory 802 for storing executable instructions of the at least two processing units 801.

[0115] The electronic device 800 may be a device in various forms, for example, the electronic device 800 may be a chip on which the at least two processing units 801 and the memory 802 are integrated. For another example, the electronic device 800 may be a device composed of a plurality of chips or circuits, for example, the at least two processing units 801 and the memory 802 may be respectively arranged in different chips or circuit boards.

[0116] Each of the at least two processing units 801 is configured to read a corresponding executable instruction from the memory 802 and execute the read executable instruction to implement the above Figure 2 The data collaborative processing method for multiple processing units described in the corresponding embodiment.

[0117] The at least two processing units 801 mentioned above may be processing units specifically used for performing neural network operations, such as neural network acceleration processors. The at least two processing units 801 may also control other components in the electronic device 600 to perform desired functions.

[0118] It should be understood that for each of the at least two processing units 801, when the processing unit executes the above Figure 2 In the data collaborative processing method for multiple processing units described in the corresponding embodiment, the processing unit is the first processing unit, and the other processing units are at least one second processing unit.

[0119] The above-mentioned memory 802 may include one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium.

[0120] In one example, the electronic device 800 may further include: an input device 803 and an output device 804, and these components are interconnected via a bus system and / or other forms of connection mechanisms (not shown).

[0121] For example, the input device 803 may be a mouse, keyboard or other device for inputting various commands supporting neural network operations, etc. The input device 803 may also be a communication network connector for receiving various commands and other contents from a remote location.

[0122] The output device 804 can output various information to the outside, including the calculation results of the neural network, etc. The output device 804 can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, etc.

[0123] Of course, to simplify, Figure 8 Only some of the components related to the present disclosure in the electronic device 800 are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, according to specific application situations, the electronic device 800 may also include any other appropriate components.

[0124] The electronic device provided by the above embodiment of the present disclosure executes the above Figure 2 The data collaborative processing method for multiple processing units described in the corresponding embodiment realizes automatic collaboration of various operation stages during the execution of neural network operation tasks by multiple processing units, without the need for coordination through the main processing unit, thereby saving the time spent on communication with the main processing unit and improving the efficiency of neural network operations.

[0125] In some optional implementations, such as Figure 8 As shown, the electronic device 800 further includes a shared memory 805 for storing data required by at least one sub-network included in the neural network during operation and data output by the at least one sub-network. The shared memory 805 can be integrated with the at least two processing units 801 and the memory 802 in one chip, or can be set in different chips.

[0126] It should be noted that the names of the shared memory 805 and the memory 802 are merely functional distinctions, and are not hardware distinctions. The shared memory 805 and the memory 802 may be the same device or different devices.

[0127] By setting up shared memory, the calculation result data output by each processing unit can be temporarily stored in the shared memory, which makes it easier for the processing unit to directly extract the calculation result data from the shared memory. It can also reduce the time spent on data exchange with the main processing unit, which helps to further improve the efficiency of neural network operations.

[0128] In some optional implementations, such as Figure 8As shown, the electronic device 800 also includes a main processing unit 806, which is used to read the data output by the neural network from the shared memory in response to receiving a third signal sent by each of the at least two processing units indicating that the neural network has completed operation. After receiving the third signal, the main processing unit can read the operation result data corresponding to the target sub-network from the shared memory, and can also read the operation result data corresponding to other sub-networks, and then use the read operation result data for subsequent processing (such as classification, outputting information for display, etc.).

[0129] This embodiment notifies the main processing unit 806 of the completion of the operation when at least two processing units 801 automatically collaborate to execute the neural network operation task. This achieves the goal of only needing to communicate with the main processing unit once when the neural network operation is completed. While increasing the speed of the neural network operation, it also saves the time for the main processing unit 806 to communicate with at least two processing units 801, thereby improving the operating efficiency of the main processing unit.

[0130] In some optional implementations, such as Figure 8 As shown, a first connection line 807 and a second connection line 808 are provided between the at least two processing units 801 .

[0131] Each of the at least two processing units 801 is used to send a first signal indicating the end of this operation to the other connected processing units through the first connection 807, and receive a second signal indicating the end of this operation from the other connected processing units through the second connection 808.

[0132] This embodiment realizes direct communication between the processing units by setting the first connection line and the second connection line between the processing units, thereby helping to enable the processing units to perform collaborative operations of the neural network more efficiently.

[0133] Exemplary computer program products and computer-readable storage media

[0134] In addition to the above-mentioned methods and devices, an embodiment of the present disclosure may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the data collaborative processing method for multiple processing units according to various embodiments of the present disclosure described in the above-mentioned "Exemplary Method" section of this specification.

[0135] The computer program product may be written in any combination of one or more programming languages ​​to write program code for performing the operations of the disclosed embodiments, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0136] In addition, an embodiment of the present disclosure may also be a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, enable the processor to execute the steps of a method for data collaborative processing for multiple processing units according to various embodiments of the present disclosure described in the above “Exemplary Method” section of this specification.

[0137] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0138] The basic principles of the present disclosure are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present disclosure are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present disclosure. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, and are not limitations. The above details do not limit the present disclosure to the necessity of adopting the above specific details to be implemented.

[0139] Each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0140] The block diagrams of the devices, apparatuses, equipment, and systems involved in this disclosure are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagrams. As will be appreciated by those skilled in the art, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including," "comprising," "having," and the like are open words, referring to "including but not limited to," and can be used interchangeably therewith. The words "or" and "and" used herein refer to the words "and / or," and can be used interchangeably therewith, unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to," and can be used interchangeably therewith.

[0141] The method and apparatus of the present disclosure may be implemented in many ways. For example, the method and apparatus of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of steps for the method is for illustration only, and the steps of the method of the present disclosure are not limited to the order specifically described above, unless otherwise specifically stated. In addition, in some embodiments, the present disclosure may also be implemented as a program recorded in a recording medium, which includes machine-readable instructions for implementing the method according to the present disclosure. Therefore, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.

[0142] It should also be noted that in the apparatus, device and method of the present disclosure, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present disclosure.

[0143] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

[0144] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.

Claims

1. A data collaborative processing method for multiple processing units, wherein: The method comprises: The first processing unit in the multi-processing units operates a first set of data corresponding to a target sub-network in a preset neural network to obtain operation result data, wherein the neural network includes multiple sub-networks, and the target sub-network is a sub-network currently to be operated in each sub-network; generating a first signal for sending a prompt to at least one second processing unit included in the multi-processing units to indicate the end of the current operation; Detecting a second signal generated by each of the at least one second processing unit indicating that each of the second processing units has completed operation on the second group of data corresponding to the target subnetwork; In response to the first processing unit and the at least one second processing unit both completing the operation task on the target sub-network, based on the position of the target sub-network in the neural network, generating an instruction for instructing the first processing unit to further operate on the neural network; Among them, the first processing unit and the at least one second processing unit are respectively used to perform data operations on different parts of the neural network, and a communication connection is established between the first processing unit and the at least one second processing unit, and the communication connection is used to send the first signal and the second signal.

2. The method according to claim 1, wherein: The generating, based on the position of the target sub-network in the neural network, an instruction for instructing the first processing unit to further operate the neural network comprises: In response to determining that the target sub-network is not the last-level sub-network in the neural network, a first instruction is generated, and a first set of data corresponding to the target sub-network to be run is reacquired according to the first instruction.

3. The method according to claim 1, wherein: The generating, based on the position of the target sub-network in the neural network, an instruction for instructing the first processing unit to further operate the neural network comprises: In response to determining that the target sub-network is the last-level sub-network in the neural network, a second instruction is generated, and according to the second instruction, a third signal indicating that the neural network has completed its operation is sent to the main processing unit included in the multi-processing unit.

4. The method according to claim 2, wherein: The generating a first signal for sending a prompt to at least one second processing unit included in the multiple processing units to indicate the end of the current operation includes: Setting a level on a first connection line between each second processing unit in the at least one second processing unit to a first level representing a first signal; The detecting a second signal generated by each of the at least one second processing unit indicating that each second processing unit has completed operation of the second group of data corresponding to the target subnetwork, comprises: It is detected whether the level on the second connection line between each second processing unit in the at least one second processing unit is the first level, and if it is the first level, it is determined that the second signal is detected.

5. The method according to claim 4, wherein: After the determining that the second signal is detected, the method further includes: The level on the second connection line is set to a second level.

6. The method according to any one of claims 1 to 5, wherein: After computing the first set of data corresponding to the target subnetwork to obtain computing result data, the method further includes: The operation result data is stored in the shared memory corresponding to the multiple processing units.

7. The method according to claim 6, wherein: The performing operation on the first set of data corresponding to the target sub-network to obtain operation result data includes: In response to determining that the target subnetwork is not a first-level subnetwork included in the neural network, obtaining from the shared memory preset parameters processed by the first processing unit corresponding to the target subnetwork and operation result data output by an upper-level subnetwork of the target subnetwork as a first group of data, and performing operation on the first group of data to obtain operation result data; In response to determining that the target subnetwork is a first-level subnetwork included in the neural network, the preset parameters and preset input data processed by the first processing unit corresponding to the target subnetwork are obtained from the shared memory as a first group of data, and the first group of data is operated to obtain operation result data.

8. A data collaborative processing device for multiple processing units, wherein: The device comprises: A computing module, configured to compute a first set of data corresponding to a target subnetwork in a preset neural network through a first processing unit in the multi-processing units to obtain computing result data, wherein the neural network includes a plurality of subnetworks, and the target subnetwork is a subnetwork currently to be run in each subnetwork; A first generating module, used for generating a first signal for sending to at least one second processing unit included in the multi-processing units to prompt the completion of the current operation; a detection module, configured to detect a second signal generated by each of the at least one second processing unit, indicating that each of the second processing units has completed operation on the second group of data corresponding to the target subnetwork; A second generating module is configured to generate, in response to the first processing unit and the at least one second processing unit both completing the operation task on the target sub-network, an instruction for instructing the first processing unit to further operate on the neural network based on the position of the target sub-network in the neural network; Among them, the first processing unit and the at least one second processing unit are respectively used to perform data operations on different parts of the neural network, and a communication connection is established between the first processing unit and the at least one second processing unit, and the communication connection is used to send the first signal and the second signal.

9. An electronic device comprising at least two processing units for collaboratively operating a neural network, and a memory for storing executable instructions of the at least two processing units; Each of the at least two processing units is configured to read a corresponding executable instruction from the memory and execute the read executable instruction to implement any of the methods described in claims 1-7.

10. The electronic device according to claim 9, wherein: The electronic device also includes a shared memory; The shared memory is used to store data required by at least one sub-network included in the neural network during operation and data output by the at least one sub-network.

11. The electronic device according to claim 10, wherein: The electronic device also includes a main processing unit; The main processing unit is used to read the data output by the neural network from the shared memory in response to receiving a third signal sent by each of the at least two processing units indicating that the neural network has completed execution.

12. The electronic device according to any one of claims 9 to 11, wherein: A first connection line and a second connection line are provided between the at least two processing units; Each of the at least two processing units is configured to send a first signal indicating the end of a current operation to other connected processing units via the first connection, and receive a second signal indicating the end of a current operation from other connected processing units via the second connection.

13. A computer-readable storage medium storing a computer program, wherein the computer program is used to execute the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Space effective load in-orbit image data mining device and method

    CN108804616A

  • Neural network processor, operation method and storage medium

    CN109726807A

  • Neural network segmentation calculation method and device, storage medium and mobile terminal

    CN110298437A

  • Instruction scheduling method for executing neural network calculation and corresponding calculation system

    CN110659069A

  • Data preprocessing method and device, computer equipment and storage medium

    CN112732601A