Vector calculation unit in neural network processor

The specialized hardware circuitry for neural network computations addresses inefficiencies by simultaneously processing multiple activations, normalizations, and pooling operations, enhancing computational efficiency and reducing errors in neural network processing.

JP7566105B2Active Publication Date: 2024-10-11GOOGLE LLC
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
JP2023144224
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2015-09-03
Filing Date
2023-09-06
Publication Date
2024-10-11
Estimated Expiration
2036-04-29

AI Technical Summary

Technical Problem

Existing neural network computations are inefficient in terms of processing speed and resource utilization, particularly in handling multiple layers and operations such as normalization and pooling, which can lead to errors and reduced computational efficiency.

Method used

A specialized hardware circuitry is designed to perform neural network computations, incorporating an activation circuit for applying functions to vector values, a normalization circuit for generating normalized values, and a pool circuit for pooling operations, allowing for simultaneous processing of multiple activation values, normalized values, and pool values during each clock cycle.

Benefits of technology

This approach enables efficient computation of neural network layers by pipeline processing, reducing errors and improving computational efficiency without sacrificing quality, by enabling multiple activations, normalizations, and pooling operations per clock cycle.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007566105000001
    Figure 0007566105000001
  • Figure 0007566105000002
    Figure 0007566105000002
  • Figure 0007566105000003
    Figure 0007566105000003
Patent Text Reader

Abstract

To provide a vector computation unit configured to enable parallel processing and pipelining of neural network computation thereby achieving high-speed execution.SOLUTION: An architecture 600 for executing neural network computation for a neural network including a plurality of layers comprises: activation circuitry 602 configured to receive a vector of accumulated values and configured to apply a function to each accumulated value to generate a vector of activation values; and normalization circuitry coupled to the activation circuitry and configured to generate a respective normalized value for each activation value. The normalization circuitry includes normalized register columns 604-610 which are equal in number to the number of columns in the activation circuitry or a systolic array.SELECTED DRAWING: Figure 6
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] background This specification relates to computing neural network guesses in hardware. [Background technology]

[0002] A neural network is a machine learning model that utilizes one or more layers to generate an output, e.g., a classification, for a received input. Some neural networks include one or more hidden layers in addition to an output layer. The output of each hidden layer is used as the input to the next layer in the network, i.e., the next hidden or output layer of the network. Each layer of the network generates an output from the received input according to the current values ​​of a respective set of parameters. Summary of the Invention [Means for solving the problem]

[0003] overview Generally, this specification describes special purpose hardware circuitry for computing neural network guesses.

[0004] In general, one innovative aspect of the subject matter described in this specification can be embodied in a circuit for performing neural network computations for a neural network having a plurality of layers, the circuit comprising: an activation circuit configured to receive a vector of accumulation values ​​and configured to apply a function to each accumulation value to generate a vector of activation values; and a normalization circuit coupled to the activation circuit and configured to generate a respective normalized value for each activation value.

[0005] Implementations may include one or more of the following features: The activation circuit receives the vector of accumulated values ​​from a systolic array in the circuit. The normalization circuit comprises a plurality of normalization register strings, each normalization register string comprising a plurality of normalization registers connected in series, each normalization register string configured to receive a respective activation value, and each normalization unit in the normalization register string configured to calculate a respective normalization value. Each normalization unit is configured to pass the respective activation value to an adjacent normalization unit. Each normalization unit is configured to receive a respective activation value, configured to generate a respective intermediate normalization value from the respective activation value, and configured to send the respective intermediate normalization value to one or more adjacent normalization units. Generating the respective intermediate normalization value comprises generating a square of the respective activation value. Each normalization unit is further configured to receive one or more intermediate normalization values ​​generated from the activation values ​​from one or more adjacent normalization units, to sum each intermediate normalization value to generate an index, to access one or more values ​​from a lookup table using the index, to generate a scaling factor from the one or more values ​​and the index, and to generate the respective normalization value from the scaling factor and the respective activation value. A pooling circuit is configured to receive the normalization values ​​and to pool the normalization values ​​to generate a pooled value. The pooling circuit is configured to store the normalization values ​​in a plurality of registers and a plurality of memory units, the plurality of registers and the plurality of memory units being connected in series, each register storing one normalization value, and each memory unit storing a plurality of a pool circuit configured to receive the activation values ​​and to pool the activation values ​​to generate a pooled value; the pool circuit configured to store the activation values ​​in a plurality of registers and a plurality of memory units, the plurality of registers and the plurality of memory units being connected in series, each register storing one normalization value and each memory unit storing multiple activation values; the pool circuit configured to shift a given activation value to a subsequent register or memory unit after every clock cycle, the pool circuit configured to generate the pooled value from the normalized value; the pool circuit configured to receive the activation values ​​and to pool the activation values ​​to generate a pooled value; the pool circuit configured to store the activation values ​​in a plurality of registers and a plurality of memory units, the plurality of registers and the plurality of memory units being connected in series, each register storing one normalization value and each memory unit storing multiple activation values; the pool circuit configured to shift a given activation value to a subsequent register or memory unit after every clock cycle, the pool circuit configured to generate the pooled value from the activation values.

