Flexible inter-tile communication in multi-tile neural network accelerator
The DNN accelerator with flexible inter-tile communication mechanisms in multi-tile design reduces memory traffic and power usage by allowing tiles to write subtensors directly into other tiles' memories, enhancing performance and efficiency.
Patent Information
- Application Number
- PCT/CN2024/121535
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-06-27
- Filing Date
- 2024-09-26
- Publication Date
- 2026-01-02
AI Technical Summary
Current technologies fail to provide flexible and efficient inter-tile communication mechanisms for split DNN workloads in multi-tile DNN accelerators, leading to increased memory traffic and power usage.
A DNN accelerator with multiple tiles and an interconnect network-on-chip (NOC) that allows tiles to write subtensors directly into other tiles' memories, enabling flexible inter-tile communication options such as unicast, broadcast, and multicast with or without local memory writes, reducing memory traffic and power consumption.
This approach reduces memory traffic by up to (N-1) times in broadcast cases, minimizes memory spill, and improves performance by freeing up memory for weight prefetching, while simplifying compiler complexity.
Smart Images

Figure CN2024121535_02012026_PF_FP_ABST
Abstract
Description
FLEXIBLE INTER-TILE COMMUNICATION IN MULTI-TILE NEURAL NETWORK ACCELERATOR
[0001] Cross-Reference to Related Application
[0002] This application claims the benefit of International Patent Application No. PCT / CN2024 / 101788, filed June 27, 2024, and entitled “FLEXIBLE INTER-TILE COMMUNICATION IN MULTI-TILE NEURAL COMPUTE ENGINES, ” which is incorporated by reference in its entirety.Technical Field
[0003] This disclosure relates generally to neural network (also referred to as “deep neural network” or “DNN” ) , and more specifically, flexible inter-tile communication in multi-tile DNN accelerators.Background
[0004] DNNs are used extensively for a variety of artificial intelligence applications ranging from computer vision to speech recognition and natural language processing due to their ability to achieve high accuracy. However, the high accuracy comes at the expense of significant computation cost. DNNs have extremely high computing demands as there can be a large number of operations as well as a large amount of data to read and write. Therefore, techniques to improve efficiency of DNNs are needed.Brief Description of the Drawings
[0005] Embodiments will be readily understood by the following detailed description in conjunction with the accompanying drawings. To facilitate this description, like reference numerals designate like structural elements. Embodiments are illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings.
[0006] FIG. 1 illustrates an example transformer model, in accordance with various embodiments.
[0007] FIG. 2 illustrates computations in an example attention layer, in accordance with various embodiments.
[0008] FIG. 3 illustrates an example convolution, in accordance with various embodiments.
[0009] FIG. 4 illustrates partition of a workload of executing a DNN layer, in accordance with various embodiments.
[0010] FIG. 5 is a block diagram of a DNN system, in accordance with various embodiments.
[0011] FIG. 6 illustrates partitioning a workload of executing a DNN layer over the H dimension, in accordance with various embodiments.
[0012] FIG. 7 illustrates partitioning a workload of executing a DNN layer over the K dimension, in accordance with various embodiments.
[0013] FIG. 8A illustrates unicast with local memory write in a multi-tile system, in accordance with various embodiments.
[0014] FIG. 8B illustrates unicast without local memory write in the multi-tile system of FIG. 8A, in accordance with various embodiments.
[0015] FIG. 9A illustrates broadcast with local memory write in a multi-tile system, in accordance with various embodiments.
[0016] FIG. 9B illustrates broadcast without local memory write in the multi-tile system of FIG. 9A, in accordance with various embodiments.
[0017] FIG. 10A illustrates multicast with local memory write in a multi-tile system, in accordance with various embodiments.
[0018] FIG. 10B illustrates multicast without local memory write in in the multi-tile system of FIG. 10A, in accordance with various embodiments.
[0019] FIG. 11 illustrates a subtensor within an output tensor of a DNN layer, in accordance with various embodiments.
[0020] FIG. 12 is a block diagram of a DNN module, in accordance with various
[0021] embodiments.
[0022] FIG. 13 illustrates an example sparse cell, in accordance with various embodiments.
[0023] FIG. 14 illustrates an example sparse cell array, in accordance with various embodiments.
[0024] FIG. 15 is a block diagram of a drain module, in accordance with various embodiments.
[0025] FIG. 16 is a flowchart of a method for executing a DNN layer, in accordance with various embodiments.
[0026] FIG. 17 is a block diagram of an example computing device, in accordance with various embodiments.Detailed Description
[0027] The last decade has witnessed a rapid rise in artificial intelligence (AI) based data processing, particularly based on DNNs. DNNs are widely used in the domains of computer vision, speech recognition, image, and video processing mainly due to their ability to achieve beyond human-level accuracy. A DNN typically includes a sequence of layers. A DNN layer may include one or more deep learning operations (also referred to as “neural network operations” ) , such as convolution, matrix multiplication, layer normalization, batch normalization, SoftMax operation, pooling, elementwise operation, linear operation, nonlinear operation, and so on.
[0028] Input or output data of deep learning operations may be arranged in data structures called tensors. A tensor is a data structure having multiple elements across one or more dimensions. Examples of tensors include vector (which is one-dimensional (1D) tensor) , matrix (which is two-dimensional (2D) tensor) , three-dimensional (3D) tensors, four-dimensional (4D) tensors, and even higher dimensional tensors. A dimension of a tensor may correspond to an axis, e.g., an axis in a coordinate system. A dimension may be measured by the number of data points along the axis. The dimensions of a tensor may define the shape of the tensor. A DNN layer may receive one or more input tensors and compute an output tensor from the one or more input tensors. Taking a convolutional layer for example, the input tensors include an activation tensor (also referred to as “input feature map (IFM) ” or “input activation tensor” ) including one or more activations (also referred to as “input elements” ) and a weight tensor. The weight tensor may be a kernel (a 2D weight tensor) , a filter (a 3D weight tensor) , or a group of filters (a 4D weight tensor) . A convolution may be performed on the input activation tensor and weight tensor to compute an output activation tensor in the convolutional layer.
[0029] Tensors in DNNs can be saved in X-major (e.g., XYZ or XZY format) , Y-major formats (e.g., YXZ or YZX format) , or Z-major formats (e.g., ZXY or ZYX format) . The format of a tensor may define the order in which the data points in the tensor are stored, written, or read. The first character may represent the dimension in which data points are contiguous in memory. The second character may represent the dimension in which data points can be accessed after the contiguous data points are accessed in memory. The third character may represent the dimension in which data points are accessed after the data points in the dimension represented by the second character are exhausted. Taking the ZXY format for example, the access order first starts in the Z dimension, then moves to the X dimension, and finally moves to the Y dimension. Data points in the tensor are contiguous in memory in the Z dimension, meaning data points having the same (x, y) coordinates are contiguous in memory. Using tensor permutation, the tensor may be read from memory in a different format.
[0030] The significant improvements in DNN model size and accuracy coupled with the rapid increase in computing power of execution platforms have led to the adoption of DNN applications even within resource constrained mobile and edge devices that have limited energy availability. In edge and client devices, efficient use of limited memory resources and reducing memory traffic can be critical for achieving performance and power goals for a given memory budget. DNN models can be executed, e.g., for training or inference, by DNN accelerators. A DNN accelerator may be or include one or more data processing units. A data processing unit may include processing elements (PEs) that can carry out neural network operations and accelerate DNNs. A PE may include a multiply-accumulate (MAC) unit that is configured to perform MAC operations. A data processing unit may also be referred to as a compute tile or tile. Each tile may have its own local memory.
[0031] Multi-tile design of DNN accelerators can be more advantageous than single-tile design. Multi-tile design can provide the flexibility of processing multiple parallel, independent tasks on different tiles. Also, by adding more tiles to the DNN accelerator, peak TOPS (Tera Operations per Second) can be improved without any significant modifications to the rest of the hardware components. The flexibility and performance improvement are not available for single-tile design. Also, multi-tile design can provide built-in redundancy and fault tolerance. In contrast, there is a single point of failure for sing-tile design. Moreover, multiple tiles can be moved around in the physical layout with multi-tile design, versus a big single tile can have limitations for placement.
[0032] When multiple tiles are available, the compiler can choose to split the workload of executing DNN layers, such as a DNN layer that is too large to fit in a single tile, to increase the performance by computing in parallel across multiple tiles. The splitting can happen in various manners. For instance, the output tensor of the DNN layer, which can be used to represent the workload of executing the DNN layer, may be split over the height (H) dimension, the width (W) dimension, the output channel or depth (K) dimension. Additionally or alternatively, the workload may be split over various combinations of the three dimensions. Inter-tile communication is usually needed for facilitating partition of DNN workloads across multiple tiles. However, currently available technologies fail to provide flexible and efficient inter-tile communication mechanisms for split DNN workloads.
[0033] Embodiments of the present disclosure may improve on at least some of the challenges and issues described above by providing flexible inter-tile communication in multi-tile DNN accelerators. In an example DNN accelerator with multiple tiles, a tile, which executes a part of a DNN layer and computes a subtensor within the output tensor, may write the subtensor into the memories of other tiles. The tile may skip writing the subtensor into its own memory, which can reduce memory traffic and power usage. The performance of the DNN accelerator can be improved.
[0034] In various embodiments of the present disclosure, a DNN accelerator may include a plurality of tiles and an interconnect communicatively coupled to the tiles. The interconnect may be a network-on-chip (NOC) interconnect. A tile may include a compute block, a memory, and a drain module. The compute block may include a processing engine and a post-processing engine. The compute block may perform neural network operations in DNN layers and generate output data. The workload for executing a DNN layer may be partitioned into multiple workloads that are allocated to multiple tiles. Each tile may compute a part of the output tensor of the DNN layer, i.e., a subtensor within the output tensor. The drain module of the tile may write the subtensor into one or more memories. For instance, the drain module may write the subtensor into one or more memories in one or more other tiles through the interconnect. The other tiles may use the subtensor, possibly combined with one or more other subtensors within the output tensor, to execute the next DNN layer. The output tensor may be used as an input tensor of the next DNN layer. The drain module may be configured to write or not write the subtensor into its local memory, i.e., the memory in the same tile as the drain module. The drain module may operate in accordance with configuration parameters. For instance, the drain module may receive one or more configuration parameters that have settings to enable or disable access to one or more memories. When the drain module receives a configuration parameter that enables access to a memory, the drain module may write data into the memory. When the drain module receives a configuration parameter that disables access to a memory, the drain module may not write any data into the memory. The memory may be the local memory or memory in another tile. With these configuration parameters, the drain module can facilitate unicast with and without local write, broadcast with and without local write, and multicast with and without local write. Broadcast means sending data to all the other tiles in the DNN accelerator. Multicast means sending data to some of the other tiles but not all of them. The drain module may also receive one or more configuration parameters that indicate the position of the subtensor in the output tensor and may write the subtensor based on the configuration parameter (s) to avoid memory spill. A configuration parameter may have one or more bits. The configuration parameters may be generated by a compiler.
[0035] The present disclosure addresses memory storage and access efficiency when multiple tiles are involved in inter-tile communication. The approach in the present disclosure can reduce the memory traffic in an N-tile architecture by up to (N-1) times in a broadcast use case, where each tile may write a unique portion of the output tensor. The approach can also reduce memory spill, as the data can be stored more efficiently. The freed-up memory space can be used for prefetching weights from later layers. Reduced memory traffic can lead to reduced dynamic power and reduce potential stalls due to memory contention, resulting in improved performance. The approach can also simplify compiler complexity when aligning strategies for neighboring layers.
[0036] For purposes of explanation, specific numbers, materials and configurations are set forth in order to provide a thorough understanding of the illustrative implementations. However, it will be apparent to one skilled in the art that the present disclosure may be practiced without the specific details or / and that the present disclosure may be practiced with only some of the described aspects. In other instances, well known features are omitted or simplified in order not to obscure the illustrative implementations.
[0037] Further, references are made to the accompanying drawings that form a part hereof, and in which is shown, by way of illustration, embodiments that may be practiced. It is to be understood that other embodiments may be utilized, and structural or logical changes may be made without departing from the scope of the present disclosure. Therefore, the following detailed description is not to be taken in a limiting sense.
[0038] Various operations may be described as multiple discrete actions or operations in turn, in a manner that is most helpful in understanding the claimed subject matter. However, the order of description should not be construed as to imply that these operations are necessarily order dependent. In particular, these operations may not be performed in the order of presentation. Operations described may be performed in a different order from the described embodiment. Various additional operations may be performed or described operations may be omitted in additional embodiments.
[0039] For the purposes of the present disclosure, the phrase “A or B” or the phrase "A and / or B" means (A) , (B) , or (A and B) . For the purposes of the present disclosure, the phrase “A, B, or C” or the phrase "A, B, and / or C" means (A) , (B) , (C) , (A and B) , (A and C) , (B and C) , or (A, B, and C) . The term "between, " when used with reference to measurement ranges, is inclusive of the ends of the measurement ranges.
[0040] The description uses the phrases "in an embodiment" or "in embodiments, " which may each refer to one or more of the same or different embodiments. The terms "comprising, " "including, " "having, " and the like, as used with respect to embodiments of the present disclosure, are synonymous. The disclosure may use perspective-based descriptions such as "above, " "below, " "top, " "bottom, " and "side" to explain various features of the drawings, but these terms are simply for ease of discussion, and do not imply a desired or required orientation. The accompanying drawings are not necessarily drawn to scale. Unless otherwise specified, the use of the ordinal adjectives “first, ” “second, ” and “third, ” etc., to describe a common object, merely indicates that different instances of like objects are being referred to and are not intended to imply that the objects so described must be in a given sequence, either temporally, spatially, in ranking or in any other manner.
[0041] In the following detailed description, various aspects of the illustrative implementations will be described using terms commonly employed by those skilled in the art to convey the substance of their work to others skilled in the art.
[0042] The terms “substantially, ” “close, ” “approximately, ” “near, ” and “about, ” generally refer to being within + / -20%of a target value as described herein or as known in the art. Similarly, terms indicating orientation of various elements, e.g., “coplanar, ” “perpendicular, ” “orthogonal, ” “parallel, ” or any other angle between the elements, generally refer to being within + / -5-20%of a target value as described herein or as known in the art.
[0043] In addition, the terms “comprise, ” “comprising, ” “include, ” “including, ” “have, ” “having” or any other variation thereof, are intended to cover a non-exclusive inclusion. For example, a method, process, device, or DNN accelerator that comprises a list of elements is not necessarily limited to only those elements but may include other elements not expressly listed or inherent to such method, process, device, or DNN accelerators. Also, the term “or” refers to an inclusive “or” and not to an exclusive “or. ”
[0044] The systems, methods and devices of this disclosure each have several innovative aspects, no single one of which is solely responsible for all desirable attributes disclosed herein. Details of one or more implementations of the subject matter described in this specification are set forth in the description below and the accompanying drawings.
[0045] FIG. 1 illustrates an example transformer model 100, in accordance with various embodiments. The transformer model 100 may transform input sequences into output sequences. In some embodiments, the transformer model 100 is a DNN that can learn context and meaning by tracking relationships in sequential data, such as sequential words in a sentence, sequential audio signals, sequential images, and so on. In an example, the transformer model 100 may be at least part of a large language model (LLM) . The transformer model 100 includes an encoder block 50, a decoder block 120, and a head block 130. In other embodiment, different or additional components may be included in the transformer model 100. Further, functionality attributed to a component of the transformer model 100 may be accomplished by a different component included in the transformer model 100 or a different model or module.
[0046] The encoder block 50 receives input sequences and generates matrix representations of the input sequences. In the embodiments of FIG. 1, the encoder block 50 receives an input 101 and generates an encoder output 102. The input 101 may be an input prompt. In some embodiments, the input 101 may include one or more input tokens, such as words, phrases, sentences, images, audio signals, other types of input tokens, or some combination thereof. In an example, the input 101 may include a prompt received from a user of the transformer model 100. The prompt may include a question or request made by the user. A word in the prompt may be an input token. The encoder output 102 may include one or more vectors that are contextualized representations of the input 101. Each vector in the encoder output 102 may represent a token in the input 101 with contextual understanding.
[0047] The encoder block 50 includes an embedding layer 53, a positional encoding layer 55, and a plurality of layers 140 (individually referred to as “layer 140” ) . In other embodiments, the encoder block 50 may have different, fewer, or more components. Also, the arrangement of the components in the encoder block 50 may be different from the arrangement shown in FIG. 1. For the purpose of illustration, the encoder block 50 has N layers in FIG. 1, where N is an integer. Each layer 140 may include one or more neural network operations. The layers 140 may transform a sequence of embeddings into a representation that encapsulates the learned information from the input 101. Different layers 140 may have different internal parameters, e.g., different weights, bias, or other types of internal parameters. In some embodiments, the layers 140 have identical components. The components in a layer 140 may be layers and may also be referred to as sub-layers of the layer 140. As shown in FIG. 1, a layer 140 includes four sub-layers: a multi-head attention (MHA) layer 141, an add &norm layer 142, a feed forward layer 143, and another add &norm layer 144.
[0048] The decoder block 120 iteratively generates outputs 103 using encoded representations generated by the encoder block 50. The decoder block 120 includes an embedding layer 123, a positional encoding layer 125, and a plurality of layers 150 (individually referred to as “layer 150” ) . For the purpose of illustration, the decoder block 120 has N layers in FIG. 1, where N is an integer. In the embodiments of FIG. 1, the number of layers 150 in the decoder block 120 is the same as the number of layers 140 in the encoder block 50. In other embodiments, the number of layers 150 in the decoder block 120 may be different from the number of layers 140 in the encoder block 50. Each layer 150 may include one or more neural network operations. Different layers 150 may have different internal parameters. In some embodiments, the layers 150 may have identical components. The components in a layer 150 may be layers and may also be referred to as sub-layers of the layer 150. As shown in FIG. 1, a layer 150 includes six sub-layers: an MHA layer 151, an add &norm layer 152, an encoder-decoder attention layer 153, another add &norm layer 154, a feed forward layer 155, and another add &norm layer 156.
[0049] In some embodiments, a sequence of inference stages is performed in the decoder block 120 using encoder outputs, e.g., the encoder output 102. A matrix may be predicted through each inference stage. The outputs 103 may include a plurality of matrices. Each matrix may be further processed in the head block 130 to predict a token. The plurality of matrices may be used to predict a sequence of tokens. For the first inference stage, the decoder block 120 may receive one or more start tokens as input tokens and compute a first matrix from the input tokens and the output of the encoder block 50. The first matrix may be used by the head block 130 to predict a first token. The predicted token may be used as a new input token, in addition to the start token (s) , in the second inference stage. Similarly, a second token may be predicted through the second inference stage and may be used in the third inference stage. This iteration may continue till all the inference stages are complete.
[0050] The head block 130 receives the output of the decoder block 120 and processes it in a linear layer 133 and a SoftMax layer 135. A linear operation may be performed on the output of the decoder block 120 in the linear layer 133. The linear operation may include a multiplication of the output of the decoder block 120 with a weight matrix. The output of the linear layer 133 may be a vector. In some embodiments, the head block 130 may function as a classifier. The number of data elements in the vector computed in the linear layer 133 may depend on the number of classes involved. In an example where there are Mclasses, where M is an integer, the vector computed in the linear layer 133 may have M data elements representing the prediction for the M classes, respectively.
[0051] The output of the linear layer 133 may be input into the SoftMax layer 135. A SoftMax function may be applied on the output of the linear layer 133 to compute probability scores. A probability score may have a value in the range from 0 to 1. In some embodiments, a probability value is computed for each data element in the vector computed in the linear layer 133. The highest one of the probability scores may be the key. The corresponding index of the key may point to the token that the transformer model 100 predicts as the next in the sequence. The final output of the transformer model 100 may be the sequence of predicted tokens. In some embodiments, the head block 130 may be a language modeling head.
[0052] An embedding layer (e.g., the embedding layer 53 or the embedding layer 123) converts an input of the embedding layer (e.g., the input 101 or the outputs 103) into one or more embeddings. An embedding may be a vector, which is also referred to as an embedding vector or a vector embedding. The vector embedding may include a sequence of data elements. In some embodiments, the embedding layer 53 may generate a plurality of embeddings, each of which may be converted from a different input token in the input 101. The embeddings may capture the semantic meaning of the tokens in the input 101. The embeddings may be numerical representations that capture the relationships or meanings of words, phrases, or other data types. In an example where the input 101 is a prompt including a sequence of words, the embedding layer 53 may generate an embedding from each word in the input 101. The embedding layer 123 in the decoder block 120 may generate a plurality of embeddings from tokens received by the decoder block 120 in a similar manner as the embedding layer 53.
[0053] A positional encoding layer (e.g., the positional encoding layer 55 or the positional encoding layer 125) performs positional encoding on embeddings generated in the corresponding embedding layer. In some embodiments, the positional encoding layer may apply one or more positional encoding vectors (e.g., a positional encoding vector 104 or positional encoding vector 105) on vector embeddings from the corresponding embedding layer to generate new vector embeddings that represents the embeddings with positional context. The positional encoding vector may encode information about the position of the embedding in a sequence of embeddings. In some embodiments, the positional encoding layer performs an addition operation on a positional encoding vector and a vector embedding. The addition operation may be elementwise addition. The positional encoding layer may output an embedding matrix that includes the vector embeddings computed in the positional encoding layer.
[0054] An MHA layer (e.g., the MHA layer 141, the MHA layer 151, or the MHA layer 153) may implement a multi-head attention mechanism, which may be a multi-head self-attention mechanism or a multi-head cross-attention mechanism. In some embodiments, the MHA layer 141 or the MHA layer 151 may implement a self-attention mechanism. For self-attention, the queries, keys, and values may come from the same place. For instance, for the MHA layer 141, the queries, keys, and values may all come from the positional encoding layer 55. For the MHA layer 151, the queries, keys, and values may all come from the positional encoding layer 125. The self-attention mechanism may enable the transformer model 100 to relate each token with other tokens. The MHA layer may compute attention scores from embeddings generated in the corresponding positional encoding layer. In some embodiments, the MHA layer may receive one or more queries, one or more keys, and one or more values. In some embodiments, the MHA layer has a number of heads that receive different linearly projected versions of the queries, keys, and values and produce outputs in parallel that are then used to generate the final result.
[0055] In some embodiments, the queries, keys, and values input into the MHA layer 141 may be computed from vector embeddings generated by the positional encoding layer 55. The queries, keys, and values input into the MHA layer 151 may be computed from vector embeddings generated by the positional encoding layer 125. A query, key, or value may be a vector the represents a token in a sequence. In some embodiments, a query matrix may be computed by multiply an embedding matrix (e.g., an embedding matrix computed in a positional encoding layer) with a weight matrix where d is the dimension of a vector embedding, N is the number of vector embeddings in the embedding matrix, and h is the number of attention heads. Each row in the query matrix may be a query. A key matrix may be computed by multiple an embedding matrix (e.g., an embedding matrix computed in a positional encoding layer) with a weight matrix Each row in the key matrix may be a key. A value matrix may be computed by multiple an embedding matrix (e.g., an embedding matrix computed in a positional encoding layer) with a weight matrix Each row in the value matrix may be a value.
[0056] In some embodiments, the MHA layer 151 may implement masked multi-head self-attention. The MHA layer 151 may prevent positions from attending to subsequent positions. For instance, each token in the sequence may not be influenced by future tokens. This masking can ensure that the predictions of a particular position can depend on known outputs at positions before it and not depend on unknown outputs at positions after it.
[0057] In some embodiments, the MHA layer 153 may implement a cross-attention mechanism, such as encoder-decoder cross-attention. The MHA layer 153 may use outputs from the previous layer (i.e., the add &norm layer 152) as queries and use outputs from the encoder block 50 as keys and values. The cross-attention can align the encoder’s input with the decoder’s , empowering the decoder block 120 to identify and emphasize the most relevant parts of the encoder’s input. Certain aspects of MHA layers are described below in conjunction with FIGS. 4A and 4B.
[0058] An add &norm layer in the transformer model 100, such as the add &norm layer 142, 144, 152, 154, and 156, has an addition operation followed by a layer normalization operation. The addition operation may be an addition of the output of the preceding layer and the input of the preceding layer. The preceding layer is a layer that is arranged right before the add &norm layer. For example, the preceding layer of the add &norm layer 142 is the MHA layer 141. As another example, the preceding layer of the add &norm layer 154 is the encoder-decoder attention layer 153.
[0059] Then the layer normalization operation is applied on the result of the addition operation, which may be denoted as LayerNorm (x+sublayer (x) ) , where LayerNorm denotes layer normalization, x is the input of the preceding layer, and sublayer (x) denotes the output of the preceding layer. In some embodiments, the layer normalization operation may include a sequence of computations. In an example, the layer normalization operation may include a mean computation, which may be denoted as where Axyz denotes a data element in the input tensor, x may be the positional index of the data element in one of the spatial dimensions, y may be the positional index of the data element in the other one of the spatial dimensions, z may be the positional index of the data element in the channel dimension, and μxy denotes the output of the mean computation, which may be a 2D matrix. The mean computation may be channel-wise reduction operation. The layer normalization operation may convert μxy to a 3D tensor μxyz, e.g., by replicating every data element over z output points.
[0060] The layer normalization operation may also include an elementwise subtraction, which may be denoted as Dxyz=Axyz-μxyz. The layer normalization operation may further include a variance computation denoted as and a division computation denoted as Mxy may be a 2D tensor. The layer normalization operation may also convert Mxy to a 3D tensor Mxyz, e.g., by replicating every data element over z output points. Further, the layer normalization operation may have an element multiplication denoted as The layer normalization operation may further compute and LNxyz=A″xyz×γz. LNxyz may be the output of the layer normalization operation.
[0061] A feed forward layer (e.g., the feed forward layer 143 and the feed forward layer 155) may be a position-wise fully-connected feed forward network. In an example, the feed forward layer may include two linear layers with an activation function in between. An example of the activation function is Rectified Linear Unit (ReLU) .
[0062] FIG. 2 illustrates computations in an attention layer without KV caching, in accordance with various embodiments. The attention layer may be a multi-head attention layer, such as a multi-head self-attention layer. In some embodiments, the attention layer is in a decoder of a transformer. The computations in the attention layer may include multiplication of a query matrix 210 and a key matrix 220, which results in an attention weight matrix 230. In some embodiments, the attention layer may be a masked attention layer. One or more elements in the attention weight matrix 230 may be masked. For instance, the elements highlighted with a dotted pattern in FIG. 2 may be masked. The computations in the attention layer also includes multiplication of the attention weight matrix 230 and a value matrix 240, which results in an output matrix 250 encoding new tokens. In other embodiments, the computations in the attention layer may include other computations, such as computations with a scaling function, SoftMax function, and so on. For the purpose of simplicity and illustration, these computations are not shown in FIG. 2.
[0063] Each of the query matrix 210, key matrix 220, and value matrix 240 may include a vector for each of the tokens in the input sequence. For the purpose of illustration and simplicity, the input sequence has four tokens: tokens 1-4. In the embodiments of FIG. 2, as the decoder does not implement KV caching, computations on all the key tokens in the key matrix 220 and all the value tokens in the value matrix 240 need to be conducted. Some of the computations have already been conducted in the previous inference stage, e.g., computations on the key tokens 1-3 and computations on the value tokens 1-3. The duplication of these computations can be a waste of computational resources, such as power, time, and so on.
[0064] FIG. 3 illustrates an example convolution, in accordance with various embodiments. The convolution may be a neural network operation in a convolutional layer of a DNN. The DNN may be a convolutional neural network. The convolution can be executed on an activation tensor 310 and filters 320 (individually referred to as “filter 320” ) . The filters may constitute a weight tensor of the convolution. The result of the convolution is an output tensor 330. In some embodiments, the convolution is performed by a DNN accelerator. The convolution may be executed by a processing engine, such as the processing engine 570 in FIG. 5.
[0065] The activation tensor 310 may be computed in a previous layer of the DNN. In some embodiments (e.g., embodiments where the convolutional layer is the first layer of the DNN) , the activation tensor 310 may be an image. In the embodiments of FIG. 3, the activation tensor 310 includes activations (also referred to as “input activations, ” “elements, ” or “input elements” ) arranged in a 3D matrix. The activation tensor 310 may also be referred to as an input tensor of the convolution. An input element is a data point in the activation tensor 310. The activation tensor 310 has a spatial size Hin×Win×Cin, where Hi8n is the height of the 3D matrix (i.e., the length along the Y axis, which indicates the number of activations in a column in the 3D matrix of each input channel (IC) ) , Win is the width of the 3D matrix (i.e., the length along the X axis, which indicates the number of activations in a row in the 3D matrix of each IC) , and Cin is the depth of the 3D matrix (i.e., the length along the Z axis, which indicates the number of ICs) . For the purpose of simplicity and illustration, the activation tensor 310 has a spatial size of 7×7×3, i.e., the activation tensor 310 includes three ICs and each IC has a 7×7 3D matrix. Each input element in the activation tensor 310 may be represented by a (X, Y, Z) coordinate. In other embodiments, the height, width, or depth of the activation tensor 310 may be different.
[0066] Each filter 320 includes weights arranged in a 3D matrix. The values of the weights may be determined through training the DNN. A filter 320 has a spatial size Hf×Wf×Cf, where Hf is the height of the filter (i.e., the length along the Y axis, which indicates the number of weights in a column in each kernel) , Wf is the width of the filter (i.e., the length along the X axis, which indicates the number of weights in a row in each kernel) , and Cf is the depth of the filter (i.e., the length along the Z axis, which indicates the number of channels) . In some embodiments, Cf equals Cin. For purpose of simplicity and illustration, each filter 320 in FIG. 3 has a spatial size of 3×3×3, i.e., the filter 320 includes 3 convolutional kernels with a spatial size of 3×3. In other embodiments, the height, width, or depth of the filter 320 may be different. The spatial size of the convolutional kernels is smaller than the spatial size of the 3D matrix of each IC in the activation tensor 310.
[0067] An activation or weight may take one or more bytes in a memory. The number of bytes for an activation or weight may depend on the data format. For example, when the activation or weight has an INT8 format, the activation takes one byte. When the activation or weight has a FP16 format, the activation or weight takes two bytes. Other data formats may be used for activations or weights.
[0068] In the convolution, each filter 320 slides across the activation tensor 310 and generates a 3D matrix for an output channel in the output tensor 330. In the embodiments of FIG. 3, the 3D matrix has a spatial size of 5×5. The output tensor 330 includes activations (also referred to as “output activations, ” “elements, ” or “output element” ) arranged in a 3D matrix. An output activation is a data point in the output tensor 330. The output tensor 330 has a spatial size Hout×Wout×Cout, where Hout is the height of the 3D matrix (i.e., the length along the Y axis, which indicates the number of output activations in a column in the 3D matrix of each output channel) , Wout is the width of the 3D matrix (i.e., the length along the X axis, which indicates the number of output activations in a row in the 3D matrix of each output channel) , and Cout is the depth of the 3D matrix (i.e., the length along the Z axis, which indicates the number of output channels) . Cout may equal the number of filters 320 in the convolution. Hout and Wout may depend on the heights and weights of the activation tensor 310 and each filter 320. In an example where the kernel size is 1×1, Hout and Woutmay equal to Hin and Win, respectively.
[0069] As a part of the convolution, multiply-accumulate (MAC) operations can be performed on a 3×3×3 subtensor 315 (which is highlighted with a dotted pattern in FIG. 3) in the activation tensor 310 and each filter 320. The result of the MAC operations on the subtensor 315 and one filter 320 is an output activation. In some embodiments (e.g., embodiments where the convolution is an integral convolution) , an output activation may include 8 bits, e.g., one byte. In other embodiments (e.g., embodiments where the convolution is a floating-point convolution) , an output activation may include more than one byte. For instance, an output element may include two bytes.
[0070] After the MAC operations on the subtensor 315 and all the filters 320 are finished, a vector 335 is produced. The vector 335 is highlighted with a dotted pattern in FIG. 3. The vector 335 includes a sequence of output activations, which are arranged along the Z axis. The output activations in the vector 335 have the same (x, y) coordinate, but the output activations correspond to different output channels and have different Z coordinates. The output channel dimension along the Z axis may also be referred to as the K dimension or depth dimension. The dimension of the vector 335 along the Z axis may equal the total number of output channels in the output tensor 330. After the vector 335 is produced, further MAC operations are performed to produce additional vectors till the output tensor 330 is produced. In the embodiments of FIG. 3, the output tensor 330 is computed in a Z-major format. When the output tensor 330 is computed in the ZXY format, the vector that is adjacent to the vector 335 along the X axis may be computed right after the vector 335. When the output tensor 330 is computed in the ZYX format, the vector that is adjacent to the vector 335 along the Y axis may be computed right after the vector 335. The output tensor 330 may be permuted, e.g., by the drain module 1790, and stored in a memory (e.g., the local memory 540) in an X-major format or Y-major format.
[0071] In some embodiments, the MAC operations on a 3×3×3 subtensor (e.g., the subtensor 315) and a filter 320 may be performed by a plurality of MAC units. One or more MAC units may receive an input operand (e.g., an activation operand 317 shown in FIG. 3) and a weight operand (e.g., the weight operand 327 shown in FIG. 3) . The activation operand 317 includes a sequence of activations having the same (x, y) coordinate but different z coordinates. The activation operand 317 includes an activation from each of the ICs in the activation tensor 310. The weight operand 327 includes a sequence of weights having the same (x, y) coordinate but different z coordinates. The weight operand 327 includes a weight from each of the channels in the filter 320. Activations in the activation operand 317 and weights in the weight operand 327 may be sequentially fed into a MAC unit. The MAC unit may receive an activation and a weight ( “an activation-weight pair” ) at a time and multiple the activation and the weight. The position of the activation in the activation operand 317 may match the position of the weight in the weight operand 327. The activation and weight may correspond to the same channel.
[0072] Activations or weights may be floating-point numbers. Floating-point numbers may have various data formats, such as FP32, FP16, BF16, and so on. A floating-point number may be a positive or negative number with a decimal point. A floating-point number may be represented by a sequence of bits that includes one or more bits representing the sign of the floating-point number (e.g., positive or negative) , bits representing an exponent of the floating-point number, and bits representing a mantissa of the floating-point number. The mantissa is the part of a floating-point number that represents the significant digits of that number. The mantissa is multiplied by the base raised to the exponent to give the actual value of the floating-point number.
[0073] In some embodiments, the output activations in the output tensor 330 may be further processed based on one or more activation functions before they are written into the memory or inputted into the next layer of the DNN. The processing based on the one or more activation functions may be at least part of the post processing of the convolution. In some embodiments, the post processing may include one or more other computations, such as offset computation, bias computation, and so on. The results of the post processing may be stored in a local memory of the compute block and be used as input to the next DNN layer. In some embodiments, the input activations in the activation tensor 310 may be results of post processing of the previous DNN layer.
[0074] In some embodiments, convolution operations may be performed by a DNN accelerator, such as the DNN accelerator 502 in FIG. 5. A neural network operation in a transformer model, such as the transformer model 100, may be mapped to a convolution and performed by the DNN accelerator. In some embodiment, an input tensor of a MatMul operation (or other types of operations in the transformer model 100) may be treated (e.g., stored, loaded, or processed) as an activation tensor, and another input tensor of the MatMul operation may be treated as a weight tensor of the convolution. The DNN accelerator may perform at least part of a convolution on the activation tensor and weight tensor to compute the output of the MatMul operation. For example, a query vector, key vector, or value vector of an attention layer, which may have a shape [batch size, SL, dmodel] , may be treated as an activation tensor or weight tensor of a convolution. One of the three dimensions may be treated as the IC dimension. In an example, SL is treated as the H dimension, dmodel is treated as the W dimension, and batch size is treated as the IC dimension. In other example, SL or dmodel may be treated as the IC dimension.
[0075] FIG. 4 illustrates partition of a workload of executing a DNN layer, in accordance with various embodiments. The partition of the workload is illustrated by partition of an output tensor 400 of the DNN layer. In an example where the DNN layer is an attention layer, the output tensor 400 may be the attention weight matrix 230 or output matrix 250. In an example where the DNN layer is a convolutional layer, the output tensor may be the output tensor 330 in FIG. 3. The output tensor 400 has a spatial size of H×W×K, where H denotes the height, W denotes the width, and K denotes the depth.
[0076] In the embodiments of FIG. 4, the output tensor 400 is split over all the three dimensions. As shown in FIG. 4, the output tensor 400 is split into subtensors 410, 420, 430, 440, 450, 460, 470, and 480, each of which is a portion of the output tensor 400. The workload of executing the DNN layer is split into eight smaller workloads for computing the eight subtensors, respectively. In other embodiments, the output tensor 400 may be split in different ways. For instance, the output tensor 400 may be split across one or two of the dimensions.
[0077] In an example in which the output tensor 400 is split over the K dimension, the output tensor 400 may be split into two subtensor: one including the subtensors 410, 420, 430, and 440; the other one including the subtensors 450, 460, 470, and 480. In an example in which the output tensor 400 is split over the H dimension, the output tensor 400 may be split into two subtensor: one including the subtensors 410, 420, 450, and 460; the other one including the subtensors 430, 440, 470, and 480. In an example in which the output tensor 400 is split over the W dimension, the output tensor 400 may be split into two subtensor: one including the subtensors 410, 430, 450, and 470; the other one including the subtensors 420, 440, 460, and 480.
[0078] In an example in which the output tensor 400 is split over the H and K dimension, the output tensor 400 may be split into four subtensor: one including the subtensors 410 and 420; another one including the subtensors 430 and 440, another one including the subtensors 450 and 460, and another one including the subtensors 470 and 480. In an example in which the output tensor 400 is split over the W and K dimension, the output tensor 400 may be split into four subtensor: one including the subtensors 410 and 430; another one including the subtensors 420 and 440, another one including the subtensors 450 and 470, and another one including the subtensors 460 and 480. In an example in which the output tensor 400 is split over the H and W dimension, the output tensor 400 may be split into four subtensor: one including the subtensors 410 and 450; another one including the subtensors 420 and 460, another one including the subtensors 430 and 470, and another one including the subtensors 440 and 480.
[0079] In some embodiments, the smaller workloads generated by splitting the workload of executing the DNN layer may be allocated to multiple tiles in a DNN accelerator (e.g., the DNN accelerator 502 in FIG. 5) . That means the subtensors generated by splitting the output tensor 400 may be computed separately by multiple tiles. After a subtensor is generated, it may be moved to a different tile for executing the next DNN layer. The workload for executing the next DNN layer may be split in a different manner from the way in which the output tensor 400 is split. For example, the output tensor 400 is split in the H, W, and K dimensions as shown in FIG. 4, versus the output tensor of the next DNN layer may be split in the H and K dimensions but not split in the W dimension. The output tensor 400 may be used as an input tensor of the next DNN layer.
[0080] FIG. 5 is a block diagram of a DNN system 500, in accordance with various embodiments. The whole DNN system 500 or a part of the DNN system 500 may be implemented in one or more computing devices, such as the computing device 1700 in FIG. 17. The DNN system 500 can generate and execute DNNs, such as transformer-based models (e.g., the transformer models described above) , convolution-based models, and so on. As shown in FIG. 5, the DNN system 500 includes a DNN module 501 and a DNN accelerator 502. In other embodiments, alternative configurations, different or additional components may be included in the DNN system 500. For instance, the DNN system 500 may include multiple DNN modules or multiple DNN accelerators. Further, functionality attributed to a component of the DNN system 500 may be accomplished by a different component included in the DNN system 500 or a different system. In some embodiments, the DNN module 501 and DNN accelerator 502 may include different types of processing units. In an example, the DNN module 501 may be implemented by one or more central processing units (CPUs) or graphics processing units (GPUs) . The DNN accelerator 502 may also be referred to as a neural processing unit, AI accelerator, or AI processor. The DNN module 501 and DNN accelerator 502 may be implemented in the same chip or separate chips.
[0081] The DNN module 501 facilitates generation and deployment of DNNs. In some embodiments, the DNN module 501 may generate and train DNNs. For instance, the DNN module 501 can define the layered architecture of a DNN. The DNN module 501 can also determine the internal parameters of the DNN through a DNN training process. The DNN module 501 may also determine one or more hyperparameters that define how the DNN is trained. An example hyperparameter is a sparsity ratio that defines the sparsity level of one or more deep learning tensors for the DNN.
[0082] The DNN module 501 may deploy trained, compressed, or validated DNNs for use in deep learning applications. In some embodiments, the DNN module 501 may distribute trained, compressed, or validated DNNs to devices or systems which may use the DNNs to perform tasks (e.g., image classification, motion planning, etc. ) for which the DNNs were trained. In other embodiments, the DNN module 501 may facilitate deployment of the DNNs using the DNN accelerator 502. For instance, the DNN module 501 may receive data from a device or system coupled with the DNN system 500 and input the received data (or data generated by the DNN module 501, e.g., based on the received data) into a DNN. The DNN module 501 may generate instructions (e.g., configuration files) that control the operation of the DNN accelerator 502 during the DNN execution. The DNN module 501 may receive an output of the DNN from the DNN accelerator 502. The DNN module 501 may transmit the output of the DNN (or a result of processing the output of the DNN by the DNN module 501) to the device or system. In some embodiments, the DNN module 501 may control execution processes of trained, compressed, or validated DNNs. The DNN module 501 may function as a complier for DNNs executed by the DNN accelerator 502. The DNN module 501 may perform compilation of DNNs and generate compilation descriptors, based on which the DNNs may be executed.
[0083] The DNN module 501 may generate executable DNN models. The DNN module 501 may also facilitate execution of DNN layers by the DNN accelerator 502. For instance, the DNN module 501 may be the host for the execution of neural network operations by the DNN accelerator 502, e.g., the host for DNN inference. In some embodiments, the DNN module 501 may receive an inference request, which may be a request to have a DNN model to make a prediction based on input data. The DNN module 501 may also partition workloads for executing DNN layers into smaller workloads and determine allocation of the smaller workloads to tiles in the DNN accelerator 502. The DNN module 501 may also determine and generate configuration parameters for inter-tile communication for DNN layers executed by multiple tiles. Certain aspects of the DNN module 501 are provided below in conjunction with FIG. 12.
[0084] The DNN accelerator 502 executes DNNs provided by the DNN module 501. For instance, the DNN accelerator 502 can execute a DNN by running deep learning operations in the DNN. The process of carrying out a deep learning operation is also referred to as a process of executing the deep learning operation or a process of performing the deep learning operation. The execution of the DNN may be for training the DNN or for using the DNN to perform AI tasks. As shown in FIG. 5, the DNN accelerator 502 includes a memory 510, a DMA (direct memory access) engine 520, data processing units 530 (individually referred to as “data processing unit 530” ) , and an inter-tile interconnect 525. In other embodiments, alternative configurations, different or additional components may be included in the DNN accelerator 502. For example, the DNN accelerator 502 may include more than one memory 510 or DMA engine 520. As another example, the DNN accelerator 502 may include a single data processing unit 530. As yet another example, the DNN accelerator 502 may include one or more digital signal processors. Further, functionality attributed to a component of the DNN accelerator 502 may be accomplished by a different component included in the DNN accelerator 502 or by a different module or system (e.g., the DNN module 501) . A component of the DNN accelerator 502 may be implemented in hardware, software, firmware, or some combination thereof.
[0085] The memory 510 stores data associated with deep learning operations performed by the DNN accelerator 502. The memory 510 may be a system memory. In some embodiments, the memory 510 includes a dynamic random-access memory (DRAM) . When the DNN accelerator 502 executes operations in transformer models, at least part of the memory 510 may be used to implement KV caches, such as self-attention KV caches and cross-attention KV caches, in the transformer models. The KV caches may be updated during inference of the transformation model. Layout of data in the KV caches may be determined to optimize the efficiency of the DNN accelerator 501. The memory 510 may also store sparsity masks. A sparsity mask may be a sparsity tensor that indicates a sparsity pattern in an input tensor of a neural network operation. The sparsity mask may be a sparsity bitmap that includes one or more zero bits and one or more one bits. A zero bit may indicate that the corresponding input data element is zero, while a one bit may indicate that the corresponding input data element is nonzero.
[0086] In some embodiments, the memory 510 may store data to be used by the data processing units 530 for DNN execution. The memory 510 may store weights, such as weights of convolutional layers, which are determined by training DNNs. The memory 510 may further store inputs to DNN layers or outputs of DNN layers, such as data generated by the data processing units 530 from performing deep learning operations in DNNs. Example deep learning operations include convolutions (also referred to as “convolutional operations” ) , layer normalization operations, SoftMax operations, matrix multiplication operations, pooling operations, elementwise operations, activation functions, other types of deep learning operations, or some combination thereof. The memory 510 may be a main memory of the DNN accelerator 502. In some embodiments, the memory 510 includes one or more DRAMs.
[0087] The DMA engine 520 facilitates data transfer between the memory 510 and local memories of the data processing units 530. For example, the DMA engine 520 can read data from the memory 510 and write data into a local memory of a data processing unit 530. As another example, the DMA engine 520 can read data from a local memory of a data processing unit 530and write data into the memory 510. The DMA engine 520 provides a DMA feature that allows the data processing unit 530 to initiate data transfer between the memory 510 and the local memories of the data processing units 530 and to perform other operations while the data transfer is being conducted. In some embodiments, the DMA engine 520 may read tensors from the memory 510, modify the tensors in a way that is optimized for the data processing unit 530 before it writes the tensors into the local memories of the data processing units 530.
[0088] The data processing units 530 perform deep learning operations in DNNs. For instance, a data processing unit 530 may execute a DNN layer by running one or more deep learning operations in the DNN layer. A data processing unit 530 may execute a layer, or a portion of a layer, at a time. In some embodiments, the operations of the DNN layers may be run by multiple data processing units 530 in parallel. For instance, multiple data processing units 530 may each perform a portion of a workload for a deep learning operation. Data may be shared between the data processing units 530. A data processing unit 530 may also be referred to as a a compute tile or tile.
[0089] The data processing units 530 may be capable of running various types of deep learning operations, such as convolution, layer normalization, SoftMax operation, pooling, elementwise operation, linear operation, nonlinear operation, and so on. Deep learning operations performed by the data processing units 530 include tensor operations, i.e., operations whose inputs are tensors or operations whose outputs are tensors. In an example, the data processing unit 530 receives an input tensor and one or more convolutional kernels and performs a convolution with the input tensor and convolutional kernels. The result of the convolution may be an output tensor, which can be further computed, e.g., by the data processing unit 530 or another data processing unit 530.
[0090] In the embodiments of FIG. 5, each data processing unit 530 includes a local memory 540, a sparsity mode module 550, a load module 560, a processing engine 570, a post-processing engine 580, and a drain module 590. Some or all the components of the data processing unit 530 can be implemented on the same chip. In other embodiments, alternative configurations, different or additional components may be included in the data processing unit 530. For instance, a data processing unit 530 may include one or more digital signal processors. Further, functionality attributed to a component of the data processing unit 530 may be accomplished by a different component included in the data processing unit 530, a different data processing unit 530, another component of the DNN accelerator 502, or a different system. A component of the data processing unit 530 may be implemented in hardware, software, firmware, or some combination thereof.
[0091] The local memory 540 is local to the corresponding data processing unit 530. In the embodiments of FIG. 5, the local memory 540 is inside the data processing unit 530. In other embodiments, the local memory 540 may be outside the data processing unit 530. Data in the local memory 540 may be transferred to or from the memory 510, e.g., through the DMA engine 520. For instance, input tensors pr pit [it temsprs of DNN layers may be copied from the memory 510 to the local memory 540. In some embodiments, data in the local memory 540 may be transferred to or from the local memory of another data processing unit 530. The local memory 540 may store data received, used, or generated by the sparsity mode module 550, the load module 560, the processing engine 570, the post-processing engine 580, or the drain module 590. Examples of the data may include input activations, weights, output activations, sparsity bitmaps, and so on.
[0092] In some embodiments, the local memory 540 may store tensors to be processed by the processing engine 570 or the post-processing engine 580. The tensors may be input tensors of deep learning operations. The local memory 540 may also store tensors generated by the processing engine 570 or the post-processing engine 580. The tensors may be output tensors of deep learning operations. In some embodiments, the local memory 540 may store dense tensors (e.g., dense activation tensors, dense weight tensors, etc. ) , sparse tensors (e.g., sparse activation tensors, sparse weight tensors, etc. ) , and so on. A dense tensor may be a tensor from which zero-valued elements (if any) are not removed. A dense tensor may be converted to a sparse tensor by removing one or more zero-valued elements in the dense tensor. A sparse tensor may also be referred to as a compressed tensor or packed tensor. The process of converting a dense tensor to a sparse tensor may be referred to as sparsity encoding. Sparsity encoding may also generate a sparsity tensor. Each element in the sparsity tensor may correspond to a different element in the dense tensor and indicate whether the element in the dense tensor is zero or not. The sparsity tensor may indicate positions of elements of the sparse tensor in the dense tensor. The sparsity tensor may be a sparsity bitmap, each element of which is a bit. A sparse tensor may be converted to a dense tensor through a densifying process, in which one or more zeros may be added to the sparse tensor based on the sparsity tensor.
[0093] In some embodiments, the local memory 540 includes one or more static random-access memories (SRAMs) . The local memory 540 may be byte-addressable, and each memory address identifies a single byte (eight bits) of storage. In some embodiments, the local memory 540 may include memory banks. The number of data banks in the local memory 540 may be 16, 64, 128, 556, 512, 1024, 2048, or other numbers. A memory bank may include a plurality of storage units. In an example, a data bank may include 8, 16, 64, or a different number of storage units. A memory bank or a storage unit in a memory bank may have a memory address. In an example, a storage unit may store a single byte, and data larger than a single byte may be stored in storage units with consecutive memory addresses, i.e., adjacent storage units. For instance, a storage unit can store an integer number in the INT8 format, versus two storage units may be needed to store a number in the FP16 or BF16 format, which has 16 bits. In some embodiments, 16 bits can be transferred from the local memory 540 in a single read cycle. In other embodiments, 16 bits can be transferred from the local memory 540 in multiple read cycles, such as two cycles.
[0094] The sparsity mode module 550 determines sparsity modes in which the data processing unit 530 operates to execute DNN layers. For instance, the sparsity mode module 550 may determine whether to accelerate a layer based on weight sparsity, activation sparsity, or both. The sparsity mode module 550 select the sparsity mode for a layer from a group of sparsity modes that includes, for example, combined sparsity mode in which the layer is accelerated based on both weight sparsity and activation sparsity, activation sparsity mode in which the layer is accelerated based on activation sparsity but not based on weight sparsity, weight sparsity mode in which the layer is accelerated based on weight sparsity but not based on activation sparsity, and a dense mode in which the layer is not accelerated based on sparsity. In some embodiments (e.g., embodiments where a layer is executed by multiple data processing units 530) , the sparsity mode module 550 may determine the sparsity mode for all the data processing units 530 that executes the layer. In some embodiments, the sparsity mode module 550 may receive configuration parameters from the DNN module 501. A configuration parameter may correspond to a layer and indicate whether to accelerate the layer based on weight sparsity. The sparsity mode module 550 may determine the sparsity mode of the layer based on the configuration parameter.
[0095] The load module 560 loads data from the local memory 540 to the processing engine 570 or to the post-processing engine 580. The load module 560 may read tensors from the local memory 540. The tensors may include sparsity masks, query tensors, key tensors, value tensors, activation tensor, weight tensors, and so on. In some embodiments, the load module 560 may load data based on the sparsity mode determined by the sparsity mode module 550. The load module 560 may select different data to transmit to the processing engine 570 in different sparsity modes. For instance, the load module 560 may transmit an activation sparsity tensor and a weight sparsity tensor of a layer to the processing engine 570 in the combined sparsity mode, while transmit the activation sparsity tensor but not the weight sparsity tensor to the processing engine 570 in the activation sparsity mode and transmit the weight sparsity tensor but not the activation sparsity tensor to the processing engine 570 in the weight sparsity mode. In the dense mode, the load module 560 does not transmit either the activation sparsity tensor or the weight sparsity tensor to the processing engine 570.
[0096] The processing engine 570 performs operations in DNNs. The processing engine 570 may accelerate neural network operations based on sparsity in data. In some embodiments, the processing engine 570 may operate in a dense mode in which sparsity acceleration is not performed. The processing engine 570 may include one or more processing cells. In some embodiments, the processing cells may be arranged in one or more rows and one or more columns in the processing engine 570. Each processing cell may include PEs that may be arranged in an array that includes rows and columns. All the PEs in the processing engine 570 may constitute a bigger array that includes more rows and columns.
[0097] An example PE may be or may include one or more multiply-accumulate (MAC) units that can perform MAC operations. In some embodiments (e.g., embodiments where the data processing unit 530 executes a convolutional layer) , a computation in an MAC unit may be an MAC operation on an activation operand and a weight operand. The activation operand may be an activation tensor that may include one or more activations in the input tensor of the convolution. Different activations may be in different ICs. The weight operand may be a weight tensor that may include one or more weights in the filter of the convolution. The values of the weights are determined through training the DNN. The weights in the weight operand may be in different ICs.
[0098] In some embodiments, an MAC unit includes one or more multipliers for performing multiplications. An MAC unit may also include one or more accumulators ( “adders” ) for performing accumulations. A column of MAC units is referred to as an MAC column. An MAC column may be associated with one or more MAC lanes. A MAC lane is a path for loading data e.g., by the load module 560, into an MAC column. A MAC lane may be also referred to as a data transmission lane or data loading lane. An MAC column may have multiple MAC lanes. The loading bandwidth of the MAC column is an aggregation of the loading bandwidths of all the MAC lanes associated with the MAC column. With a certain number of MAC lanes, data can be fed into the same number of independent MAC units simultaneously. In some embodiments where an MAC column has four MAC lanes for feeding activations or weights into the MAC column and each MAC lane may have a bandwidth of 16 bytes, the four MAC lanes can have a total loading bandwidth of 64 bytes.
[0099] In some embodiments, the processing engine 570 may be capable of depthwise convolution, standard convolution, or both. In a depthwise convolution, an MAC unit may perform an MAC operation that includes a sequence of multiplications for an input operand and a weight operand. Each multiplication in the sequence (also referred to as a cycle) is a multiplication of a different activation in the input operand with a different weight in the weight operand. The activation and weight in the same cycle may correspond to the same channel. The sequence of multiplication produces a product operand that includes a sequence of products. The MAC operation may also include accumulations in which multiple product operands are accumulated to produce an output operand of the MAC unit. The processing engine 570 may output multiple output operands at a time, each of which is generated by a different MAC unit. In a standard convolution, MAC operations may include accumulations across the channels. For instance, as opposed to generating an output operand, a MAC unit may accumulate products across different channels to generate a single output point.
[0100] In some embodiments, the processing engine 570 may perform MAC operations in quantized deep learning operations, such as MAC operations in a quantized convolution. In some embodiments, an MAC unit in the processing engine 570 may receive quantized activation and quantized weights and compute a quantized MAC result. The quantized MAC result may be a quantized value in an integer format and may be the output of the MAC unit. In some embodiments, the MAC unit may also include a quantization multiplier that can multiply a quantization scale with the quantized MAC result, and the output of the MAC unit may be a real value in a floating-point format. The MAC unit may include no quantization subtractors as zero-point offsetting is not needed for the MAC operations in quantized deep learning operations.
[0101] In some embodiments, the processing engine 570 may include sparsity acceleration logic for facilitating sparsity acceleration. For instance, each processing cell in the processing engine 570 may include one or more sparsity modules. In an example, each MAC column or each MAC row may have a corresponding sparsity module that accelerates MAC operations in the MAC column or MAC row. In some embodiments, a sparsity module accelerates computations in the processing engine 570 based on sparsity in activations, sparsity in weights, or both. The sparsity module may include a storage unit that stores a sparsity tensor, which may be loaded to the storage unit by the load module 560. The sparsity tensor may be an activation sparsity tensor, a weight sparsity tensor, or a combined sparsity tensor.
[0102] An activation sparsity tensor may be the sparsity tensor of an activation tensor and has the same number of elements as the activation tensor. An element in the activation sparsity tensor may indicate whether the corresponding element in the activation tensor is zero or not. For instance, a zero-valued in the activation sparsity tensor may indicate that the corresponding element in the activation tensor is zero. A one-valued in the activation sparsity tensor may indicate that the corresponding element in the activation tensor is nonzero. A weight sparsity tensor may be the sparsity tensor of a weight tensor and has the same number of elements as the weight tensor. An element in the weight sparsity tensor may indicate whether the corresponding element in the weight tensor is zero or not. For instance, a zero-valued in the weight sparsity tensor may indicate that the corresponding element in the weight tensor is zero. A one-valued in the weight sparsity tensor may indicate that the corresponding element in the weight tensor is nonzero. The sparsity module may generate a combined sparsity tensor using an activation sparsity tensor and a weight sparsity tensor. For instance, the sparsity module may multiply an element of the activation sparsity tensor with a corresponding element of the weight sparsity tensor to compute an element of the combined sparsity tensor. The positions of the three elements in their corresponding sparsity tensors may match. In some embodiments, each element in a sparsity tensor may be a bit, and the sparsity tensor may be referred to as a sparsity bitmap.
[0103] The sparsity module may use the sparsity tensor to identify activations and weights to be used in MAC operations by the MAC units. In an embodiment where the processing engine 570 operates in the combined sparsity mode, the sparsity module may identify activations and weights that correspond to nonzero valued elements of a combined sparsity tensor. In an embodiment where the processing engine 570 operates in the activation sparsity mode, the sparsity module may identify activations and weights that correspond to nonzero valued elements of an activation sparsity tensor. In an embodiment where the processing engine 570 operates in the weight sparsity mode, the sparsity module may identify activations and weights that correspond to nonzero valued elements of a weight sparsity tensor. The sparsity module may be bypassed in the dense mode as no sparsity acceleration would be conducted.
[0104] The post-processing engine 580 processes outputs of the processing engine 570. The post-processing engine 580 may include one or more post-processing elements (PPEs) . In some embodiments, the PPEs in the post-processing engine 580 may be arranged in an array that has rows and columns. In some embodiments, the post-processing engine 580 computes activation functions. The post-processing engine 580 may receive outputs of the processing engine 570 as inputs to the activation functions. In addition or alternative to activation functions, the post-processing engine 580 may perform other types of post processing on outputs of the processing engine 570. For instance, the post-processing engine 580 may apply a bias on an output of the processing engine 570. In some embodiments, the post-processing engine 580 may be bypassed for certain neural network operations.
[0105] The drain module 590 operates on data computed by the processing engine 570 or from the post-processing engine 580. For instance, the drain module 590 drains data from the processing engine 570 or from the post-processing engine 580. The drain module may write the data to the local memory 540. The drained data may be tensors, such as output tensors of neural network operations. In some embodiments, the drain module 590 may drain data on a cell level. For each processing cell, the drain module 590 may drain outputs of PEs in the processing cell based on a row index or column index of each PE. For instance, the drain module 590 may use a sequence of cycles to drain data from a processing cell. The drain module 590 may drain the output of some of the PEs in each cycle. The sequence of the cycles may be configured based on a configuration parameter indicating the operation mode of the load module 560.
[0106] In some embodiments, the drain module 590 includes sparsity encoding logic that can convert outputs of the processing engine 570 from a dense format to a sparse format. For instance, the drain module 590 may be implemented with one or more sparsity encoders. A sparsity encoder converts dense data to compressed data based on sparsity in the dense data. For instance, the sparsity encoder may remove zeros in an activation tensor computed by the processing engine 570 to convert the activation tensor to a compressed activation tensor. The sparsity encoder may also generate sparsity tensors, including activation sparsity tensors.
[0107] In some embodiments, the data drained from the processing engine 570 may be at least part of an output tensor (e.g., the output tensor 330 in FIG. 3) of a deep learning operation. The sparsity encoder may generate a compressed version of the output tensor. The sparsity encoder may identify every zero-valued activation in the output tensor and remove these activations from the output tensor to generate a compressed activation tensor (aka “sparse activation tensor” ) . The sparsity encoder may also generate one or more sparsity tensors for the output tensor. A sparsity tensor may correspond to a portion of the output tensor (e.g., the vector 335 in FIG. 3) . The sparsity tensor may include sparsity elements (e.g., bits) , each of which corresponds to a different activation in the vector and indicates whether the corresponding activation is zeroed or not.
[0108] The drain module 590 may write the compressed activation tensor and the one or more sparsity tensors into the local memory 540 or the memory of another data processing unit 530. The sparse activation tensor and the one or more sparsity tensors may be further loaded to the memory 510, e.g., through the DMA engine 520. Additionally or alternatively, the sparse activation tensor and the one or more sparsity tensors may be loaded by the load module 560 to the processing engine 570 for further computation, e.g., for performing a deep learning operation in the next layer. In some embodiments, the post-processing engine 580 and drain module 590 may be located on a drain path of the data processing unit 530.
[0109] In some embodiments, the drain module 590 may perform unicast, multicast, and broadcast of data within the DNN accelerator 502. The data may be at least part of an output tensor of a DNN layer and may be computed by the processing engine 570 or post-processing engine 580. The drain module 590 may receive one or more configuration parameters and operate in accordance with the configuration parameters. In an example, a configuration parameter may enable or disable access of the drain module 590 to a memory. The memory may be the local memory 540 or the memory (or memories) of another data processing unit 530 (or other data processing units 530) . In an embodiment where the drain module 590 receives a configuration parameter that enables access to a memory, the drain module 590 may write drained data into the memory. The drain module 590 may receive multiple configuration parameters indicating enabled access to multiple memories and write the same data to all the memories. In some embodiments, the drain module 590 may receive a configuration parameter that disables the access to the local memory 540 along with a configuration parameter that enables the access to the memory of another data processing unit 530.
[0110] In some embodiments, the drain module 590 may also receive one or more configuration parameters that indicate a position of a subtensor computed by the data processing unit 530 in an output tensor of a DNN layer. For instance, the configuration parameters may specify the coordinate ranges of data elements of the subtensor or the coordinates of the data elements on the boundaries of the subtensor. The drain module 590 may perform data write transactions based on the configuration parameters. By using the configuration parameters, the drain module 590 can avoid memory spill. In some embodiments, the drain module 590 may combine write transactions after determining that these transactions have the same designation, i.e., the transactions are for writing data into the same memory. Certain aspects of the drain module 590 are described below in conjunction with FIG. 15
[0111] The inter-tile interconnect 525 is an interconnect that facilitates communication between the data processing units 530 in the DNN accelerator 502. In some embodiments, the inter-tile interconnect 525 may provide data paths between the data processing units 530. The inter-tile interconnect 525 may be coupled with drain modules and local memories in all the tiles to facilitate data transfer between the tiles. In some embodiments, the inter-tile interconnect 525 may facilitate the drain module 590 of a data processing unit 530 to write data into the local memory 540 of another data processing unit 530. In some embodiments, the inter-tile interconnect 525 is a NOC interconnect.
[0112] FIG. 6 illustrates partitioning a workload of executing a DNN layer over the H dimension, in accordance with various embodiments. An output tensor 604 of the DNN layer is partitioned into two subtensors 601A and 601B over the H dimension. The subtensor 601A is computed by a tile 610 from a tensor 602 in a first workload 620A of executing the DNN layer. The subtensor 610B is computed by another tile 620 from another tensor 603 in a second workload 620B of executing the DNN layer. For the purpose of illustration, the combination of the first workload 620A and second workload 620B constitutes the entire workload of executing the DNN layer. In some embodiments, each of the tensor 602 and tensor 603 is a portion of an input tensor of the DNN layer. The tensor 602 and tensor 603 may overlap. For instance, one or more data elements of the input tensor of the DNN layer may be present in both the tensor 602 and tensor 603. The tiles 610 and 620 may each be a data processing unit, e.g., the data processing unit 530 in FIG. 5. The computation of the subtensor 601A or 601B may be performed by a processing engine (e.g., the processing engine 570) or a post-processing engine (e.g., the post-processing engine 580) .
[0113] After the first workload 620A is complete, a drain module in the tile 610 performs a write operation 630 and writes the subtensor 601A to a memory in the tile 620. In some embodiments, the drain module in the tile 610 does not write the two subtensors 601A into a memory in the tile 610. The write operation 630 may be a unicast operation without local write. After the second workload 620B is complete, a drain module in the tile 620 may perform a write operation 630 and writes the subtensor 601B into the memory in the tile 620. The write operation 630 is a local write as the data is written into the same tile. After the write operation 630 and write operation 630, the memory in the tile 620 stores the entire output tensor 604.
[0114] In some embodiments, the tile 620 may use the output tensor 604 to execute the next DNN layer. The output tensor 604 may be smaller than the input tensor of the DNN layer that includes the tensor 602 and tensor 603, and a workload 640 of executing the next DNN layer may be smaller than the workload of executing the DNN layer. One tile 620 may be sufficient to perform the workload 640. The tile 620 may compute another tensor 605, which may be the output tensor of the next DNN layer.
[0115] FIG. 7 illustrates partitioning a workload of executing a DNN layer over the K dimension, in accordance with various embodiments. An output tensor 704 of the DNN layer is partitioned into two subtensors 701A and 701B over the K dimension. The subtensor 701A is computed by a tile 710 from a tensor 702 in a first workload 720A of executing the DNN layer. The subtensor 710B is computed by another tile 720 from another tensor 703 in a second workload 720B of executing the DNN layer. For the purpose of illustration, the combination of the first workload 720A and second workload 720B constitutes the entire workload of executing the DNN layer. In some embodiments, each of the tensor 702 and tensor 703 is a portion of an input tensor of the DNN layer. The tensor 702 and tensor 703 may overlap. For instance, one or more data elements of the input tensor of the DNN layer may be present in both the tensor 702 and tensor 703. The tiles 710 and 720 may each be a data processing unit, e.g., the data processing unit 530 in FIG. 5. The computation of the subtensor 701A or 701B may be performed by a processing engine (e.g., the processing engine 570) or a post-processing engine (e.g., the post-processing engine 580) .
[0116] After the first workload 720A is complete, a drain module in the tile 710 performs a write operation 730 and writes the subtensor 701A to a memory in the tile 720. In some embodiments, the drain module in the tile 710 does not write the two subtensors 701A into a memory in the tile 710. The write operation 730 may be a unicast operation without local write. After the second workload 720B is complete, a drain module in the tile 720 may perform a write operation 730 and writes the subtensor 701B into the memory in the tile 720. The write operation 730 is a local write as the data is written into the same tile. After the write operation 730 and write operation 730, the memory in the tile 720 stores the entire output tensor 704.
[0117] In some embodiments, the tile 720 may use the output tensor 704 to execute the next DNN layer. The output tensor 704 may be smaller than the input tensor of the DNN layer that includes the tensor 702 and tensor 703, and a workload 740 of executing the next DNN layer may be smaller than the workload of executing the DNN layer. One tile 720 may be sufficient to perform the workload 740. The tile 720 may compute another tensor 705, which may be the output tensor of the next DNN layer.
[0118] Even though each DNN layer workload is split into two workloads in the examples shown in FIGS. 6 and 7, a DNN layer workload may be split into more workloads in other embodiments. Also, the subtensor 601A or subtensor 701A may be sent to more than one tile.
[0119] FIG. 8A illustrates unicast with local memory write in a multi-tile system 800, in accordance with various embodiments. The multi-tile system 800 may be a DNN accelerator, such as the DNN accelerator 502. The multi-tile system 800 shown in FIG. 8A includes a tile 810A, another tile 810B, and an inter-tile interconnect 820. Each of the tile 810A and tile 810B includes a compute block 830 and a local memory 840. The multi-tile system 800 may include more tiles or other components.
[0120] In FIG. 8A, data computed by the compute block 830 of the tile 810A is written into the local memory 840 of the tile 810A. The compute block 830 may include a processing engine, such as the processing engine 570, and a post-processing engine, such as the post-processing engine 580. There is no inter-tile communication in FIG. 8A, and data is not written into the local memory 840 of the tile 810B.
[0121] FIG. 8B illustrates unicast without local memory write in the multi-tile system 800 of FIG. 8A, in accordance with various embodiments. Different from the unicast shown in FIG. 8A, the unicast in FIG. 8B includes write of data computed by the compute block 830 of the tile 810A into the local memory 840 of the tile 810B through the inter-tile interconnect 820. It is not needed to write the data into the local memory 840 of the tile 810A, as the tile 810A will not need the data for the next DNN layer. By avoiding the local write, there can be more memory space available in the tile 810A for storing other data and performing other neural network operations. Memory traffic and power consumption can be reduced. The performance of the multi-tile system 800 can be improved.
[0122] FIG. 9A illustrates broadcast with local memory write in a multi-tile system 900, in accordance with various embodiments. The multi-tile system 900 may be a DNN accelerator, such as the DNN accelerator 502. The multi-tile system 900 shown in FIG. 9A includes tiles 910A-910D and an inter-tile interconnect 920. Each of the tiles 910A-910D includes a compute block 930 and a local memory 940. The multi-tile system 900 may include a different number of tiles or other components.
[0123] In FIG. 9A, data computed by the compute block 930 of the tile 910A is written into the local memory 940 of each of the tiles 910A-910D, meaning the data is broadcast to all the tiles in the multi-tile system 900. The compute block 930 may include a processing engine, such as the processing engine 570, and a post-processing engine, such as the post-processing engine 580. The write of the data into the local memory 940 of the tile 910A is local memory write. The write of the data into the local memory of the other tiles, i.e., tiles 910B-910D, is inter-tile communication through the inter-tile interconnect 920.
[0124] FIG. 9B illustrates broadcast without local memory write in the multi-tile system 900 of FIG. 9A, in accordance with various embodiments. Different from the broadcast shown in FIG. 9A, the broadcast in FIG. 9B does not include the local memory write of data computed by the compute block 930 of the tile 910A. The local memory write can be avoided, as the tile 910A will not need the data for the next DNN layer. By avoiding the local memory write, there can be more memory space available in the tile 910A for storing other data and performing other neural network operations. Memory traffic and power consumption can be reduced. The performance of the multi-tile system 900 can be improved.
[0125] FIG. 10A illustrates multicast with local memory write in a multi-tile system 1000, in accordance with various embodiments. The multi-tile system 1000 may be a DNN accelerator, such as the DNN accelerator 502. The multi-tile system 1000 shown in FIG. 10A includes tiles 1010A-1010D and an inter-tile interconnect 1020. Each of the tiles 1010A-1010D includes a compute block 1030 and a local memory 1040. The multi-tile system 1000 may include a different number of tiles or other components.
[0126] In FIG. 10A, data computed by the compute block 1030 of the tile 1010A is written into the local memory 1040 of the tile 1010A, tile 1010B, and tile 1010D. The data is not written into the local memory 1040 of the tile 1010C. The data is multicast to some of the tiles but not all the tiles in the multi-tile system 1000. The compute block 1030 may include a processing engine, such as the processing engine 570, and a post-processing engine, such as the post-processing engine 580. The write of the data into the local memory 1040 of the tile 1010A is local memory write. The write of the data into the local memory of the tile 1010B and tile 1010D is inter-tile communication through the inter-tile interconnect 1020.
[0127] FIG. 10B illustrates multicast without local memory write in the multi-tile system 1000 of FIG. 10A, in accordance with various embodiments. Different from the broadcast shown in FIG. 10A, the broadcast in FIG. 10B does not include the local memory write of data computed by the compute block 1030 of the tile 1010A. The local memory write can be avoided, as the tile 1010A will not need the data for the next DNN layer. By avoiding the local memory write, there can be more memory space available in the tile 1010A for storing other data and performing other neural network operations. Memory traffic and power consumption can be reduced. The performance of the multi-tile system 1000 can be improved.
[0128] FIG. 11 illustrates a subtensor 1110 within an output tensor 1100 of a DNN layer, in accordance with various embodiments. The output tensor 1100 may be computed by executing the DNN layer. Examples of the output tensor 1100 may include the attention weight matrix 230, output matrix 250, output tensor 330, output tensor 604, and output tensor 704. Examples of the subtensor 1110 may include the subtensor 601A, subtensor 601B, subtensor 701A, subtensor 701B, and so on.
[0129] In some embodiments, the subtensor 1110 may be computed by a tile performing one of the workloads generated by partitioning the workload of executing the DNN layer. The subtensor 1110 may be written, e.g., by a drain module of the tile, into one or more memories based on configuration parameters. The one or more memories may include the local memory of the tile or one or more memories of one or more other tiles. In an example, the drain module may receive a configuration parameter that enables access to each memory into which the subtensor 1110 is to be written. Additionally or alternatively, the drain module may receive a configuration parameter that disables access to each memory into which the subtensor 1110 is not to be written. Therefore, the configuration parameters may ensure the drain module to write the subtensor 1110 into the right tiles, e.g., tiles that is to use the subtensor 1110 for executing the next DNN layer.
[0130] In some embodiments, the drain module may receive configuration parameters that indicate a position of the subtensor 1110 in the output tensor 1100. The drain module may generate write transactions for writing the subtensor 1110 based on the configuration parameters to avoid memory spill. In an example, the configuration parameters may indicate the position of a data element 1120 in the output tensor 1100 and the position of a data element 1130 in the output tensor 1100. The position of the data element 1120 and the position of the data element 1130 may define the coordinate ranges of all the data elements in the subtensor 1110. For instance, the x coordinate of the data element 1120 may be the lowest x coordinate of the subtensor 1110, and the x coordinate of the data element 1130 may be the highest x coordinate of the subtensor 1110. Also, the y coordinate of the data element 1120 may be the highest y coordinate of the subtensor 1110, and the y coordinate of the data element 1130 may be the lowest y coordinate of the subtensor 1110. Moreover, the z coordinate of the data element 1120 may be the highest z coordinate of the subtensor 1110, and the z coordinate of the data element 1130 may be the lowest z coordinate of the subtensor 1110. The drain module may identify data elements with coordinates that fall into the coordinate ranges determined based on the configuration parameter and write the identified data elements to the destination (s) .
[0131] FIG. 12 is a block diagram of a DNN module 1200, in accordance with various embodiments. The DNN module 1200 may be an embodiment of the DNN module 501 in FIG. 5. As shown in FIG. 12, the DNN module 1200 includes an interface module 1210, a training module 1220, a compressing module 1230, a validating module 1240, a compiler 1250, and a datastore 1260. In other embodiments, alternative configurations, different or additional components may be included in the DNN module 1200. Further, functionality attributed to a component of the DNN module 1200 may be accomplished by a different component included in the DNN module 1200 or a different module or system.
[0132] The interface module 1210 facilitates communications of the DNN module 1200 with other modules or systems. For example, the interface module 1210 establishes communications between the DNN module 1200 with an external database to receive data that can be used to train DNNs or input into DNNs to perform tasks. As another example, the interface module 1210 transmits configuration parameters to the DNN accelerator 502 for configuring components of the DNN accelerator 502 for DNN execution. As yet another example, the interface module 1210 supports the DNN module 1200 to distribute DNNs to other systems, e.g., computing devices configured to apply DNNs to perform tasks.
[0133] The training module 1220 trains DNNs by using a training dataset. The training module 1220 forms the training dataset. In an example where the training module 1220 trains a DNN to recognize objects in images, the training dataset includes training images and training labels. The training labels describe ground-truth classifications of objects in the training images. In some embodiments, each label in the training dataset corresponds to an object in a training image. In some embodiments, a part of the training dataset may be used to initially train the DNN, and the rest of the training dataset may be held back as a validation subset used by the validating module 1240 to validate performance of a trained DNN. The portion of the training dataset not including the tuning subset, and the validation subset may be used to train the DNN.
[0134] The training module 1220 also determines hyperparameters for training the DNN. Hyperparameters are variables specifying the DNN training process. Hyperparameters are different from parameters inside the DNN (e.g., weights of filters) . In some embodiments, hyperparameters include variables determining the architecture of the DNN, such as number of hidden layers, etc. Hyperparameters also include variables which determine how the DNN is trained, such as batch size, number of epochs, etc. A batch size defines the number of training samples to work through before updating the parameters of the DNN. The batch size is the same as or smaller than the number of samples in the training dataset. The training dataset can be divided into one or more batches. The number of epochs defines how many times the entire training dataset is passed forward and backwards through the entire network. The number of epochs defines the number of times that the deep learning algorithm works through the entire training dataset. One epoch means that each training sample in the training dataset has had an opportunity to update the parameters inside the DNN. An epoch may include one or more batches. The number of epochs may be 1, 12, 10, 120, 100, 1200, 1000, or even larger.
[0135] The training module 1220 defines the architecture of the DNN, e.g., based on some of the hyperparameters. The architecture of the DNN includes an input layer, an output layer, and a plurality of hidden layers. The input layer of an DNN may include tensors (e.g., a multidimensional array) specifying attributes of the input image, such as the height of the input image, the width of the input image, and the depth of the input image (e.g., the number of bits specifying the color of a pixel in the input image) . The output layer includes labels of objects in the input layer. The hidden layers are layers between the input layer and output layer. The hidden layers include one or more convolutional layers and one or more other types of layers, such as pooling layers, fully-connected layers, normalization layers, SoftMax or logistic layers, and so on. The convolutional layers of the DNN abstract the input image to a feature map that is represented by a tensor specifying the feature map height, the feature map width, and the feature map channels (e.g., red, green, blue images include 3 channels) . A pooling layer is used to reduce the spatial volume of input image after convolution. It is used between two convolution layers. A fully-connected layer involves weights, biases, and neurons. It connects neurons in one layer to neurons in another layer. It is used to classify images between different categories by training.
[0136] In the process of defining the architecture of the DNN, the training module 1220 also adds an activation function to a hidden layer or the output layer. An activation function of a layer transforms the weighted sum of the input of the layer to an output of the layer. The activation function may be, for example, a ReLU activation function, a tangent activation function, or other types of activation functions.
[0137] After the training module 1220 defines the architecture of the DNN, the training module 1220 inputs a training dataset into the DNN. The training dataset includes a plurality of training samples. An example of a training sample includes an object in an image and a ground-truth label of the object. The training module 1220 modifies the parameters inside the DNN ( “internal parameters of the DNN” ) to minimize the error between labels of the training objects that are generated by the DNN and the ground-truth labels of the objects. The internal parameters include weights of filters in the convolutional layers of the DNN. In some embodiments, the training module 1220 uses a cost function to minimize the error.
[0138] The training module 1220 may train the DNN for a predetermined number of epochs. The number of epochs is a hyperparameter that defines the number of times that the deep learning algorithm will work through the entire training dataset. One epoch means that each sample in the training dataset has had an opportunity to update internal parameters of the DNN. After the training module 1220 finishes the predetermined number of epochs, the training module 1220 may stop updating the parameters in the DNN. The DNN having the updated parameters is referred to as a trained DNN.
[0139] The compressing module 1230 compresses DNNs. For instance, the compressing module 1230 may add pruning operations to DNN layers to reduce computational complexity or memory usage. A pruning operation may prune weight tensors of a DNN layer by changing one or more nonzero weights of the layer to zeros. The modification may be done before, during, or after training. Weights may be pruned during training, during inference, or a combination of both. The compressing module 1230 may determine a sparsity ratio for a DNN layer. The sparsity ratio may be a ratio of the number of zero-valued weight to the total number of weights in the layer. The compressing module 1230 may perform the pruning operation till the sparsity ratio of the DNN layer meets a target sparsity ration, such as 10%, 20%, 30%, 120%, 120%, and so on. In some embodiments, the compressing module 1230 may select a structured sparsity pattern for a DNN layer and prunes weight of the DNN layer to reach the structured sparsity pattern. The structured sparsity pattern may be represented by a structured sparsity ratio N: M. In the pruning process, the compressing module 1230 may divide a kernel into weight blocks, each of which include M consecutive weights. For each of the weight blocks, the compressing module 1230 may select N element (s) and change the value of the unselected element (s) in the weight block to zero. The compressing module 1230 may generate sparsity maps that indicate weight sparsity.
[0140] In some embodiments, the compressing module 1230 may select one or more layers in a DNN and modify each selected layer with a pruning operation. For instance, the compressing module 1230 may select computationally complex layers, such as layers with large filters. For a pruning operation of a layer or of a type of layer, the compressing module 1230 may determine a weight threshold that would not cause a loss of the accuracy of the DNN to exceed an accuracy loss constraint. A pruning operation may modify weights having absolute values above the weight threshold to zeros and leave the other weights unchanged. The weight pruning can reduce memory storage as zero-valued weights may not be stored. Also, the number of operations in the layer can be reduced as computations on zero-valued weights can be skipped without impacting the output of the layer. In some embodiments, the compressing module 1230 may also measure energy saving, final DNN accuracy, or layer-wise sparsity caused by pruning operations.
[0141] After compressing a DNN, the compressing module 1230 may fine tune the DNN, e.g., through a retraining process. The compressing module 1230 may fine tunes DNNs after weights are pruned. In some embodiments, the fine-tuning process is a retraining or further training process. For instance, after weights in a DNN are pruned, the compressing module 1230 may further train the DNN by inputting a training dataset into the DNN. The values of the unpruned weights in the DNN may be modified based on outputs of the DNN and ground-truth labels of the training samples in the training dataset. In some embodiments, the values of the pruned weights (i.e., zero) are not changed during the fine-tuning process. For instance, the compressing module 1230 may place a mask over a pruned weight block and the mask can prevent values in the pruned weight blocks from being changed during the fine-tuning process. In other embodiments, the values of all weights, including the pruned weights, may be changed during the fine-tuning process. After one or more cycles of retraining and weight changing by the compressing module 1230, the compressing module 1230 may perform a new pruning process, e.g., by selecting weight blocks and pruning the selected weight blocks. In some embodiments, the weight pruning process may be repeated multiple times before the fine-tuning process is done. In some embodiments, the number of epochs in the fine-tuning process may be different from the number of epochs in the training process in which the pre-pruning values of the weights are determined. For instance, the fine-tuning process may have less epochs than the training process. In an example, the number of epochs in the fine-tuning process may be relatively small, such as 2, 3, 12, 12, and so on.
[0142] The validating module 1240 verifies accuracy of trained or compressed DNNs. In some embodiments, the validating module 1240 inputs samples in a validation dataset into a trained DNN and uses the outputs of the DNN to determine the model accuracy. In some embodiments, a validation dataset may be formed of some or all the samples in the training dataset. Additionally or alternatively, the validation dataset includes additional samples, other than those in the training sets. In some embodiments, the validating module 1240 may determine an accuracy score measuring the precision, recall, or a combination of precision and recall of the DNN. The validating module 1240 may use the following metrics to determine the accuracy score: Precision = TP / (TP + FP) and Recall = TP / (TP + FN) , where precision may be how many the DNN correctly predicted (TP or true positives) out of the total it predicted (TP + FP or false positives) , and recall may be how many the DNN correctly predicted (TP) out of the total number of objects that did have the property in question (TP +FN or false negatives) . The F-score (F-score = 2 *PR / (P + R) ) unifies precision and recall into a single measure.
[0143] The validating module 1240 may compare the accuracy score with a threshold score. In an example where the validating module 1240 determines that the accuracy score of the DNN is less than the threshold score, the validating module 1240 instructs the training module 1220 to re-train the DNN. In one embodiment, the training module 1220 may iteratively re-train the DNN until the occurrence of a stopping condition, such as the accuracy measurement indication that the DNN may be sufficiently accurate, or a number of training rounds having taken place.
[0144] The compiler 1250 compiles information of DNNs to executable instructions that can be executed, e.g., by the DNN accelerator 502, to carry out neural network operations in DNNs. In some embodiments, the compiler 1205 may generate a graph representing a DNN. The graph may include nodes and edges. A node may represent a specific neural network operation in the DNN. An edge may connect two nodes and represent a connection between the two corresponding neural network operations. In an example, an edge may encode a tensor that flows from one of the neural network operations to the other neural network operation. The tensor may be an output tensor of the first neural network operation and an input tensor of the second neural network operation. The edge may encode one or more attributes of the tensor, such as size, shape, storage format, and so on. The compiler 1250 may use the graph to generate executable DNNs. For instance, the compiler may generate computer program instructions (e.g., compilation descriptors) for executing DNNs. The instructions may be stored in registers associated with components of the DNN accelerator 502.
[0145] The compiler 1250 may also generate configuration parameters that specify operation modes of components in the DNN accelerator 502, such as one or more configuration parameters specifying whether a data processing unit 530 operates in dense or sparse modes. In dense modes, the data processing unit 530 may execute a DNN layer without any sparsity acceleration. For instance, the data processing unit 530 may not skip computations of zero data elements in dense modes. In sparse modes, the data processing unit 530 may accelerate the execution of a DNN layer based on sparsity by skipping computations of zero-valued data elements. The compiler 1250 may determine whether to accelerate the layer based on weight sparsity, activation sparsity, or both. The compiler 1250 may select the sparse mode for a layer from a group of sparse modes that includes, for example, combined sparse mode in which the layer is accelerated based on both weight sparsity and activation sparsity, activation sparse mode in which the layer is accelerated based on activation sparsity but not based on weight sparsity, weight sparse mode in which the layer is accelerated based on weight sparsity but not based on activation sparsity, and a dense mode in which the layer is not accelerated based on sparsity. In some embodiments (e.g., embodiments where a layer is executed by multiple data processing units 530) , the compiler 1250 may determine the sparse mode for all the data processing units 530 that executes the layer. The configuration parameters may be provided to the data processing unit 530, e.g., through the interface module 1210.
[0146] The compiler 1250 may also generate configuration parameters that facilitates data read or data write, such as a configuration parameter that indicates the number of data elements to be processed (e.g., the number of data elements in a tile) , configuration parameter that indicates the memory address where an input data element may be fetched, configuration parameter that indicates memory address where an output data element may be stored, configuration parameter that indicates memory address where another configuration parameters may be stored, and so on. Configuration parameters may be stored in one or more registers, such as configuration space registers, that are associated with the corresponding components of the DNN accelerator 502.
[0147] In some embodiments, the compiler 1250 may facilitate distribution of workloads of executing DNN layers for improving hardware utilization. The compiler 1250 may partition the output tensor of a DNN layer into subtensors. Each subtensor represents a separate workload. For instance, the compiler 1250 may determine the shape or size of each subtensor based on the shape or size of the output tensor and the number of tiles available for executing the DNN layer. The compiler 1250 may split the output tensor in the H dimension, W dimension, K dimension, or some combination thereof. For each subtensor, the compiler 1250 may also identify a tile that can compute the subtensor, e.g., based on one or more characteristics of the DNN layer, the subtensor, and the tile. The compiler 1250 may ensure that the tile has sufficient memory space and computational capacity (e.g., sufficient PEs or PPEs) to compute the subtensor.
[0148] The compiler 1250 may also generate configuration parameters for configuring write transactions for writing the subtensors into memories. For instance, the compiler 1250 may generate one or more configuration parameters for a subtensor that allows the tile (e.g., a drain module of the tile) computing the subtensor to have access to a memory of each tile that is identified to use the subtensor for executing the next layer. The compiler 1250 may also generate one or more configuration parameters for a subtensor that blocks the drain module of the tile computing the subtensor from accesses a memory of a tile that is not identified to use the subtensor for executing the next layer. The compiler 1250 may also determine positional parameters of each subtensor, e.g., the coordinates of one or more data elements on one or more boundaries of the subtensor. The compiler 1250 may generate configuration parameters form the positional parameters so that the drain module may use the configuration parameters to find the right data elements to write. In some embodiments, the compiler 1250 may also generate configuration parameters that enable or disable the drain module to combine write transactions. The compiler 1250 may also generate configuration parameters that enable the drain module to determine whether write transactions have the same destination before they are combined.
[0149] The datastore 1260 stores data received, generated, used, or otherwise associated with the DNN module 1200. For example, the datastore 1260 stores the datasets used by the training module 1220 and validating module 1240, such as the hyperparameters for training DNNs, internal parameters of trained DNNs (e.g., weights, etc. ) , data for sparsity acceleration (e.g., sparsity masks, etc. ) , and so on. The datastore 1260 may store configuration parameters, sparsity masks, or other data generated by the compressing module 1230. The datastore 1260 may include one or more memories. In the embodiment of FIG. 12, the datastore 1260 is a component of the DNN module 1200. In other embodiments, the datastore 1260 may be external to the DNN module 1200 and communicate with the DNN module 1200 through a network.
[0150] FIG. 13 illustrates an example sparse cell 1300, in accordance with various embodiments. The sparse cell 1300 may be at least part of a processing engine, e.g., the processing engine 570 in FIG. 5. The sparse cell 1300 includes 16 MAC units 1310 (individually referred to as “MAC unit 1310” ) , which constitutes a MAC array having four rows and four columns. The MAC array has a spatial shape of 13x4, meaning the height of the MAC array is four and the width of the MAC array is also 13. The sparse cell 1300 also includes 16 weight register files 1320 (individually referred to as “weight register file 1320” ) , 16 activation register files 1330 (individually referred to as “activation register file 1330” ) , four row buffers 1340 (individually referred to as “row buffer 1340” ) , and sparsity modules 1366 (individually referred to as “sparsity module 1366” ) . In other embodiments, the sparse cell 1300 may include fewer, more, or different components. For example, the sparse cell 1300 may include a different number of MAC units 1310, weight register files 1320, activation register files 1330, row buffers 1340, or sparsity modules 1366. As another example, the sparse cell 1300 may include column buffers in lieu of or in addition to the row buffers 1340. Also, the shape (e.g., the height or width) of the MAC array may be different.
[0151] The MAC units 1310 are configured to perform MAC operations. Each MAC unit 1310 may include one or more multipliers and one or more adders. A multiplier may multiply an activation with a weight at a time to compute a product. In some embodiments (e.g., embodiments where the MAC unit 1310 includes multiple multipliers) , the multipliers may operate simultaneously to process multiple activation-weight pairs and compute multiple products in one cycle. An adder may accumulate products computed by the multipliers. Even though not shown in FIG. 13, the sparse cell may include an adder tree including a plurality of adder tiers. The first tier may receive outputs of a plurality of MAC units 1310. The number of adders in the first tier may be half of the number of the MAC units 1310, and each adder may accumulate the outputs of two MAC units 1310. The second tier may receive outputs of adders in the first tier. The number of adders in the second tier may be half of the number of adders in the first tier, and each adder in the second tier may accumulate the outputs of two adders in the first tier. The adder tree may include one or more other tiers. The last tier may include a single adder that accumulates outputs of adders in the second last tier to compute a partial sum of the sparse cell 1300.
[0152] The weight register files 1320 store weights to be processed in MAC operations. In the embodiments of FIG. 13, four weight register files 1320 are grouped into a storage set that stores data to be used by a column of MAC units 1310. There are four storage sets corresponding to the four columns of MAC units 1310. In some embodiments, a weight register file 1320 may correspond to a MAC unit 1310 and store data to be processed by the MAC unit. In some embodiments, the four weight register files 1320 for a single column of MAC units 1310 constitute a data storage unit of the column.
[0153] The activation register files 1330 stores activations to be processed in MAC operations. In the embodiments of FIG. 13, four activation register files 1330 are grouped into a storage set that stores data to be used by a row of MAC units 1310. There are four storage sets corresponding to the four rows of MAC units 1310. In some embodiments, an activation register file 1330 may correspond to a MAC unit 1310 and store data to be processed by the MAC unit. In some embodiments, the four activation register files 1330 for a single row of MAC units 1310 constitute a data storage unit of the row. The row buffers 1340 store outputs of the MAC units 1310. Each row buffer 1340 may drain outputs of a single row of MAC units 1310.
[0154] The sparsity module 1366 facilitates dynamic sparsity-based acceleration or workload distribution in the sparse cell 1300. In the embodiments of FIG. 13, each sparsity module 1366 includes a sparsity tensor storage unit 1365 and a control logic 1367. The sparsity tensor storage unit 1365 stores combined sparsity tensors. A combined sparsity tensor stored in the sparsity tensor storage unit 1365 may correspond to an activation tensor and a weight tensor. A nonzero element in the combined sparsity tensor may correspond to a nonzero activation-weight pair that includes a nonzero activation and a nonzero weight. The position of the nonzero activation in the activation tensor may match the position of the nonzero weight in the weight tensor. The product of the nonzero activation and nonzero weight would be nonzero.
[0155] The control logic 1367 may control transmission of activations and weights stored from the weight register files 1320 and the activation register files 1330 to the MAC units 1310 based on sparsity tensors. For instance, the control logic 1367 may select a subset of the weights stored in the weight register files 1320 and select a subset of activations stored in the activation register files 1330 based on a sparsity tensor. The control logic 1367 may transmit the selected weights and activations to the MAC units 1310 for performing MAC operations. The other weights stored in the weight register files 1320 or the other activations stored in the activation register files 1330 are skipped from computation. In the embodiments of FIG. 13, each sparsity module 1366 controls sparsity acceleration or workload distribution in a respective MAC unit 1310. As the sparsity acceleration or workload distribution is either based on both weight sparsity and activation sparsity, 16 sparsity modules 1366 are used for acceleration computations in the 16 MAC units 1310.
[0156] As shown in FIG. 13, the sparse cell 1300 is associated with multiplexers (MUXs) 1303, 1304, 1305, and 1306. In other embodiments, the sparse cell 1300 may be associated with a different number of MUXs or other devices. The MUX 1303 facilitates loading weights, e.g., from the local memory 540, into the weight register files 1320. The MUX 1304 facilitates loading activations, e.g., from the local memory 540, into the activation register files 1330. The MUX 1305 facilitates loading sparsity tensors into the sparsity tensor storage unit 1365. The MUX 1306 may be a drain MUX that can facilitate draining outputs of the MAC units 1310, e.g., to the local memory 540.
[0157] FIG. 14 illustrates a sparse cell array 1400, in accordance with various embodiments. The sparse cell array 1400 may be an example of the processing engine 570 in FIG. 5. In FIG. 14, the sparse cell array 1400 includes sparse cells 1410 (individually referred to as “sparse cell 1410” ) arranged in four columns and four rows, an activation memory 1420, and a weight memory 1430. The sparse cell array 1400 may also be referred to as a data processing unit. In other embodiments, the sparse cell array 1400 may include fewer, more, or different components. For instance, the sparse cell array 1400 may include a different number of columns, rows, or sparse cells 1410.
[0158] Each sparse cell 1410 may perform sparsity accelerated MAC operations. The sparse cells 1410 may facilitate dynamic sparsity mode. For instance, the sparsity modes of a sparse cell 1410 may be dynamically changed between a combined sparsity mode, an activation sparsity mode, a weight sparsity mode, and a dense mode. An embodiment of a sparse cell 1410 may be the sparse cell 1300 in FIG. 13. The activation memory 1420 stores activations, such as activations in input tensors of deep learning operations. Activations may be loaded from the activation memory 1420 to sparse cells 1410. The weight memory 1430 stores weights, such as weights in filters of deep learning operations. Weights may be loaded from the weight memory 1430 to sparse cells 1410. The activation memory 1420 or weight memory 1430 may be a buffer. In other embodiments, the sparse cell array 1400 may include a dense data memory and a sparse data memory in lieu of the activation memory 1420 and weight memory 1430. The dense data memory may store dense tensors, e.g., dense tensors generated by the load module 1760. The sparse data memory may store sparse tensors.
[0159] The sparse cell array 1400 may also execute matrix multiplications in attention layers of transformer models. In an example of a matrix multiplication operation on a query tensor and a key tensor, one of the activation memory 1420 and weight memory 1430 may be used to store the query tensor and the other one may be used to store the key tensor. In an example of a matrix multiplication operation on attention weights and a value tensor, one of the activation memory 1420 and weight memory 1430 may be used to store the attention weights and the other one may be used to store the value tensor.
[0160] FIG. 15 is a block diagram of a drain module 1500, in accordance with various embodiments. The drain module 1500 extracts output elements computed by a compute block and writes the output elements into memories. The drain module 1500 may be an example of the drain module 590 in FIG. 5. As shown in FIG. 15, the drain module 1500 includes circular buffers 1520 (individually referred to as “circular buffer 1520” ) , a drain staging buffer 1530, a global drain module 1540, drain banks 1550 (individually referred to as “drain bank 1550” ) , sparse encoders 1560 (individually referred to as “sparse encoder 1560” ) , a write module 1570, and a write buffer 1580. In other embodiments, alternative configurations, different or additional components may be included in the drain module 1500. Further, functionality attributed to a component of the drain module 1500 may be accomplished by a different component included in the drain module 1500 or a different module or system.
[0161] The circular buffers 1520 may temporarily store data computed by the processing engine 570 or post-processing engine 580. In some embodiments, each circular buffer 1520 corresponds to a PE column and stores the output of the PE column. The output data stored in the circular buffers 1520 may be further transmitted and written into the drain staging buffer 1530.
[0162] The global drain module 1540 may select output elements stored in the drain staging buffer 1530. In some embodiments, the global drain module 1540 may select output elements of a subtensor with the output tensor of a DNN layer. The subtensor may be computed by the tile including the drain module 1500. The global drain module 1540 may select the output elements in accordance with configuration parameters that indicate positions of the output elements in the output tensor.
[0163] In some embodiments, the global drain module 1540 selects output elements in a predetermined manner, e.g., a 1×1×output channels (OC) manner. In some embodiments, the global drain module 1540 selects one of a predetermined number of entries of the drain staging buffer 1530. The predetermined number may be the number of MAC units in a column of the sparse cell. In other embodiments, the global drain module 1540 may select a predetermined amount of data, e.g., 16 bytes, 32 bytes, and so on. After the entries are selected, the global drain module 1540 may select one or more drain banks 1550 and multicast the selected entries to the selected drain bank (s) 1550. In an example, there may be 16 drain banks 1550 arranged in four groups. Each group may include 4 drain banks 1550. The global drain module 1540 may assign the right rotate value specific to each drain bank 1550 to align and concatenate the consecutive OCs in a single drain bank 1550. The global drain module 1540 may further write the correct set of bytes in the selected line of the drain staging buffer 1530 to the drain bank 1550.
[0164] In some embodiments, a single drain bank 1550 may store an output vector including output elements having the same (x, y) coordinate but different OCs. The output elements of the output vector may be arranged in sequence in accordance with their OCs. For instance, the OC coordinate of the first output element in the output vector may be in 0, the OC coordinate of the second output element may be in 1, the OC coordinate of the third output element may be in 2, and so on. Different drain banks 1550 may store different output vectors. The output elements in different drain banks 1550 may have different x coordinates or different y coordinates.
[0165] A sparse encoder 1560 converts dense data to compressed data based on sparsity in the dense data. In some embodiments, a sparse encoder 1560 may receive output elements (e.g., the output tensor 330 in FIG. 3) of a layer, e.g., from the global drain module 1540. The output elements may be arranged in output vectors. The sparse encoder 1560 may generate a compressed version of one or more output vectors. In some embodiments, the sparse encoder 1560 may compress an output vector based on a threshold value. The sparse encoder 1560 may compare the absolute value of each output element with the threshold value. The sparse encoder 1560 may remove any output elements whose absolute value is no greater than the threshold value from the output vector to generate a compressed output vector. The threshold value may be zero. The removed output elements may not be stored in the write buffer 1580 or the local memory to save bandwidth and memory usage.
[0166] In some embodiments, a sparse encoder 1560 may also generate one or more sparsity maps of the output vector. The sparsity map may include sparsity elements, each of which corresponds to a different output element in the output vector and indicates whether the corresponding output element is removed or not. In some embodiments, the sparsity map may be a sparsity bitmap, and a sparsity element in the sparsity bitmap may be a bit. A zero bit may indicate that the corresponding output element is removed and not in the compressed output vector, while a one bit may indicate that the corresponding output element is not removed and is in the compressed output vector.
[0167] In some embodiments, a sparse encoder 1560 may encode sparsity on a context level. A context may be a portion of the output tensor generated by the sparse cell array. In an example, the context may be an output vector including output elements that have the same (X, Y) coordinate but different Z coordinates. The context may be processed in the next DNN layer, e.g., by one or more MAC units. For a given context, the sparse encoder 1560 may read in multiple lines from a data bank before emitting a single line of N bytes (where N is an integer, such as 16, 32, 64, etc. ) , depending on the sparsity level. As the elements in a context stream may come over multiple rounds, the sparse encoder 1560 can save data indicating a state of the context ( “context state” ) in a buffer and retrieve the context state back later from the buffer. A context state may include the compressed context, sparsity map of the context, output elements in the compressed context, and line counts.
[0168] The write module 1570 determines memory addresses of output elements and writes output elements into a memory based on the memory addresses. An example of the memory may be the local memory 540 in FIG. 5. In some embodiments (e.g., embodiments where the sparse encoder 1560 compresses the output tensor) , the write module 1570 may write compressed output vectors generated by the sparse encoder 1560 into the memory. The write module 1570 may determine memory addresses in accordance with one or more configuration parameters. A configuration parameter may indicate the destination of the output element, such as the memory into which the output elements are written. In some embodiments, the write module 1570 may identify one or more memories that it has access to and write the output elements into all the identified memories. The access may be indicated by one or more configuration parameters. The write module 1570 may perform local memory write, i.e., write the output elements into the memory of the tile including the drain module 1500. The write module 1570 may also perform inter-tile write, i.e., write the output elements into memories of other tiles. The write module 1570 may be communicatively coupled with an inter-file interconnect (e.g., the inter-file interconnect 535, the inter-tile interconnect 820, the inter-tile interconnect 920, or the inter-tile interconnect 1020) .
[0169] In some embodiments, the write module 1570 may include a write combine buffer that may combine multiple write transactions into a combined write transaction. For instance, the write module 1570 may combine write transactions for writing below-threshold amount of data. In some embodiments, the write module 1570 may determine whether write transactions have the same destination. In response to determining that the write transactions have the same destination, the write module 1570 may combine the write transactions. In some embodiments, the write module 1570 may identify write transactions having the same destination and combine at least some of the identified write transactions.
[0170] In some embodiments, the write module 1570 may skip output elements removed by the sparse encoder 1560 in the compression process. The write module 1570 may also write sparsity maps generated by the sparse encoder 1560 into the memory or a separate memory. In some embodiments, the write module 1570 may determine memory addresses of sparsity maps associated with the output tensor and write the sparsity maps to the memory based on the memory addresses.
[0171] To write an output vector or sparsity map into the memory, the write module 1570 may generate a write request that includes the memory address (se) of the output vector or sparsity map and transmit the write request to the memory. The memory, after receiving the write request, may process the write request and store the output vector or sparsity map in one or more data write operations. The write buffer 1580 may store the output vector, sparsity map, or the write request while the write request or one or more previous write requests are being processed by the memory.
[0172] FIG. 16 is a flowchart of another method 1600 for executing a DNN layer, in accordance with various embodiments. The method 1600 may be performed by the DNN accelerator 502 in FIG. 5. Although the method 1600 is described with reference to the flowchart illustrated in FIG. 16, many other methods for executing neural network layer may alternatively be used. For example, the order of execution of the steps in FIG. 16 may be changed. As another example, some of the steps may be changed, eliminated, or combined.
[0173] The DNN accelerator 502 computes 1610, by a first tile comprising a first memory and a drain module, a first subtensor of an output tensor of a neural network layer. In some embodiments, the first tile computes the first subtensor by performing a neural network operation in the neural network layer on a first part of an input tensor of the neural network layer.
[0174] The DNN accelerator 502 computes 1620, by a second tile comprising a second memory, a second subtensor of the output tensor of the neural network layer. In some embodiments, the second tile computes the second subtensor by performing a neural network operation in the neural network layer on a second part of an input tensor of the neural network layer. In some embodiments, the DNN accelerator 502 writes the second subtensor into the second memory.
[0175] The DNN accelerator 502 writes 1630, by a drain module, the subtensor into the second memory through an interconnect communicatively coupled with the first tile and the second tile. In some embodiments, the DNN accelerator 502 receives one or more configuration parameters specifying a position of the first subtensor in the output tensor. The DNN accelerator 502 writes the first subtensor based on the one or more configuration parameters. In some embodiments, the DNN accelerator 502 determines whether two or more write transactions have a same destination, the same destination being the first memory or the second memory. The DNN accelerator 502 combines the two or more write transactions into a combined write transaction in response to determining that the two or more write transactions have the same destination. The DNN accelerator 502 performs the combined write transaction.
[0176] In some embodiments, the DNN accelerator 502 writes the first subtensor in accordance with a configuration parameter. The configuration parameter enables access of the drain module to the second memory. In some embodiments, the DNN accelerator 502 writes the first subtensor in accordance with a configuration parameter. The configuration parameter disables access of a drain module to the first memory. In some embodiments, the DNN accelerator 502 also writes the first subtensor into the first memory in accordance with a configuration parameter. The configuration parameter enables access of the drain module to the first memory.
[0177] In some embodiments, the DNN accelerator 502 determines whether two or more write transactions have the same destination. The same destination is the first memory or the second memory. The DNN accelerator 502 combines the two or more write transactions into a combined write transaction in response to determining that the two or more write transactions have the same destination. The DNN accelerator 502 performs the combined write transaction.
[0178] In some embodiments, the DNN accelerator 502 stores, in the second memory, the output tensor of the neural network layer. The DNN accelerator 502 executes a next neural network layer using the output tensor. In some embodiments, the interconnect is communicatively coupled with other tiles. The DNN accelerator 502 writes the first subtensor into a memory of at least one of the other tiles through the interconnect. In some embodiments, the first subtensor is unpresent in a memory of one of the other tiles.
[0179] FIG. 17 is a block diagram of an example computing device 1700, in accordance with various embodiments. In some embodiments, the computing device 1700 can be used as at least part of the DNN system 500 in FIG. 5. A number of components are illustrated in FIG. 17 as included in the computing device 1700, but any one or more of these components may be omitted or duplicated, as suitable for the application. In some embodiments, some or all of the components included in the computing device 1700 may be attached to one or more motherboards. In some embodiments, some or all of these components are fabricated onto a single system on a chip (SoC) die. Additionally, in various embodiments, the computing device 1700 may not include one or more of the components illustrated in FIG. 17, but the computing device 1700 may include interface circuitry for coupling to the one or more components. For example, the computing device 1700 may not include a display device 1706, but may include display device interface circuitry (e.g., a connector and driver circuitry) to which a display device 1706 may be coupled. In another set of examples, the computing device 1700 may not include an audio input device 1718 or an audio output device 1708 but may include audio input or output device interface circuitry (e.g., connectors and supporting circuitry) to which an audio input device 1718 or audio output device 1708 may be coupled.
[0180] The computing device 1700 may include a processing device 1702 (e.g., one or more processing devices) . The processing device 1702 processes electronic data from registers and / or memory to transform that electronic data into other electronic data that may be stored in registers and / or memory. The computing device 1700 may include a memory 1704, which may itself include one or more memory devices such as volatile memory (e.g., DRAM) , nonvolatile memory (e.g., read-only memory (ROM) ) , high bandwidth memory (HBM) , flash memory, solid state memory, and / or a hard drive. In some embodiments, the memory 1704 may include memory that shares a die with the processing device 1702. In some embodiments, the memory 1704 includes one or more non-transitory computer-readable media storing instructions executable to perform operations for executing DNN layers (e.g., the method 1600 described in conjunction with FIG. 16) or some operations performed by one or more components of the DNN system 500, such as operations performed by the data processing unit 530 or by the drain module 590. The instructions stored in the one or more non-transitory computer-readable media may be executed by the processing device 1702.
[0181] In some embodiments, the computing device 1700 may include a communication chip 1712 (e.g., one or more communication chips) . For example, the communication chip 1712 may be configured for managing wireless communications for the transfer of data to and from the computing device 1700. The term "wireless" and its derivatives may be used to describe circuits, devices, systems, methods, techniques, communications channels, etc., that may communicate data through the use of modulated electromagnetic radiation through a nonsolid medium. The term does not imply that the associated devices do not contain any wires, although in some embodiments they might not.
[0182] The communication chip 1712 may implement any of a number of wireless standards or protocols, including but not limited to Institute for Electrical and Electronic Engineers (IEEE) standards including Wi-Fi (IEEE 802.10 family) , IEEE 802.16 standards (e.g., IEEE 802.16-2005 Amendment) , Long-Term Evolution (LTE) project along with any amendments, updates, and / or revisions (e.g., advanced LTE project, ultramobile broadband (UMB) project (also referred to as "3GPP2" ) , etc. ) . IEEE 802.16 compatible Broadband Wireless Access (BWA) networks are generally referred to as WiMAX networks, an acronym that stands for worldwide interoperability for microwave access, which is a certification mark for products that pass conformity and interoperability tests for the IEEE 802.16 standards. The communication chip 1712 may operate in accordance with a Global System for Mobile Communication (GSM) , General Packet Radio Service (GPRS) , Universal Mobile Telecommunications System (UMTS) , High Speed Packet Access (HSPA) , Evolved HSPA (E-HSPA) , or LTE network. The communication chip 1712 may operate in accordance with Enhanced Data for GSM Evolution (EDGE) , GSM EDGE Radio Access Network (GERAN) , Universal Terrestrial Radio Access Network (UTRAN) , or Evolved UTRAN (E-UTRAN) . The communication chip 1712 may operate in accordance with Code-division Multiple Access (CDMA) , Time Division Multiple Access (TDMA) , Digital Enhanced Cordless Telecommunications (DECT) , Evolution-Data Optimized (EV-DO) , and derivatives thereof, as well as any other wireless protocols that are designated as 3G, 4G, 5G, and beyond. The communication chip 1712 may operate in accordance with other wireless protocols in other embodiments. The computing device 1700 may include an antenna 1722 to facilitate wireless communications and / or to receive other wireless communications (such as AM or FM radio transmissions) .
[0183] In some embodiments, the communication chip 1712 may manage wired communications, such as electrical, optical, or any other suitable communication protocols (e.g., the Ethernet) . As noted above, the communication chip 1712 may include multiple communication chips. For instance, a first communication chip 1712 may be dedicated to shorter-range wireless communications such as Wi-Fi or Bluetooth, and a second communication chip 1712 may be dedicated to longer-range wireless communications such as global positioning system (GPS) , EDGE, GPRS, CDMA, WiMAX, LTE, EV-DO, or others. In some embodiments, a first communication chip 1712 may be dedicated to wireless communications, and a second communication chip 1712 may be dedicated to wired communications.
[0184] The computing device 1700 may include battery / power circuitry 1714. The battery / power circuitry 1714 may include one or more energy storage devices (e.g., batteries or capacitors) and / or circuitry for coupling components of the computing device 1700 to an energy source separate from the computing device 1700 (e.g., AC line power) .
[0185] The computing device 1700 may include a display device 1706 (or corresponding interface circuitry, as discussed above) . The display device 1706 may include any visual indicators, such as a heads-up display, a computer monitor, a projector, a touchscreen display, a liquid crystal display (LCD) , a light-emitting diode display, or a flat panel display, for example.
[0186] The computing device 1700 may include an audio output device 1708 (or corresponding interface circuitry, as discussed above) . The audio output device 1708 may include any device that generates an audible indicator, such as speakers, headsets, or earbuds, for example.
[0187] The computing device 1700 may include an audio input device 1718 (or corresponding interface circuitry, as discussed above) . The audio input device 1718 may include any device that generates a signal representative of a sound, such as microphones, microphone arrays, or digital instruments (e.g., instruments having a musical instrument digital interface (MIDI) output) .
[0188] The computing device 1700 may include a GPS device 1716 (or corresponding interface circuitry, as discussed above) . The GPS device 1716 may be in communication with a satellite-based system and may receive a location of the computing device 1700, as known in the art.
[0189] The computing device 1700 may include another output device 1710 (or corresponding interface circuitry, as discussed above) . Examples of the other output device 1710 may include an audio codec, a video codec, a printer, a wired or wireless transmitter for providing information to other devices, or an additional storage device.
[0190] The computing device 1700 may include another input device 1720 (or corresponding interface circuitry, as discussed above) . Examples of the other input device 1720 may include an accelerometer, a gyroscope, a compass, an image capture device, a keyboard, a cursor control device such as a mouse, a stylus, a touchpad, a bar code reader, a Quick Response (QR) code reader, any sensor, or a radio frequency identification (RFID) reader.
[0191] The computing device 1700 may have any desired form factor, such as a handheld or mobile computer system (e.g., a cell phone, a smart phone, a mobile internet device, a music player, a tablet computer, a laptop computer, a netbook computer, an ultrabook computer, a personal digital assistant (PDA) , an ultramobile personal computer, etc. ) , a desktop computer system, a server or other networked computing component, a printer, a scanner, a monitor, a set-top box, an entertainment control unit, a vehicle control unit, a digital camera, a digital video recorder, or a wearable computer system. In some embodiments, the computing device 1700 may be any other electronic device that processes data.
[0192] The following paragraphs provide various examples of the embodiments disclosed herein.
[0193] Example 1 provides an apparatus, including a first tile including a first compute block configured to compute a first subtensor within an output tensor of a neural network layer, a first memory, and a drain module configured to operate on the first subtensor; a second tile including a second compute block configured to compute a second subtensor within the output tensor of the neural network layer, and a second memory; and an interconnect communicatively coupled with the drain module, the first memory, and the second memory, in which the drain module is configured to operate on the first subtensor by writing the first subtensor into the second memory through the interconnect.
[0194] Example 2 provides the apparatus of example 1, in which writing the first subtensor including writing the first subtensor based on one or more configuration parameters specifying a position of the first subtensor in the output tensor.
[0195] Example 3 provides the apparatus of example 1 or 2, in which the drain module includes a write combine buffer, and the write combine buffer is configured to: determine whether two or more write transactions have a same destination, the same destination being the first memory or the second memory; in response to determining that the two or more write transactions have the same destination, combine the two or more write transactions into a combined write transaction; and perform the combined write transaction.
[0196] Example 4 provides the apparatus of any one of examples 1-3, in which the drain module is further configured to operate on the first subtensor in accordance with a configuration parameter enabling access of the drain module to the second memory.
[0197] Example 5 provides the apparatus of any one of examples 1-4, in which the drain module is further configured to operate on the first subtensor in accordance with a configuration parameter disabling access of the drain module to the first memory.
[0198] Example 6 provides the apparatus of any one of examples 1-4, in which the drain module is further configured to operate on the first subtensor in accordance with a configuration parameter enabling access of the drain module to the first memory, and the drain module is configured to operate on the first subtensor further by writing the first subtensor into the first memory.
[0199] Example 7 provides the apparatus of any one of examples 1-6, in which the second memory is configured to store the output tensor of the neural network layer, and the second compute block is further configured to execute a next neural network layer using the output tensor.
[0200] Example 8 provides the apparatus of example 7, in which the second tile further includes a second drain module, the second drain module configured to write the second subtensor into the second memory.
[0201] Example 9 provides the apparatus of any one of examples 1-8, in which the apparatus includes other tiles that are communicatively coupled with the interconnect, and the drain module is further configured to write the first subtensor into a memory of at least one of the other tiles through the interconnect.
[0202] Example 10 provides the apparatus of example 9, in which the first subtensor is unpresent in a memory of one of the other tiles.
[0203] Example 11 provides a method, the method including computing, by a first tile including a first memory, a first subtensor within an output tensor of a neural network layer; computing, by a second tile including a second memory, a second subtensor within the output tensor of the neural network layer; and writing, by the drain module, the first subtensor into the second memory through an interconnect communicatively coupled with the first tile and the second tile.
[0204] Example 12 provides the method of example 11, in which writing the first subtensor including receiving one or more configuration parameters specifying a position of the first subtensor in the output tensor; and writing the first subtensor based on the one or more configuration parameters.
[0205] Example 13 provides the method of example 11 or 12, in which writing the first subtensor includes determining whether two or more write transactions have a same destination, the same destination being the first memory or the second memory; in response to determining that the two or more write transactions have the same destination, combining the two or more write transactions into a combined write transaction; and performing the combined write transaction.
[0206] Example 14 provides the method of any one of examples 11-13, in which writing the first subtensor includes writing the first subtensor in accordance with a configuration parameter enabling access of the drain module to the second memory.
[0207] Example 15 provides the method of any one of examples 11-14, in which writing the first subtensor includes writing the first subtensor in accordance with a configuration parameter disabling access of the drain module to the first memory.
[0208] Example 16 provides the method of any one of examples 11-14, further including writing the first subtensor into the first memory in accordance with a configuration parameter enabling access of the drain module to the first memory.
[0209] Example 17 provides the method of any one of examples 11-16, further including storing, in the second memory, the output tensor of the neural network layer; and executing a next neural network layer using the output tensor.
[0210] Example 18 provides the method of any one of examples 11-17, further including writing the second subtensor into the second memory.
[0211] Example 19 provides the method of any one of examples 11-18, in which the interconnect is communicatively coupled with other tiles, and the method further includes writing the first subtensor into a memory of at least one of the other tiles through the interconnect.
[0212] Example 20 provides the method of example 19, in which the first subtensor is unpresent in a memory of one of the other tiles.
[0213] Example 21 provides one or more non-transitory computer-readable media storing instructions executable to perform operations, the operations including computing, by a first tile including a first memory, a first subtensor within an output tensor of a neural network layer; computing, by a second tile including a second memory, a second subtensor within the output tensor of the neural network layer; and writing, by the drain module, the first subtensor into the second memory through an interconnect communicatively coupled with the first tile and the second tile.
[0214] Example 22 provides the one or more non-transitory computer-readable media of example 21, in which writing the first subtensor including receiving one or more configuration parameters specifying a position of the first subtensor in the output tensor; and writing the first subtensor based on the one or more configuration parameters.
[0215] Example 23 provides the one or more non-transitory computer-readable media of example 21 or 22, in which writing the first subtensor includes determining whether two or more write transactions have a same destination, the same destination being the first memory or the second memory; in response to determining that the two or more write transactions have the same destination, combining the two or more write transactions into a combined write transaction; and performing the combined write transaction.
[0216] Example 24 provides the one or more non-transitory computer-readable media of any one of examples 21-23, in which writing the first subtensor includes writing the first subtensor in accordance with a configuration parameter disabling access of the drain module to the first memory. 25 The one or more non-transitory computer-readable media of any one of claims 21-23, in which the operations further include writing the first subtensor into the first memory in accordance with a configuration parameter enabling access of the drain module to the first memory.
[0217] The above description of illustrated implementations of the disclosure, including what is described in the Abstract, is not intended to be exhaustive or to limit the disclosure to the precise forms disclosed. While specific implementations of, and examples for, the disclosure are described herein for illustrative purposes, various equivalent modifications are possible within the scope of the disclosure, as those skilled in the relevant art will recognize. These modifications may be made to the disclosure in light of the above detailed description.
Claims
1.An apparatus, comprising:a first tile comprising:a first compute block configured to compute a first subtensor within an output tensor of a neural network layer,a first memory, anda drain module configured to operate on the first subtensor;a second tile comprising:a second compute block configured to compute a second subtensor within the output tensor of the neural network layer, anda second memory; andan interconnect communicatively coupled with the drain module, the first memory, and the second memory,wherein the drain module is configured to operate on the first subtensor by writing the first subtensor into the second memory through the interconnect.2.The apparatus of claim 1, wherein writing the first subtensor comprising:writing the first subtensor based on one or more configuration parameters specifying a position of the first subtensor in the output tensor.3.The apparatus of claim 1 or 2, wherein the drain module comprises a write combine buffer, and the write combine buffer is configured to:determine whether two or more write transactions have a same destination, the same destination being the first memory or the second memory;in response to determining that the two or more write transactions have the same destination, combine the two or more write transactions into a combined write transaction; andperform the combined write transaction.4.The apparatus of any one of claims 1-3, wherein the drain module is further configured to operate on the first subtensor in accordance with a configuration parameter enabling access of the drain module to the second memory.5.The apparatus of any one of claims 1-4, wherein the drain module is further configured to operate on the first subtensor in accordance with a configuration parameter disabling access of the drain module to the first memory.6.The apparatus of any one of claims 1-4, wherein the drain module is further configured to operate on the first subtensor in accordance with a configuration parameter enabling access of the drain module to the first memory, and the drain module is configured to operate on the first subtensor further by writing the first subtensor into the first memory.7.The apparatus of any one of claims 1-6, wherein the second memory is configured to store the output tensor of the neural network layer, and the second compute block is further configured to execute a next neural network layer using the output tensor.8.The apparatus of claim 7, wherein the second tile further comprises a second drain module, the second drain module configured to write the second subtensor into the second memory.9.The apparatus of any one of claims 1-8, wherein the apparatus comprises other tiles that are communicatively coupled with the interconnect, and the drain module is further configured to write the first subtensor into a memory of at least one of the other tiles through the interconnect.10.The apparatus of claim 9, wherein the first subtensor is unpresent in a memory of one of the other tiles.11.A method, the method comprising:computing, by a first tile comprising a first memory and a drain module, a first subtensor within an output tensor of a neural network layer;computing, by a second tile comprising a second memory, a second subtensor within the output tensor of the neural network layer; andwriting, by the drain module, the first subtensor into the second memory through an interconnect communicatively coupled with the first tile and the second tile.12.The method of claim 11, wherein writing the first subtensor comprising:receiving one or more configuration parameters specifying a position of the first subtensor in the output tensor; andwriting the first subtensor based on the one or more configuration parameters.13.The method of claim 11 or 12, wherein writing the first subtensor comprises:determining whether two or more write transactions have a same destination, the same destination being the first memory or the second memory;in response to determining that the two or more write transactions have the same destination, combining the two or more write transactions into a combined write transaction; andperforming the combined write transaction.14.The method of any one of claims 11-13, wherein writing the first subtensor comprises:writing the first subtensor in accordance with a configuration parameter enabling access of the drain module to the second memory.15.The method of any one of claims 11-14, wherein writing the first subtensor comprises:writing the first subtensor in accordance with a configuration parameter disabling access of the drain module to the first memory.16.The method of any one of claims 11-14, further comprising:writing the first subtensor into the first memory in accordance with a configuration parameter enabling access of the drain module to the first memory.17.The method of any one of claims 11-16, further comprising:storing, in the second memory, the output tensor of the neural network layer; andexecuting a next neural network layer using the output tensor.18.The method of any one of claims 11-17, further comprising:writing the second subtensor into the second memory.19.The method of any one of claims 11-18, wherein the interconnect is communicatively coupled with other tiles, and the method further comprises:writing the first subtensor into a memory of at least one of the other tiles through the interconnect.20.The method of claim 19, wherein the first subtensor is unpresent in a memory of one of the other tiles.21.One or more non-transitory computer-readable media storing instructions executable to perform operations, the operations comprising:computing, by a first tile comprising a first memory and a drain module, a first subtensor within an output tensor of a neural network layer;computing, by a second tile comprising a second memory, a second subtensor within the output tensor of the neural network layer; andwriting, by the drain module, the first subtensor into the second memory through an interconnect communicatively coupled with the first tile and the second tile.22.The one or more non-transitory computer-readable media of claim 21, wherein writing the first subtensor comprising:receiving one or more configuration parameters specifying a position of the first subtensor in the output tensor; andwriting the first subtensor based on the one or more configuration parameters.23.The one or more non-transitory computer-readable media of claim 21 or 22, wherein writing the first subtensor comprises:determining whether two or more write transactions have a same destination, the same destination being the first memory or the second memory;in response to determining that the two or more write transactions have the same destination, combining the two or more write transactions into a combined write transaction; andperforming the combined write transaction.24.The one or more non-transitory computer-readable media of any one of claims 21-23, wherein writing the first subtensor comprises:writing the first subtensor in accordance with a configuration parameter disabling access of the drain module to the first memory.25.The one or more non-transitory computer-readable media of any one of claims 21-23, wherein the operations further comprise:writing the first subtensor into the first memory in accordance with a configuration parameter enabling access of the drain module to the first memory.
Citation Information
Patent Citations
Kernel Decomposition and Activation Broadcasting in Deep Neural Networks (DNNs)
US20230008622A1
Write combine buffer (WCB) for deep neural network (DNN) accelerator
US20230020929A1
Accelerating data load and computation in frontend convolutional layer
US20230073661A1
Pruning activations and weights of neural networks with programmable thresholds
US20230394312A1
Exploiting data sparsity at a machine-learning hardware accelerator
WO2023224614A1