Neural network comprising local storage device units
By optimizing feature data processing using internal storage devices and hardware accelerators in neural networks, the problem of high power consumption of deep learning algorithms in embedded devices is solved and efficient computing and storage are achieved.
Patent Information
- Application Number
- CN202410368353.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2024-01-29
- Filing Date
- 2024-03-28
- Publication Date
- 2024-10-01
Smart Images

Figure CN118734902A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates generally to neural networks, and more particularly to convolutional neural networks (CNNs). Background Art
[0002] Deep learning algorithms facilitate very high performance in many applications involving recognition, identification and / or classification tasks, however, this advancement may come at the expense of significant use of processing power. As a result, their adoption may be hampered by the lack of availability of low-cost and energy-efficient solutions. Therefore, when deploying deep learning applications on embedded devices, stringent performance specifications may coexist with strict constraints in terms of power and energy consumption.
[0003] CNN is a type of deep neural network (DNN). Their architecture is characterized by convolutional layers and fully connected layers. The previous layer performs convolution operations between the input of the layer and the convolution kernel, non-linear activation functions (such as rectifiers), and max pooling operations, which are usually the most demanding operations in terms of computational workload. Summary of the invention
[0004] In one embodiment, a method includes: receiving feature data at a neural network from a memory external to the neural network; passing the feature data to an internal storage device of the neural network; and storing the feature data in the internal storage device with a write transformer unit of the internal storage device, the internal storage device having a first address configuration based on a first hardware accelerator, the first hardware accelerator being next in the flow of the neural network. The method includes passing the feature data from the internal storage device to the first hardware accelerator, and generating first transformed feature data by processing the feature data with the first hardware accelerator.
[0005] In one embodiment, a method includes receiving feature data at a neural network from a memory external to the neural network and transferring the feature data to an internal storage device of the neural network. The method includes storing the feature data in the internal storage device and reading the feature data to the first hardware accelerator with a read transformer unit of the neural network in a read address mode based on operation of the first hardware accelerator. The method includes generating first transformed feature data by processing the feature data with the first hardware accelerator.
[0006] In one embodiment, a device includes a neural network. The neural network includes a stream engine configured to receive feature data from a memory external to the neural network, a hardware accelerator, and an internal storage device configured to receive the feature data from the stream engine. The internal storage device includes a write transformer unit configured to write the feature data to the internal storage device in a write address mode based on a configuration of the hardware accelerator. The internal storage device includes a read transformer unit configured to read the feature data to the hardware accelerator in a read address mode based on a configuration of the hardware accelerator, the hardware accelerator is configured to receive the feature data from the internal storage device, and process the feature data to generate transformed feature data.
[0007] In one embodiment, a method includes receiving feature data at a neural network from a memory external to the neural network, transferring the feature data to an internal memory device of the neural network, and storing the feature data in the memory of the internal memory device. The method includes transferring the feature data to a plurality of registers of the internal memory device with a read transducer unit of the internal memory device, and transferring the feature data from the registers to a hardware accelerator of the neural network.
[0008] In one embodiment, a method includes receiving, at a neural network, feature data arranged in rows and columns from a memory external to the neural network, and transferring the feature data to an internal storage device of the neural network. The method includes storing the feature data in a memory of the internal storage device by at least partially transposing the rows and columns of the feature data with a write transformer unit of the internal storage device. The method includes transferring the feature data from the memory of the internal storage device to a hardware accelerator, and generating first transformed feature data by processing the feature data with the hardware accelerator.
[0009] In one embodiment, a device includes a neural network. The neural network includes a flow engine configured to receive feature data from a memory external to the neural network, a hardware accelerator, and an internal storage device configured to receive the feature data from the flow engine. The internal storage device includes: a memory configured to store the feature data; a plurality of registers coupled to the memory; and a read transformer unit configured to read the feature data to the hardware accelerator, wherein reading the feature data to the hardware accelerator includes passing the feature data from the memory to the plurality of registers. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Figure 1 is a block diagram of an electronic device according to some embodiments.
[0011] Figure 2 is a block diagram of a processing flow within a neural network according to some embodiments.
[0012] Figure 3is a block diagram of a portion of a neural network according to some embodiments.
[0013] Figure 4 is a representation of a feature tensor according to some embodiments.
[0014] Figure 5 is a representation of a feature tensor and sub-tensors extracted from the feature tensor according to some embodiments.
[0015] Figure 6 is a representation of a feature tensor and sub-tensors extracted from the feature tensor according to some embodiments.
[0016] Figure 7 is a block diagram of an internal storage device of a neural network according to some embodiments.
[0017] Figure 8 is an illustration of memory reading from an internal storage device of a neural network according to some embodiments.
[0018] Fig. 9 is an illustration of memory reading from an internal storage device of a neural network according to some embodiments.
[0019] Fig.10 is a block diagram of a read transducer unit of an internal storage device according to some embodiments.
[0020] Fig.11A - Fig. 11C is a diagram of the memory of an internal storage device according to some embodiments.
[0021] Fig. 12A - Fig.12D is a diagram of memory and registers of an internal storage device according to some embodiments.
[0022] Fig.13 is a diagram of a memory of an internal storage device with a read scheme according to some embodiments.
[0023] Fig.14 is a diagram of a memory of an internal storage device with a read scheme according to some embodiments.
[0024] Fig.15A - Fig.15I is a diagram of registers of a read transducer unit of a local memory according to some embodiments.
[0025] Fig.16 is a flowchart of a method for operating a CNN according to some embodiments.
[0026] Fig.17 is a flowchart of a method for operating a CNN according to some embodiments.
[0027] Fig.18 is a flowchart of a method for operating a CNN according to some embodiments.
[0028] Fig.19 is a flowchart of a method for operating a CNN according to some embodiments. DETAILED DESCRIPTION
[0029] Figure 1 1 is a block diagram of an electronic device 100 according to some embodiments. The electronic device 100 includes a neural network 102 and an external memory 104. The external memory 104 includes feature data 106 processed by the neural network 102. The neural network 102 receives the feature data 106 from the external memory 104 and generates prediction data 114 based on the feature data 106. As will be explained in more detail below, the components of the neural network 102 cooperate to provide effective and efficient processing of the feature data 106.
[0030] In a neural network, feature data may be read from external memory multiple times. However, reading data from external memory may take a significant amount of time and processing resources. Neural network 102 improves efficiency by including internal memory device 110. As will be explained in more detail below, internal memory device 110 greatly improves the efficiency of neural network 102 by reducing the number of times neural network 102 reads from external memory 104.
[0031] In one embodiment, the feature data 106 is generated by an image sensor (not shown) or another type of sensor of the electronic device 100. Therefore, the feature data 106 may include image data corresponding to one or more images captured by the image sensor. The image data is formatted so that it can be received by the neural network 102. The neural network 102 analyzes the feature data 106 and generates prediction data 114. The prediction data 114 indicates a prediction or classification related to one or more aspects of the image data. The prediction data 114 may correspond to recognizing the shape, object, face, or other aspects of the image. Although some embodiments herein describe receiving the feature data 106 from a sensor or sensor system, the feature data 106 may also be received from other types of systems or devices without departing from the scope of the present disclosure. For example, the feature data 106 may include a data structure stored in a memory and including statistical data collected and stored by an external CPU. Other types of feature data 106 may be used without departing from the scope of the present disclosure. The components of the neural network 102 may be implemented as an application specific integrated circuit (ASIC) on a single integrated circuit die.
[0032] Although some examples herein describe neural network 102 implemented in conjunction with an image sensor, neural network 102 may be implemented in conjunction with other types of sensors without departing from the scope of the present disclosure, or combinations of various sensor types. Additionally, neural network 102 may process data other than sensor data without departing from the scope of the present disclosure. Furthermore, machine learning networks or processes other than neural networks may be used without departing from the scope of the present disclosure.
[0033] In one embodiment, neural network 102 is trained using a machine learning process to recognize aspects of training images provided to neural network 102. The machine learning process includes passing a plurality of training images having known features to neural network 102. The machine learning process trains neural network 102 to generate prediction data that accurately predicts, or classifies, the features of the training images. The training process may include a deep learning process.
[0034] Neural network 102 includes a plurality of hardware accelerators 112. Hardware accelerators correspond to hardware circuits that collectively perform the functions of neural network 102. Hardware accelerators 112 may include convolution units, activation units, pooling units, multiply and accumulate (MAC) units, decompression units, and other types of units.
[0035] In the example of a convolutional neural network, the convolution units implement the convolutional layers of the neural network 102. Thus, each convolution unit is a hardware block that implements a convolution operation corresponding to the convolutional layer of the neural network 102. Each activation unit is a hardware block that implements an activation operation after the convolution operation. Each pooling unit is a hardware block that implements a pooling function between convolutional layers. The convolution units 106, activation units 108, and pooling units 110 cooperate in generating prediction data 114 from the feature data 106.
[0036] In one embodiment, each convolution unit is a convolution accelerator. Each convolution unit performs a convolution operation on the feature data provided to the convolution unit. Feature data is generated from feature data 106. The convolution operation of the convolution layer convolves the feature data with kernel data generated during the machine learning process of the neural network 102. The convolution operation generates feature data that is changed according to the kernel data.
[0037] The data from the convolution unit is provided to the activation unit. The activation unit performs an activation operation on the data from the convolution unit. The activation operation may include performing a nonlinear operation on the data values received from the convolution unit. An example of an activation operation is a rectified linear unit (ReLU) operation. Other types of activation operations may be used without departing from the scope of the present disclosure.
[0038] The pooling unit receives feature data from the activation unit. The pooling unit performs a pooling operation on the feature data received from the activation unit. The pooling operation is performed on the feature data to prepare the feature data for the convolution operation of the next convolutional layer. The pooling unit performs a pooling operation between convolutional layers. The pooling unit is used to accelerate the convolutional neural network operation. The pooling unit can perform a maximum pooling operation, a minimum pooling operation, an average pooling operation, or other types of pooling operations.
[0039] The neural network 102 uses a tensor data structure of feature data. The input of each unit hardware accelerator may be an input tensor. The feature data 106 may be stored as a feature tensor. The feature tensor may be provided to the neural network 102 from the external memory 104. The output of each hardware accelerator 112 may be an output tensor having a different data value from the input tensor. In one example, the convolution unit receives an input tensor and generates an output tensor. The activation unit receives the output tensor of the convolution unit as an input tensor and generates an output tensor. The pooling unit receives the output tensor of the activation unit as an input tensor and generates an output tensor. The output tensor of the pooling unit may be passed to the external memory 104.
[0040] Tensors are similar to matrices in that they include multiple rows and columns and have data values in various data fields. A convolution operation generates an output tensor of the same dimensions as the input tensor, albeit with different data values. An activation operation generates an output tensor of the same dimensions as the input tensor, albeit with different data values. A pooling operation generates an output tensor of reduced dimensions compared to the input tensor.
[0041] The pooling operation takes a portion of the feature tensor, such as a pooling window, and generates a pooled sub-tensor of reduced size compared to the pooling operation. Each data field in the pooled sub-tensor is generated by performing a specific type of mathematical operation on multiple data fields from the feature tensor, such as taking the maximum, minimum, or average value from these data fields. The pooling operation is performed on each portion of the feature tensor. Each pooled sub-tensor is passed to the next convolutional layer as the feature tensor of that convolutional layer. Therefore, pooling helps to reduce and arrange the data for the next convolution operation.
[0042] Continuing with the example of an image sensor, the image sensor may output sensor data of a plurality of floating point data values. The floating point data values may utilize a large amount of memory, or it may be cumbersome or inefficient to process the floating point data values with the neural network 102. Therefore, before the sensor data is arranged into an input tensor, the floating point data values may undergo a quantization process. The quantization process transforms each floating point data value into a quantized data value. The quantized data values may have a reduced number of bits compared to the floating point data values, may be changed to integers, or may be otherwise changed to facilitate efficient processing by the neural network 102.
[0043] Various quantization formats may be used for feature data 106. One possible quantization format is a scale / offset format. Another possible quantization format is a fixed point format. There may be various advantages to using any of these formats. The quantization formats, or other quantization formats, may be utilized without departing from the scope of the present disclosure.
[0044] Stream engine 105 receives feature data 106 from external memory 104 and provides feature data 106 to stream switch 108. Stream switch 108 is a switch or series of switches that directs the flow of data within neural network 102. Typically, when data is provided from one component of neural network 102 to another component, the data passes through the stream switches between the components. Thus, a processing chain of neural network 102 can be established by configuring stream switches 104 to provide data between components.
[0045] Internal storage device 110 is configured to store data received from external memory 104 so that external memory 104 can be accessed less times. Thus, in one example, when stream engine 105 receives feature data, stream engine 105 passes the feature data to internal storage device 110 via stream switch 108. Internal storage device 110 then stores the data before providing it to the next component of neural network 102.
[0046] In one example, the next component of the neural network may be a hardware accelerator 112 such as a convolution unit. The convolution unit receives feature data and performs a convolution operation by convolving the feature data with kernel data. The kernel data is generated during the machine learning process of the neural network 102. The convolution operation generates feature data that changes according to the kernel data. New feature data is provided from one convolution unit 104 to the next hardware accelerator 112.
[0047] In one example, the kernel data may correspond to multiple kernels. Each kernel may be in the form of a matrix or tensor of a selected size. Each kernel operates on a portion of the tensor data. Typically, these portions of the tensor data overlap. This may result in multiple reads of data from the external memory 104.
[0048] As an example, each kernel may correspond to a 3×3 tensor or matrix. In a sequence of convolutions, the kernel may operate on the first 3×3 portion (3 columns and 3 rows) of the tensor data. The next kernel (or even the same kernel) may operate on the second 3×3 portion of the tensor data. The kernel may continue to operate on additional 3×3 portions of the tensor data until all convolution operations are performed. The first portion of the tensor data may overlap with the second portion of the tensor data. For example, the second portion of the tensor data may be shifted one column to the right relative to the first portion of the tensor data so as to include two columns of the first portion of the sensor data. When the last column of feature data is reached for a set of three rows, the next 3×3 portion may return to the first column and may be shifted down one row. The movement between the portions may correspond to the stride. Various other schemes for convolving feature data with kernel data may be used. Different kernel sizes may also be used.
[0049] Due to the overlapping nature of the convolution operations on the feature data 106 with various kernels, individual data values from the feature data 106 may be provided to the convolution accelerator multiple times. One possible solution is to read these individual data values multiple times from the external memory 104. However, this is both time-consuming and resource-intensive. Therefore, reading each data value of the feature data 106 multiple times from the external memory 104 may result in serious deficiencies in the effectiveness and efficiency of the neural network 102.
[0050] By implementing the external storage device 110 within the neural network 102, the neural network 102 avoids the disadvantage of reading the same data multiple times from the external memory 104. In particular, the feature data 106 can be provided to the neural network 102 from the external memory 104 in relatively large batches. The stream engine 105 provides the batch of feature data to the internal storage device 110 through the stream switch 105. Then, the next hardware accelerator 112 (e.g., a convolution accelerator) can receive the feature data 106 from the internal storage device 110. Instead of reading the data value multiple times from the external memory 104, the hardware accelerator 112 can read the data value from the internal storage device 110. This can greatly reduce the number of times the external memory 104 is accessed.
[0051] In one embodiment, the internal storage device 110 not only stores the feature data before providing the feature data to the hardware accelerator 112, but the internal storage device 110 also rearranges the data when storing the data. For example, the internal storage device 110 may include a transformation and control circuit that stores the feature data 106 in a selected write addressing mode (write address mode) to improve efficiency and provide the data to the next hardware accelerator 112. Instead of sequentially writing the data values in the rows and columns of the memory array of the internal storage device 110 in the order in which the data values are received from the external memory 104, instead, the transformation and control circuit of the internal storage device 110 can store the data values in a non-sequential manner in the rows and columns of the memory array relative to the order in which the data values are received from the external memory 104. The write addressing mode is selected based on how the data is processed by the next hardware accelerator 112. This can greatly improve efficiency and provide data from the internal storage device 110 to the hardware accelerator 112.
[0052] In one embodiment, the transformation and control circuitry of the internal storage device 110 may also read out feature data to the next hardware accelerator 112 based on the selected read address mode. Rather than sequentially reading data from the rows and columns of the memory array of the internal storage device 110, instead, the transformation and control circuitry of the internal storage device 110 may read data values from the rows and columns of the memory array of the internal storage device 110 in a non-sequential manner. The read addressing mode may be selected based on how the data is processed by the next hardware accelerator 112. Reading data in this manner may greatly improve the efficiency of providing data from the internal storage device 110 to the hardware accelerator 112. As used herein, reading data with the internal storage device 110 corresponds to outputting data from the internal storage device 110 to another component of the neural network 102.
[0053] Data rearrangement via selective write and read modes can greatly improve the efficiency of the neural network 102. In particular, feature data can be provided to the hardware accelerator 112 in a mode that enables rapid access and processing of the feature data. Continuing again with the example of the convolution operator, the feature data can be read in a selected manner to enable convolution operations with kernel data with high efficiency.
[0054] The internal storage device 110 can operate as a smart cache. In particular, the conversion and control circuitry of the internal storage device 110 can include a write converter unit, a read converter unit, and a control unit. These units can write and read data with selected write and read address patterns to improve the efficiency of the neural network 112.
[0055] As used herein, the term "convolution unit" may be used interchangeably with "convolution circuit" or "convolution circuit device". As used herein, the term "pooling unit" may be used interchangeably with "pooling circuit" or "pooling circuit device". As used herein, the term "activation unit" may be used interchangeably with "activation circuit" or "activation circuit device". As used herein, the term "requantization unit" may be used interchangeably with "requantization circuit" or "requantization circuit device". This is because the convolution unit, activation unit, pooling unit, and requantization unit 112 are hardware circuits.
[0056] Figure 2 is a functional flow diagram of a process 200 that may be used by a neural network 102 according to one embodiment. At 202, a flow engine 105 (not shown, see Figure 1 ) reads data from the external memory 104 and passes through the flow switch 108 (not shown, see Figure 1 ) provides the data to the internal storage device 110. At 204, the internal storage device 110 writes the data with a write addressing mode selected to enhance the efficiency of the neural network 102. At 204, the internal storage device 110 then reads (outputs) the data to the convolution accelerator 120 according to the read address mode selected to enhance the efficiency of the neural network 102. The convolution accelerator 120 processes the feature data and provides the processed feature data to the pooling unit 122 through the stream switch. At 206, the pooling unit 122 performs a pooling operation on the processed feature data. At 208, the pooling unit 110 provides the processed feature data to the external memory 104 through the stream engine 105 and the stream switch 108. The operation of the convolution accelerator 120 and the pooling unit 122 may correspond to a single-layer CNN.
[0057] At 210, the processed feature data is read from the external memory into the internal storage device 110 via the stream switch 108 and the stream engine 105, as previously described. The internal storage device 110 may write the processed feature data to a memory having an address mode selected to improve the efficiency of the neural network 102. At 212, the internal storage device 110 may read the processed feature data to the convolution accelerator 120, where the read mode is selected to improve the efficiency of the neural network 102. The convolution accelerator 120 processes the feature data. At 214, the convolution accelerator 120 provides the now doubly processed feature data to the pooling unit 122 via the stream switch. The pooling unit 122 performs a pooling operation on the feature data. The operations of convolution and pooling may correspond to a second convolution layer of the neural network.
[0058] The pooling unit 110 may provide the processed feature data to the fully connected layer. The fully connected layer may then output prediction data 114. Although only the convolution accelerator 120 and the pooling unit 122 are shown as hardware operators in the process 200, in practice, other hardware accelerators may be used instead of the convolution accelerator 120 and the pooling unit 122, or in addition to the convolution accelerator 120 and the pooling unit 122. Additional convolution layers may also be used before passing the data to the fully connected layer.
[0059] Figure 3 A portion of a neural network 102 is shown in accordance with some embodiments. Feature data 106 has been stored in an internal storage device 110. Feature data 106 may be written to the internal storage device 110 with a selected write addressing mode. Feature data 106 may then be read to a convolution accelerator 120 with a selected read addressing mode. Convolution accelerator 120 generates transformed feature data 130 (or processed feature data) by convolving feature data 106 with kernel data 128. The reading of feature data 106 to convolution accelerator 120 is selected so that convolution accelerator 120 can perform a series of convolution operators with kernels from kernel data 128 in a very efficient manner.
[0060] Figure 4 is a representation of a feature tensor 132 according to one embodiment. The feature tensor 132 includes a plurality of blocks. Each of these blocks represents a data value. The tensor 132 includes a height, a width, and a depth. Although Figure 4 The feature tensor 132 of FIG. 1 shows a 5×5×5 tensor, but in practice, the feature tensor 132 may include other height, width, and depth sizes.
[0061] In one embodiment, during various convolution, activation, pooling, and requantization operations, the feature tensor 132 is divided into batches. The feature tensor 132 can be measured by height, width, or depth. Convolution, activation, pooling, and requantization operations are performed on batches from the feature tensor. Each batch can be considered a sub-tensor of the feature tensor 132.
[0062] Figure 5 1 shows a tensor 132 according to one embodiment. In practice, the tensor 132 is read into the neural network 102 in batches 134. The batches 134 are stored in the internal storage device 110. The batches 134 can then be read from the internal storage device 110 in the form of stripes 135. Figure 5 In the example of FIG. 1 , the strip has four rows and 10 columns. The number of columns of the strip is the same as the number of columns of the batch 134. In practice, the strip 134 may have a different size or configuration without departing from the scope of the present disclosure.
[0063] Figure 5 Also shown is the manner in which the strips 135 may be read to the convolution unit 120. In particular, the strips may be read from the internal storage device 110 in a column-wise manner, returning to the top after reading the bottom of the column. Figure 5 In the example of , the dashed line of the bar represents a 3×3 portion of the tensor data that can be convolved with the 3×3 kernel by the convolution accelerator. The next 3×3 portion to be convolved with the next kernel can have a stride of one column to the right. Reading data from the internal storage device 110 by column in the manner shown can greatly improve the efficiency of the convolution operation with the kernel.
[0064] Figure 6 A tensor 132 is shown according to one embodiment. In practice, the tensor 132 is read into the neural network 102 in batches 134. The batches 134 are stored in the internal storage device 110. The batches 134 can then be read from the internal storage device 110 in patches 136. The number of columns in each patch can be less than the number of columns in the batch 134.
[0065] Figure 6 It is shown by the dashed box how a plurality of overlapping patches 136 are extracted from the batch 134. The reading pattern of the data values of the patches 136 may be selected to help ensure efficient convolution operations with the kernel of the convolution accelerator.
[0066] Figure 7 1 is a block diagram of an internal storage device 110 according to some embodiments. The internal storage device 110 includes a memory array 140. The memory array 140 can be arranged in rows and columns of memory cells. The memory array 140 can be divided into a plurality of memory cuts 142. Each memory cut 142 can have its own write port and read port. In one embodiment, each memory cut 142 can be associated with a specific hardware accelerator 112 of the neural network 102. In one embodiment, multiple cuts can be associated with a single hardware accelerator 112. Each memory cut 142 can include a plurality of memory cells arranged in rows and columns. The internal storage device 110 can include logic surrounding the memory array 140, such as pointers, enablers, etc.
[0067] In one embodiment, the memory array 140 is a static random access memory (SRAM) array. Other types of memory may be used in the memory array 140 without departing from the scope of the present invention. In one example, the memory array 140 is 1024×120 memory cells, corresponding to 16kB, but other sizes may be used without departing from the scope of the present invention.
[0068] The internal storage device 110 includes a write transformer unit 146. When data is transferred to the internal storage device 110, the write transformer unit 146 may write the feature data to the memory 140 according to a write address mode selected to enable the next hardware accelerator 112 to operate effectively on the feature data. The internal storage device 110 may include configuration registers that control the function of the write transformer unit 146.
[0069] The internal storage device 110 includes a read transformer unit 148 and a control unit 152. The control unit 152 controls the operation of the read transformer unit 148. The read transformer unit reads data from the memory 140 according to a read parameter. The read parameter is provided by the control unit 152. The read parameter is selected as an addressing (address) pattern for reading data from the memory 140 to the output buffer 150. The feature data may be passed from the output buffer 150 of the internal storage device 110 to the hardware accelerator 112 as rearranged feature data.
[0070] The read transformer unit 148 can work with multiple memory cuts 142. This can allow both more data to be provided to subsequent hardware accelerators 112 and different memory cuts 142 to be dedicated to different hardware accelerators 112. The solution can consider a selection method among the different memory cuts 142, thereby selecting which memory cut to address to retrieve subsequent data given the unit to which the data will be sent. The memory cuts 142 can have the same or different numbers of rows and columns. The read transformer unit 148 can use each memory cut 142 by knowing their size.
[0071] The control unit 152 may be used as an interface between the memory 140 and the read transformer unit 148. The control unit may generate write addresses, read addresses, and may determine that a minimum amount of data has been received to start reading data out to the next hardware accelerator 112. The control unit may consider the dimensionality of the tensor in terms of the dimensionality of stripes and patches.
[0072] In one embodiment, once the selected minimum amount of data has been written to memory 140, read transformer unit 148 may begin reading data to the next hardware accelerator 112. Due to the selected read addressing mode used by read transformer unit 148, the data may be reorganized as it is read.
[0073] In one embodiment, the write transformer unit 146 may transform the feature data 146 and may make the feature data suitable for writing into the memory 140. For example, if each data value of the feature data is 32 bits, the write transformer unit 146 may reduce the number of bits in each data value to 24 bits by discarding 8 bits from each data value.
[0074] The internal storage device 110 can be used in conjunction with the convolutional neural network architecture to properly arrange, reorganize and transform data to reduce execution time and utilize data usage in such applications. However, the internal storage device 110 is not limited to this framework and can be used in every architecture that performs data management and its operations to simplify calculations.
[0075] The internal storage device 110 may be used primarily (but not only) to prepare data for the following operations so that they are ready to be fed to the hardware accelerator. The reorganization of the data may follow methods that can exploit data locality or data organization to obtain faster and more compact operations, thus reducing execution time, number of epochs in computation, and energy consumption.
[0076] In one embodiment, data arrives in packets of n bits specified by the architectural connections and can then be packed, reorganized, and transformed to obtain the benefits described herein. The local storage device 110 provides an operating mode dedicated to obtaining a solution to the memory efficiency problem and provides management between the different memory units in order to coordinate them and correctly format the data to be processed by the different units of the architecture and optimize its energy consumption over the entire computation.
[0077] The internal storage device 110 can utilize nested loop processing for convolutional neural networks. In this case, the internal storage device can utilize hardware and software methods for im2col, im2row transformations and re-layout strategies for input tensors in general to obtain better data utilization. The data can first be organized offline by the compiler in a manner that can take some advantages from the way the data is stored and / or retrieved. This can provide easier memory access (for storage and retrieval of data) and / or easier organization and development of the required calculations (for convolution or other types of operations).
[0078] The internal storage device 110 can be correctly written to / read from the memory cells using a write transformer unit 146 and a read transformer unit 148. These units can be used according to the instructions given by the compiler, because it is possible to store and retrieve data in this way not only from a temporal perspective but also from a spatial perspective (for both cores and features). The read and write processes can utilize a nested loop approach, thereby using multiple parameters to organize the reading / writing of data.
[0079] The hardware solution may also follow this approach of considering multiple parameters in memory management and using them to provide efficiency and flexibility through different memory operations in order to correctly take advantage of the data reshaped by the compiler. Given the number of cells in the design that share the memory itself, the memory port can be single or multiple. In the former case, each cell can have its own dedicated memory cut 142. In the latter case, more management of the memory can be utilized, but a higher flexibility of the memory can be considered and sub-partitioning of the memory can be considered at the beginning of a new era.
[0080] Read and write operations may also follow certain schedules and provide some synchronization, handshake or / and authorization mechanisms to correctly provide data transformations and output the correct data to avoid problems. Therefore, when using a shared memory approach, memory slicing 142 may also be aligned with the needs of the hardware units and therefore with the detailed description of providing a scheduler for accessing the memory of more than one unit simultaneously.
[0081] Furthermore, the definition of the sizes and dimensions of different memory cuts 142 can be designed and specified so that the transformed data can be managed, stored and provided to different nested loop solution methods so that the unit can be reused for different neural network models. In the case of convolutional neural network models using well-known read / write patterns, the design can also provide some customized memory cuts for dedicated operations. The design of the internal storage device 110 can also provide smart addressing modes so that multiple parts of the memory can be correctly addressed simultaneously on the addressing mode, data, or both, and can also reduce the time and energy of developing operations for different units.
[0082] More details on neural networks and machine learning applications can be found in T. Chen, Z. Du, N. Sun, J. Wang, C. Wu, Y. Chen, and O. Temam, “DianNao: a small-footprint high-throughput accelerator for ubiquitous machine-learning,” in 19th Int'l Conf. on Architectural Support for Programming Languages and Operating Systems. ACM, 2014, pp. 269-284, Y. Chen, T. Luo, S. Liu, S. Zhang, L. He, J. Wang, L. Li, T. Chen, Z. Xu, N. Sun, et al., “DaDian Nao: a machine-learning supercomputer,” in 47th Annual IEEE / ACM Int'l Symp. on Microarchitecture(MICRO), IEEE, 2014, pp. 609-622, M. Peemen, A. A. Setio, B. Mesman, and H. Corporaal, “Memorycentric accelerator design for convolutional neural networks,” in 31st Int'l Conf Int'l Conf. on Computer Design(ICCD), 2013, pp. 13-19 and J. Jin, V. Gokhale, A. Dundar, B. Krishnamurthy, B. Martini, and E. Culurciello, “An efficient implementation of "deep convolutional neural networks on a mobile coprocessor" is found in IEEE 57th Int'l Midwest Symp. on Circuits and Systems (MWSCAS), IEEE, 2014, pages 133-136, each of which is incorporated herein by reference in its entirety.
[0083] Figure 8 is a diagram of memory 140 of internal storage device 110 of neural network 102 according to one embodiment. Figure 8The memory 140 is Figure 7 The memory 140 is an example of the memory 140. The memory 140 is arranged in n rows and m columns.
[0084] Figure 8 Also shown is the portion of data that the first core 128a will operate on when the data is passed to the convolution operator. In one embodiment, the internal storage device 110 reads out data corresponding to the first core 128a in the column so that the core 128a performs a convolution operation on the selected portion of the feature data in the memory 140. The first portion includes data from rows 1, 2, 3 and from columns 1, 2, 3.
[0085] In one embodiment, the data of the first core 128a is written to the output buffer of the internal storage device 120 in rows, wherein the data values of the first row (1-1, 1-2, and 1-3) are read first, followed by the data values in the second row (2-1, 2-2, and 2-3), and finally the data values of the third row (3-1, 3-2, and 3-3). This reading mode can greatly facilitate performing convolution operations based on the core of the core data. Other reading modes may be used without departing from the scope of the present disclosure.
[0086] Figure 8 Also shown is the portion of data on which the second core 128b will operate when the data is passed to the convolution operator. In one embodiment, the internal storage device 110 reads out the data corresponding to the first core 128b in the row so that the core 128b performs a convolution operation on a selected portion of the feature data in the memory 140. For example, the data to be convolved with the second core 128b is read by a row in which the data values of the first row (1-2, 1-3, and 1-4) are read first, then the data values in the second row (2-2, 2-3, and 2-4) are read, and finally the data values of the third row (3-2, 3-3, and 3-4) are read. This reading mode can greatly facilitate the convolution operation performed according to the core of the core data. It can be seen that other reading modes can be used without departing from the scope of the present disclosure to overlap the sixth data value convolved with the first core 128a with the data value to be convolved with the second core 128b. Because the data is initially stored in the internal storage device 110, repeated data values can be read from the internal storage device 110 instead of repeatedly accessing the external memory 104.
[0087] Fig. 9 is a diagram of memory 140 of internal storage device 110 of neural network 102 according to one embodiment. Fig. 9140. It shows how rows of tensor data are larger than rows of memory 140. Thus, a single row of tensor data may occupy portions of two rows in memory 140. Write transformer unit 146 and read transformer unit 148 may help ensure that when data is read from memory 140 to convolution operator 120, addresses are selected to ensure that the data is read in a manner that facilitates the convolution operation with the kernel.
[0088] The internal memory device 110 may determine when the next data value to be convolved with the next kernel is found in the same row of physical memory of the memory array 140 or in a different row of physical memory of the memory array 140. Thus, the writing and reading of data may be implemented with a physical address pattern that increases efficiency and provides data to the next hardware accelerator 112.
[0089] In one embodiment, according to Fig. 9 In the example shown, for the first patch (to be convolved with the first kernel), the internal storage device 110 reads the first three data values of the first row of the tensor data (1-1, 1-2, and 1-3), then reads the first three data values of the second row of the tensor data (2-1, 2-2, and 2-3), and then reads the first three data values of the tensor data (3-1, 3-2, and 3-3). Because the rows of the tensor data are different from the physical rows of the memory 140 of the internal storage device, the internal storage device intelligently reads the correct sequence of data values regardless of the different sizes of the rows between the original tensor data and the memory array 140. After reading the first patch, the second patch can be read by shifting the tensor data one column to the right.
[0090] Therefore, the internal memory device pays special attention when picking up the same row of data on a different row (address incremented by +1, which may not be incremented when moving to the next row). Knowing the row and column offsets, the internal memory device 110 can intelligently know when to change addresses when moving from one pixel to another when moving from one pixel to a "neighboring" pixel.
[0091] Knowing the height offset, the internal storage device 110 can know how many positions to skip before the next data when changing the row in the patch being considered and the vertical stride Hstride. Combined with the horizontal stride Wstride and Hstride, these parameters can also help move the vertical and horizontal pointers of the memory to the starting point of the next patch to be considered.
[0092] The internal storage device 110 implements a solution to the problem from the software side and the ASIC hardware side. This is suitable for use in different neural network models in a programmable manner to obtain solutions for different needs in different situations. This can also improve the power performance and overall computing speed of the ASIC implementation.
[0093] Embodiments of the present disclosure implement solutions to the problem of neural network throughput from the aspects of software and ASIC hardware. Embodiments of the present disclosure are suitable for use with different CNN models in a programmable manner to obtain solutions for different needs in different scenarios. Embodiments of the present disclosure are programmable and suitable for use with different CNN models to improve the power performance and overall computing speed of ASIC implementations. Embodiments of the present invention provide multiple solutions for reconfigured output stages in local storage units. This allows different trade-offs to be obtained in different situations in order to achieve better throughput and performance.
[0094] Fig.10 is a block diagram of read transducer unit 148 according to one embodiment. Fig.10 The read transducer unit 148 is Figure 7 Thus, the read transducer unit 148 is a part of the internal storage device 110, as described with respect to Figure 1 - Fig. 9 described.
[0095] The read transformer unit 148 includes a plurality of registers 160 and control logic 162. As previously described, the read transformer unit 148 reads data from the memory 140 according to the read parameters. The read parameters are provided by the control unit 152. The read parameters are selected as an address pattern for reading data from the memory 140 to the output buffer 150. The feature data may be passed from the output buffer 150 of the internal storage device 110 to the hardware accelerator 112 as rearranged feature data.
[0096] In one embodiment, the read transformer unit 148 uses registers 160 to implement efficient reading of data from the memory 140 of the internal storage device 110 to the output buffer 150. When the read transformer unit 148 reads data from the memory 140, the read transformer unit 148 can load the data into the register 160 in a selected manner so that the data can be read from the memory 140 less times, thereby improving efficiency. The control logic 162 can help read data from the memory 140 into the register 160 and pass the data from the register 160 to the output buffer 150. The read transformer unit can also include multiple counters and other circuits. The control logic 162 can be part of the control unit 150, and the control unit 150 can be separate from the control unit 152. Further details on the use of registers 160 are described in detail in the following. Fig. 12A - Fig.12D and Fig.15A - Fig.15I Available in.
[0097] Fig.11A - Fig. 11Cis a diagram of the memory 140 of the internal storage device 110 according to one embodiment. Fig.11A A case is shown in which a tensor (or a portion of a tensor) that reads data into the memory 140 of the internal storage device 110 has the same width as the memory 140 . Fig. 11B A situation is shown in which a tensor (or a portion of a tensor) that reads data into memory 140 has a different width than memory 140 . Fig. 11C Principles according to one embodiment are shown by which data read from a tensor may be transformed by a write transformer unit 146 of an internal storage device 110 to facilitate efficient reading of data from memory 140 regardless of the difference between the width of memory 140 and the input tensor.
[0098] exist Fig.11A In , memory 140 has a width of 7 (i.e., 7 columns). The input tensor that reads data into memory 140 also has a width of 7. Fig.11A In the example of , the height of the kernel is 3. Therefore, the data to be convolved with the kernel may consist of a vector 164 having three data values. The data values of interest are described as vectors, but in reality, each vector corresponds to a portion of a column of the tensor data. In the example where the kernel height is 3, each vector corresponds to three data values from a particular column of the tensor data. As a simple example, if the first vector 164 is to have the first data value from each row of the tensor data, then the vector 164 may be conveniently read as the first data value of each of the first three rows of the memory 140 (here the values 0, 7, and 14). The next vector 164 to be retrieved may include the second data value from each of the first three rows (here the values 1, 8, and 15), and so on. These operations may be simple because the width of the memory 140 is the same as the width of the tensor. Although these read operations are described as vectors 164, in reality, patches of data may be read for each kernel that includes multiple vectors.
[0099] exist Fig. 11B , the width of memory 140 is 7, but the width of the input tensor is 9. Therefore, the first vector 164 to be read from memory 140 will include data values 0, 9, and 18. This read operation is less convenient because the first vector 164 includes a first value 0 from the first row, a third value 9 from the second row, and a fifth value 18 from the third row, rather than reading the first data value from each of the first three rows of the first vector 164. This is obviously less convenient and may become increasingly inefficient for subsequent read operations.
[0100] exist Fig.11A and 11BIn the example of , three rows are read from the memory 140 of the internal storage device 110 in order to obtain three values of the vector 164. This corresponds to three separate read operations. For each read operation, many bits may be read, but only a small fraction of them may be used. Furthermore, in subsequent operations, the same locations may be read again and again, resulting in inefficient memory usage. The effect is more severe for small strides, so there are fewer bits dedicated to the word for each pixel.
[0101] Fig. 11C A reading scheme according to one embodiment is shown. Fig. 11C In the example, a sorting adaptation for better column retrieval is provided. More specifically, when feature data (tensor data) is received at the internal storage device 110, the write transformer unit 146 provides write parameters for writing the feature data to the memory 140 to facilitate column retrieval. Fig. 11C As shown, data values 0, 7, and 14 from the tensor data are written into the first three slots of the first row of memory 140. Therefore, the first vector 164 to be read now occupies the first three slots of the first row of memory 140. This enables the vector to be read with a single row read operation. The next vector 164 to be read, which includes data values 1, 8, and 15, is in the first three slots of the second row. This enables the next vector column to be read in a single read operation of the second row. The next vector, which includes data values 2, 9, and 16, is in the first three slots of the third row.
[0102] When the first three slots of each row contain vectors, the next vector or column is written to the next three slots of the first row of memory 140. Fig. 11C In the example, this corresponds to Fig. 11C The data values in the example are 21, 28, 35. The next three slots in each row are then filled with data values in the same way.
[0103] In this way, all columns of tensor data (described here as vectors) can be read in the same read operation. The next read operation will be performed on another memory address associated with the next column. The efficiency of the read operation is better than Fig.11A and Fig. 11B However, when the window is shifted, the same location may be read multiple times. However, this solution solves some of the above disadvantages. In particular, since the initial processing of each pixel is utilized in the input, the problem occurs when the write operation is shifted. When the window under consideration is written on more than one memory location (i.e., on more than one row), more read operations may be required, such as when the column of interest occupies part of two rows of the memory 140. This solution corresponds to a shifted row write alignment.
[0104] Fig. 12A - Fig.12DIt is shown that according to one embodiment, the Fig. 11C Describe the solution to the problem associated with the solution. In particular, Fig. 12A - Fig.12D The scheme uses the register 160 of the reading converter unit 148, as described in relation to Fig.10 Described. Fig. 12A In the example above, the tensor or feature data has been written to the memory 140, essentially as described with respect to Fig. 11C described.
[0105] exist Fig. 12B , three registers 160a-c are used. Data from the first row of memory 140 is read into register 160a. Data from the second row of memory 140 is read into register 160b. Data from the third row of memory 140 is read into register 160c. A first vector or set of data values 164a is then passed from the first three slots of register 160a on a first clock cycle. A second vector or set of data values 164b is read from the first three slots of register 160b on a second clock cycle. A third vector or set of data values 164c is read from the third register 160c on a third clock cycle. Each vector 164 is read as the first three values in register 160 in a single read operation.
[0106] exist Fig. 12C 160a-c are shifted right by one data value. In the next clock cycle, vector 164a (comprising data values 7, 14, and 21) is read from register 160a. In the next clock cycle, a second vector or set of data values 164b (comprising data values 8, 15, and 22) is read from the first three slots of register 160b. In the next clock cycle, a third vector or set of data values 164c (comprising data values 9, 16, and 23) is read from third register 160c.
[0107] exist Fig.12D , each register 160a-c is shifted right by one data value. In the next clock cycle, vector 164a (including data values 14, 21, and 28) is read from register 160a. On the next clock cycle, a second vector or set of data values 164b (including data values 15, 22, and 29) is read from the first three slots of register 160b. On the next clock cycle, a third vector or set of data values 164c (including data values 16, 23, and 30) is read from the third register 160c. This scheme corresponds to column write alignment and column read.
[0108] exist Fig. 12A - Fig.12DIn the example of , the horizontal stride is 1. In other words, only a single data value is shifted in each register between sets of read operations. As a result, each data value can be read multiple times. However, in other examples, a stride of two or three can be used, where two or three data values are shifted. If all three data values are shifted, no data value is read twice.
[0109] Fig. 12A - Fig.12D Three registers are shown. However, in practice it may be beneficial to have a register for each row of memory 140. If there are a large number of rows in memory 140 this may cause problems as this will result in a large number of registers 160 being used.
[0110] Fig.13 A reading scheme according to one embodiment is shown. In case the vertical stride is greater than 1, it is possible to employ such parameters with various storage schemes. Fig.13 An example with a vertical stride of 2 is shown. In this case, the pixels of the column to be considered can be stored in only one storage unit. This allows to improve the efficiency of the read operation, considering that the read instruction will follow the spatial configuration of the data in the memory. Even if the memory location is not fully written in most cases, the trade-off is advantageous in certain configurations, considering that this inefficiency is offset by the possibility of reading the data only once. However, these considerations may be limited to the case of certain strides in the pixel size. Therefore, this can lead to a high degree of constraint on the parameters. This scheme corresponds to a line write alignment scheme with shifters and parallel repacking.
[0111] Fig.14 A read scheme with three vertical spans of two columns stored in memory locations (rows) according to one embodiment is shown. In this case, each row of memory 140 includes two columns from tensor data. The first row includes a first column of feature data, which includes data values 0, 7, and 14. The first row includes a second column of feature data, which includes data values 1, 8, and 15. The remaining storage slots of the row are blank. The second row includes a second column of feature data, which includes data values 2, 9, 16. The second row includes a second column of feature data, which includes data values 3, 10, and 17. The third row includes a first column of feature data, which includes data values 4, 11, and 18. The third row includes a second column of feature data, which includes data values 5, 12, and 19.
[0112] Similar considerations apply in the case where different vertical spans are considered and it is possible to fit one or more columns within a single memory location (i.e., row). In this case, in different writing schemes, a larger vertical span with smaller pixels will also result in more than one pixel being written at a time, in the case where more than one column is stored per memory location. This reduces the number of writes per single transaction and obtains Fig.14 Memory configuration shown.
[0113] Fig.15A - Fig.15I A read scheme for multiple registers 160 with a read transformer unit 148 is shown according to one embodiment. As will be explained in more detail below, after a setup period corresponding to a number of clock cycles equal to the number of data values in a column or vector 164, the vector 164 can then be read on each subsequent clock cycle without retrieving the data value multiple times from the memory 140. This can correspond to line write alignment with a pipeline shifter for column-wise output. In FIG. 15- Fig.15I In the embodiment of the present invention, seven registers 160a-160g are shown. However, other numbers of registers may be used without departing from the scope of the present invention.
[0114] exist Fig.15A In the first clock cycle, the first seven data values (data values 0-6) are read from the memory 140 into the first seven slots of the register 160a. Fig. 15B , the next seven data values (data values 7-13) are read from memory 140 into slots 2-7 of register 160a in the second clock cycle. The first slot of register 160a is not overwritten in the second clock cycle. In the second clock cycle, data values 1-6 are transferred from register 160a to register 160b.
[0115] exist Fig. 15C , the next seven data values (numbers 14-20) from memory 140 are read into slots 3-9 of register 160a in the third clock cycle. Slots 1 and 2 of register 160a are not overwritten in the third clock cycle. As shown, data values 0, 7, and 14 now occupy the first three slots of register 160a. This corresponds to the first vector 164 used for convolution with the kernel data. As will be explained in more detail below, in each subsequent clock cycle, another vector 164 will be ready to be read from the next register. In the third clock cycle, data values 8-13 are transferred from the first register 160a to slots 2-7 of register 160b without overwriting the first slot of register 160b. In addition, data values 2-6 are transferred from register 160b to register 160c in the third clock cycle.
[0116] exist Fig.15D, on the fourth clock cycle, the next seven data values are read from memory 140 into register 160a (not explicitly shown). Data values 15-20 are transferred from register 168 to register 160b without overwriting slots 1 and 2 (comprising data values 1 and 8, respectively). Data values 9 through 13 are transferred from the second register 160b to register 160c. Data values 3-6 are transferred from register 160c to register 160d. Vector 164 comprising data values 1, 8, 15 is now read from register 160b on the fourth clock cycle.
[0117] exist Fig.15E , on the fifth clock cycle, the next seven data values are read from memory 140 into slots 5-11 of register 160A. Six data values are transferred from register 168 to register 160b. Five data values are transferred from register 160b to register 160c. Four data values are transferred from register 160c to register 160D. And three data values are transferred from register 160D to register 160E. The next column or vector 164 is now read from register 160c.
[0118] exist Fig.15F , on the sixth clock cycle, the next seven data values are read from memory 140 into slots 6-12 of register 160A. Six data values are transferred from register 168 to register 160b. Five data values are transferred from register 160b to register 160c. Four data values are transferred from register 160c to register 160D. And three data values are transferred from register 160D to register 160E. Two data values are transferred from register 16CE to register 160F. The next column or vector 164, which includes data values 3, 10, and 17, is now read from register 160d.
[0119] exist Figure 15G , on the seventh clock cycle, the next seven data values are read from memory 140 into slots 7-13 of register 160A. Six data values are transferred from register 168 to register 160b. Five data values are transferred from register 160b to register 160c. Four data values are transferred from register 160c to register 160D. And three data values are transferred from register 160D to register 160E. Two data values are transferred from register 160e to register 160F. One data value is transferred from register 160F to register 160G. The next column or vector 164, which includes data values 4, 11, and 18, is now read from register 160e.
[0120] exist Fig.15H, on the eighth clock cycle, the next seven data values are read from memory 140 into slots 8-14 of register 160A. Six data values are transferred from register 168 to register 160b. Five data values are transferred from register 160b to register 160c. Four data values are transferred from register 160c to register 160D. And three data values are transferred from register 160D to register 160E. Two data values are transferred from register 160e to register 160F. One data value is transferred from register 160F to register 160G. The next column or vector 164, which includes data values 5, 12, and 19, is now read from register 160f.
[0121] exist Fig.15I , on the ninth clock cycle, the next seven data values are read from memory 140 into slots 1-7 of register 160A. Six data values are transferred from register 168 to register 160b. Five data values are transferred from register 160b to register 160c. Four data values are transferred from register 160c to register 160D. And three data values are transferred from register 160D to register 160E. Two data values are transferred from register 160e to register 160F. One data value is transferred from register 160F to register 160G. The next column or vector 164, which includes data 6, 13, and 20, is now read from register 160g. Although not shown, on a subsequent clock cycle, the data is again read from memory 140 into the registers as described above, so that after two established clock cycles, the data can then be read from one of the registers on each subsequent clock cycle.
[0122] In a general sense, in the example using seven registers, at each clock cycle, N data values are read from memory 140 into the first register. N-1 data values are transferred from the first register to the second register. N-2 data values are transferred from the second register to the third register, and so on. Each time new data is written to a register, the starting slot is shifted to the left. Due to the shift, some data values are not overwritten. Finally, the first three data values in the register are ready to be read.
[0123] In one embodiment, it is beneficial to consider a number of registers equal to the number of pixels included in the memory location. However, due to their increase, this is not always possible. However, it is possible to find a compromise for different situations. The mechanism will automatically align the column data clock cycle after the clock cycle to provide new data in each cycle, except for those data where the data needs to be recharged. At the same time, the new data provides the next data on the first considered register. In this way, the outputs from the registers can be issued one by one using the output selectors therein to improve the efficiency of the throughput and output bandwidth after the initial delay required to transfer the initial data into the registers and to form the first column to be sent to the outside. This is higher when considering larger cores.
[0124] In some cases, the number of registers to be considered may be too high. In these cases, a compromise can be found between the number of registers to be used in the number of times a memory location should be re-read. In one example, there are one hundred 28-bit memories with a considered pixel depth of three bits, and up to 42 pixels can be stored in a single memory location (omitting the last bit of the memory word). However, in some cases, it may not be feasible to have 42-bit registers with a width greater than 128. Therefore, it is not possible to have only 27 registers and seven times the same word, reducing the read time of the same location can achieve the sum of the previous game and avoid allocating too much area for the considered unit.
[0125] Fig.16 is a flow chart of a method 1600 according to one embodiment. The method 1600 may utilize Figure 1 - Fig.15I The components, systems, and processes described herein are described herein. At 1602, method 1600 includes receiving, at a neural network, feature data from a memory external to the neural network. At 1604, method 1600 includes transferring the feature data to an internal storage device of the neural network. At 1606, method 1600 includes storing, with a write transformer unit of the internal storage device, the feature data in an internal storage device having a first address configuration based on a first hardware accelerator that is next in the flow of the neural network. At 1608, method 1600 includes transferring the feature data from the internal storage device to the first hardware accelerator. At 1610, method 1600 includes generating first transformed feature data by processing the feature data with the first hardware accelerator.
[0126] Fig.17 is a flow chart of a method 1700 according to one embodiment. The method 1100 may utilize Figure 1 - Fig.15AThe method 1700 includes receiving, at a neural network, feature data from a memory external to the neural network. At 1704, the method 1700 includes transferring the feature data to an internal storage device of the neural network. At 1706, the method 1700 includes storing the feature data in the internal storage device. At 1708, the method 1700 includes reading the feature data to a first hardware accelerator using a read transformer unit of the neural network with a read address pattern based on an operation of the first hardware accelerator. At 1710, the method 1700 includes generating first transformed feature data by processing the feature data with the first hardware accelerator.
[0127] Fig.18 is a flow chart of a method 1800 according to one embodiment. The method 1800 may utilize Figure 1 - Fig.15A The components, systems, and processes described herein. At 1802, method 1800 includes receiving feature data at a neural network from a memory external to the neural network. At 1804, method 1800 includes transferring the feature data to an internal memory device of the neural network. At 1806, method 1800 includes storing the feature data in a memory of the internal memory device. At 1808, method 1800 includes transferring the feature data to a plurality of registers of the internal memory device with a read transducer unit of the internal memory device. At 1810, method 1800 includes transferring the feature data from the registers to a hardware accelerator of the neural network.
[0128] Fig.19 is a flow chart of a method 1900 according to one embodiment. The method 1100 may utilize Figure 1 - Fig.15A The components, systems, and processes described herein. At 1902, method 1900 includes receiving, at a neural network, feature data arranged as rows and columns from a memory external to the neural network. At 1904, method 1900 includes transferring the feature data to an internal storage device of the neural network. At 1906, method 1900 includes storing the feature data in a memory of the internal storage device by at least partially transposing the rows and columns of the feature data with a write transformer unit of the internal storage device. At 1908, method 1900 includes transferring the feature data from the memory of the internal storage device to a hardware accelerator. At 1910, the method includes generating first transformed feature data by processing the feature data with the hardware accelerator.
[0129] In one embodiment, a method includes: receiving feature data at a neural network from a memory external to the neural network; passing the feature data to an internal storage device of the neural network; and storing the feature data in the internal storage device with a write transformer unit of the internal storage device, the internal storage device having a first address configuration based on a first hardware accelerator, the first hardware accelerator being next in the flow of the neural network. The method includes passing the feature data from the internal storage device to the first hardware accelerator, and generating first transformed feature data by processing the feature data with the first hardware accelerator.
[0130] In one embodiment, a method includes receiving feature data at a neural network from a memory external to the neural network and transferring the feature data to an internal storage device of the neural network. The method includes storing the feature data in the internal storage device and reading the feature data to the first hardware accelerator with a read transformer unit of the neural network in a read address mode based on operation of the first hardware accelerator. The method includes generating first transformed feature data by processing the feature data with the first hardware accelerator.
[0131] In one embodiment, a device includes a neural network. The neural network includes a stream engine configured to receive feature data from a memory external to the neural network, a hardware accelerator, and an internal storage device configured to receive the feature data from the stream engine. The internal storage device includes a write transformer unit, the write transformer unit is configured to write the feature data to the internal storage device in a write address mode based on the configuration of the hardware accelerator. The internal storage device includes a read transformer unit, which is configured to read the feature data to the hardware accelerator in a read address mode based on the configuration of the hardware accelerator, the hardware accelerator is configured to receive the feature data from the internal storage device, and process the feature data to generate transformed feature data.
[0132] In one embodiment, a method includes receiving feature data at a neural network from a memory external to the neural network, transferring the feature data to an internal memory device of the neural network, and storing the feature data in the memory of the internal memory device. The method includes transferring the feature data to a plurality of registers of the internal memory device with a read transducer unit of the internal memory device, and transferring the feature data from the registers to a hardware accelerator of the neural network.
[0133] In one embodiment, a method includes receiving, at a neural network, feature data arranged in rows and columns from a memory external to the neural network, and transferring the feature data to an internal storage device of the neural network. The method includes storing the feature data in a memory of the internal storage device by at least partially transposing the rows and columns of the feature data with a write transformer unit of the internal storage device. The method includes transferring the feature data from the memory of the internal storage device to a hardware accelerator, and generating first transformed feature data by processing the feature data with the hardware accelerator.
[0134] In one embodiment, a device includes a neural network. The neural network includes a stream engine configured to receive feature data from a memory external to the neural network, a hardware accelerator, and an internal storage device configured to receive the feature data from the stream engine. The internal storage device includes: a memory configured to store the feature data; a plurality of registers coupled to the memory; and a read transformer unit configured to read the feature data to the hardware accelerator, which includes passing the feature data from the memory to the plurality of registers.
[0135] Some embodiments may take the form of or include a computer program product. For example, according to one embodiment, a computer readable medium is provided, which includes a computer program suitable for performing one or more of the above methods or functions. The medium may be a physical storage medium, such as a read-only memory (ROM) chip, or a disk, such as a digital versatile disk (DVD-ROM), a compact disk (CD-ROM), a hard disk, a memory, a network, or a portable medium article to be read by an appropriate drive or via an appropriate connection, including one or more bar codes or other related codes encoded on one or more such computer readable media and readable by an appropriate reader device.
[0136] In addition, in some embodiments, some or all of these methods and / or functions may be implemented or provided in other ways, such as at least partially implemented or provided in firmware and / or hardware, which firmware and / or hardware include but are not limited to one or more application-specific integrated circuits (ASICs), digital signal processors, discrete circuits, logic gates, standard integrated circuits, controllers (e.g., by executing appropriate instructions, and including microcontrollers and / or embedded controllers), field programmable gate arrays (FPGAs), complex programmable logic devices (CPLDs), etc., as well as devices using RFID technology and various combinations thereof.
[0137] The various embodiments described above can be combined to provide additional embodiments. These and other changes can be made to the embodiments according to the above detailed description. Generally, in the following claims, the terms used should not be interpreted as limiting the claims to the specific embodiments disclosed in the specification and claims, but should be interpreted as including all possible embodiments and the full range of equivalents to which these claims are authorized. Therefore, the claims are not limited by this disclosure.