[0006] Certain embodiments of the subject matter described herein can be implemented to achieve one or more of the following advantages: A plurality of activation values ​​for each neural network layer of a neural network can be calculated during a given clock cycle. Optionally, the processor can generate a plurality of normalized values ​​from the activation values ​​during another given clock cycle. Also, optionally, the processor can generate a pooled value from the normalized values ​​or the activation values. The processor can take a new cumulative sum at each clock cycle to generate an activation result, a normalized result, and a pooled result at each clock cycle, thereby pipeline the computation.

[0007] The present invention also provides a corresponding method for operating a neural network. The details of one or more embodiments of the subject matter herein are set forth in the accompanying drawings and the description below. Other features, aspects, and advantages of the subject matter will become apparent from the description, drawings, and claims. [Brief description of the drawings]

[0008] [Figure 1]FIG. 2 is a flow diagram of an exemplary method for performing computations for a given layer of a neural network. [Diagram 2] 1 illustrates an exemplary neural network processing system. [Diagram 3] 1 illustrates an exemplary architecture including a matrix computation unit. [Figure 4] 1 illustrates an exemplary architecture of a cell in a systolic array. [Diagram 5] 1 illustrates an exemplary architecture of a vector computation unit. [Figure 6] 1 illustrates an exemplary architecture of a normalization circuit. [Figure 7] 13 illustrates another exemplary architecture of a normalization circuit with sample activation values. [Figure 8] 1 illustrates an exemplary architecture of a normalization unit in a normalization circuit. [Figure 9] 1 illustrates an exemplary architecture of a pool circuit. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0009] Like reference numbers and designations in the various drawings indicate like elements. Detailed Description A neural network with multiple layers can be used to compute a guess. For example, given an input, the neural network can compute a guess for the input. The neural network computes this guess by processing the input through each layer of the neural network. In particular, the layers of the neural network are arranged in an order, with each layer having a respective set of weights. Each layer receives an input and processes the input according to the layer's set of weights to generate an output.

[0010] Thus, to compute a guess from a received input, the neural network takes that input and processes it through each of the neural network layers in that order. The neural network processes the neural network layers to generate guesses, and the output from one neural network layer is provided as an input to the next neural network layer. The data inputs to a neural network layer, such as the inputs to the neural network or the outputs to a neural network layer of a layer below the layer in the sequence, can be referred to as the activation inputs to that layer.

[0011] In some implementations, the layers of a neural network are arranged in a directed graph, i.e., any particular layer can receive multiple inputs, multiple outputs, or both. The layers of a neural network can also be arranged such that the output of a layer can be sent back as input to a previous layer.

[0012] Some neural networks normalize the output from one or more neural network layers to generate normalized values ​​that are used as inputs to subsequent neural network layers. Normalizing the output can help ensure that the normalized values ​​remain within the likely domain for the inputs of subsequent neural network layers, which can reduce errors in making guesses.

[0013] Some neural networks pool outputs from one or more neural network layers to generate a pooled value that is used as an input to a subsequent neural network layer. In some implementations, the neural network pools a group of outputs by determining the maximum or average value of the group of outputs and using the maximum or average value as the pooled output for the group. Pooling the outputs can maintain some spatial invariance, so that outputs arranged in various configurations can be processed to have the same guess value. Pooling the outputs can also reduce the dimensionality of the inputs received by subsequent neural network layers while maintaining the desired properties of the outputs before pooling, improving efficiency without significantly sacrificing the quality of the guesses generated by the neural network.

[0014] Described herein is a special purpose hardware circuit that optionally performs normalization, pooling, or both on the outputs of one or more neural network layers.

[0015] 1 is a flow diagram of an exemplary process 100 for performing computations for a given layer of a neural network using special purpose hardware circuitry. For convenience, method 100 is described in the context of a system having one or more circuits that perform method 100. Method 100 may be performed for each layer of a neural network to compute guesses from received inputs.

[0016] The system receives a plurality of sets of weight inputs for a given layer (step 102) and a plurality of sets of activation inputs for a given layer (step 104). The plurality of sets of weight inputs and the plurality of sets of activation inputs may be received from a dynamic memory and a unification buffer, respectively, of a special purpose hardware circuit. In some implementations, both the plurality of sets of weight inputs and the plurality of sets of activation inputs may be received from a unification buffer.

[0017] The system generates 106 accumulation values ​​from the weight inputs and activation inputs using a matrix multiplication unit of the special purpose hardware circuit. In some implementations, the accumulation values ​​are dot products of the sets of weight inputs and the sets of activation inputs. That is, for one set of weights that is a subset of all weights in the layer, the system may multiply each weight input by each activation input and sum the products to form an accumulation value. The system may then multiply the other sets of weights and the other sets of activation inputs by dot products. It is possible to calculate the dot product with

[0018] The system may generate layer outputs from the accumulated values ​​using a vector computation unit of the special purpose hardware circuit (step 108). In some implementations, the vector computation unit applies an activation function to the accumulated values, which is further described below with reference to FIG. 5. The layer outputs may be stored in a synthesis buffer for use as input to subsequent layers in the neural network, or may be used to generate guesses. The system finishes processing the neural network once it has processed the received inputs through each layer of the neural network to generate guesses for the received inputs.

[0019] 2 illustrates an exemplary special purpose integrated circuit 200 for performing neural network computations. The system 200 includes a host interface 202. The host interface 202 can receive instructions including parameters for the neural network computations. The parameters can include one or more of: how many layers to process, a corresponding set of weight inputs for each layer of the layers, an initial set of activation inputs, i.e., inputs to the neural network for computing guesses, corresponding input and output sizes of each layer, a stride value for the neural network computations, and a type of layer to process, e.g., a convolutional layer or a fully connected layer.

