# US 2023/0068941 A1 · Quantized neural network training and inference

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

- Number: US 2023/0068941 A1
- Document ID: US20230068941A1
- Status: Published application
- Kind: A1
- Application number: 17/670,361
- Filed: 2022-02-11
- Published: 2023-03-02
- Earliest claimed: 2021-08-27
- Assignees: NVIDIA Corporation
- Applicants: Nvidia Corporation
- Inventors: Thierry TAMBE; Steve DAI; Brucek KHAILANY; Rangharajan VENKATESAN
- Web page: https://patentgrep.com/patent/US20230068941A1

## CPC

- G06N 3/04: Architecture, e.g. interconnection topology
- G06F 17/16: Matrix or vector computation {, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization (matrix transposition G06F7/78)}
- G06N 3/0495: Quantised networks; Sparse networks; Compressed networks
- G06N 3/063: using electronic means
- G06N 3/084: Backpropagation, e.g. using gradient descent
- G06N 3/09: Supervised learning
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

One embodiment of a computer-implemented method for processing a neural network comprises receiving a first quantized matrix that corresponds to a portion of a multi-dimensional input tensor and has been quantized based on a first scale factor; and performing one or more computational operations using the first quantized matrix and the first scale factor to generate one or more data values that correspond to a first portion of a multi-dimensional output tensor.

## Claims

### Claim 1

A computer-implemented method for processing a neural network, the method comprising:
receiving a first quantized matrix that corresponds to a portion of a multi-dimensional input tensor and has been quantized based on a first scale factor; and
performing one or more computational operations using the first quantized matrix and the first scale factor to generate one or more data values that correspond to a first portion of a multi-dimensional output tensor.

### Claim 2 (depends on 1)

The computer-implemented method of claim 1, further comprising:
receiving a second quantized matrix that corresponds to a portion of a second multi-dimensional input tensor and has been quantized based on a second scale factor;
wherein performing the one or more computational operations further comprises using the second quantized matrix and the second scale factor to generate the one or more data values.

### Claim 3 (depends on 2)

The computer-implemented method of claim 2, wherein performing the one or more computational operations comprises computing one or more dot-product values using the first quantized matrix and the second quantized matrix.

### Claim 4 (depends on 2)

The computer-implemented method of claim 2, wherein performing the one or more computational operations comprises scaling each dot-product value included in one or more dot-product values using the first scale factor and the second scale factor.

### Claim 5 (depends on 1)

The computer-implemented method of claim 1, wherein the first quantized matrix comprises a transposed matrix.

### Claim 6 (depends on 1)

The computer-implemented method of claim 1, wherein the first quantized matrix is included in a plurality of quantized matrices, wherein each quantized matrix included in the plurality of quantized matrices corresponds to a different portion of the multi-dimensional input tensor and has been quantized using a different scale factor.

### Claim 7 (depends on 6)

The computer-implemented method of claim 6, wherein performing the one or more computational operations further comprises, for each quantized matrix included in the plurality of quantized matrices, using the quantized matrix and an associated scale factor to generate one or more associated data values that correspond to a different portion of the multi-dimensional output tensor.

### Claim 8 (depends on 1)

The computer-implemented method of claim 1, further comprising scaling the multi-dimensional output tensor based on a second scale factor associated with the multi-dimensional output tensor.

### Claim 9 (depends on 1)

The computer-implemented method of claim 1, further comprising quantizing the multi-dimensional output tensor by subdividing the multi-dimensional output tensor into a plurality of matrices and quantizing each matrix included in the plurality of matrices.

### Claim 10 (depends on 1)

The computer-implemented method of claim 1, further comprising quantizing the multi-dimensional output tensor by:
computing, for each matrix included in a plurality of matrices that comprise the multi-dimensional output tensor, a corresponding scale factor based on one or more data values included in the matrix; and
quantizing each matrix included in the plurality of matrices based on the corresponding scale factor.

### Claim 11

One or more non-transitory computer-readable media storing instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of:
receiving a first quantized matrix that corresponds to a portion of a multi-dimensional input tensor and has been quantized based on a first scale factor; and
performing one or more computational operations using the first quantized matrix and the first scale factor to generate one or more data values that correspond to a first portion of a multi-dimensional output tensor.

### Claim 12 (depends on 11)

The one or more non-transitory computer-readable media of claim 11, further comprising:
receiving a second quantized matrix that corresponds to a portion of a second multi-dimensional input tensor and has been quantized based on a second scale factor;
wherein performing the one or more computational operations further comprises using the second quantized matrix and the second scale factor to generate the one or more data values.

### Claim 13 (depends on 12)

The one or more non-transitory computer-readable media of claim 12, wherein performing the one or more computational operations comprises computing a first dot-product value between a first vector included in the first quantized matrix and a second vector included in the second quantized matrix.

### Claim 14 (depends on 12)

The one or more non-transitory computer-readable media of claim 12, wherein performing the one or more computational operations comprises scaling a first dot-product value based on at least one of the first scale factor or the second scale factor.

### Claim 15 (depends on 11)

The one or more non-transitory computer-readable media of claim 11, further comprising receiving the first scale factor and storing the first quantized matrix and the first scale factor in a data buffer.

### Claim 16 (depends on 15)

The one or more non-transitory computer-readable media of claim 15, wherein performing the one or more computational operations comprises reading a first set of input values included in the first quantized matrix from the data buffer; and reading the first scale factor from the data buffer, wherein the first set of input values also is used to perform the one or more computational operations.

### Claim 17 (depends on 15)

The one or more non-transitory computer-readable media of claim 15, wherein the data buffer comprises a plurality of rows, and wherein storing the first quantized matrix and the first scale factor in the data buffer comprises storing the first quantized matrix and the first scale factor in a first row included in the plurality of rows.

### Claim 18 (depends on 15)

The one or more non-transitory computer-readable media of claim 15, wherein the data buffer comprises a plurality of memory banks, wherein storing the first quantized matrix in the data buffer comprises for each column included in the first quantized matrix, storing the column in a different memory bank included in the plurality of memory banks.

### Claim 19 (depends on 11)

The one or more non-transitory computer-readable media of claim 11, wherein the first quantized matrix is included in a plurality of quantized matrices, wherein each quantized matrix included in the plurality of quantized matrices corresponds to a different portion of the multi-dimensional input tensor and has been quantized using a different scale factor, and further comprising for each quantized matrix included in the plurality of quantized matrices, receiving the quantized matrix and an associated scale factor, and storing the quantized matrix and the associated scale factor in a different row of a data buffer.

### Claim 20

A system comprising:
one or more memories storing instructions; and
one or more processors that are coupled to the one or more memories and,
when executing the instructions, perform the steps of:
receiving a first quantized matrix that corresponds to a portion of a multi-dimensional input tensor and has been quantized based on a first scale factor; and
performing one or more computational operations using the first quantized matrix and the first scale factor to generate one or more data values that correspond to a first portion of a multi-dimensional output tensor.
