Efficient memory allocation in neural network computational tiles
A shared instruction mechanism for memory allocation in hardware accelerators addresses inefficiencies in large neural networks by reducing instruction size and bandwidth, enhancing computational efficiency and error resilience.
Patent Information
- Application Number
- JP2025061894
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2025-04-03
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2041-04-26
AI Technical Summary
Existing hardware accelerators face inefficiencies in performing inference computations for large neural networks due to the high number and size of instructions required for memory allocation, which can exceed memory limits and lead to errors and increased pause overhead, especially in iterative loops.
Implementing a shared instruction mechanism that allocates memory for multiple computing units within a hardware accelerator, reducing the need for multiple separate instructions by using a single shared instruction to identify a common memory address for each computing unit, thereby reducing instruction size and bandwidth requirements.
This approach significantly reduces instruction size and bandwidth needs, improving computational efficiency and reducing errors, enabling efficient processing of large neural networks even with iterative loops.
Smart Images

Figure 0007955416000001 
Figure 0007955416000002 
Figure 0007955416000003
Abstract
Description
Background Art
[0001] Background This specification generally relates to neural networks. In particular, this specification relates to neural networks on hardware accelerators having a plurality of compute tiles to processing inputs to the network
[0002] A neural network is a machine learning model that predicts outputs for received inputs using one or more layers of non-linear units.
[0003] Some neural networks include one or more hidden layers in addition to the output layer. The output of each hidden layer is used as input to the next layer in the network, i.e., the next hidden layer or the output layer. Each layer of the network generates an output from the received input according to the current values of the respective set of network parameters.
[0004] Network parameters for a neural network are values that affect operations performed by the neural network and are also values that are adjusted as part of training. For example, network parameters may include values of weight matrices and, in some cases, values of bias vectors of network layers of the neural network. Summary of the Invention
[0005] Summary This specification generally describes techniques for generating instructions that cause computing units of a hardware computing system to efficiently allocate memory while processing inputs to a particular type of neural network layer.
[0006] In general, an innovative aspect of the subject matter described herein can be embodied as a method comprising: acquiring data representing (i.e., defining) a neural network comprising multiple layers; selecting a subset of multiple layers from among the multiple layers of the neural network based on the acquired data; allocating a subset of multiple computing units to each layer in the subset of multiple layers, each comprising its own addressable memory unit, to at least partially perform inference computations associated with the layer; determining a memory size and a common memory address for each addressable memory unit of each computing unit in the subset of multiple computing units allocated to the layer; and generating a shared instruction that, when executed by each of the subsets of multiple computing units, causes the computing unit to store the results of performing inference computations associated with the layer at a determined common memory address having the determined memory size in the addressable memory of the computing unit.
[0007] The operation in a method of embodying this innovative aspect of the subject further includes providing a shared instruction to multiple computing units. This method can be performed by a computer system such as a hardware accelerator comprising multiple computing units. This computer system may further include a controller, which comprises multiple computing units to perform parallel processing based on the instructions sent by the controller to the multiple computing units. It is for controlling the control unit.
[0008] Another innovative aspect of the subject matter described herein can be embodied as a method comprising the operation of providing a set of instructions for performing inference computations on multiple layers of a neural network to a system comprising multiple computing units. Each computing unit comprises its own addressable memory. The set of instructions comprises a first memory allocation instruction associated with a first layer in the multiple layers of the neural network, which identifies a first memory address of each addressable memory and a first subset of the multiple computing units, and a second memory allocation instruction associated with a second layer in the multiple layers of the neural network, which identifies a second memory address of each addressable memory and a second subset of the multiple computing units. The second memory address is different from the first memory address, and the second subset is different from the first subset.
[0009] This set of instructions causes the system to output to each computing unit in the first subset the results of inference calculations associated with the first layer in multiple layers, based on the first memory address, to the respective memory addresses of the computing unit's addressable memory, and to each computing unit in the second subset the results of inference calculations associated with the second layer in multiple layers, based on the second memory address, to the respective memory addresses of the computing unit's addressable memory.
[0010] Other embodiments of this aspect include a corresponding computer system, an apparatus, and a computer program recorded on one or more computer storage devices, each configured to perform the operation of the method.
[0011] The subject matter described herein can be implemented in particular embodiments to achieve one or more of the following effects:
[0012] It has multiple computing units (for example, compute tiles). A computing system implementing a neural network model in a hardware accelerator can efficiently perform inference computations for the neural network model by issuing a single shared instruction to multiple computing units associated with a particular layer of the neural network model using the described technique. The shared instruction identifies a shared memory address where the computing units store, fetch, and aggregate partial results computed by that layer and its associated computing units. Instead of using the described technique, in some situations where computing units are assigned multiple different memory addresses to store results from inference computations in a particular layer, the system would need to issue multiple separate instructions to each of the multiple computing units. However, a system employing the described technique can issue a single shared instruction to send to each computing unit in a particular layer, thereby reducing the total number of instructions required by at least a factor N. This factor N is the total number of computing units used to perform inference computations in a particular network layer.
[0013] This system can reduce the overall bandwidth required for instructions by issuing shared instructions, thereby reducing memory usage. Therefore, in situations where the system (which may be a hardware accelerator) includes a controller that controls it, and the instruction bandwidth and memory of that controller's instruction memory are constrained, Therefore, instead of fetching parts of separate instructions from the host to the controller at each of multiple points in time, this system can directly load shared instructions into the controller's instruction memory. In this way, the system can reduce, or even eliminate, the time wasted when transmitting multiple parts of separate instructions. In some implementations, the described technique can reduce the overall required instruction bandwidth by more than 50% compared to conventional methods.
[0014] Furthermore, systems employing the described techniques are capable of performing inference computations for considerably large neural network models. Previously, computing large neural networks was difficult, or even impossible, on certain hardware accelerators. The number and size of instructions required to allocate memory for inference computations of large neural networks increase with the number of neural networks and network layers, so the overall instruction size can be extremely significant. When the instruction size is large, the system needs to send multiple parts of separate instructions from the host to the controller multiple times, which is inefficient and can increase pause overhead. Moreover, in the case of large neural networks with iterative loops, correctly fetching multiple parts of multiple, separate instructions from the host to the controller is prone to errors for the system.
[0015] However, if the system issues shared instructions as described herein, it is possible to significantly reduce the size of the instructions. Therefore, the system can load all shared instructions directly to reduce pause time by avoiding fetching instructions multiple times from the host (for example, by reducing the time spent loading shared instructions) and to avoid potential errors when fetching instructions to compute the neural network using iterative loops.
[0016] Furthermore, the techniques described can reduce memory usage. For example, systems using shared instructions can reduce the memory allocation for storing activation inputs, weight inputs, and hyperparameters for a particular machine learning model on a computing unit (e.g., a GPU or TPU), which can consequently improve the computational efficiency of performing inference calculations for that particular machine learning model.
[0017] Details of one or more embodiments of the subject matter of this specification are given in the accompanying drawings and the following description. Other features, aspects, and advantages of the subject matter will become apparent from the description, drawings, and claims. [Brief explanation of the drawing]
[0018] [Figure 1] This figure shows an exemplary hardware computing system for performing inference calculations on a neural network model. [Figure 2A] This diagram shows an example of a conventional memory allocation for layers and associated computational tiles in a neural network model. [Figure 2B] This diagram illustrates an example of common memory allocation for the eligible layers and associated computational tiles of a neural network model. [Figure 3] This diagram illustrates an exemplary allocation of additional memory addresses for the fully connected layers and associated computational tiles of a neural network model. [Figure 4] This is an illustrative and detailed architectural diagram for computation tiles in the system. [Figure 5] This is a diagram illustrating an exemplary process for memory allocation of computational tiles in a system for performing inference calculations for a neural network model. [Modes for carrying out the invention]
[0019] Detailed explanation This specification describes techniques for improving the efficiency of inference computations in hardware computing systems that include multiple computing units when processing inputs in neural network models.
[0020] Each computing unit of the hardware computing system is self-contained and can independently perform the computations required by at least a portion of a given layer of a multi-layer neural network. The described techniques can reduce the required instruction memory size and improve computation efficiency in hardware computing systems when performing inference computations for deep or large-scale neural network models.
[0021] A trained neural network model that has multiple layers can be used to compute inferences. For example, given an input, a neural network can compute an inference for the input.
[0022] The neural network computes an inference by processing the input through each of the neural network layers. In particular, at least some of the neural network layers each have a respective set of weights. Each layer receives an input and processes the input in accordance with the set of weights for the layer to generate an output.
[0023] A data input to a neural network layer, e.g., either an input to the neural network or an output of one or more layers in the neural network, can be referred to as an activation input to the layer.
[0024] In some implementations, the layers of the neural network are arranged in a sequence. In other implementations, the layers are arranged as a directed graph.
[0025] In other words, any particular layer can receive multiple inputs, produce multiple outputs, or both. The layers of a neural network can also be arranged such that the output of one layer can be sent back as input to a previous layer.
[0026] Each layer of a neural network model can have its own type, defined, for example, by the node connections between the layers of that neural network.
[0027] As an example, one type of layer in a neural network model can be a fully connected layer. In the case of a fully connected layer, every node in this type of layer is connected to all the nodes in at least one adjacent layer; that is, the fully connected layer is connected to at least one other layer in the neural network from which it receives node inputs. For example, when a given layer is a fully connected layer and the network layers are arranged as a sequence, each node in the given layer is connected to all the nodes in the layer preceding the given layer in the sequence.
[0028] Fully connected layers can be found in several different neural networks. For example, a fully recurrent neural network (FRNN) contains only fully connected layers. The simplest form of an FRNN may be a multilayer perceptron (MLP), which includes an input layer, an output layer, and one or more hidden layers, each of which is a fully connected layer. Conventional recurrent neural networks can also include one or more fully connected layers. In convolutional neural networks (CNNs), fully connected layers are typically located as one of the last few layers of the CNN network. In a CNN, a fully connected layer receives node outputs from all the nodes in the preceding convolutional layers and can generate node outputs for classifying or labeling input data. For example, a fully connected layer might be the second-to-last layer in a CNN, followed by a SoftMax layer.
[0029] Another example of a different type of layer is the element-wise layer. An element-wise layer performs operations on the input data element by element, such as element-wise addition, element-wise multiplication, and element-wise nonlinear operations. In some implementations, each node in an element-wise layer is connected to just one node in an adjacent layer. That is, each node in an element-wise layer performs an operation on the input received from a single corresponding node in an adjacent layer.
[0030] One exemplary element-by-element layer could be a network layer in which each node in the layer contains a node operation for each activation function (e.g., a ReLU or Sigmoid function), in which case each node receives only one node input from the adjacent layer. Another exemplary element-by-element layer could be a network layer for node residual connections. More specifically, each node in the layer contains a residual function, which receives a single input from a node in an adjacent layer and outputs a residual that is added to the corresponding residual input to the subsequent layer. Optionally, each node in the layer may also contain a nonlinear function applied to the node residuals.
[0031] Element-wise node operations can include any appropriate operation, such as element-wise addition, subtraction, and multiplication. For example, an element-wise node output could be the addition of two corresponding elements, following a node operation in an element-wise manner.
[0032] A neural network can also include other layers of different types, such as mean pooling layers and convolutional layers, and the nodes between layers are partially connected. Each node in a layer is connected to each subset of nodes in adjacent layers.
[0033] To perform inference computations for a neural network model, that is, to compute an output for a given input, a hardware computing system distributes some or all of the layers of the neural network across multiple computing units (also called "computation tiles") within its hardware computing system, so that each computing unit can perform operations (e.g., tensor computations) for at least some of the layers it is assigned to.
[0034] For certain types of layers, such as element-wise layers and fully connected layers, the layer's computations are distributed across multiple computing units. Each computing unit outputs at least one partial result obtained from the execution of the layer's related inference computations and stores each partial result in one or more memory addresses in the computing unit's addressable memory units.
[0035] In some implementations, each computing unit may have its own addressable memory unit, each pointed to one or more memory addresses in a memory device.
[0036] To generate at least a portion of the layer output from the partial results produced by the computing units assigned to the layer, the system may generate separate instructions for each computing unit. These separate instructions may include data determining one or more respective memory addresses for storing each partial result, and data determining whether each partial result for one computing unit is used to generate at least a portion of the input to another layer. More specifically, since one or more compute tiles assigned to a subsequent layer may require copying or combining partial results from one or more compute tiles in a preceding layer, the system needs to generate separate instructions for the tiles in the subsequent layer, each of these separate instructions identifying the respective memory addresses where the relevant partial results are stored for that tile in order to correctly fetch the partial results. As more compute tiles are assigned to a particular network layer, more separate instructions are required to identify different memory addresses. Thus, the number and size of instructions increase with the total number of computing units assigned to the layer, and the number of instructions may exceed the limits of memory.
[0037] If the total number of separate instructions exceeds the limits of the system's memory, the system will become less efficient when sending all instructions from the host to the controller. More specifically, the system needs to transfer some of the instructions from the host each time and copy some of the instructions in the computer's instruction memory contained within the system. Furthermore, if the neural network module is considerably large and includes iterative loops for performing inference computations, the system cannot perform inference computations for these neural network models using conventional methods. Iterative loops for performing inference computations for neural network models reside either on-device or in the cloud in many neural network models deployed on neural network accelerator chips. Therefore, finding a suitable method for efficiently performing inference computations for such neural networks is of great interest. Examples of neural network models whose computations require iterative loops include long-shorter-term memory (LSTM) models or recurrent neural network (RNN) models such as WaveRNN, OCT, and RNN-T.
[0038] The technologies described below in this specification can address the problems mentioned above.
[0039] Figure 1 shows an exemplary computing system 100 for performing inference calculations of a neural network model.
[0040] The system 100 includes a hardware accelerator 101 (also referred to as an integrated circuit configuration or chip in the following specification, but which in some implementation forms may also be implemented as multiple physically separate integrated circuits) and a host 108 located off-chip and configured to communicate with the hardware accelerator 101 via a wired or wireless connection.
[0041] The host 108 can be implemented as one or more computer programs on one or more off-chip hardware devices, i.e., not part of the hardware accelerator 101, and generates instructions to control the operations of the hardware accelerator 101.
[0042] As shown in Figure 1, the hardware accelerator 101 is connected to the controller 102 and a set of tiles 132-148 collectively referred to as the computation tilesets 112 and 114. It includes chip memory (not shown).
[0043] The controller 102 generally includes a data memory 104, an instruction memory 106, and at least one processor configured to execute one or more instructions encoded in the instruction memory. The instruction memory 106 can store one or more machine-readable instructions that can be executed by one or more processors of the controller 102. The instruction memory 106 includes memory of a specific size, such as 256kB. The data memory 104 can be any of a variety of data storage media for storing and subsequently accessing various data related to calculations within the system 100.
[0044] The controller 102 is capable of receiving instructions and data parameters from the host 108 and is configured to provide instructions to multiple compute tiles via the instruction bus 124 (described later).
[0045] Data parameters relate to the data that defines the neural network model and the input data to the neural network model.
[0046] Generally, it is ideal for the controller 102 to receive all instructions from the host 108 at the outset and store them in the instruction memory 106. In this way, during the inference computation, the controller 102 can avoid fetching parts of the instructions during computation, which can lead to errors introduced by iterative loops in the neural network. In the case of neural networks that do not have iterative loops, which is rare but possible, the controller 102 can be configured to receive some of all the instructions to compute these neural network models at one point in time and fetch the other parts at different points in time. Optionally, the controller 102 in system 100 can be configured to receive more instructions from the host 108 and store them in the instruction memory 106 after at least some of the previously stored instructions have been executed.
[0047] The controller 102 is capable of instructing one or more computational tiles to perform inference calculations for at least a portion of the neural network model.
[0048] Each computation tile is an individual computing unit that works in cooperation with other computation tiles in system 100 to accelerate computation across one or more layers of a neural network model. As shown in Figure 1, computation tile set 112 includes computation tile 0, computation tile 1, computation tile 2, and computation tile 3 (i.e., tiles 132, 134, 136, and 138), each of which includes addressable memory units 152, 154, 156, and 158, respectively. Computation tile set 114 consists of computation tiles 142-148, each of which includes addressable memory units 162, 164, 166, and 168, respectively. After each computation tile performs an inference computation, it stores a partial result at the respective memory address within its respective addressable memory unit, according to the respective instructions broadcast by the controller 102.
[0049] Each of these instructions may include its own header (e.g., a bitmap) indicating which computation tile should execute the instruction.
[0050] The controller 102 can broadcast instructions for each computation tile. More specifically, the controller 102 can broadcast instructions received from the host 108. Instructions can be broadcast to each compute tile along the data path 118 using the instruction bus 124; that is, instructions stored in the instruction memory 106 can be transmitted by the instruction bus 124, which provides communication via the data path 118 that starts from the controller 102 and rings back each compute tile in compute tile sets 112 and 114 to the controller 102. While transmitting one or more instructions on the instruction bus 124, these instructions may be, for example, 32 bits wide, but the first 7 bits contain header information indicating the instruction address / destination that receives and executes these instructions. For example, these first 7 bits may contain data parameters representing a specific node ID. Each compute tile along the data path 118 can sequentially examine the instruction header to determine whether the request by the host 108 is addressed to the compute tile whose header is being examined.
[0051] If the node ID in the header does not indicate that the destination is the tile being examined, the tile being examined copies the input instruction packet to the instruction bus that connects to the next tile for examination by the next tile. If the node ID in the header indicates that the destination is the tile being examined, the tile being examined performs the operation encoded in the input instruction packet.
[0052] The instruction may include data in the header (e.g., one or more node IDs) to identify a subset of computation tiles for performing calculations within all the tiles. A subset of computation tiles is assigned to perform calculations within a particular layer of the neural network. Each computation tile in the subset performs inference calculations for each non-overlapping portion of the layer to which it is assigned. For example, each computation tile in the same tile set (computation tiles 132, 134, 136, and 138 in tile set 112) can be assigned to the same layer of the neural network model and perform inference calculations associated with that layer.
[0053] The instruction can further identify one or more memory addresses within the corresponding compute tile for outputting data. To address the above-mentioned issues with instructions having a size exceeding the size limit of the instruction memory 106, the host 108 can generate a shared instruction for each subset of compute tiles assigned to a particular network layer. A shared instruction for a particular network layer can identify the memory size and common memory address for each compute tile in the subset. A shared instruction for each layer may have data (e.g., one or more node IDs) to identify each compute tile and cause the compute tile to store partial results in its respective addressable memory unit at its respective common memory address having the same memory size. In some implementations, the controller 102 can generate multiple instruction packets for each layer based on its respective shared instruction, each of which has a node ID for the corresponding tile associated with that layer and a common memory address for the corresponding tile to store partial results having the same memory size.
[0054] The controller 102 can, according to instructions, combine stored partial results generated by each of the relevant computation tiles from a common memory address to produce the final output from the neural network for a given input. More specifically, the controller 102 can instruct one or more computation tiles in a subsequent layer to combine partial results from previous layers stored in the common address of the previous layer. After completing the inference computation for the neural network, the controller 102 can instruct the computation tiles in the last layer of the neural network to produce the final output. The controller 102 then The final output can then be provided to host 108.
[0055] Thus, in order to cause the hardware accelerator 101 to perform inference calculations for the neural network deployed on the hardware accelerator, the host 108 generates a series of instructions and sends them to the controller 102. Once these instructions are executed by one or more computation tiles in the hardware accelerator 101, one or more computation tiles are caused to perform their respective inference calculations for at least a portion of the neural network in accordance with these instructions.
[0056] Multiple instructions issued by host 108 employing the described technology may be shared instructions for multiple compute tiles assigned to one or more eligible network layers. Details on how shared instructions are used to allocate memory for each compute tile assigned to the network layer will be described in more detail later.
[0057] Figure 2A illustrates an example of a conventional memory allocation for the layers of a neural network model and associated computation tiles 132, 134, 136, and 136.
[0058] The host 108 can generate and provide data to the controller 102 for assigning the operations represented by each layer of the neural network to each subset of all available computation tiles. Each tile in each subset of tiles can perform at least a non-overlapping portion of the operations for the relevant layer. For example, the host 108 can determine the operations in a particular layer of the neural network and assign them to a set of computation tiles 112, including computation tiles 132, 134, 136, and 138, so that each computation tile performs at least a non-overlapping portion of the inference computation.
[0059] Each computation tile may contain its own addressable memory unit, and each addressable memory unit may contain multiple memory addresses. For example, tile 132 may contain an addressable memory unit 152 having different memory addresses 202, such as memory addresses 202a, 202b, 202c, and 202d.
[0060] Conventionally, the controller 102 is configured to broadcast separate instructions to each tile assigned to the same network layer. Each of the separate instructions may include a memory allocation instruction for the corresponding tile. The memory allocation instruction can identify the respective memory addresses for each addressable memory unit of the corresponding computation tile for storing each partial result. Each respective partial result is generated by the corresponding computation tile that performs the respective part of the inference computation for the layer to which it is assigned when an input is given.
[0061] Referring to Figure 2A as an example, a particular layer is assigned to a first set of computation tiles 112, which includes computation tiles 132, 134, 136, and 138. Each computation tile performs at least a portion of the inference computation for that particular layer. These inference computations may include, for example, tensor computations of a portion of the input activations and the corresponding layer weights. After obtaining the respective partial results from the corresponding portions of the inference computations, each computation tile stores its respective partial result in a different memory address according to the respective conventional instruction for that tile. For example, as shown in Figure 2A, computation tile 132 outputs its respective partial result to memory address 202a of addressable memory unit 152 according to the first conventional instruction. Similarly, computation tile 134 outputs to memory address 204b according to the second conventional instruction, computation tile 136 outputs to memory address 206d according to the third conventional instruction, and computation tile 13 8 outputs to memory address 208c, following the fourth conventional instruction.
[0062] Conventional instructions for a given neural network layer, when executed by the tiles associated with that layer, cause those tiles to perform at least each portion of the inference computation for that layer, generate each partial result, and store those partial results at different memory addresses in each of the tiles' addressable memory units. This can be beneficial because, for example, if a subsequent layer of a given layer is a fully connected layer, and therefore each tile associated with that subsequent layer requires the entire output of the given layer, even if only to compute a partial output of the subsequent layer, then each of the one or more tiles associated with the subsequent fully connected layer can directly copy each of the stored partial results from the different memory addresses associated with the preceding layer to the same memory address in its tile's local memory.
[0063] More specifically, relating to Figure 2A and according to conventional instructions, tiles 132, 134, and 136 can be assigned to a first layer, and tile 138 can be assigned to a fully connected layer following the first layer. Tiles 132, 134, and 136 can each obtain their respective partial results for performing inference computations in the first layer and store those respective partial results at memory addresses 202a, 204b, and 206d, respectively. Collectively, each partial result contains the entire set of node outputs from the first layer. To obtain one or more input activations for the subsequent fully connected layer, tile 138 can directly copy its respective partial results from address 202a of tile 132 to addresses 208a, 204b through 208b, and 206 through 208d of tile 138, without allocating any other memory addresses of tile 138 to store the entire set of node outputs.
[0064] However, since one or more tiles in the first layer store partial results at different local memory addresses, and one or more tiles in subsequent layers (e.g., fully connected layers) need to copy each of the stored partial results from those different local memory addresses, the host 108 needs to generate each instruction that identifies the memory address for each tile in the first layer to store each partial result, and each instruction that identifies the memory address for each tile in the subsequent layer from which to collect the partial results.
[0065] To speed up the execution of inference computations for a particular neural network, the system tends to use as many tiles as possible for parallelization. The total size of the instructions, therefore, increases to different degrees based on each level of parallelization.
[0066] Furthermore, as more tiles are assigned to a particular layer, or as more nodes reside in subsequent fully connected layers, a greater number of separate instructions are required for the tiles associated with that particular layer to store partial results, and for the tiles associated with subsequent layers to copy or combine partial results from that particular layer. Thus, as described above, the size of the instructions for performing inference computations for a neural network increases with the number of computation tiles associated with each layer and the size of the layer (i.e., the number of nodes in the layer).
[0067] As the size of instructions increases, the efficiency of performing inference computations for neural networks can be impaired, especially in the case of large-scale neural networks.
[0068] However, the computing system 100 described later can solve this problem. In relation to Figure 1, the computing system 100 can first acquire data for the host 108. This data can represent a neural network having multiple layers, and the type of layer for each of the multiple layers, such as element-wise layers or fully connected layers.
[0069] Host 108 can determine and select a subset of layers from all the layers of the neural network represented by the received data. For simplicity, this subset of layers of the neural network is called the eligible layers. Thus, eligible layers are layers that satisfy the eligibility criteria. Eligible layers include layers that are either element-wise or fully connected.
[0070] Each host 108 can generate its own shared instructions for its respective eligible layer and associated computation tile.
[0071] Each shared instruction for an eligible layer and its associated tile may include at least a memory allocation instruction that specifies a common memory address and a predetermined memory size for the associated tile. Each compute tile may store its respective partial result in a common memory address having a predetermined memory size. The predetermined memory size may be determined by the host 108 or set by the user. The memory size may be determined based on the number of values in the partial result that each tile needs to output after executing the portion of the compute that the layer has allocated to it. For example, the memory size for an element-wise layer with at least five node computes and each allocated to an associated tile is larger than that for an element-wise layer with only two node computes and each allocated to an associated tile. As another example, a fully connected layer may require a smaller memory size than an element-wise layer, depending on how many values each associated tile needs to output.
[0072] In addition to storing each partial output in a common memory address for the eligible layer and associated tile, host 108 also generates a shared instruction for the fully connected layer and associated tile to aggregate the stored data from the preceding layer. The preceding layer can be any suitable eligible layer, such as a fully connected layer or an element-by-element layer.
[0073] Host 108 can also generate shared instructions for the fully connected layer, further including shared accumulation instructions that specify additional memory addresses. When executed by a tile, the shared accumulation instructions cause each tile associated with the fully connected layer to retrieve partial results representing all node results of the preceding layer stored in a common address, and then accumulate the retrieved partial results in the additional memory address. This is because, even if a computation tile associated with a fully connected layer is assigned to only a portion of the layer operations, the computation tile still needs to retrieve the entire set of results from the preceding layer.
[0074] The term "integration" refers to combining all node outputs from a preceding eligible layer into appropriate input activations for one or more nodes in a subsequent fully connected layer. More specifically, when an integration instruction issued by host 108 is executed by each tile associated with each node in the fully connected layer, it causes each tile associated with each node in the fully connected layer to collect (e.g., copy and store) the entire set of node outputs from a common address associated with the preceding layer, and each to construct its respective input activation for its respective node in the fully connected layer based on the collected entire set of node outputs at an additional common address specified in the shared integration instruction. Each input activation (or integrated partial result) generated according to the integration instruction can then be used by each tile as input for the fully connected layer to generate a partial result.
[0075] The results collected by tiles for a fully connected layer are typically larger in size than the individual partial results stored in the common memory addresses in the addressable memory of each computation tile allocated to the preceding layer. Therefore, a shared aggregate instruction generated by system 100 can identify additional common addresses having one or more additional common memory addresses, each of different sizes. For example, an additional common address could be a single additional common address having a larger memory size than the common address for storing partial results for a certain layer. As another example, an additional common address could include one or more additional common addresses, each of different sizes, for a certain fully connected layer. The total number of additional common addresses and the size of each additional common address can be determined based on the layer size of the preceding layer or based on the size of the partial results collected from the preceding layer.
[0076] Each computation tile associated with the fully connected layer performs at least each portion of the inference computation of the fully connected layer to process the accumulated input activations, in accordance with a shared instruction issued by the host 108, and generates its respective partial result for storage in a common memory address, in accordance with a shared instruction to the fully connected layer.
[0077] In the case of element-wise layers, shared instructions do not need to specify any memory addresses other than the common memory address. Each tile associated with an element-wise layer does not need to aggregate the respective partial results associated with the preceding layer, nor does it need to aggregate the respective partial results associated with the current layer to form an input activation for the next layer, according to the shared instructions issued by host 108. Instead, each node input activation of an element-wise layer is a node output activation from the preceding layer, and each output activation of that layer is a node input activation to the subsequent layer. Therefore, the computation tile of the next layer can directly copy the output activation stored in the common memory address of the corresponding computation tile associated with the preceding layer, according to the shared instructions.
[0078] Figure 2B illustrates an example of common memory allocation for the qualified layers of a neural network model and associated computation tiles 132, 134, 136, and 138.
[0079] As shown in Figure 2B, host 108 generates a shared instruction for each of the computation tiles 132, 134, 136, and 138 assigned to the eligible layers. The shared instruction identifies a common memory address for each computation tile to store its respective partial result in a common address in its respective addressable memory unit 152, 154, 156, and 158. The common address may be a memory location on chip memory, which is configured such that, for each of the respective addressable memory units for each computation tile, when the corresponding tile accesses data stored in the common address for a particular layer, at least each portion of each respective addressable memory unit "points to". For example, computation tiles 132, 134, 136, and 138 each generate their respective partial results obtained by performing their respective parts of the inference computation in the relevant layer and store their respective partial results in the common address. In some implementations, the respective memory addresses 202a for tile 132, 204a for compute tile 134, 206a for compute tile 136, and 208a for compute tile 138 all "point" to a common memory address. Since each compute tile stores its respective partial result at the common address, the stored partial results can also be accessed by other compute tiles using shared instructions. Therefore, the host 108 reduces the instruction size by generating shared instructions for compute tiles to access the common memory address for fetching the stored partial results. This is possible.
[0080] In some implementations, shared instructions for layers and associated tiles may include data for both storage and access, which further reduces the memory bandwidth requirements for receiving instructions from the host 108 and broadcasting those instructions using the controller 102.
[0081] Figure 3 illustrates an exemplary allocation of additional memory addresses for the fully connected layers of the neural network model and associated computation tiles 132, 134, 136, and 138.
[0082] As described above, for each fully connected layer, in addition to the respective common address for the tile that stores the partial results after each part of the computation has been performed in that particular fully connected layer, the host 108 can generate a shared instruction that identifies an additional memory address for the tile associated with that particular fully connected layer in order to combine the partial results from the preceding eligible layer. More specifically, each tile associated with a fully connected layer can copy the entire set of node outputs from the preceding layer and combine them at the additional memory address. The combined results are used as the respective node activation inputs for performing inference computations in the fully connected layer. Even if a tile associated with a fully connected layer performs only a part of the layer's computation, this tile is instructed to retrieve all the node outputs stored in the common address from the preceding layer and combine those node outputs at the additional memory address of the layer.
[0083] In some implementations, host 108 can identify each node output in the partial results stored in a common memory address for the preceding layer (for example, by the node output and its associated number or ID), and consequently, tiles in the fully connected layer can copy each of the identified node outputs from the preceding layer and combine them non-iteratively in additional memory addresses.
[0084] Assuming that tiles 132, 134, 136, and 138 are associated with a fully connected layer, the layer preceding that fully connected layer is a qualifying layer. As shown in Figure 3, each tile, following a shared instruction for these tiles, allocates additional memory addresses to its respective addressable memory unit. For example, memory unit 152 of tile 132 is configured to include an additional memory address 302, memory unit 154 of tile 134 includes an additional memory address 304, memory unit 156 of tile 136 includes an additional memory address 306, and memory unit 158 of tile 138 includes an additional memory address 308. Each additional memory address in each memory unit is associated with an additional common address on the chip memory.
[0085] In accordance with the aggregate instructions among the shared instructions for the fully connected layers and associated tiles, each tile retrieves the entire set of node outputs from the partial results stored at a common address for the eligible preceding layer and aggregates those node outputs to its respective additional memory address. For example, compute tile 132 copies the partial results from the eligible preceding layer and combines them at memory address 302 of memory unit 152; compute tile 134 copies the partial results from the eligible preceding layer and combines them at memory address 304 of memory unit 154; compute tile 136 copies the partial results from the eligible preceding layer and combines them at memory address 306 of memory unit 156; compute tile 138 copies the partial results from the eligible preceding layer and combines them at memory address 308 of memory unit 158.
[0086] As a more specific example, Figure 4 illustrates an exemplary and detailed architecture for computation tile 132 in system 100.
[0087] As shown in Figure 4, an exemplary computation tile 132 may include narrow memory units 425 and wide memory units 412a, 412b, 412c, and 412d (collectively, 412). The designations narrow and wide generally refer to the width (bits / bytes) of the memory units in the narrow memory 425 and wide memory 412. In some implementations, the narrow memory 425 includes memory units, each with a size (width) of less than 16 bits, and the wide memory 412 includes memory units, each with a size (width) of less than 32 bits.
[0088] Typically, the computation tile 132 assigned to the eligible layer receives data from the host, including input activations and parameters, along the data path 118. The computation tile 132 writes the input activations to narrow memory 425 and the parameters to wide memory 412, following a shared instruction for the eligible layer. In some implementations, the narrow memory 524 may contain a memory arbiter, typically used to determine which control device (e.g., TensorOp control or DMAOp control) is allowed to access the narrow memory 210 for each memory cycle.
[0089] If the eligible layer is fully connected and the layer preceding the fully connected layer is also an eligible layer, the computation tile 132 aggregates the entire set of node outputs from the partial results obtained for the preceding layer at the additional memory address indicated by the shared instruction.
[0090] More specifically, the computation tile 132 performs the respective parts of the inference computation associated with a particular layer of the neural network using MAC operators and add registers. The computation tile 132 provides input activations for the layer to one or more MAC operators from the narrow memory 425 along the input bus. The computation tile 132 also provides parameters to one or more MAC operators from the wide memory unit 412. One or more MAC operators and add registers perform dot product calculations and additions using the input activations and parameters.
[0091] Computational tile 132 provides a partial result, generated from the MAC operator and an add register, to a nonlinear unit along the output bus. The nonlinear unit is configured to apply a nonlinear function, such as a Sigmoid or ReLU function, to the partial result to generate at least a portion of the output activation for subsequent layers. Computational tile 132 stores the output activation at a common address allocated in a narrow memory unit 425 according to a shared instruction for the layer. Other computational tiles associated with the next layer can fetch the stored output activation from the narrow memory unit of computational tile 132. In some implementations, a shared instruction for a layer may include data determining whether the stored partial result from one or more computational tiles of that layer is used to generate an input activation for a computational tile associated with a subsequent layer, if so, the stored partial result belongs to the final result (e.g., the input activation for the final output of a subsequent layer or neural network).
[0092] Figure 5 illustrates an exemplary process 500 for memory allocation of computation tiles in system 100 for performing inference computations for a neural network model. For convenience, process 500 is described as being executed by one or more computer systems located in one or more locations. For example, a hardware computing system such as system 100 in Figure 1, which is appropriately programmed, can execute process 500. As a more specific example, the host of system 100 in Figure 1... If properly programmed, process 108 can execute process 500.
[0093] The host first obtains data representing the neural network (502). The data representing the neural network includes data that identifies the type of neural network (e.g., a convolutional neural network or a recurrent neural network), the total number of layers in the neural network (e.g., 10 hidden layers between the input and output layers), the number of nodes in each layer (e.g., 10, 20, or 50 nodes, each containing at least network operations), data representing the sequence of all layers, and data representing the node connections between layers (e.g., whether a layer is a fully connected layer, a partially connected layer, or an element-wise connected layer with one of the adjacent layers). In some implementations, this data may include parameters that further define the trained neural network, such as learned sets of weights for each layer and each associated node, and data format requirements for the input or output layers or both (e.g., data representing requirements for the size of input data for the input layers in the trained neural network, or data representing the output format, such as the number of output categories for the trained neural network). In some implementations, the host can determine whether the data represents an untrained neural network or a trained neural network lacking weights. In response, the host can either train the neural network using an example for training, or prompt a notification on the user interface indicating that the input neural network is untrained, and request data representing the trained neural network or data representing the missing weights.
[0094] The controller 102 receives data representing the neural network from the host 108 and stores that data in the controller 102's data memory 104. In some implementations, the controller 102 can receive all the data at once, or it can receive some of the data at a time until all the data has been received.
[0095] The controller 102 also receives instructions from the host 108 and stores the received instructions in the instruction memory 106. Similarly, the controller can retrieve partial instructions from the host 108 in multiple iterations. Furthermore, the controller can send back data to the host 108, including partial or final results after performing inference calculations for the neural network model.
[0096] After receiving the data, the host determines the type of each layer in the neural network model based on the received data. For example, the host determines, based on the received data, whether the network layers are fully connected, element-wise layers, or any other type of layer.
[0097] The host then selects an appropriate subset of several layers of the neural network based on the acquired data (504). Specifically, the host selects a subset of several layers based at least in part on the layer type. The selected subset of several layers is also referred to herein as the eligible layers. For example, the host may select all fully connected layers from all layers to form a certain subset. As another example, the host may select both fully connected layers and element-wise layers from all layers to form another subset. In some implementations, the host may select a first subset containing all fully connected layers of the neural network and a second subset containing all element-wise layers of the neural network.
[0098] For each layer in a subset of layers, the host allocates an appropriate subset of computing units to perform at least partially the inference computations associated with that layer (506). For example, node operations for inference computations in a fully connected layer are distributed across four computing tiles. As another example, node operations for inference computations in an element-wise layer are distributed across ten computing tiles.
[0099] Each computing unit includes its own addressable memory unit, and as a result, each computing unit can store partial results in its respective addressable memory unit at a given memory address. For example, relating to Figure 2B, compute 132 includes an addressable memory unit 152, which has four different memory addresses 202a-d, each "pointing" to a respective physical address on the chip memory. Each of the memory addresses 202a-d can be redirected to another physical memory address by an instruction issued from the host.
[0100] When a shared instruction is issued for a compute tile assigned to an eligible layer, the host determines the memory size and common memory address for that eligible layer and each associated compute unit (508). The determined memory size may be at least partially based on the type of network layer. For example, the determined memory size may be larger for a fully connected layer than for a per-element layer.
[0101] The memory size may also be a predetermined, fixed size for a given eligible network layer, based on the hardware architecture, layer characteristics, and computational requirements. In some implementations, the memory size can instead be preconfigured by the user through a user interface. The memory size could be 5Kb, 10Kb, or 1Mb, to name a few examples.
[0102] Host 108 generates a shared instruction including a memory allocation instruction, which, when executed by each computing unit associated with a layer, causes the computing unit to store the results of the inference computation performed with respect to the layer at a common memory address having a memory size in the addressable memory of that computing unit (510). For example, relating to Figure 2B, computation tiles 132, 134, 136, and 138 are associated with an element-wise layer, and each computation tile stores the partial results of its allocated inference computation at its respective memory addresses (e.g., 202a, 204a, 206a, and 208a) within its respective addressable memory unit (e.g., 152, 154, 156, and 158). The respective memory addresses 202a, 204a, 206a, and 208a can be considered a common memory address. However, to be precise, each of the memory addresses 202a, 204a, 206a, and 208a has an address identifier that initially "points" to the chip's common memory address, and therefore, each data storage / load process to memory addresses 202a, 204a, 206a, and 208a is effectively a data storage / load process to the common memory address. Alternatively, each of the memory addresses 202a, 204a, 206a, and 208a may initially "point" to its own memory address, but this may be changed to "point" to the common memory address due to memory allocation instructions in shared instructions.
[0103] The memory allocation instruction may further include data that identifies whether the memory allocation instruction applies to one or more computing units assigned to each eligible layer. In doing so, the controller 102 will, in accordance with the memory allocation instruction, perform the necessary actions. Accordingly, the memory storage of each computation tile can be selectively controlled. For example, referring again to Figure 2B, it is possible to specify that only computation tiles 132, 134, and 136 can store partial results in a common memory address having a predetermined memory size.
[0104] The data for identifying a computing unit may be binary data and may include the node ID of the computing tile and a status flag indicating whether a memory allocation instruction is applicable to the computing tile. For example, 0 indicates that the memory allocation instruction is not applicable to the computing unit with that node ID, and 1 indicates that the instruction is applicable to that computing unit.
[0105] Memory allocation instructions may also include data that tracks partial results stored in a common memory address. The host can issue a shared instruction, which, when executed by the corresponding tile, causes the controller 102 to track a starting common memory address, which is the memory address to which each result belongs so that it is stored for a particular layer and each result forms the final result. More specifically, when one or more computation tiles aggregate partial results to provide a final output for one or more layer outputs or a network, those computation tiles can correctly identify which partial results should be aggregated and where they should be aggregated. For example, referring again to Figure 2B, computation tile 132 stores partial results at address 202a, which "points" to a common memory address (or similarly, stores partial results in a common memory address). After each computation tile has performed its respective inference computation for a layer, a shared instruction issued by the host can identify whether the partial results will be used to generate the layer output. In such cases, the shared instruction issued by the host can further identify how the partial result should be handled in the arithmetic sequence.
[0106] As described above, the host can determine the type of network layer. In response to determining that the layer is a fully connected layer, and for each computing unit associated with that fully connected layer, the host generates a shared instruction, which further includes an integrator instruction. The integrator instruction can identify an additional memory address (i.e., a memory address different from the common memory address) used to integrate the entire set of node outputs from the preceding eligible layer. More specifically, when executed by each computing unit assigned to that fully connected layer, the integrator instruction can cause each compute tile to integrate the entire set of node outputs from the partial results stored in the common address associated with the preceding eligible layer into its additional common address.
[0107] The additional memory addresses may be addresses accessible to computing units assigned to the fully connected layer. For example, relating to Figure 3, compute tiles 132 and 134 are assigned to a single fully connected layer, and when an instruction issued by the host is executed, it causes the controller 102 to allocate memory address 302 to addressable memory unit 312 and memory address 304 to addressable memory unit 314. Both memory addresses 302 and 304 point to additional common memory addresses.
[0108] Computation tiles 132 and 134 can aggregate one or more related partial results obtained from preceding layers and store them in an additional common memory address. Computation tiles 132 and 134 can mutually access the data stored in the additional common memory address.
[0109] In some implementations, the accumulating instruction further includes data that determines whether one or more of the stored partial results from preceding layers are to be accumulated to additional memory addresses by the fully connected layer and associated computing units. This can be useful for parallel computing, particularly when tiles redundantly compute node outputs and store their respective partial results in common addresses. Therefore, it is necessary that tiles in the system correctly fetch the relevant node outputs from the common addresses.
[0110] Referring again to Figure 1, assume that computation tile 148 is associated with a fully connected layer and is assigned to perform operations on the first node of this layer. Computation tiles 132 and 134 are each associated with a qualified preceding layer of the fully connected layer, in which case computation tile 132 is assigned to perform operations on the first half of the nodes of the preceding layer, and computation tile 134 is assigned to perform operations on the second half of the nodes of the preceding layer. If computation tile 148 is associated with a fully connected layer, the scaling instruction includes data determining that all relevant partial results stored in computation tiles 132 and 134 should be scaled to an additional memory address according to a shared instruction (more specifically, a scaling instruction) to the fully connected layer.
[0111] The neural network system implemented by System 100 in Figure 1 could be part of a computer vision system, for example, in a computer vision system for an autonomous vehicle or robotic system. In real-world vision applications, unfamiliar objects are almost everywhere due to the so-called "long tail" of objects that occur in real-world scenes. As another example, this system could be used as part of photo compilation software where it may be necessary to create new categories on the fly. In addition to object recognition, this system can perform other computer vision tasks, such as object detection and segmentation. In other domains, rare and novel objects may also exist, such as images and sounds, and the system could also be used in relation to such other domains.
[0112] For example, neural network systems can be used in language modeling systems, image / video processing systems, or action selection systems. Tasks may include classification tasks such as image processing tasks, speech recognition tasks, natural language processing tasks, word recognition tasks, or optical character recognition tasks. Furthermore, tasks may include reinforcement learning tasks, in which an agent interacts with one or more real or simulated environments to achieve one or more goals.
[0113] In the case of language modeling tasks or translation of text from a source language to a target language using a neural network, the system may be configured to receive an input sequence of source embeddings representing the source sequence of words in the source natural language, and to generate an output sequence of target embeddings representing the target sequence of words, which is the translation of the source sequence into the target natural language. More generally, the system can be applied to other sequence transfer applications where source sequences are mapped to target sequences.
[0114] Input data may include one or more of the following: image data, moving image / video data, motion data, sound data, audio data, electronic documents, data representing the state of an environment, and / or data representing an action. For example, image data may include color or monochrome pixel value data. Such image data may be captured from an image sensor such as a camera or a LiDAR sensor. Audio data may include data that defines an audio waveform, such as a set of values in the time domain and / or frequency domain that define the waveform, and this waveform may represent speech in natural language. Electronic document data is, This may include text data representing words in natural language. Data representing the state of an environment may include any type of sensor data, such as data characterizing the state of a robot or vehicle, such as pose data and / or position / velocity / acceleration data, or data characterizing the state of an industrial plant or data center, such as sensed electronic signals, such as sensed current signals and / or temperature signals. Data representing actions may include, for example, position, velocity, acceleration, and / or torque control data, or data for controlling the operation of one or more items in a device in an industrial plant or data center. This data may generally relate to real or, for example, simulated virtual environments.
[0115] The output data can similarly include any type of data. For example, in a classification system, the output data may include classification labels for input data items. In a regression task, the output data may predict the values of continuous variables, such as control variables for controlling electronic or electromechanical systems, such as robots, vehicles, data centers, or plants. In another example of a regression task acting on image or audio data, the output data may define one or more locations in the data, such as the position of an object, the position of one or more corners of an object's bounding box, or the time position of a sound feature in an audio waveform. In a reinforcement learning system, the output data may include data representing an action, as described above, which is an action performed by an agent operating in an environment on a mechanical agent, such as a robot or vehicle.
[0116] Data representing an action may include, for example, data defining an action value (Q-value) for that action, data parameterizing a probability distribution sampled to determine that action, or data directly defining an action in a continuous action space. Thus, in a reinforcement learning system, a neural network system can either directly parameterize a probability distribution for an action selection policy, or learn to evaluate the value of an action value function (Q-value). In the latter case, multiple memories and their respective output networks may share a common embedding network to provide Q-values for each available action.
[0117] Neural networks can be configured to accept any type of digital data input and, based on that input, generate any type of score, classification, or regression output.
[0118] For example, if the input to a neural network is an image or a feature extracted from an image, the output generated by the neural network for a given image could be a score for each of a set of target categories, each score representing the estimated probability that the image contains an image of a target belonging to that category.
[0119] As another example, if the input to a neural network is an internet resource (e.g., a web page), a document, a portion of a document or feature extracted from an internet resource, or a portion of a document, the output generated by the neural network for a given internet resource, document, or portion of a document could be a score for each of a set of topics, each score representing the estimated probability that the internet resource, document, or portion of a document relates to that topic.
[0120] As another example, if the input to a neural network is impressionistic contextual features for a particular advertisement, the output generated by the neural network could be a score representing the estimated probability that the particular advertisement will be clicked.
[0121] As another example, if the input to the neural network is personalized recommendation features for the user, such as features that characterize the context for recommendation or features that characterize previous actions taken by the user, the output generated by the neural network could be a score for each of a set of content items, each score representing the estimated probability that the user would respond favorably to being recommended the content item.
[0122] As another example, if the input to a neural network is a sequence of text in one language, the output produced by the neural network could be a score for each of the set of text segments in another language, with each score representing the estimated probability that the text segment in the other language is a proper translation of the input text into the other language.
[0123] As another example, if the input to a neural network is a sequence representing spoken utterances, the output produced by the neural network could be a score for each of a set of text segments, each score representing the estimated probability that the text segment is an accurate transcription of the utterance.
[0124] Embodiments of the subject matter and the functional operations described herein can be implemented as digital electronic circuit configurations, as tangibly embodied computer software or firmware, as computer hardware including the structures disclosed herein and their structural equivalents, or as a combination of one or more of these. Embodiments of the subject matter described herein can be implemented as one or more computer programs, i.e., as one or more modules of computer program instructions encoded on a tangible, non-temporary program carrier for execution by a data processing device or control of the operation of a data processing device. Alternatively or in addition thereto, the program instructions can be encoded on artificially generated propagating signals, such as machine-generated electrical signals, optical signals, or electromagnetic signals, which are generated to encode information, transmit it to a suitable receiver device, and execute it by a data processing device. Computer storage media can be machine-readable storage devices, machine-readable storage boards, random or serial access memory devices, or a combination of one or more of these.
[0125] The processes and logic flows described herein can be executed by one or more programmable computers running one or more computer programs to perform functions by performing operations on input data and generating outputs. These processes and logic flows can also be executed by dedicated logic circuit configurations, such as field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), or general-purpose graphics processing units (GPGPUs), and similarly, devices can also be implemented as dedicated logic circuit configurations.
[0126] A computer suitable for running computer programs may include, for example, a general-purpose or dedicated microprocessor, or both, or any other type of central processing unit, and may be based on them. Generally, the central processing unit receives instructions and data from read-only memory, random-access memory, or both. Essential elements of a computer are a central processing unit for executing or running instructions, and one or more memory devices for storing instructions and data. Generally, a computer Data includes, for example, one or more large storage devices for storing data, such as magnetic disks, magneto-optical disks, or optical disks, or is operationally coupled to one or more of these large storage devices to receive, transmit, or both receive and transmit data. However, it is not necessary for a computer to have such devices.
[0127] Computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media, and memory devices, including, as exemplary, semiconductor memory devices such as EPROM, EEPROM, and flash memory devices, and magnetic disks such as internal hard disks or removable disks. Processors and memory can be complemented by or incorporated into dedicated logic circuit configurations.
[0128] This specification includes many details of specific implementations, which should be interpreted not as limiting any invention or claim, but as descriptions of features that may be specific to a particular embodiment of a particular invention. Furthermore, several specific features described herein in the context of separate embodiments may be implemented as a combination in a single embodiment. Conversely, various features described in the context of a single embodiment may be implemented separately or as any appropriate partial combination in multiple embodiments. Moreover, several features may be described above as operating in a particular combination, and may even be initially claimed as such; however, in some cases, one or more features from a claimed combination may be excluded from this combination, and the claimed combination may be directed towards a partial combination or a variation of a partial combination.
[0129] Similarly, while the drawings show multiple operations in a specific order, this should not be understood as meaning that these operations must be performed in the specific order shown or sequentially to achieve the desired result, nor should it be understood as meaning that all illustrated operations must be performed. In certain situations, multitasking and parallel processing may be advantageous. Furthermore, the separation of various system modules and components in the embodiments described above should not be understood as meaning that such separation is required in all embodiments, and that the described program components and systems can generally be integrated into a single software product or packaged into multiple software products.
[0130] Specific embodiments of the subject matter have been described. Other embodiments also fall within the scope of the following claims. For example, the operations described in the claims can be performed in different orders and still achieve the desired results. As an example, the processes shown in the accompanying drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In certain implementations, multitasking and parallel processing may be advantageous.
Claims
1. A method, wherein the said method is The method includes obtaining data representing a neural network having multiple layers, wherein the obtained data represents a fully connected layer that receives data from a preceding layer, and the method further includes From among a plurality of computing units, each containing its own addressable memory unit, a subset of the inference computations associated with the fully connected layer is assigned to each of the plurality of computing units. Within each addressable memory unit of each computing unit, a space large enough to hold the data generated by all of the preceding computing units of the preceding layer is allocated to the common additional memory address, A method comprising generating a shared aggregate instruction, wherein, when the shared aggregate instruction is executed by each computing unit assigned to the fully connected layer, the computing unit causes the computing unit to aggregate the data generated by the plurality of preceding computing units in the preceding layer into the space allocated to the common additional memory address.
2. The method according to claim 1, further comprising generating a shared storage instruction, wherein when the shared storage instruction is executed by each computing unit assigned to the fully connected layer, the computing unit causes the computing unit to store the partial result of the fully connected layer in a common memory address.
3. The fully connected layer is selected from the plurality of layers, The method according to claim 1, wherein the selection includes determining the layer type of each of the plurality of layers of the neural network based on the acquired data representing the neural network.
4. The method according to claim 3, wherein the selection is at least partially based on the determined layer type.
5. From among the plurality of computing units, each containing its own addressable memory unit, a second subset of the plurality of computing units is allocated to at least partially perform inference computations related to each of the plurality of layers other than the fully connected layer, The method according to claim 1, further comprising generating one or more integrated instructions for each of the plurality of layers other than the fully connected layer, for the corresponding computing unit of the second subset of the plurality of computing units.
6. The method according to claim 1, wherein the shared aggregate instruction further includes data identifying one or more computing units of the subset of the plurality of computing units to which the shared aggregate instruction applies.
7. The method according to claim 6, wherein the data identifying the one or more computing units is binary instruction data.
8. The method according to claim 1, further comprising data that, for each computing unit of the subset of the plurality of computing units of the fully connected layer, determines whether each result among the results related to other layers preceding the fully connected layer is aggregated at the common additional memory address in the addressable memory unit of the computing unit of the fully connected layer.
9. The method according to claim 1, further comprising providing the shared integrated instructions to the plurality of computing units.
10. It is a method, The system includes providing a set of instructions for performing inference calculations for multiple layers of a neural network to a system comprising multiple computing units, each of which has its own addressable memory, The aforementioned set of instructions is: The neural network includes a first integrating instruction associated with a first fully connected layer in the plurality of layers, the first integrating instruction identifies a first additional memory address of each of the addressable memories and a first subset of the plurality of computing units, The aforementioned set of instructions further includes: The neural network includes a second integrating instruction associated with a second fully connected layer in the plurality of layers, the second integrating instruction identifies a second additional memory address of each of the addressable memories and a second subset of the plurality of computing units, the second additional memory address being different from the first additional memory address, and the second subset being different from the first subset. The aforementioned set of instructions is transmitted to the system, For each computing unit of the first subset, the results of inference calculations associated with the first fully connected layer in the plurality of layers, and one or more results associated with other layers preceding the first fully connected layer, are aggregated at the respective memory addresses of the addressable memory of the computing unit, based on the first additional memory address. A method for performing the following for each computing unit of the second subset: accumulating the results of inference calculations associated with the second fully connected layer in the plurality of layers, and one or more results associated with other layers preceding the second fully connected layer, in the respective memory addresses of the addressable memory of the computing unit, based on the second additional memory address.
11. The first subset of the plurality of computing units corresponds to a subset of the plurality of computing units in which the inference computations associated with the first fully connected layer in the plurality of layers are distributed, The method according to claim 10, wherein the second subset of the plurality of computing units corresponds to a subset of the plurality of computing units in which inference computations related to the second fully connected layer in the plurality of layers are distributed.
12. The method according to claim 10, wherein the set of instructions further includes one or more memory allocation instructions associated with each of the one or more layers among the plurality of layers that are different from the first fully connected layer and the second fully connected layer.
13. The method according to claim 10, wherein the first integrated instruction associated with the first fully connected layer, when executed by each computing unit of the first subset, causes the system to allocate additional memory addresses associated with each computing unit of the first subset.
14. The method of claim 10, further comprising data for determining, for each computing unit of the first subset, whether each of the results of the preceding layers of the first fully connected layer and related inference calculations is to be aggregated at each memory address of the computing unit, based on the first additional memory address.
15. The method according to claim 10, in response to a decision that the results of inference calculations associated with the preceding layers of the first fully connected layer are to be aggregated, the first aggregate instruction associated with the first fully connected layer further causes the system to aggregate the results of the inference calculations associated with the preceding layers in the memory addresses of the corresponding computing units based on the first additional memory addresses.
Citation Information
Patent Citations
Neural network accelerator with on-chip resident parameters
JP2020532780A
Neural network processing system having multiple processors and a neural network accelerator
JP2020537786A
Multi-tile memory management
WO2020190805A1