[0020] The host interface 202 can send instructions to the sequencer 206, which converts the instructions into low-level control signals that control the circuit to perform neural network calculations. In some implementations, the control signals regulate the data flow in the circuit, such as how the sets of weight inputs and the sets of activation inputs flow through the circuit. The sequencer 206 can send the control signals to the integration buffer 208, the matrix computation unit 212, and the vector computation unit 214. In some implementations, the sequencer 206 also sends control signals to the direct memory access engine 204 and the dynamic memory 210. In some implementations, the sequencer 206 is a processor that generates the control signals. The sequencer 206 can use the timing of the control signals to send the control signals to each component of the circuit 200 at the appropriate time. In some other implementations, the host interface 202 passes the control signals from an external processor.

[0021] The host interface 202 can send the multiple sets of weight inputs and the initial set of activation inputs to a direct memory access engine 204. The direct memory access engine 204 can store the multiple sets of activation inputs in a unified buffer 208. In some implementations, the direct memory access stores the multiple sets of weights in a dynamic memory 210, which can be a memory unit. In some implementations, the dynamic memory is located off the circuit.

[0022] The unified buffer 208 is a memory buffer. The unified buffer 208 can be used to store a set of active inputs from the direct memory access engine 204 and the output of the vector computation unit 214, which is described in more detail below with reference to Figure 5. The direct memory access engine 204 can also read the output of the vector computation unit 214 from the unified buffer 208.

[0023] The dynamic memory 210 and the integration buffer 208 can respectively send multiple sets of weight inputs and multiple sets of activation inputs to the matrix computation unit 212. In some implementations, the matrix computation unit 212 is a two-dimensional systolic array. The matrix computation unit 212 may be a one-dimensional systolic array or may be a multi-dimensional array of mathematical operations. , for example, other circuitry capable of performing multiplications and additions. In some implementations, the matrix calculation unit 212 is a general-purpose matrix processor.

[0024] The matrix computation unit 212 may process the weight inputs and activation inputs to provide a vector of outputs to the vector computation unit 214. In some implementations, the matrix computation unit sends the vector of outputs to the integration buffer 208, which sends the vector of outputs to the vector computation unit 214. The vector computation unit may process the vector of outputs and store the processed vector of outputs in the integration buffer 208. The processed vector of outputs may be used as activation inputs to the matrix computation unit 212, for example, for use in a subsequent layer in the neural network. The matrix computation unit 212 and the vector computation unit 214 are described in further detail below with reference to Figures 3 and 5, respectively.

[0025] 3 illustrates an example architecture 300 including a matrix computation unit. The matrix computation unit is a two-dimensional systolic array 306. The array 306 includes a plurality of cells 304. In some implementations, a first dimension 320 of the systolic array 306 corresponds to a column of cells and a second dimension 322 of the systolic array 306 corresponds to a row of cells. The systolic array may have more rows than columns, more columns than rows, or an equal number of columns and rows.

[0026] In the illustrated example, value loader 302 sends activation inputs to the rows of array 306 and weight fetcher interface 308 sends weight inputs to the columns of array 306. However, in some other implementations, activation inputs are sent to the columns of array 306 and weight inputs are sent to the rows of array 306.

[0027] Value loader 302 may receive activation inputs from a consolidation buffer, such as consolidation buffer 208 of FIG. 2. Each value loader may send a corresponding activation input to a respective left-most cell of array 306. For example, value loader 312 may send an activation input to cell 314. A value loader may also send an activation input to an adjacent value loader, such that the activation input is available to another left-most cell of array 306. This allows the activation input to be shifted for use by another particular cell of array 306.

[0028] The weight fetcher interface 308 may receive weight inputs from a memory unit, such as the dynamic memory 210 of Figure 2. The weight fetcher interface 308 may send corresponding weight inputs to individual top cells of the array 306. For example, the weight fetcher interface 308 may send weight inputs to cells 314 and 316.

[0029] 2 shifts activation inputs along one dimension across array 306, e.g., to the right, and shifts weight inputs along another dimension across array 306, e.g., to the bottom. For example, in one clock cycle, an activation input in cell 314 can be shifted into an activation register in cell 316 to the right of cell 314. Similarly, a weight input in cell 316 can be shifted into a weight register in cell 318 below cell 314.

[0030] At each clock cycle, each cell can process a given weight input, a given activation input, and the accumulated output from adjacent cells to generate an accumulated output. The accumulated output can also be passed to adjacent cells along the same dimension as the given weight input. This is further explained below with reference to FIG.

[0031] The accumulated outputs can be passed along the same columns as the weight inputs, e.g., toward the bottom of the columns in the array 306. In some implementations, the array 306 may include an accumulator unit 310 at the bottom of each column that stores and accumulates each accumulated output from each column when performing calculations on a layer with more activation inputs than rows. In some implementations, each accumulator unit stores multiple parallel accumulated values, which are further described below with reference to FIG. 6. The accumulator unit 310 can accumulate each accumulated output to generate a final accumulated value. The final accumulated value can be sent to a vector computation unit, e.g., vector computation unit 502 of FIG. 5. In some other implementations, the accumulator unit 310 passes the accumulated value to the vector computation unit without performing any accumulations when processing a layer with fewer activation inputs than rows.

