Low latency matrix multiplication component
By employing a systolic array connection and a dual-weight shift chain structure in the matrix multiplication unit, the problem of matrix multiplication time extension is solved, and efficient neural network computation is achieved.
Patent Information
- Application Number
- CN202310556021.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2017-05-17
- Filing Date
- 2018-05-17
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2038-05-17
AI Technical Summary
In existing technologies, the matrix multiplication component has a long latency, which affects the efficiency of neural network computation.
The matrix multiplication unit, which uses a pulsating array connection, improves the weight loading rate and enables rapid transfer of weight values by setting two weight shift register chains and vertical and horizontal weight shift chains in each column.
This reduces the latency of the matrix multiplication component and improves the efficiency of neural network computation.
Smart Images

Figure CN116661732B_ABST
Abstract
Description
[0001] Case Analysis
[0002] This application is a divisional application of Chinese Invention Patent Application No. 201880004576.1, filed on May 17, 2018. Technical Field
[0003] This application relates to a low-latency matrix multiplication component. Background Technology
[0004] This specification relates to performing neural network calculations using hardware.
[0005] A neural network is a machine learning model that uses one or more layers to generate outputs, such as classifications, from received inputs. In addition to the output layer, some neural networks also include one or more hidden layers. The output of each hidden layer serves as the input to the next layer in the network—either the next hidden layer or the output layer. Each layer of the network generates its output from the received input based on the current values of its corresponding set of parameters. Summary of the Invention
[0006] This specification describes techniques involving dedicated hardware circuitry for training neural networks, computing neural network inference, or both, and specifically relates to dedicated hardware circuitry for reducing latency on a matrix multiplication unit by increasing the rate at which weight values are loaded into a weight matrix register within the matrix multiplication unit.
[0007] Spurious arrays are connected to perform matrix multiplication and typically have a uniform structure throughout the array. The matrix multiplication unit of a spurious array consists of multiply-add sub-units, each of which takes an input operand, multiplies the operand by stored weights to obtain a result, and adds the result to a partial sum to produce a new partial sum.
[0008] One way to reduce latency is to increase the rate at which weights are loaded into the multiply-accumulate unit.
[0009] Generally speaking, an innovative aspect of the subject matter described in this specification may be embodied in dedicated hardware circuitry for training neural networks, computing neural network inference, or both.
[0010] Other embodiments of this aspect include corresponding computer systems, devices, and computer programs recorded on one or more computer storage devices, each configured to perform the actions of a method. For a system of one or more computers to be configured to perform a specific operation or action, this means that the system has software, firmware, hardware, or a combination thereof installed thereon that causes the system to perform the operation or action at runtime. For one or more computer programs to be configured to perform a specific operation or action, this means that one or more computer programs include instructions that, when executed by a data processing device, cause the device to perform the operation or action.
[0011] The above and other embodiments may optionally include one or more of the following features, either individually or in combination. Specifically, one embodiment may combine all of the following features.
[0012] The matrix multiplication unit can be implemented as a systolic cell array. Each cell in the cell array may include: a weight matrix register configured to receive weight inputs from a transposed or non-transposed weight shift register; a transposed weight shift register configured to receive weight inputs from the horizontal direction to be stored in the weight matrix register; a non-transposed weight shift register configured to receive weight inputs from the vertical direction to be stored in the weight matrix register; and a multiplication unit coupled to the weight matrix register and configured to multiply the weight inputs of the weight matrix register with the vector data inputs to obtain a multiplication result. Each cell may include a multiplexer configured to select between weight inputs from the transposed and non-transposed weight shift registers and forward the selected weight inputs to the weight matrix register.
[0013] The matrix multiplication unit may include a first weight holding register configured to hold weight values from either a transposed weight shift register or a non-transposed weight shift register.
[0014] The matrix multiplication unit may include a second weight holding register configured to hold weight values from either a transposed weight shift register or a non-transposed weight shift register.
[0015] The weight values can be loaded into the matrix multiplication unit from the transposed weight shift register in the horizontal direction to the first weight holding register and from the non-transposed weight shift register in the vertical direction to the second weight holding register.
[0016] The weight matrix register is loaded with values from either the first weight holding register or the second weight holding register.
[0017] In another embodiment, the matrix multiplication component implemented as a systolic array may include: a plurality of cells arranged as columns of the systolic array; two weight shift register chains for each column of the systolic array; a weight matrix register for each cell configured to store weight inputs received from the weight shift registers; and a multiplication component coupled to the weight shift registers and configured to multiply the weight inputs of the weight matrix registers by a vector data input to obtain a multiplication result. Each weight shift register is connected to only one chain and each cell is connected to only one weight shift register.
[0018] Weight values can be sent from a vector register containing weight value pairs to two weight shift register chains.
[0019] When two weight values are unavailable from the vector register, the holding register at the top of each column can hold the weight values.
[0020] When two weight values are available, the two weight values are shifted into the weight shift register in the cell during the clock cycle.
[0021] When both weight values are unavailable, in the first clock cycle when the first weight value is available, the holding register is loaded with the first weight value as the holding value, and no shift is performed. In the next clock cycle, when the second weight value is available, the second weight value and the holding value are shifted through two shift chains. One value is shifted to the weight shift register connected to each shift chain.
[0022] Each shift chain can have two injection points for injecting weight values, one at the top of the column and the other at the second point in the column. The vector register can contain a set of four 8-bit integers, each representing a separate weight value. Two of the four integers can be injected at the top of the column, and the other two can be injected at the second point in the array.
[0023] The subject matter described in this specification can be implemented in specific embodiments to achieve one or more of the following advantages. A matrix multiplication unit with two weight shift register chains per column of a pulsating array can transfer weights from the vector register to the matrix multiplication unit at twice the rate of a matrix multiplication unit with only one weight shift register chain. Furthermore, a matrix multiplication unit with two weight shift register chains per column that sends weight values to two points in the array, namely the top and middle points of the array, can transfer weights from the vector register to the matrix multiplication unit at four times the rate of a matrix multiplication unit with only one weight shift register chain.
[0024] Alternatively, the matrix multiplication unit may have units containing both a non-transposed weight shift register and a transposed weight shift register. The matrix multiplication unit can then use separate registers for the vertical and horizontal weight shift chains, resulting in the matrix multiplication unit being able to load weight values at twice the rate of a matrix multiplication unit without separate registers for two weight shift chains.
[0025] These weight shift loading methods can be combined to achieve an 8x increase in load time from a matrix multiplication unit that does not have two weight shift register chains per column and separate registers for vertical and horizontal weight shift chains. These weight shift chains and / or separate registers can be added to the matrix multiplication unit without significantly increasing its complexity or footprint.
[0026] Details of one or more embodiments of the subject matter of this specification are set forth in the accompanying drawings and the following description. Other features, aspects, and advantages of the subject matter will become apparent from the specification, the accompanying drawings, and the claims. Attached Figure Description
[0027] Figure 1A A high-level diagram of an example dedicated hardware chip used for training a neural network is shown.
[0028] Figure 1B A high-level example of the computing core is shown.
[0029] Figure 1C An example neural network processing system is shown.
[0030] Figure 2 The diagram illustrates an example core architecture that includes matrix multiplication units. Each matrix multiplication unit is a two-dimensional systolic array.
[0031] Figure 3 The illustration shows an example architecture of multiple cells within a pulsating array.
[0032] Figure 4 An example of the architecture of a matrix multiplication unit with two weight shift register chains per column is shown to improve the rate of loading weight values.
[0033] Figure 5 This is a flowchart of an example method for loading weight values into a given multi-cell column.
[0034] Figure 6 An example of an architecture for a matrix multiplication unit with two weight shift register chains per column is shown, which sends weight values at two points in the column to improve the rate of loading weight values.
[0035] Figure 7An example of the architecture of a matrix multiplication unit with separate registers for horizontal and vertical weight shifting to improve the rate of loading weight values is shown.
[0036] Figure 8 An example cell is shown, which has a set of holding registers for increasing the rate of loading weight values.
[0037] Similar reference numerals and labels are used to indicate similar elements in the various figures. Detailed Implementation
[0038] A neural network with multiple layers can be trained and then used for computational inference. For example, a neural network has parameters, each initialized with a value. During training, the neural network performs a neural network training process to adjust the values of its parameters, for example, using backpropagation to determine the trained values of the parameters from their initial values. The trained neural network can then be used to compute inference, that is, to process the input through the layers of the neural network to generate the neural network's output.
[0039] For example, taking into account the input, a neural network can compute inference about the input. The neural network computes this inference by processing the input through each layer of the network. In some implementations, the layers of the neural network are arranged in a sequence.
[0040] Therefore, in order to compute inference from the received input, the neural network receives the input and processes it through each layer in the sequence of neural network layers to generate inference, where the output from one neural network layer is provided as input to the next neural network layer. Data inputs to a neural network layer, such as the input to the neural network itself or the output of the layer below it in the sequence, can be referred to as activation inputs to the layer.
[0041] In some implementations, the layers of a neural network are arranged as a directed graph. That is, 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 the layer above it.
[0042] Figure 1A A high-level diagram of an example dedicated hardware chip for training a neural network is shown. As shown, a single dedicated hardware chip includes two independent processors, such as 102a and 102b. Each processor 102a and 102b contains two distinct cores: (1) a computational core, namely, a Very Long Instruction Word (VLIW) machine (103a and 103b) and (2) a sparse computational core, namely, an embedding layer accelerator (105a and 105b).
[0043] Each computational core, such as the 103a and 103b, is optimized for dense linear algebra problems. Each computational core is controlled by a single Very Long Instruction Word (VLWORD). Each computational core executes its own stream of VLWORD instructions.
[0044] Example sparse computation cores, such as 105a or 105b, map very sparse high-dimensional data to dense low-dimensional data, allowing the remaining layers in the layer to process the densely packed input data. For example, a sparse computation core can perform computations on any embedded layer in a neural network being trained.
[0045] To perform this sparse-to-dense mapping, the sparse computing core uses a pre-built lookup table, an embedding table. For example, when a series of query terms are given as user input, each query term is converted into a hash identifier or a one-hot encoded vector. Using the identifier as a table index, the embedding table returns the corresponding dense vector, which can be the input activation vector for the next layer. The sparse computing core can also perform simplification operations on the search query terms to create a dense activation vector. The sparse computing core works together to perform efficient sparse distributed lookups because embedding tables can be large and unsuitable for the limited high-bandwidth memory of a dedicated hardware chip. Further details about the functionality of the sparse computing core can be found in U.S. Patent Application No. 15 / 016,486, filed February 5, 2016, entitled “MATRIX PROCESSING APPARATUS”.
[0046] Figure 1B A high-level example of a computing core (101) is shown. The computing core may be a machine that controls multiple computing units in parallel, i.e., a VLIW machine. Each computing core (101) includes: a scalar memory (104), a vector memory (108), a scalar processing unit (107), a vector register (106), and extended vector units (i.e., a rectangular multiplication unit (MXU) (113), a transpose unit (XU) (114), and a reduction and permutation unit (RPU) (116)).
[0047] The example scalar processor performs a VLIW instruction fetch / execution loop and controls the computational core. After fetching and decoding the instruction bundle, the scalar processor itself executes the instructions found in the scalar slots of the bundle using only the multiple multi-bit registers of the scalar processor (107) and scalar memory (104), i.e., 32 32-bit registers. The scalar instruction set includes normal arithmetic operations, such as those used in address calculation, load / store instructions, and branch instructions. The remaining instruction slots encode instructions for the vector processing unit or other extended vector units (113, 114, 116). Decoded vector instructions are forwarded to the vector processing unit.
[0048] Along with vector instructions, the scalar processor (107) can forward the values of up to three scalar registers to other processors and components to perform operations. The scalar processor can also retrieve computation results directly from the vector processor. However, in some implementations, the example chip has a low-bandwidth communication path from the vector processor to the scalar processor.
[0049] The vector instruction scheduler is located between the scalar processor and the vector processor. This scheduler receives decoded instructions from the non-scalar VLIW slot and broadcasts those instructions to the vector processing unit. About Figure 1C Describe the vector processing component in detail.
[0050] An example scalar processor (107) accesses a small, fast, dedicated scalar memory (104), which is supported by a larger but slower high-bandwidth memory (HBM) (110). Similarly, an example vector processing unit accesses a small, fast, dedicated vector memory (108), which is also supported by HBM (110). Word-level accesses occur between the scalar processor (107) and the scalar memory (104) or between the vector processing unit and the vector memory (108). The granularity of loading and storing between the vector processor and the vector memory is a vector of 128 32-bit words. Direct memory accesses occur between the scalar memory (104) and the HBM (110) and between the vector memory (108) and the HBM (110). In some embodiments, memory transfers from the HBM (110) to the processing unit (107) can only be performed via either the scalar or vector memory. Alternatively, there may be no direct memory transfers between the scalar and vector memories.
[0051] Instructions can specify operations for extended vector units. Along with each instruction executing a vector unit, there exists a two-dimensional, 128×8 vector unit. Each vector unit can send a register value to the extended vector unit as an input operand. Each extended vector unit takes its input operand, performs the corresponding operation, and returns the result to the vector processor (306). The following is about... Figure 4 Describe the extended vector component.
[0052] Figure 1C An example application-specific integrated circuit 100 for performing neural network computations is shown. As shown, the chip includes two computational cores (103a, 103b) and two sparse computational cores (152a, 152b).
[0053] The chip has a shared area that includes a host interface to the host (150), four high-bandwidth memory stacks (156a to 156d) along the bottom, and an inter-chip interconnect (148) connecting the interface and the memory, as well as data from other chips. Two high-bandwidth memory stacks (156a-b, 156c-d) are associated with each computing core (103a, 103b).
[0054] The chip stores data in high-bandwidth memory (156c-d), reads data into and out of vector memory (108), and processes the data. The computing core (103b) itself includes vector memory (108) as on-chip S-RAM divided into two dimensions. The vector memory has an address space in which addresses are stored as floating-point numbers, i.e., 128 numbers of 32 bits each. The computing core (103b) also includes a computation unit for calculating values and a scalar unit for controlling the computation unit.
[0055] The vector processing unit consists of a 2D array of vector processing units, i.e., 128×8, all of which execute the same instructions in Single Instruction Multiple Data (SIMD) mode. The vector processor has channels and sub-channels, i.e., 128 channels and 8 sub-channels. Within a channel, vector units communicate with each other by loading and storing instructions. Each vector unit can access a 4-byte value simultaneously. Vector units not belonging to the same channel cannot communicate directly. These vector units must use the simplification / permutation unit described below.
[0056] The computation unit includes 32 vector registers within a vector processing unit (106) that can be used for floating-point and integer operations. The computation unit includes two arithmetic logic units (ALUs) (126c-d) for performing computations. One ALU (126c) performs floating-point addition, and the other ALU (126d) performs floating-point multiplication. Both ALUs (126c-d) can perform various other operations, such as shifting, masking, and comparison. For example, the computation core (103b) might want to add vector register V1 and a second vector register V2, and place the result in a third vector register V3. To perform addition, the computation core (103b) performs multiple operations within one clock cycle, i.e., 1024 operations. Using these registers as operands, each vector unit in the vector unit can simultaneously execute two ALU instructions, one load instruction and one store instruction, each clock cycle. The base address of the load or store instruction can be computed by a scalar processor and forwarded to the vector processor. Each vector component in each sub-channel can use various methods, such as stepping, and a special index address register to calculate its own offset address.
[0057] The computation unit also includes an extended unary pipeline (EUP) (116) that performs operations such as square root and reciprocal. The computation core (103b) takes three clock cycles to perform these operations because they fetch one operand at a time. Because the EUP processing takes more than one clock cycle, a first-in-first-out (FIFO) data store is used to store the results. When the operation is complete, the result is stored in the FIFO. The computation core can then use a separate instruction at a later time to pull the data out of the FIFO and place it in a vector register. A random number generator (120) allows the computation core (103b) to generate 128 random numbers per cycle.
[0058] As described above, each processor has three extended vector units: a matrix multiplication unit (113) that performs matrix multiplication operations; a cross-channel unit (XLU) that includes operations for transposing matrices, i.e., 128×128 matrices; and a simplification and permutation unit that performs operations on matrices. Figure 1C The components are shown as separate parts: simplification component 115 and replacement component 116.
[0059] The matrix multiplication unit performs matrix multiplication between two matrices. The matrix multiplication unit (113) receives data as the computation core needs to load the set of numbers to be multiplied by the matrices. As shown, the data comes from vector registers (106). Each vector register contains numbers, i.e., 32 bits. However, floating-point conversion can occur when data is sent to the matrix multiplication unit (113) to reduce the number to a smaller bit size, i.e., from 32 bits to 16 bits. The serializer (130) ensures that when the numbers are read from the vector registers, the two-dimensional array, i.e., the 128×8 matrix, is read as a set of 128 numbers sent to the matrix multiplication unit (113) in each of the next eight clock cycles. After the matrix multiplication has completed its computation, the result is deserialized (132a, b), meaning the resulting matrix is held over multiple clock cycles. For example, for a 128×8 matrix, the 128 numbers are held in each of the 8 clock cycles and then pushed to the appropriate FIFO, such as the transpose result FIFO (TRF) 134 or the multiplication result FIFO (TRF) 136, so that the two-dimensional array of 128×8 numbers can be captured and stored in a vector register contained in the vector processing unit (106) in one clock cycle.
[0060] During a period of 128 cycles, the weights are shifted into the matrix multiplication unit (113) as numbers to be multiplied by the matrix. Once the matrix and weights have been loaded, the computation core (103b) sends a set of 128 × 8 numbers to the matrix multiplication unit (113). Each row of the set can be multiplied by the matrix to produce multiple results, i.e., 128 results per clock cycle. While the computation core is performing matrix multiplication, it is also transforming the new set of numbers in the background into the next matrix to be multiplied by the computation core, so that the next matrix is available after the computation of the previous matrix has been completed. The matrix multiplication unit (113) can process the weight inputs as data in the matrix to be multiplied and the left-hand data inputs as data in the vector to be multiplied by the matrix, and provides the output vector to the vector processing unit. The vector processing unit can process the output vector and store the processed output vector in the vector memory. For example, the vector processing unit can apply a nonlinear function to the output of the matrix multiplication unit to generate vector data values. In some implementations, vector processing unit 106 generates normalized values, pooled values, or both. The processed output vector can be used as left-hand data input to matrix multiplication unit 113, for example, for subsequent layers of a neural network.
[0061] The transpose unit transposes the matrix. The transpose logic unit (114) receives numbers and transposes them such that the numbers on the channels are transposed using numbers of a different size. In some implementations, the vector processor includes a 128×8 vector unit. Therefore, to transpose a 128×128 matrix, sixteen separate transpose instructions are required for the full matrix transpose. Once transpose is complete, the transposed matrix is available. However, explicit instructions are needed to move the transposed matrix into the vector register file.
[0062] The simplification / permutation unit (or units 115, 116) addresses the cross-channel communication problem by supporting various operations such as permutation, channel rotation, rotation permutation, channel simplification, permutation channel simplification, and segmented permutation channel simplification. As shown, these calculations are separate; however, the computation core can use one calculation or another, or a calculation linked to another. The simplification unit (115) simplifies each row of numbers and supplies the numbers to the permutation unit (116). The permutation unit modifies data between different channels. The transpose unit, simplification unit, permutation unit, and matrix multiplication unit each take more than one clock cycle to complete. Therefore, each unit has an associated FIFO, allowing calculation results to be pushed to the FIFO and individual instructions to be executed later to pull data out of the FIFO and into a vector register. By using the FIFO, the computation core does not need to retain multiple vector registers for the duration of long operations. As shown, each unit in the unit obtains data from a vector register in the vector processing unit (106).
[0063] The computational core uses a scalar unit to control the computational unit. The scalar unit has two main functions: (1) performing loop counting and addressing and (2) generating direct memory address (DMA) requests, enabling the DMA controller to move data between high-bandwidth memory (156c-d) and vector memory (108) in the background and then to the inter-chip connection (148) of other chips in the example system. The scalar unit contains an instruction memory (104), an instruction decoder and issuer (102), a scalar processing unit (107) containing scalar registers, i.e., 32 bits, the scalar memory (104), and two ALUs (126a, b) for performing two operations per clock cycle. The scalar unit can supply operands and immediate values to the vector operations. Each instruction can be sent as an instruction bundle from the instruction decoder and issuer (102), which contains instructions to be executed on vector registers in the vector processing unit (106). Each instruction bundle is a Very Long Instruction Word (VLIW), where each instruction is a multi-bit wide instruction divided into multiple instruction fields.
[0064] Figure 2 The illustration shows an example core architecture 200 including matrix multiplication units (MXUs) 201a and 201b. Each MXU is a two-dimensional systolic array. The array is connected to perform matrix multiplication operations. The MXU multiplies a 128-element vector with a preloaded 128×128 vector, resulting in a constant throughput of one multiplication per clock cycle.
[0065] Each MXU can have 128 rows and 128 columns. MXUs can be divided into identical blocks, called tiles. For example, an MXU can be divided into 32 tiles, each containing 32 rows and 16 columns. Each tile can be further divided into multiply-add sub-component units. Each unit takes vector data as input operands, multiplies the operands by stored weights to obtain the result, and adds the result to a partial sum to produce a new partial sum. In some implementations, sub-component units can be divided into larger multi-unit arrays, i.e., 2×2 arrays or 4×4 arrays of multiply-add sub-component units, called sedecim units. Instead of moving input data from one multiply-add sub-component unit to the next at a rate of one per clock cycle, data can move across the systolic array at a rate of one unit per clock cycle.
[0066] Before initiating a series of vector-matrix multiplications, the matrices need to be preloaded into the MXU. This matrix data is called the "weights." The weight matrix is transferred to the MXU via the source bus connected to it and shifted into the weight shift register. The contents of the weight shift register are then loaded into the weight matrix register, allowing matrix multiplication to begin. About Figures 3 to 8 The weight loading process will be described in more detail.
[0067] like Figure 2 As shown, each MXU, such as 113a and 113b, is connected to three buses: a first source bus (230a, 230b) for untransposed weights, a second source bus (220a, 220b) for transposed weights, and a left-hand side bus (210a, 210b) for vector data to be multiplied by the matrix stored in the MXU. The MXUs are connected to the buses via wires attached to the edges of the MXUs. Each transposed component (XU), such as 114a and 114b, is also connected to the first and second source buses.
[0068] The first and second source buses are multi-purpose buses containing data sent from the vector processing unit that will be consumed by the XU or MXU. Data processing occurs in the vector processing data path, which includes vector register 206, serial processing unit 202, and selection unit 204. There are multiple ways the vector processing unit can send weights on the bus. Weights can be sent normally, "high," or "low." Eight 32-bit floating-point numbers per channel (one per subchannel) are routed to bfloat, 16-bit floating-point numbers. These values are encapsulated into four pairs and sent to the MXU every other cycle over eight consecutive cycles. The difference between normal, "high," and "low" is how the vector processing unit performs the 32-bit floating-point to bfloat conversion. Weights can be encapsulated, meaning that each of the eight 32-bit values per channel contains an encapsulated pair of bfloat values. Instead of eight values, 16 values are sent to the MXU using the source bus for each of eight consecutive cycles. During odd-numbered cycles, the lower 16 bits of each subchannel are sent to the MXU, and during even-numbered cycles, the higher 16 bits of each subchannel are sent. Weights may be sent via bytes, either additionally or alternatively. Each 32-bit operand consists of a package set of four 8-bit signed 2-complementary integers. Each byte is converted to a modified signed numeric value. These values are sent to the MXU via the source bus over eight consecutive cycles.
[0069] Weights can be sent as non-transpose or transpose instructions using either the first or second source bus and shifted into the weight shift register. When triggered by a load operation, the contents of the weight shift register are loaded into the weight matrix register as described below. The load path from the weight shift register to the weight matrix register is also where the conversion from the modified sign value to bfloat is performed using byte-mode data. The load control bus indicates that this conversion will be performed.
[0070] Depending on the instruction being executed, the 32-bit value from the source bus can include: a 16-bit floating-point value package, where bits [15:0] represent the earlier value; or a package of four 8-bit integers in modified sign numeric format, where bits [7:0] represent the earliest value and the other values sequentially following it. When the MXU receives data from the bus, the data value is evenly distributed across the MXU, which has a value of 0 on the left and a value of 127 on the right.
[0071] The left-hand side (LHS) data bus transmits 128 16-bit floating-point numbers in a specific format, such as bfloat, to be multiplied by a matrix stored in the connected MXU. The data on the LHS data bus comes from the vector processing unit and passes through transpose units such as 114a and 114b. When the LHS input arrives at the MXU, the value is evenly distributed across the MXU, which has a value of 0 on the left and a value of 127 on the right.
[0072] The results of matrix multiplication are uniformly distributed across MXU and sent from MXU to matrix result FIFOs (MRFs), such as 136a and 136b. The results from XU are sent to the corresponding transpose result FIFOs (MRFs), such as 136a and 136b.
[0073] Figure 3 The illustration shows an example architecture of multiple units within a matrix multiplication unit. As described above, each matrix multiplication unit is a two-dimensional systolic array. The array comprises multiple multiply-add sub-units that can be divided into multiple units. In some implementations, the first dimension of the systolic array corresponds to the columns of the units, and the second dimension of the systolic array corresponds to the rows of the units. The systolic array may have more rows than columns, more columns than rows, or an equal number of columns and rows. This specification describes certain processing of columns or a vertical description. However, different designs may perform row processing or horizontal execution.
[0074] In the example shown, left-hand data registers 315a and 315b send vector data inputs to the rows of the array. Weight shift chains 301a and 301b send weight input values to the columns of the array, and weight shift chains 302a and 302b send weight input values to the rows of the array. The shift chains are wired paths along which values can be transferred, for example, from memory to each of the registers within the matrix multiplication unit.
[0075] Each weight shift register 305 is designed to shift the weight content value along the chain of weight shift registers 305 from the source bus. After data is shifted in, a parallel copy operation ensures that all data is copied from the weight shift register 305 to the corresponding weight matrix register 325. While the data is in the weight matrix register 325, the data is used for any number of multiplication cycles. During this time, more weights can be shifted into the weight register 305 in the background (typically) in preparation for the next multiplication set.
[0076] Left-hand data registers 315a and 315b can receive vector data inputs. Each left-hand data register holds one LS data item per clock cycle. Each vector data input received by the multi-cell can flow freely in the corresponding left-hand register of the multi-cell, such as left-hand data registers 315a and 315b. The left-hand data registers store the vector data inputs provided by the vector registers through the adjacent multi-cells located to the left of a given multi-cell, depending on the position of the multi-cell within the array. For example, if the multi-cell 300 is located at the leftmost position in the systolic array of the matrix multiplication unit, the vector data inputs are provided by the vector registers. The vector registers can provide multiple different vector data inputs to the multi-cell 300, where each received vector data input can then be stored by a different left-hand data register in left-hand data register 315. Each row receives one value per clock cycle, regardless of the number of rows in the multi-cell.
[0077] Each left-hand register can be coupled to a cell along the first dimension of the multi-cell array. The connection between the left-hand register and the cell is... Figure 3 The dashed lines indicate this. For example, the left-hand data register 315a (left-hand data register) in the multi-cell array is coupled to cells 350a and 350c in the first row. Similarly, the left-hand data register 315b (second left-hand register) in the multi-cell array is coupled to cells 350b and 350d in the second row. Each left-hand register 315 transfers the stored vector data input to the cell 350 coupled to the left-hand register. Therefore, for a given number of cells extending along the first dimension (e.g., along a given row or along a given column), the vector data input can be transferred to all cells in the multi-cell array, not just a single cell, allowing the vector data input to be rapidly distributed across the cell array, thereby improving the operational efficiency of the multi-cell array.
[0078] Multiple vector data inputs can also be sent to adjacent left-hand registers, allowing the multiple vector data inputs to be used in another multi-cell of the array. This process allows vector data inputs to be shifted for use in another specific multi-cell of the array.
[0079] Each cell 350 of the multi-cell array 300 contains stored weight values. Before the matrix multiplication process begins, the weights are loaded by shifting them into the cells of the systolic array. A dedicated chain and weight shift register are provided for weight shifting, allowing new weights to be shifted simultaneously with the execution of the preceding matrix multiplication process. The weight inputs are loaded into the multi-cell array in a manner that reduces the overall latency of the matrix multiplication operation.
[0080] As described above, weight shift chains 301 and 302 can receive weight inputs from memory components such as the vector memory 108 of FIG. 1. The shift chains can send multiple corresponding weight inputs to the weight matrix register 325 associated with the multi-cell 300.
[0081] In some implementations, the weight shift register will pass through the array shift vector data inputs along one dimension, such as to the right, while simultaneously passing through the array shift weight inputs along one or two dimensions, such as to the right or downward. For example, within one clock cycle, each of the multiple vector data inputs at multiple cells 300 can be shifted to the corresponding left-hand data register in the next multi-cell in the same row. The horizontal data (left-hand data) and vertical data (partial sum) are each shifted by one multi-cell per clock cycle. The weights are shifted only when indicated by the system and can be shifted by 1, 2, or 4 rows (or columns) depending on the implementation and the executed instructions.
[0082] Multiplexer 330 selects weights from the weight shift register 305 of the first shift chain 301 or the second shift chain 302 and forwards the selected input to a single row in the weight matrix register 325. Although multiplexer 330 is shown outside the boundary row of cell 350, in some embodiments, multiplexer 330 is present within cell 350.
[0083] During a clock cycle, each multi-cell can process multiple given weight inputs and multiple given vector data inputs to generate multiple cumulative outputs. Generally, processing includes a multiplication operation that multiplies the vector data inputs with stored weights. The cumulative outputs can also be purged down along the same dimension as the given weight inputs to adjacent multi-cells. In some implementations, the weights are shifted more than one multi-cell during a given clock cycle to transition from one convolution computation to another.
[0084] The accumulated output can be passed along the same column as the weighted input, for example, towards the bottom of the columns in the array. In some implementations, partial sum registers 310a, 311a pass partial sum values from previous multi-cells to multi-cells. The array may include partial sum registers 310b, 311b storing the accumulated output from each column of the multi-cells. For each column of the multi-cell, the product generated by the sub-component units in the column is combined with the input partial sum from the multi-cell above and then transferred as the next partial sum. For some multi-cells, such as those in the bottom columns of a systolic array, the accumulated output may include the last accumulated value that can be transferred to the vector computation unit. In some implementations, the last accumulated value is transferred directly from the bottom multi-cells of the array to the vector computation unit, while in other implementations, the last accumulated value is first stored in memory or processed by a different component before being sent to the vector computation unit.
[0085] Figure 4 An example of a multi-cell architecture for a matrix multiplication unit with two weight shift register chains per column is shown to improve the rate of loading weight values. (e.g.) Figure 4 As shown, cells 435a and 435b form one column of the multi-cell 400, and cells 435c and 435d form a second column of the multi-cell 400. Each column has two chains of weight shift registers. Each cell in a given column is configured to receive weight input from only one of the two chains in the column. Figure 4 As shown, chain 401 connects to the weight shift registers in the even-numbered rows and chain 402 connects to the weight shift registers in the odd-numbered rows. Each cycle, two new values are shifted into each column and all existing weight values are shifted down two rows. Therefore, weights can be loaded into multiple cells at twice the rate of the matrix multiplication unit of two weight shift register chains without a systolic array.
[0086] As shown in the figure, weight values are moved in from vector register 403. In this implementation, one vector register 403 is located for each column of the matrix multiplication unit. Although vector register 403 is in Figure 3 In the example, it is shown at the top of the matrix multiplication unit, but the vector register 403 can be physically located at various positions relative to the matrix multiplication unit, such as at the bottom of the unit.
[0087] Vector register 403 can hold register values that are some values greater than or less than the values operated on by the matrix multiplication unit. For example, the register can hold an n-bit value, while the matrix multiplication unit operates on an n / 2-bit value. In some implementations, each vector register holds a 32-bit value and the matrix multiplication unit operates on a 16-bit value. An example matrix multiplication unit has a mode that treats each 32-bit value of the register as a pair of 16-bit values, wherein one 16-bit value in the pair is sent to a first weight shift chain 401 and the second 16-bit value in the pair is sent to a second weight shift chain 402. While one example register 403 is shown per column, there may be only one vector register 403 per multi-unit. Alternatively, each chain can be connected to a separate vector register 303 that provides a single 16-bit weight value to the chain. In this case, the 32-bit floating-point value in vector register 403 is converted to a 16-bit value.
[0088] In some implementations, the weight values may not be sent at twice the rate of the matrix multiplication unit without two shift chains per column. To handle this, a holding register 445 is placed at the top of each column to hold the weight values until two weight values are available, one weight value for each vertical shift chain. In the first clock cycle when only one weight value is available, the available weight value is copied into the holding register 445. In the next clock cycle when a new weight value is available, the weight value in the holding register is shifted from the holding register to the weight shift register via a weight shift chain, and the new weight value available in that clock cycle is shifted to the second weight shift register via a second weight shift chain.
[0089] Horizontal shift chain 405 can provide weight values to the cells as described above. In some embodiments, there may be two horizontal shift chains to reduce weight loading latency in the same manner as the vertical shift chains 401 and 402 described above.
[0090] Multiplexer 430 determines whether the weight values sent to the weight matrix register within the unit come from horizontal shift chain 405 or vertical shift chain 401b or 402b. Once the weight values have been loaded into the weight matrix register and the left-hand data register 415 provides vector data input, matrix multiplication can then be performed by unit 435.
[0091] Figure 5 This is a flowchart of an example procedure 500 for loading weight values into a given multi-cell column. The interface receives at least one weight value (501) from a vector register.
[0092] The interface determines whether multiple weight values are available (502).
[0093] If multiple weight values are available, the interface shifts the weight values to the weight shift register (504) in cell 435 within the multi-cell via a shift chain during the clock cycle.
[0094] The interface continues to load weight values until all weight values from the weight matrix are loaded into the matrix multiplication unit (506).
[0095] If two weight values are not available in the same clock cycle, then in the first cycle when a single weight value is available, the holding register 445 is loaded with the available weight value and no shift is performed (503).
[0096] In the next cycle when another weight value becomes available, the interface shifts the new value and the value held in holding register 445 to the weight shift register (505) in the multi-cell via two shift chains.
[0097] Then, the interface continues to load weight values until all weight values from the weight matrix are loaded into the matrix multiplication unit (506).
[0098] When multiple weight values are unavailable in each cycle, the interface activates the shift chain only once every other cycle.
[0099] Figure 6 An example architecture of a matrix multiplication unit with two weight shift register chains per column is shown, which injects weight values at two points in the column to increase the rate of loading weight values by four times. Figure 3 As shown, the matrix multiplication unit has two shift chains per column of a systolic array. Each unit 650 contains a shift register 635 connected to only one shift chain. As described above, the vector register 603 can hold register values that are some value greater than or less than the value operated on by the matrix multiplication unit. For example, the register can hold an n-bit value, while the matrix multiplication unit operates on an n / 2-bit value. The values in the vector register can be partitioned or transformed in some way to match the value size desired by the matrix multiplication unit.
[0100] In one implementation, each register 603 can hold a 32-bit value. The value in each vector register 603 can be treated as four 8-bit signed integers of the encapsulation set, with each integer representing a separate weight value. Figure 3 As shown, each 8-bit signed integer can be sent on two 16-bit chains. However, the integer is sent to two injection points 680, 681 in each column of the systolic array. The integer is sent to the top (680b, 680b), and another point is sent to the bottom of the array (680a, 6801a). Embodiments with the described multiple injection points can be combined with other embodiments and features discussed herein.
[0101] In some implementations, if integers are sent along the array to the midpoint, no additional connection is needed to inject the integers because the chain from the vector register to the top of the array traverses the length of the array from bottom to bottom. At the top of each column, two integers are converted to 16-bit floating-point values in the format used by the array, which are then injected into the two weighted shift chains (680a, 681a) mentioned above. The shift chains are cut by a multiplexer at the midpoint, and a second set of integer-to-float converters at that point take the other two integers from each 32-bit value, convert them, and inject them into that point (680b, 681b). For example, a 32-bit word can be divided into four equal 8-bit parts: A, B, C, and D. The weighted interface can send parts A and B to the top of the array and convert them into 16-bit values to be operated on by the matrix multiplication unit. The weighted interface can also send parts C and D to the midpoint of the array via a multiplexer. In this implementation, portions of C and D are not sent to the top of the array, but are injected into the weight shift register of the cell at the midpoint of the shift chain. A multiplexer is present on the shift chain at the midpoint, such that the weight value is selected from the injection point rather than from the previous weight shift register on the shift chain.
[0102] The point where the second weight is injected into the array doesn't have to be the midpoint, but rather some other point. For example, it could be a point at one-quarter of the way along the array. In this case, the weights injected at the top are shifted to the first and third quarter-units of the matrix multiplication unit, while the weights injected at the quarter-points are shifted to the second and fourth quarter-units of the matrix multiplication unit. This process requires additional connections, but allows the weights to begin shifting earlier while the previous matrix multiplications are completed.
[0103] As shown in the figure, two shift chains exist in each column. However, in some implementations, two shift chains may additionally or alternatively exist in each row, with two injection points per shift chain.
[0104] Figure 7An example architecture of a matrix multiplication unit with transposed weight shifting and normal untransposed weight shifting to improve the rate of loading weight values is shown. Each multi-unit 700 includes multiple units 750 and can be loaded with weight values from either the vertical or horizontal direction. Loading weights vertically from the top results in a weight matrix being stored in the matrix multiplication unit. Loading the same weights in the same order but from the side results in a transposed weight matrix being stored in the matrix multiplication unit. During neural network system training, both the untransposed and transposed weight matrices must be loaded at different steps in the training algorithm. When weights are loaded vertically from the top, the weight values are shifted downwards through the units. When weights are loaded horizontally from the left, the weight values are shifted to the right through the multi-unit 700. Figure 7 The diagram illustrates normal shift chains 701a and 701b connected to normal shift register 705. Transpose shift chains 702a and 702b are connected to transpose shift register 705. Multiplexer 730 determines from which shift chains 701 and 702 load weight matrix register 725.
[0105] In some implementations, n cycles are required to shift a set of weights into the weight matrix register of the matrix multiplication unit. The second set of weights can begin shifting n / 2 cycles after the first set of weights is loaded, and a new set of weights can be loaded from the shift register into the weight matrix register every n / 2 cycles.
[0106] In some implementations, it is not always necessary to use the entire 128×128 weights of the group. Weights in unused positions can be set to zero, effectively making the weight matrix smaller. The matrix multiplication unit then does not need to shift data into all rows or columns of the weight shift register. Each weight shift instruction shifts 8 rows of data, or 8 columns of data for a transpose load, into the pulsating array. Sixteen weight shift instructions load the entire 128×128 matrix, replacing all previous data. Each weight shift register is cleared as data is copied from the weight shift register to the corresponding weight matrix register. Shifting new data into the weight shift register can begin immediately after the load and clear signals begin propagating. The weight shift signals are not available for use by all cells below and to the right of the load and clear wavefront, so that data is not shifted before it has a chance to be loaded. Because the old data is completely cleared, it is not necessary to shift data in the allowed rows or columns. Only the top (or left) portion of the shift register will be filled with new data and the remainder will remain zero, resulting in the input data to those rows being omitted (or the output data from those columns being zero).
[0107] Figure 8Example unit 800 is shown, featuring a set of holding registers for increasing the rate of loading weight values. Unit 800 includes one or more sets of weight holding registers used as temporary storage for array weights that have already been shifted in. Instead of being copied to the weight matrix register 825, the values of weight shift register set 805a can also be copied to weight holding register set 845a. Instead of being copied to the weight matrix register 825, the values of a second weight shift register set 805b can also be copied to a second weight holding register set 845b. When a set of weight values is loaded into the weight matrix register, instead of directly from weight shift registers 805a, 805b, the set of weight values can also be obtained from the set of holding registers in array holding register 845. This process allows the weight set to be loaded more than once after being shifted into the array. For example, if the algorithm requires switching between two sets of weights, weight values from one shift chain can be shifted to holding registers between loads. This process also allows the timing of weight shifts to be decoupled from weight loading. For example, when a new set of weight values begins to shift every n / c cycles, two sets of weight values can be shifted simultaneously, and the other set can be moved to the weight holding register while the first set is loaded into the weight matrix register. After an additional n / 2 cycles, the second set is loaded into the weight matrix register from the holding register.
[0108] In some implementations... Figure 4 and / or Figure 6 The two shift chains can be combined with the addition of normal and transpose shift registers to increase the number of weight values that can be loaded into the matrix multiplication unit at a given time.
[0109] The embodiments of the subject matter and functional operation described in this specification can be implemented in digital electronic circuit systems, in tangibly embodied computer software or firmware, in computer hardware including the structures disclosed in this specification and their structural equivalents, or in one or more combinations thereof. Embodiments of the subject matter described in this specification can be implemented as one or more computer programs, i.e., one or more modules of computer program instructions encoded on a tangible, non-transitory storage medium for execution by a data processing device or for controlling the operation of a data processing device. The computer storage medium can be a machine-readable storage device, a machine-readable storage substrate, a random or serial access memory device, or one or more combinations thereof. Alternatively or additionally, the program instructions can be encoded on artificially generated propagation signals, such as machine-generated electrical, optical, or electromagnetic signals, generated for encoding information for transmission to a suitable receiver device for execution by the data processing device.
[0110] The term "data processing device" refers to data processing hardware and encompasses a variety of devices, apparatuses, and machines used for processing data, including, for example, programmable processors, computers, or multiple processors or computers. The device may also be or further include special-purpose logic circuit systems, such as FPGAs (Field-Programmable Gate Arrays) or ASICs (Application-Specific Integrated Circuits). In addition to hardware, the device may optionally include code that creates an execution environment for computer programs, such as code constituting processor firmware, protocol stacks, database management systems, operating systems, or combinations thereof.
[0111] A computer program, also referred to or described as a program, software, software application, module, software module, script, or code, can be written in any form of programming language, including compiled or interpreted languages, declarative languages, or programming languages, and can be deployed in any form, including as a standalone program or as a module, component, subroutine, or other unit suitable for a computing environment. A program may, but does not need to, correspond to a file in a file system. A program may be stored as part of a file that holds other programs or data (e.g., in one or more scripts in a markup language document), in a single file dedicated to the program in discussion, or in multiple coordinating files (e.g., in a file storing one or more modules, subroutines, or portions of code). A computer program can be deployed to execute on a single computer or on multiple computers located at a station or distributed across multiple stations and interconnected by a data communication network.
[0112] The processes and logic flows described in this specification can be performed by one or more programmable computers executing one or more computer programs to perform functions by manipulating input data and generating outputs. The processes and logic flows can also be performed by a dedicated logic circuit system, such as an FPGA or ASIC, or by a combination of a dedicated logic circuit system and one or more programmable computers.
[0113] A computer suitable for executing computer programs can be based on a general-purpose or special-purpose microprocessor, or both, or any other type of central processing unit (CPU). Generally, the CPU receives instructions and data from read-only memory (ROM) or random access memory (RAM), or both. The basic elements of a computer are the CPU for making or executing instructions and one or more storage devices for storing instructions and data. The CPU and memory may be supplemented by or incorporated into a special-purpose logic circuit system. Generally, a computer will also include one or more mass storage devices for storing data, such as disks, magneto-optical disks, or optical disks, or operatively coupled to them to receive or transfer data, or both. However, a computer does not necessarily need to have such devices. Furthermore, a computer can be embedded in another device, for example, to name just a few, a mobile phone, a personal digital assistant (PDA), a mobile audio or video player, a game console, a global positioning system (GPS) receiver, or a portable storage device (e.g., a universal serial bus (USB) flash drive).
[0114] Computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media and memory devices, such as: semiconductor memory devices such as EPROM, EEPROM and flash memory devices, magnetic disks such as internal hard disks or removable disks, magneto-optical disks, CD-ROM disks and DVD-ROM disks.
[0115] To provide interaction with the user, embodiments of the subject matter described in this specification can be implemented on a computer having a display device for displaying information to the user, such as a CRT (cathode ray tube) or LCD (liquid crystal display) monitor, and a keyboard and pointing device such as a mouse or trackball, through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback, such as visual feedback, auditory feedback, or tactile feedback; and input from the user can be received in any form, including sound, speech, or tactile input. Additionally, the computer can interact with the user by sending documents to and receiving documents from the device used by the user; for example, by sending a webpage to a web browser on the user's device in response to a request received from a web browser. Similarly, the computer can interact with the user by sending text messages or other forms of messages to a personal device, such as a smartphone, running a messaging application, and receiving response messages from the user as answers.
[0116] Embodiments of the subject matter described in this specification can be implemented in a computing system that includes backend components (e.g., as a data server), middleware components (e.g., an application server), a foreground component (e.g., a client computer with a graphical user interface, web browser, or app through which a user can interact with embodiments of the subject matter described in this specification), or any combination of one or more such backend, middleware, or foreground components. The components of the system can be interconnected via digital data communication (e.g., a communication network) of any form or medium. Examples of communication networks include local area networks (LANs) and wide area networks (WANs), such as the Internet.
[0117] A computing system may include clients and servers. Clients and servers are generally geographically separated and typically interact via a communication network. The client-server relationship is established by computer programs running on respective computers and having a client-server relationship with each other. In some embodiments, the server sends data, such as HTML pages, to a user device, for example, to display data to a user interacting with the device and to receive user input from that user. Data generated at the user device, such as the result of user interaction, can be received from the device at the server.
[0118] Example 1 is a matrix multiplication unit implemented as a dynamic cell array. Each cell of the cell array includes: a weight matrix register configured to receive weight inputs from a transposed or non-transposed weight shift register; a transposed weight shift register configured to receive weight inputs from the horizontal direction to be stored in the weight matrix register; a non-transposed weight shift register configured to receive weight inputs from the vertical direction to be stored in the weight matrix register; and a multiplication unit coupled to the weight matrix register and configured to multiply the weight inputs of the weight matrix register with the vector data inputs to obtain a multiplication result.
[0119] Example 2 is a matrix multiplication component according to Example 1, wherein each unit further includes: a multiplexer configured to select between weight inputs of a transposed weight shift register and a non-transposed weight shift register and forward the selected weight input to a weight matrix register.
[0120] Example 3 is a matrix multiplication unit according to Example 1 or 2, which further includes a first weight holding register configured to hold weight values from a transposed weight shift register or a non-transposed weight shift register.
[0121] Example 4 is a matrix multiplication unit according to any one of Examples 1 to 3, the matrix multiplication unit further including a second weight holding register configured to hold weight values from a transposed weight shift register or a non-transposed weight shift register.
[0122] Example 5 is a matrix multiplication component according to any one of Examples 1 to 4, wherein weight values are loaded from the transpose weight shift register into the first weight holding register, and weight values are loaded from the vertical direction into the second weight holding register.
[0123] Example 6 is a matrix multiplication component according to any one of Examples 1 to 5, wherein the weight matrix register is loaded with values from either the first weight holding register or the second weight holding register.
[0124] Example 7 is a matrix multiplication unit implemented as a pulsating array, the matrix multiplication unit comprising:
[0125] Multiple cells arranged in columns of a systolic array; two weight shift register chains for each column of the systolic array; wherein each weight shift register is connected to only one chain and each cell is connected to only one weight shift register; a weight matrix register for each cell configured to store inputs received from the weight shift registers; and a multiplication unit coupled to the weight matrix registers and configured to multiply the weight inputs of the weight matrix registers with vector data to obtain a multiplication result.
[0126] Example 8 is a matrix multiplication unit according to Example 7, wherein the weight values are sent from a vector register containing weight pair values to two weight shift register chains.
[0127] Example 9 is a matrix multiplication component according to Example 7 or 8, which includes a holding register at the top of each column for holding weight values when two weight values are unavailable from the vector register.
[0128] Example 10 is a matrix multiplication component according to any one of Examples 7 to 9, wherein when two weight values are available, the two weight values are shifted to a weight shift register in the unit during a clock cycle.
[0129] Example 11 is a matrix multiplication component according to any one of Examples 7 to 10, wherein when two weight values are unavailable: in a first clock cycle when the first weight value is available, the holding register is loaded with the first weight value as a holding value and no shift is performed; and in the next clock cycle, when the second weight value is available, the second weight value and the holding value are shifted to a weight shift register connected to the shift chain via two shift chains, with each shift chain shifting one value.
[0130] Example 12 is a matrix multiplication component according to any one of Examples 7 to 11, the matrix multiplication component further comprising: each shift chain having two injection points for injecting weight values, one at the top of the column and the other at a second point in the column.
[0131] Example 13 is a matrix multiplication component according to any one of Examples 7 to 12, the matrix multiplication component further comprising: a vector register containing four 8-bit integers of a package set, each of the 8-bit integers representing a separate weight value.
[0132] Example 14 is a matrix multiplication component according to any one of Examples 7 to 13, the matrix multiplication component further comprising: injecting two of the four integers at the top of the column and injecting the other two of the four integers at a second point in the array.
[0133] While this specification contains numerous specific implementation details, these details should not be construed as limiting the scope of any invention or the scope of what may be claimed, but rather as descriptions of features specific to particular embodiments of a particular invention. Certain features described in this specification within the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments. Furthermore, while features may be described above as operating in certain combinations and even initially claimed in this manner, one or more features from a claimed combination may, in some cases, be removed from that combination, and the claimed combination may involve sub-combinations or variations thereof.
[0134] Similarly, although the operations are depicted in a specific order in the accompanying drawings, this should not be construed as requiring them to be performed in the specific order shown or in a sequential order, or as requiring all the illustrated operations to achieve the desired result. In some environments, multitasking and parallel processing may be advantageous. Furthermore, the separation of the various system modules and components in the above embodiments should not be construed as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product or packaged into multiple software products.
[0135] Specific embodiments of the subject matter have been described. Other embodiments are within the scope of the following claims. For example, the actions referenced in the claims can be performed in a different order and still achieve the desired result. As an example, the processes shown in the figures do not necessarily require the specific order or sequential order shown to complete the desired result. In some cases, multitasking and parallel processing may be advantageous.
Claims
1. A matrix multiplication component configured to perform neural network computation of a neural network, the matrix multiplication component being implemented as a systolic cell array arranged in a two-dimensional format, each cell in the cell array comprising: A weight matrix register, configured to receive weight inputs from one or more weight storage registers of a neural network; The one or more weight storage registers, wherein the one or more weight storage registers are configured to receive weight inputs of the neural network to be stored in the weight matrix register from both a first direction in the two-dimensional format and a second direction in the two-dimensional format, wherein the second direction is different from the first direction; as well as A multiplication unit coupled to the weight matrix register and configured to multiply the weight input of the weight matrix register with the vector data input of the neural network to obtain a multiplication result.
2. The matrix multiplication component according to claim 1, wherein, Each unit also includes: Multiplexer, the multiplexer being configured to: Select a weight input from the weight inputs received from the first direction and the second direction; and The selected weights are input and sent to the weight matrix register.
3. The matrix multiplication component of claim 1 further includes a first weight holding register configured to hold the weight input from the first direction.
4. The matrix multiplication unit of claim 3 further includes a second weight holding register configured to hold the weight input from the second direction.
5. The matrix multiplication component according to claim 4, wherein, The weight input from the first direction is loaded from the one or more weight storage registers into the first weight holding register, wherein the weight input from the second direction is loaded from the one or more weight storage registers into the second weight holding register.
6. The matrix multiplication component according to claim 5, wherein, The weight matrix register is loaded with one of the weight inputs from the first direction and the weight inputs from the second direction.
7. The matrix multiplication component according to claim 6, wherein, The weight inputs in the weight matrix register are used for any number of multiplication cycles.
8. The matrix multiplication component according to claim 7, wherein, During the number of multiplication cycles, additional weight inputs are shifted into the one or more weight storage registers to prepare for subsequent sets of one or more multiplications.
9. The matrix multiplication component according to claim 7, wherein, During the number of multiplication cycles, another weight input of the neural network is multiplied by another vector data input of the neural network to obtain another multiplication result.
10. The matrix multiplication component according to claim 1, wherein, The vector data input moves by more than one unit per clock cycle.
11. The matrix multiplication component according to claim 1, wherein, The one or more weight storage registers include a transposed weight shift register and a non-transposed weight shift register that is physically separate from the transposed weight shift register.
12. The matrix multiplication component according to claim 1, wherein, The one or more weight storage registers configured to receive the weights include: A first weight storage register, configured to receive a first weight input from another cell in the array along the first direction via a first wired path; and A second weight storage register is configured to receive a second weight input from another cell in the array along the second direction via a second wired path, wherein the weight input is at least one of the first weight input or the second weight input.
13. A cell among a plurality of cells arranged in an array of matrix multiplication units, the cell comprising: A weight matrix register configured to receive weight inputs from one or more weight storage registers of a neural network, wherein the one or more weight storage registers are configured to receive multiple weight inputs from a first direction of the array and a second direction of the array, the second direction being different from the first direction; and A multiplication unit coupled to the weight matrix register, wherein the multiplication unit is configured to receive weight input from the weight matrix register, wherein the multiplication unit is configured to multiply the received weight input with the vector data input of the neural network to generate a multiplication result.
14. The unit according to claim 13, wherein, The multiplication result is part of a multi-neural network computation.
15. The unit according to claim 14, wherein, The multiplication unit is configured to multiply the received weight input with another vector data input to generate another multiplication result, wherein the other multiplication result is another part of the computation of the plurality of neural networks.
16. The unit according to claim 13, wherein, The array is a pulsating cell array.
17. The unit according to claim 13, wherein: The array has a two-dimensional format; The first direction of the array is the first direction of the two-dimensional format; and The second direction of the array is the second direction of the two-dimensional format.
18. The unit of claim 13, further comprising a multiplexer configured to: Select a weight input from the plurality of weight inputs; and The selected weights are input and sent to the weight matrix register.
19. The unit according to claim 13, wherein, The one or more weight storage registers include transposed weight shift registers and non-transposed weight shift registers.
20. The unit according to claim 19, wherein, The untransposed weighted shift register and the transposed weighted shift register are physically separate.
21. The unit according to claim 13, wherein, The one or more weight storage registers include: A first weight storage register, configured to receive a first weight input from a first cell of the plurality of cells along the first direction via a first wired path; and A second weight storage register, configured to receive a second weight input from a second cell among the plurality of cells along the second direction via a second wired path. The weight input is one of the first weight input and the second weight input.
22. A method comprising: The weight matrix register of a neural network receives weight inputs from one or more weight storage registers from units of a plurality of cells arranged in an array of matrix multiplication components, wherein the one or more weight storage registers receive multiple weight inputs from the neural network from a first direction and a second direction of the array, wherein the second direction is different from the first direction; and The weight input is multiplied by the vector data input of the neural network by a multiplication unit coupled to the weight matrix register to generate a multiplication result.
23. The method according to claim 22, wherein, The multiplication result is part of a multi-neural network computation.
24. The method of claim 23, further comprising: The multiplication unit multiplies the received weight input with another vector data input to generate another multiplication result, wherein the other multiplication result is another part of the computation of the plurality of neural networks.
25. The method according to claim 22, wherein, The array is a pulsating cell array.
26. The method according to claim 22, wherein: The array has a two-dimensional format; The first direction of the array is the first direction of the two-dimensional format; and The second direction of the array is the second direction of the two-dimensional format.
27. The method of claim 22, further comprising: The multiplexer selects a weight input from the plurality of weight inputs; as well as The selected weight input is received from the multiplexer by the weight matrix register.
28. The method according to claim 22, wherein, The one or more weight storage registers include transposed weight shift registers and non-transposed weight shift registers.
29. The method according to claim 28, wherein, The untransposed weighted shift register and the transposed weighted shift register are physically separate.
30. The method according to claim 22, wherein, The one or more weight storage registers include: A first weight storage register, configured to receive a first weight input from a first cell of the plurality of cells along the first direction via a first wired path; and A second weight storage register, configured to receive a second weight input from a second cell among the plurality of cells along the second direction via a second wired path. The weight input is one of the first weight input and the second weight input.
31. A non-transitory computer program product storing instructions, said instructions causing said at least one programmable processor to perform operations when executed by said at least one programmable processor, said operations including: The weight matrix register of a neural network receives weight inputs from one or more weight storage registers from units of a plurality of cells arranged in an array of matrix multiplication components, wherein the one or more weight storage registers receive multiple weight inputs from the neural network from a first direction and a second direction of the array, wherein the second direction is different from the first direction; and The weight input is multiplied by the vector data input of the neural network by a multiplication unit coupled to the weight matrix register to generate a multiplication result.
32. The non-transitory computer program product according to claim 31, wherein: The array has a two-dimensional format; The first direction of the array is the first direction of the two-dimensional format; and The second direction of the array is the second direction of the two-dimensional format.
33. A cell among a plurality of cells arranged in an array of matrix multiplication units, the cell comprising: A weight matrix register configured to receive weight inputs from a plurality of weight storage registers, wherein each of the plurality of weight storage registers is configured to receive a corresponding weight input from a corresponding direction of the array, wherein the corresponding direction includes a first direction of the array and a second direction of the array different from the first direction; and A multiplication unit configured to receive the weight input from the weight matrix register and generate a multiplication result based on the received weight input and another input data.
34. The unit according to claim 33, wherein, The other input data includes vector data input, and the multiplication result is part of a plurality of neural network computations.
35. The unit according to claim 34, wherein, The multiplication unit is configured to receive another weight input from the weight matrix register and multiply the other received weight input by another vector data input to generate another multiplication result, wherein the other multiplication result is another part of the computation of the plurality of neural networks.
36. The unit according to claim 33, wherein, The array is a pulsating cell array.
37. The unit according to claim 33, wherein: The array has a two-dimensional format; The first direction of the array is the first direction of the two-dimensional format; and The second direction of the array is the second direction of the two-dimensional format.
38. The unit of claim 33, further comprising a multiplexer configured to: Select a weight input from at least two corresponding weight inputs, each stored in its respective weight storage register; and The selected weights are input and sent to the weight matrix register.
39. The unit according to claim 33, wherein, The plurality of weight storage registers includes a transposed weight shift register and a non-transposed weight shift register that is physically separate from the transposed weight shift register.
40. The unit according to claim 33, wherein, The plurality of weight storage registers include: A first weight storage register, configured to receive a first weight input from a first cell of the plurality of cells along the first direction via a first wired path; and A second weight storage register is configured to receive a second weight input from a second cell among the plurality of cells along the second direction via a second wired path; The weight input is one of the first weight input and the second weight input.
41. A method comprising: A weight matrix register of a cell arranged in an array of matrix multiplication units receives weight inputs from a plurality of weight storage registers, wherein each of the plurality of weight storage registers is configured to receive a corresponding weight input from a corresponding direction of the array, wherein the corresponding direction includes a first direction of the array and a second direction of the array different from the first direction; and The multiplication unit coupled to the weight matrix register obtains the multiplication result based on the received weight input and another input data.
42. The method according to claim 41, wherein, The other input data includes vector data input, and the multiplication result is part of a plurality of neural network computations.
43. The method of claim 42, further comprising: The multiplication unit receives another weight input from the weight matrix register; as well as The multiplication unit multiplies another received weight input with another vector data input to generate another multiplication result, wherein the other multiplication result is another part of the computation of the plurality of neural networks.
44. The method according to claim 41, wherein, The array is a pulsating cell array.
45. The method according to claim 41, wherein: The array has a two-dimensional format; The first direction of the array is the first direction of the two-dimensional format; and The second direction of the array is the second direction of the two-dimensional format.
46. The method of claim 41, further comprising: The multiplexer selects a weight input from at least two corresponding weight inputs, each of which is stored in its respective weight storage register. as well as The selected weight input is received from the multiplexer by the weight matrix register.
47. The method according to claim 41, wherein, The plurality of weight storage registers includes a transposed weight shift register and a non-transposed weight shift register that is physically separate from the transposed weight shift register.
48. The method according to claim 41, wherein, The plurality of weight storage registers include: A first weight storage register, configured to receive a first weight input from a first cell of the plurality of cells along the first direction via a first wired path; and A second weight storage register, configured to receive a second weight input from a second cell among the plurality of cells along the second direction via a second wired path. The weight input is one of the first weight input and the second weight input.
49. A non-transitory computer program product storing instructions, said instructions causing said at least one programmable processor to perform operations when executed by said at least one programmable processor, said operations including: A weight matrix register of a cell arranged in an array of matrix multiplication units receives weight inputs from a plurality of weight storage registers, wherein each of the plurality of weight storage registers is configured to receive a corresponding weight input from a corresponding direction of the array, wherein the corresponding direction includes a first direction of the array and a second direction of the array different from the first direction; and The multiplication unit coupled to the weight matrix register obtains the multiplication result based on the received weight input and another input data.
50. The non-transitory computer program product according to claim 49, wherein: The array has a two-dimensional format; The first direction of the array is the first direction of the two-dimensional format; and The second direction of the array is the second direction of the two-dimensional format.
51. The non-transitory computer program product according to claim 49, wherein, The plurality of weight storage registers includes a transposed weight shift register and a non-transposed weight shift register that is physically separate from the transposed weight shift register.
52. The non-transitory computer program product of claim 49, wherein the plurality of weight storage registers comprises: A first weight storage register is configured to receive a first weight input from a first cell among the plurality of cells along the first direction via a first wired path; as well as A second weight storage register is configured to receive a second weight input from a second cell among the plurality of cells along the second direction via a second wired path; The weight input is one of the first weight input and the second weight input.
Citation Information
Patent Citations
Matrix processing apparatus
US9898441B2
Multiplier circuit for digitally coded valves - provides outputs by stages coupled to shift resistor unit
DE4000574A1
Minimum mean square error processing
US20110125819A1
