# US 10,956,537 B2 · Permuting in a matrix-vector processor

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 10,956,537 B2
- Document ID: US10956537B2
- Status: Granted
- Kind: B2
- Application number: 16/840,972
- Filed: 2020-04-06
- Published: 2020-09-24
- Granted: 2021-03-23
- Earliest claimed: 2017-02-17
- Assignees: Google Inc.
- Applicants: Google LLC
- Inventors: Dong Hyuk Woo; Gregory Michael Thorson; Andrew Everett Phelps; Olivier Temam; Jonathan Ross; Christopher Aaron Clark
- Web page: https://patentgrep.com/patent/US10956537B2

## CPC

- G06F 17/16: Matrix or vector computation {, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization (matrix transposition G06F7/78)}
- G06F 7/76: Arrangements for rearranging, permuting or selecting data according to predetermined rules, independently of the content of the data
- G06F 9/30032: {Movement instructions, e.g. MOVE, SHIFT, ROTATE, SHUFFLE}
- G06F 9/30036: {Instructions to perform operations on packed data, e.g. vector, tile or matrix operations}
- G06N 3/063: using electronic means
- G06N 3/084: Backpropagation, e.g. using gradient descent
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

A circuit comprises an input register configured to receive an input vector of elements, a control register configured to receive a control vector of elements, wherein each element of the control vector corresponds to a respective element of the input vector, and wherein each element specifies a permutation of a corresponding element of the input vector, and a permute execution circuit configured to generate an output vector of elements corresponding to a permutation of the input vector. Generating each element of the output vector comprises accessing, at the input register, a particular element of the input vector, accessing, at the control register, a particular element of the control vector corresponding to the particular element of the input vector, and outputting the particular element of the input vector as an element at a particular position of the output vector that is selected based on the particular element of the control vector.

## Claims

### Claim 1

A matrix-vector permuting system comprising a permute execution circuit that includes:
an input register configured to receive and access vectors of elements of an input matrix, the input register having N addresses for storing each element of the input matrix,
a plurality of multiplexors, wherein each multiplexor is connected to the N addresses of the input register and each output of the plurality of multiplexors is sent to a corresponding value output of the permute execution circuit, and
a control register connected to the plurality of multiplexors, the control register having N addresses, wherein each address is configured to store an element corresponding to a control signal for controlling a permutation of one of the elements of the input matrix.

### Claim 2 (depends on 1)

The system of claim 1, wherein the vectors of elements of the input matrix are received as staggered input and wherein the permute execution circuit further comprises:
a flattening register configured to:
receive each input element of input vector in a separate cycle in an order beginning with a lowest-order bit position of the flattening register; and
pop all input elements of the input vector simultaneously from the flattening register to the input register.

### Claim 3 (depends on 2)

The system of claim 2, wherein each element of the input matrix is received at each cycle in an order beginning with a lowest-order bit position of the input vector.

### Claim 4 (depends on 3)

The system of claim 3, wherein popping all input elements of the input vector simultaneously from the flattening register to the input register comprises:
determining that a highest-order bit of the flattening register has received valid data, and
popping all input elements of the input vector simultaneously from the flattening register to the input register in response to determining that the highest-order bit of the flattening register has received valid data.

### Claim 5 (depends on 3)

The system of claim 3, wherein popping all input elements of the input vector simultaneously from the flattening register to the input register comprises:
determining that the flattening register has received a number of input elements of the input vector equal to a dimension of the input vector, and
popping all input elements of the input vector simultaneously from the flattening register to the input register in response to determining that the flattening register has received the number of input elements of the input vector equal to the dimension of the input vector.

### Claim 6 (depends on 1)

The system of claim 1, wherein the control register is configured to receive a control vector of control elements, and
wherein the permute execution circuit is configured to generate an output vector, comprising:
accessing, at a particular position of the control register, a particular control element of the control vector corresponding to a particular position of the output vector,
selecting a particular position of the input register based on the particular control element of the control vector corresponding to the particular position of the output vector,
accessing, at the particular position of the input register, a particular input element of the input vector, and
outputting the particular input element of the input vector as an output element at the particular position of the output vector.

### Claim 7 (depends on 6)

The system of claim 6, the permute execution circuit further comprising an output register configured to receive the output vector.

### Claim 8 (depends on 7)

The system of claim 7, wherein the output register is configured to output the output vector as a staggered output such that a single output element of the output vector is output at each cycle in an order beginning with a lowest-order bit position of the output vector.

### Claim 9

A method for matrix-vector permuting, comprising:
receiving and accessing, by an input register of a permuting executing circuit, vectors of elements of an input matrix, the input register having N addresses for storing each element of the input matrix;
connecting each of a plurality of multiplexors to the N addresses of the input register and sending each output of the plurality of multiplexors to a corresponding value output of the permute execution circuit; and
connecting a control register to the plurality of multiplexors, the control register having N addresses, wherein each address is configured to store an element corresponding to a control signal for controlling a permutation of one of the elements of the input matrix.

### Claim 10 (depends on 9)

The method of claim 9, wherein the vectors of elements of the input matrix are received as staggered input by performing operations comprising:
receiving, at a flattening register, each input element of the input vector in a separate cycle in an order beginning with a lowest-order bit position of the flattening register; and
popping, from the flattening register, all input elements of the input vector simultaneously from the flattening register to the input register.

### Claim 11 (depends on 10)

The method of claim 10, wherein the control register is configured to receive a control vector of control elements, and
wherein the permute execution circuit is configured to generate an output vector, comprising:
access, at a particular position of the control register, a particular control element of the control vector corresponding to a particular position of the output vector,
select a particular position of the input register based on the particular control element of the control vector corresponding to the particular position of the output vector,
access, at the particular position of the input register, a particular input element of the input vector, and
output the particular input element of the input vector as an output element at the particular position of the output vector.

### Claim 12 (depends on 11)

The method of claim 11, further comprising an output register configured to receive the output vector.

### Claim 13 (depends on 12)

The method of claim 12, wherein the output register is configured to output the output vector as a staggered output such that a single output element of the output vector is output at each cycle in an order beginning with a lowest-order bit position of the output vector.

### Claim 14 (depends on 10)

The method of claim 10, wherein each element of the input matrix is received at each cycle in an order beginning with a lowest-order bit position of the input vector.

### Claim 15 (depends on 14)

The method of claim 14, wherein popping all input elements of the input vector simultaneously from the flattening register to the input register comprises:
determining that a highest-order bit of the flattening register has received valid data, and
popping all input elements of the input vector simultaneously from the flattening register to the input register in response to determining that the highest-order bit of the flattening register has received valid data.

### Claim 16 (depends on 14)

The method of claim 14, wherein popping all input elements of the input vector simultaneously from the flattening register to the input register comprises:
determining that the flattening register has received a number of input elements of the input vector equal to a dimension of the input vector, and
popping all input elements of the input vector simultaneously from the flattening register to the input register in response to determining that the flattening register has received the number of input elements of the input vector equal to the dimension of the input vector.