[0032] FIG. 4 illustrates an example architecture 400 of a cell in a systolic array, such as systolic array 306 of FIG.

[0033] The cell may include an activation register 406 that stores activation inputs. The activation register may receive activation inputs from a left neighbor, i.e., a neighbor located to the left of a given cell, or from a unification buffer, depending on the location of the cell in the systolic array. The cell may include a weight register 402 that stores weight inputs. The weight inputs may be sent from an upper neighbor or from a weight fetcher interface, depending on the location of the cell in the systolic array. The cell may also include a sum register 404. The sum register 404 may store an accumulated value from an upper neighbor. A multiplication circuit 408 may be used to multiply the weight inputs from the weight register 402 with the activation inputs from the activation register 406. The multiplication circuit 408 may output the product to a summing circuit 410.

[0034] A summing circuit can sum the product with an accumulated value from sum register 404 to generate a new accumulated value. Summing circuit 410 can then send the new accumulated value to another sum register located in a lower adjacent cell. The new accumulated value can be used as an operand for the sum in the lower adjacent cell.

[0035] A cell can also shift its weight and activation inputs to adjacent cells for processing. For example, weight register 402 can send its weight input to another weight register in an adjacent cell below. Activation register 406 can send its activation input to another activation register in an adjacent cell to the right. Thus, both the weight and activation inputs can be reused by other cells in the array in subsequent clock cycles.

[0036] In some implementations, the cell also includes a control register. The control register can store a control signal that determines whether the cell should shift a weight input or an activation input to an adjacent cell. In some implementations, shifting the weight input or activation input takes one or more clock cycles. The control signal can also determine whether to send an activation input or a weight input to the multiplication circuit 408, or whether the multiplication circuit 408 operates on the activation input and the weight input. The control signal can also be passed to one or more adjacent cells, for example using wires.

[0037] In some implementations, the weights are pre-shifted into the weight path registers 412, which receive weight inputs, for example from upper adjacent cells, and control signals A weight input can be sent to weight register 402 based on the activation signal. Weight register 402 can statically store the weight input such that as the activation input is sent to the cell over multiple clock cycles, for example via activation register 406, the weight input remains within the cell and is not sent to an adjacent cell. Thus, a weight input can be applied to multiple activation inputs, for example using multiplication circuit 408, and the respective accumulated values ​​can be sent to adjacent cells.

[0038] 5 illustrates an example architecture 500 of a vector computation unit 502. The vector computation unit 502 may receive a vector of accumulated values ​​from a matrix computation unit, such as the matrix computation unit described with reference to FIG.

[0039] The vector computation unit 502 can process the vector of accumulated values ​​in the activation unit 404. In some implementations, the activation unit includes circuitry that applies a nonlinear function to each accumulated value to generate an activation value. For example, the nonlinear function can be tanh(x), where x is the accumulated value.

[0040] Optionally, the vector computation unit 502 may normalize the activation values ​​in a normalization circuit 506 that generates normalized values ​​from the activation values.

[0041] Also, optionally, the vector computation unit 502 may pool values ​​of either the activation values ​​or the normalized values ​​using a pooling circuit 508. The pooling circuit 508 may apply an aggregation function to one or more of the normalized values ​​to generate a pooled value. In some implementations, the aggregation function is a function that returns the maximum, minimum, or average value of the normalized values ​​or a subset of the normalized values.

[0042] The control signal 510 can be sent, for example, by the sequencer 206 of Figure 2, and can adjust how the vector computation unit 502 processes the vector of accumulated values. That is, the control signal 510 can adjust whether the activation values ​​are pooled, normalized, or pooled and normalized. The control signal 510 can also specify the activation function, normalization function, or pooling function, as well as other parameters for normalization and pooling, such as a stride value.

[0043] The vector computation unit 502 can send values, such as activation values, normalized values, or pooled values, to a consolidation buffer, such as the consolidation buffer 208 of FIG.

[0044] In some implementations, a pooling unit 508 receives the activation values ​​on behalf of the normalization circuit 506 and stores the pooled values ​​in the integration buffer. In some implementations, the pooling unit 508 sends the pooled values ​​to the normalization circuit 506, which generates the normalized values ​​that are stored in the integration buffer.

[0045] 6 illustrates an exemplary architecture 600 of a normalization circuit, e.g., normalization circuit 506 of FIG. 5. The normalization circuit may receive a vector of activation values ​​from an activation circuit 602, e.g., activation circuit 504 of FIG. 5, for each clock cycle. Depending on the value of a system parameter, the normalization circuit may either pass the vector of activation values ​​to a pooling circuit, i.e., not normalize the activation values, or generate a vector of normalized values ​​from the vector of activation values. For example, if a system parameter (e.g., provided by a user) instructs the circuit to pass the vector of activation values ​​to a pooling circuit, but if, e.g., the user does not want to normalize the values, the system parameter may be a signal to a multiplexer that passes the values ​​directly to the pooling circuit and skips the normalization circuit.

[0046] In some implementations, the vector of activation values ​​includes activation values ​​generated by applying an activation function to accumulated values ​​generated from activation inputs based on a set of weight inputs.

[0047] In some other implementations, the activation values ​​for a set of weight inputs are staggered across multiple vectors of activation values ​​due to delays incurred when shifting the activation and weight inputs. For example, the matrix computation unit may derive accumulated values ​​A0-A1 from a set of activation inputs and a set of weight inputs from kernel A. n A set of activation inputs from kernel B and a set of weight inputs can be used to generate cumulative values ​​B0 to B n The set of activation inputs from kernel C and the set of weight inputs can be used to generate cumulative values ​​C0 to C n It is possible to generate the cumulative values ​​A0 to A n and B0 to B ncan be generated in a subsequent clock cycle because, as described above with reference to FIG. 4, the weight inputs and activation inputs are shifted across the matrix computation unit before the corresponding accumulation values ​​are calculated. A0 can be generated in clock cycle 0, A1 and B0 can be generated in clock cycle 1, A2, B1 and C0 can be generated in clock cycle 2, and A n ,B n-1 and C n-2 can be generated at clock cycle n, and so on. The matrix computation unit can generate a vector of accumulated values ​​that includes A0 and B0 for clock cycle X, and another vector of accumulated values ​​that includes A1 and B1 for clock cycle X+1. Thus, the accumulated values ​​of a given kernel, e.g. A0 to A1 from kernel A, can be n can be distributed in a staggered manner across multiple vectors of accumulated values ​​in subsequent clock cycles.

[0048] As a result, the multiple vectors of accumulation values ​​can become multiple vectors of activation values, for example after processing by activation circuit 504 of FIG. 5, and each of the multiple vectors of activation values ​​can be sent to a separate string of normalization registers. In particular, activation circuit 602 can send each activation value from the vector of activation values ​​to a separate string of normalization registers 604-610. In particular, each of normalization registers 616-622 can receive a respective activation value. The string of normalization registers can include a set of normalization registers connected in series. That is, the output of a first normalization register in the string can be sent as an input of a second normalization register in the string. In some implementations, each normalization register stores an activation value. In some other implementations, each normalization register also stores the square of the activation value. In some implementations, the normalization circuit has as many strings of normalization registers as there are columns in the activation circuit or systolic array.

[0049] In some implementations, before providing the vector of activation values ​​to the normalization register string, the circuit sends the vector to a squaring unit. The squaring unit can compute the square of each activation value for use in calculating the normalization values, as described further below. The squaring unit can generate a vector of squared activation values, one for each vector of activation values, and send the vector of squared activation values ​​to the normalization register string. In some other implementations, the squaring unit sends both the vector of activation values ​​and the vector of squared activation values ​​to the normalization register string.

[0050] In some implementations, the normalization circuit forms the staggered groups, such as staggered groups 624 and 628, based on a normalization radius parameter. The normalization radius parameter determines the surrounding normalization registers to be used in calculating the normalization values. The number of outputs may be equal to two times the normalization radius parameter. By way of example, staggered groups 624 and 628 are formed from a normalization radius parameter of 1. Staggered group 624 is formed from a normalization radius parameter of 1. Register 632 and 618, as well as a zero register 636. Zero register 636 may always output a value of 0 and may act as a buffer in calculating the normalization value at the edge of the normalization circuit. Zero registers 635 and 638 may be included in string of zero registers 612. An example of values ​​in staggered groups is further described below with reference to FIG.

[0051] In some implementations, a normalization unit, e.g., normalization units 626, 630, uses the outputs from the staggered groups to generate the squares of the activation values ​​in the corresponding components, e.g., registers of the staggered groups, that are used to calculate the normalization value. For example, the components may be used to generate a sum of the squares of all the activation values. The normalization unit may use the sum of squares to calculate the normalization value, as described further below. In some implementations, there is a corresponding normalization unit for each staggered group.

[0052] The normalization circuit can generate a normalization value for the activation value based on the staggered group. For example, the normalization value for the activation value stored in the normalization register 632 can be stored in the normalization unit 626. In particular, based on the staggered group 624, the normalization circuit can calculate a sum of all squares generated by the normalization registers in the staggered group 624, for example using a summation circuit. The sum can be stored in the normalization unit 626. The sum can be a normalization value corresponding to the activation value. The normalization circuit can continue to generate another corresponding normalization value for the staggered group 628 including the normalization registers 634, 640 and the zero register 620, and the corresponding normalization value can be stored in the normalization unit 630.

[0053] The normalization circuit can form a vector of normalization values ​​from the generated normalization values, which can be stored in a normalization unit, for example, and can send the vector of normalization values ​​to a pooling circuit if specified by the neural network parameters, or can send it to a consolidation buffer.

[0054] 7 illustrates another exemplary architecture 700 of a normalization circuit with sample activation values ​​in normalization registers. As shown in staggered groups 724 and 728, the normalization radius parameter may be one. In particular, staggered group 724 includes normalization registers 732 and 718 and a zero register 736. Staggered group 728 includes a zero register 738 and normalization registers 734 and 740.

[0055] Normalization registers 716-720, 732, 734, and 740 may store activation values ​​corresponding to columns, for example, from a systolic array. The notation AX,Y in normalization register 740, for example A0,0, indicates the activation value corresponding to column X at clock cycle Y.

[0056] As shown in the figure, the activation values ​​are loaded in a staggered manner. For example, in clock cycle 0, activation values ​​A0,0, A1,0, and A2,0 may be calculated, but the normalization circuit loads three activation values ​​over three clock cycles. In some implementations, the activation values ​​are loaded in a non-staggered manner. That is, A0,0, A1,0, and A2,0 may be loaded in one clock cycle.

[0057] N0 may be a normalization value for A0,1 stored in normalization register 726. N0 may be calculated based on the sum of the squares of A0,1 and A1,1 and 0 (from zero register 736), as described below with reference to FIG. 8. Similarly, N1 may be a normalization value for A0,0, calculated based on the sum of the squares of A0,0 and A1,0 and A2,0 (from register 720). , 0 may be the normalization value for

[0058] The normalization circuit can calculate a normalization value for each activation value using a radius of 1. Other radii are possible. If the normalization circuit has not yet loaded the activation value required for the normalization calculation, the normalization circuit can shift the activation value to a subsequent normalization register until the required activation value is loaded. For example, to calculate a normalization value for activation value A0,2 stored in normalization register 716, activation value A1,2 is needed in view of a radius of 1. On a subsequent clock cycle, activation value A1,2 can be loaded into normalization register 718, at which point the normalization circuit can calculate a normalization value for activation value A0,2.

[0059] 8 illustrates an example architecture 800 of a normalization unit in a normalization circuit. The normalization unit may receive an activation value 802. In some implementations, the activation value 802 is passed to a subsequent normalization unit via a multiplexer 814, for example, if the circuit determines that the activation value 802 is in the wrong position, i.e., the activation value needs to be stored in a subsequent normalization unit for normalization calculations. The normalization circuit may send a control signal to the multiplexer 814 to pass a particular output, for example, either the normalized value or the unaffected activation value.

[0060] In some implementations, the activation values ​​are passed to a squaring circuit 804. The squaring circuit 804 can generate squared activation values ​​808, i.e., raise the activation values ​​to a power of 2. The squaring circuit 804 can send the squared activation values ​​808 to adjacent normalization units, e.g., other normalization units in the same staggered group of normalization units.

[0061] In some implementations, as described above with reference to FIG. 6, the received activation values ​​are already squared before being provided to the normalization register string.

[0062] The normalization units may also receive squared activation values ​​810 from adjacent normalization units at a summation circuit 806. The summation circuit 806 may generate a sum of the squared activation values ​​808 and the received squared activation values ​​810.

[0063] The sum may be sent to a memory unit 812. In some implementations, the memory unit 812 includes a lookup table and an interpolation unit. The normalization unit may use a portion of the sum, for example a set of high bits of the sum, as an address to look up one or more coefficients provided by the system parameters. The memory and interpolation unit 812 may generate a normalization scaling factor based on the coefficients and the sum of the squared activation values. The normalization scaling factor may be sent to a multiplication unit 816.

[0064] In some implementations, the sum of squares is a 12-bit value. The normalization unit can use the most significant 4 bits of the sum of squares as an index into a lookup table. The most significant 4 bits can be used to access a coefficient from the lookup table, for example, specified by a user. In some implementations, the most significant 4 bits access two 12-bit coefficients: A and B. The least significant 8 bits can be a delta used in a formula to calculate the normalized scaling factor. An example formula is ScalingFactor=minimum(1048575, [A * delta + B * 256 + 2^7]) >> 8, where minimum processes two arguments and returns the argument with the minimum value.

[0065] The normalization unit uses a multiplication unit 816 to calculate a normalization scaling factor and an active 5. The normalized value may be multiplied by the normalization value 802 to generate a normalized value. In some implementations, the normalized value is then sent to a pooling circuit, such as pooling circuit 508 of FIG.

[0066] FIG. 9 illustrates an exemplary architecture 900 of a pooling circuit. The pooling circuit may apply an aggregation function to one or more normalization or activation values ​​to generate a pooled value. By way of example, the architecture 900 may perform pooling of a 4×4 set of activation or normalization values. The pool shown in FIG. 9 has a square region, i.e., 4×4, but rectangular regions are also possible. For example, if the region has a window of n×m, the architecture 900 may have n*m ​​registers, i.e., n columns and m rows.

[0067] The pooling circuit can receive a sequence of elements from a vector of normalization values, such as from the normalization circuit 506 of FIG. 5. For example, the sequence can represent pixels of an 8×8 portion of an image, and the pooling circuit architecture 900 can pool values ​​from a 4×4 subset of the 8×8 portion. In some implementations, the normalization values ​​are added to the sequence as they are calculated by a normalization circuit coupled to the pooling circuit. In some implementations, the neural network processor includes multiple parallel pooling circuits. Over each clock cycle, each pooling circuit can receive a respective element from the vector of normalization values ​​from the normalization circuit. Each pooling circuit can interpret the elements received from the normalization circuit as a two-dimensional image arriving in raster order.

[0068] The pooling circuit may include a series of registers and a memory unit. Each register may send an output to an aggregation circuit 906 that applies an aggregation function across the values ​​stored in the register. The aggregation function may return a minimum, maximum, or average value from a set of values.

[0069] The first normalized value can be sent to and stored in the register 902. On a subsequent clock cycle, the first normalized value can be shifted to a subsequent register 908 and stored in the memory 904, and the second normalized value can be sent to and stored in the register 902.

[0070] After four clock cycles, the four normalization values ​​are stored in the first four registers 902, 908-912. In some implementations, the memory unit 904 operates under first-in-first-out (FIFO) basis. Each memory unit can store up to eight normalization values. After the memory unit 904 accommodates a complete pixel column, it can send the normalization value to the register 914.

[0071] At any given time, the aggregation circuit 906 can access the normalized values ​​from each register. The normalized values ​​in the registers should represent the normalized values ​​of a 4×4 portion of the image.

[0072] The pooling circuit can generate a pooled value from the normalized values, e.g., the maximum normalized value, the minimum normalized value, or the average normalized value, accessed using the aggregation circuit 906. The pooled value can be sent to a consolidation buffer, e.g., the consolidation buffer 208 of FIG.

[0073] After generating the first pooled value, the pool circuit can continue to generate pooled values ​​by shifting the normalized values ​​through each register so that new normalized values ​​can be stored in the registers and pooled by the aggregation circuit 906. For example, in the architecture 900, the pool circuit can shift the normalized values ​​over four or more clock cycles, thereby shifting the normalized values ​​in the memory unit into the registers. In some implementations, the pooling circuit shifts the new normalization value until the new normalization value is stored in the last top register, such as register 916.

[0074] The aggregation circuit 906 may then pool the new normalized values ​​stored in the register.

[0075] In some implementations, instead of receiving a vector of normalization values, the pooling circuit receives a vector of activation values ​​as described above with reference to FIG.

[0076] The subject matter and functional operations described herein may be implemented in digital electronic circuitry, in tangibly embodied computer software or firmware, in computer hardware including the structures disclosed herein and their structural equivalents, or in any combination of one or more of them. The subject matter described herein may be implemented as one or more computer programs, i.e., as one or more modules of computer program instructions encoded on a tangible, non-transitory program carrier for execution by or control of the operation of a data processing apparatus. Alternatively or additionally, the program instructions may be encoded in an artificially generated propagated signal, such as a machine-generated electrical, optical or electromagnetic signal, which is generated to encode information and transmit it to a suitable receiver device for execution by the data processing apparatus. The computer storage medium may be a machine-readable storage device, a machine-readable storage substrate, a random or serial access memory device, or a combination of one or more of them.

[0077] The term "data processing apparatus" encompasses all kinds of apparatus, devices and machines for processing data, including, by way of example, a programmable processor, a computer, or multiple processors or computers. The apparatus may include special purpose logic circuitry, such as an FPGA (field programmable gate array) or an ASIC (application specific integrated circuit). In addition to hardware, the apparatus may also include code that creates an execution environment for a subject computer program, such as code that constitutes a processor firmware, a protocol stack, a database management system, an operating system, or a combination of one or more of these.

[0078] A computer program (which may be referred to or described as a program, software, software application, module, software module, script, or code) may be written in any form of programming language, including compiled or interpreted languages, or declarative or procedural languages, and may be deployed in any form including a stand-alone program or a module, component, subroutine, or other unit suitable for use in a computing environment. A computer program may correspond to a file in a file system, but this is not required. A program may be stored as part of a file that holds other programs or data, e.g. one or more scripts stored in a markup language document, in a single file dedicated to the program in question, or in multiple cooperating files, e.g. files that store one or more modules, subprograms, or code portions. A computer program may be deployed to run on one computer or on multiple computers that are located at one site or distributed across multiple sites and interconnected by a communication network.

[0079] The processes and logic flows described herein may be implemented using one or more programmable The processes and logic flows may be performed by, and an apparatus may be implemented as, special purpose logic circuitry, such as an FPGA (field programmable gate array) or an ASIC (application specific integrated circuit), and the processes and logic flows may be performed by, and an apparatus may be implemented as, special purpose logic circuitry, such as an FPGA or an ASIC.

[0080] A computer suitable for executing a computer program may be based, by way of example, on a general purpose or special purpose microprocessor, or both, or on other types of central processing units. Typically, the central processing unit receives instructions and data from a read-only memory or a random access memory, or both. The essential elements of a computer are a central processing unit for implementing or executing instructions, and one or more memory devices for storing instructions and data. Typically, a computer also includes one or more mass storage devices, such as magnetic disks, magneto-optical disks, or optical disks, for storing data, or is operatively coupled to receive data from, transmit data to, or transmit data to, the one or more mass storage devices. However, a computer need not have such devices. Additionally, a computer may be integrated into another device, such as a mobile phone, a personal digital assistant (PDA), a mobile audio or video player, a game console, a Global Positioning System (GPS), to name a few. The address may be implemented in a GPS (Global Positioning System) receiver, or may be implemented in a portable storage device, such as a universal serial bus (USB) flash drive.

[0081] Computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media and memory devices, including, by way of example, semiconductor memory devices, such as EPROM, EEPROM and flash memory devices; magnetic disks, such as internal hard disks or removable disks; magneto-optical disks; and CD ROM and DVD-ROM disks. The processor and the memory may be supplemented by, or incorporated in, special purpose logic circuitry.

[0082] To solicit user interaction, embodiments of the subject matter described herein may be implemented in a computer having a display device, such as a CRT (cathode ray tube) or LCD (liquid crystal display) monitor, for displaying information to the user, and a keyboard and pointing device, such as a mouse or trackball, by which the user can send input to the computer. Other types of devices may also be used to solicit user interaction. For example, feedback provided to the user may be any form of sensory feedback, such as visual feedback, auditory feedback, or tactile feedback, and input from the user may be received in any form, including acoustic input, speech input, or tactile input. The computer may also interact with the user by sending documents to and receiving documents from a device used by the user, for example by sending a web page to a web browser on the user's client device in response to a request received from the web browser.

[0083] An embodiment of the subject matter described herein may be implemented in a computing system that includes a back-end component, e.g., a data server, or may be implemented in a computing system that includes a middleware component, e.g., an application server, or may be implemented in a front-end component, e.g., a user interface component, such as a network interface. The system may be implemented in a computing system including a client computer having a graphical user interface or web browser capable of interacting with the back-end, middleware, or front-end components, or in a computing system including any combination of one or more of such back-end, middleware, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication, such as a communication network. Examples of communication networks include local area networks (LANs) and wide area networks (WANs), such as the Internet.

[0084] A computing system may include clients and servers. Clients and servers are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.

[0085] Although the specification contains many specific implementation details, these should not be construed as limiting the scope of the invention or what may be claimed, but rather as describing features that may be specific to particular embodiments of a particular invention. Certain features described in this specification in the context of separate embodiments may also be implemented in a single embodiment in combination. Conversely, various features described in the context of a single embodiment may also be implemented in multiple embodiments separately or in any suitable subcombination. Furthermore, although features may be described above as operating in a particular combination, and may even be initially claimed as such, one or more features from a claimed combination may in some cases be deleted from the combination, and the claimed combination may be directed to a subcombination or a variation of the subcombination.

[0086] Similarly, although operations are shown in the figures in a particular order, this should not be understood as requiring such operations to be performed in the particular order shown or in a sequential order to achieve desirable results, or as requiring all of the shown operations to be performed. In certain circumstances, multitasking and parallel processing may be advantageous. Furthermore, the separation of various system modules and components in the above embodiments should not be understood as requiring such separation in all embodiments, and it should be understood that the program components and systems described may generally be implemented in a single software product or packaged in multiple software products.

[0087] Specific embodiments of the subject matter have been described. Other embodiments are within the scope of the following claims. For example, the actions recited in the claims may be performed in a different order and still achieve desirable results. As an example, the processes depicted in the accompanying figures do not necessarily require the particular order depicted, or sequential order, to achieve desirable results. In certain implementations, multitasking and parallel processing may be advantageous.

Claims

1. A vector computation unit for performing neural network computations, comprising: an activation circuit, the activation circuit comprising: It takes in a vector of accumulated values, receiving one or more control signals specifying an activation function; configured to apply the activation function to the accumulated values ​​to generate a vector of activation values; The vector calculation unit further comprises: A pool circuit, the pool circuit comprising: receiving the activation value; receiving the one or more control signals specifying a Pooling function; A vector computation unit configured to apply the Boolean function to the activation values ​​to generate Boolean values.

2. The vector calculation unit of claim 1, wherein the one or more control signals are provided by a sequencer.

3. A vector calculation unit as described in claim 1 or 2, wherein the cumulative value corresponds to the product of a matrix multiplication between a layer of the neural network and a parameter matrix of the layer.

4. The signal processing circuit further includes a normalization circuit, receiving the activation value; receiving the one or more control signals specifying a normalization function; A vector computation unit according to any one of claims 1 to 3, configured to apply the normalisation function to the activation values ​​to generate a respective normalised value for each activation value.

5. The pool circuit further comprises: receiving the normalized value; The vector computation unit of claim 4 , configured to apply the Boolean function to the normalized value to generate the Boolean value.

6. A vector calculation unit as described in any one of claims 1 to 5, wherein the pool value includes at least one of a maximum, minimum or average value of the activation values, or a maximum, minimum or average value of a subset of the activation values.

7. The vector computation unit of claim 1, wherein the pooling circuit includes a plurality of parallel pooling circuits, each pooling circuit configured to receive a subset of the activation values ​​and generate a respective pooled value.

8. A vector calculation unit as claimed in any one of claims 1 to 7, further comprising a plurality of registers and a plurality of memory units configured to store the activation values.

9. A method for performing neural network computations, comprising: an activation circuit receiving a vector of accumulation values ​​and one or more control signals specifying an activation function; said activation circuit applying said activation function to said accumulated values ​​to generate a vector of activation values; a pooling circuit receiving the activation values ​​and the one or more control signals specifying a pooling function; and the pooling circuit applying the pooling function to the activation values ​​to generate pooled values.

10. The method of claim 9, wherein the one or more control signals are provided by a sequencer.

11. The method of claim 9 or 10, wherein the cumulative value corresponds to the product of a matrix multiplication between a layer of the neural network and a parameter matrix of the layer.

12. A method comprising: a normalization circuit receiving the activation values ​​and the one or more control signals specifying a normalization function; The method of any one of claims 9 to 11, further comprising: the normalization circuit applying the normalization function to the activation values ​​to generate a respective normalized value for each activation value.

13. The method of claim 12, further comprising the steps of: receiving said normalized value by said pooling circuit; 13. The method of claim 12, further comprising the step of: said pooling circuit applying said pooling function to said normalized value to generate said pooled value.

14. A method according to any one of claims 9 to 13, wherein the pooled value comprises at least one of the maximum, minimum or average of the activation values, or the maximum, minimum or average of a subset of the activation values.

15. A method according to any one of claims 9 to 14, wherein the pooling circuit comprises a plurality of parallel pooling circuits, each pooling circuit configured to receive a subset of the activation values ​​and generate a respective pooled value.

16. The method of claim 9, further comprising storing the activation value in a plurality of registers and a plurality of memory units.

17. A program that causes a processor to execute a method according to any one of claims 9 to 16.

Citation Information

Patent Citations

  • Neural network signal processor

    JP1990170263A

  • Method and apparatus for signal classification using multi-layer networks

    JP2002519720A

  • Learning device, learning program, and learning method

    JP2015095215A