# US 2022/0365750 A1 · Datatype conversion technique

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

- Number: US 2022/0365750 A1
- Document ID: US20220365750A1
- Status: Published application
- Kind: A1
- Application number: 17/745,512
- Filed: 2022-05-16
- Published: 2022-11-17
- Earliest claimed: 2021-05-14
- Assignees: NVIDIA Corporation
- Applicants: NVIDIA Corporation
- Inventors: Girish Bhaskarrao Bharambe; Kyrylo Perelygin; Advait Soman; Andrew Robert Kerr; Farhana Schuchman; Jaydeep Marathe; Stephen Anthony Bernard Jones; Ronny Meir Krashinsky; Jaewook Shin
- Web page: https://patentgrep.com/patent/US20220365750A1

## CPC

- G06F 7/49984: {Rounding away from zero}
- G06F 7/483: Computations with numbers represented by a non-linear combination of denominational numbers, e.g. rational numbers, logarithmic number system or floating-point numbers {(G06F7/4806, G06F7/4824, G06F7/49, G06F7/491, G06F7/544 take precedence)}
- G06F 7/5443: {Sum of products (for applications thereof, see the relevant places, e.g. G06F17/10, H03H17/00)}
- G06F 17/16: Matrix or vector computation {, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization (matrix transposition G06F7/78)}
- G06F 7/49947: {Rounding}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Apparatuses, systems, and techniques to generate numbers. In at least one embodiment, one or more circuits are to cause one or more thirty-two bit floating point numbers to be truncated to generate one or more rounded numbers based, at least in part, on one or more rounding attributes.

## Claims

### Claim 1

A processor, comprising:
one or more circuits to cause one or more thirty-two bit floating point (FP32) numbers to be truncated to generate one or more rounded thirty-two bit TensorFloat (TF32) numbers based, at least in part, on one or more rounding attributes.

### Claim 2 (depends on 1)

The processor of claim 1, wherein the one or more circuits are further to cause the one or more rounded TF32 numbers to be used in one or more operands of one or more matrix multiply and accumulate (MMA) operations.

### Claim 3 (depends on 1)

The processor of claim 1, wherein the one or more circuits are further to cause the one or more rounded TF32 numbers to be used in one or more operands of one or more matrix multiply and accumulate (MMA) operations to be performed by a group of threads all performing a same instruction.

### Claim 4 (depends on 1)

The processor of claim 1, wherein the one or more circuits are to select a method of rounding the one or more FP32 numbers based, at least in part, on one or more instruction parameters that indicate the one or more rounding attributes.

### Claim 5 (depends on 1)

The processor of claim 1, wherein the one or more circuits are to select a method of rounding the one or more FP32 numbers based, at least in part, on one or more application programming interface (API) parameters that indicate the one or more rounding attributes.

### Claim 6 (depends on 1)

The processor of claim 1, wherein the one or more circuits are select a method of rounding the one or more FP32 numbers based, at least in part, on one or more platform independent instruction parameters that indicate the one or more rounding attributes.

### Claim 7 (depends on 1)

The processor of claim 1, wherein the one or more circuits are to cause one or more FP32 numbers to be truncated by at least rounding an FP32 number to a TF32 number using a round ties to away from zero rounding mode.

### Claim 8 (depends on 1)

The processor of claim 1, wherein the one or more circuits are to further cause one or more hardware matrix engines to perform one or more matrix operations based, at least in part, on the one or more rounded TF32 numbers.

### Claim 9

A method, comprising:
causing one or more thirty-two bit floating point (FP32) numbers to be truncated to generate one or more rounded thirty-two bit TensorFloat (TF32) numbers based, at least in part, on one or more rounding attributes.

### Claim 10 (depends on 9)

The method of claim 9, further comprising, performing one or more matrix operations based, at least in part, on one or more matrices comprising the one or more rounded TF32 numbers.

### Claim 11 (depends on 9)

The method of claim 9, wherein the one or more rounding attributes are specified as an input parameter to an application programming interface (API) call to perform an operation.

### Claim 12 (depends on 9)

The method of claim 9, wherein the one or more rounding attributes are specified in a set of instructions to perform a matrix operation.

### Claim 13 (depends on 9)

The method of claim 9, wherein causing the one or more FP32 numbers to be truncated comprises adding a value to each of the one or more FP32 numbers and discarding a set of bits from each of the one or more FP32 numbers.

### Claim 14 (depends on 9)

The method of claim 9, wherein the one or more rounding attributes indicate a selection of a method of performing truncation.

### Claim 15 (depends on 9)

The method of claim 9, wherein causing the one or more one or more FP32 numbers to be truncated comprises generating, based at least in part on one or more human-readable instructions, one or more machine instructions to perform truncation of the one or more FP32 numbers.

### Claim 16 (depends on 9)

The method of claim 9, wherein causing the one or more FP32 numbers to be truncated comprises generating a software program to cause a set of threads to perform one or more matrix operations on a graphics processing unit using the one or more rounded TF32 numbers.

### Claim 17

A system, comprising:
one or more processors to cause one or more thirty-two bit floating point (FP32) numbers to be truncated to generate one or more rounded thirty-two bit TensorFloat (TF32) numbers based, at least in part, on one or more rounding attributes.

### Claim 18 (depends on 17)

The system of claim 17, wherein the one or more processors are further to cause one or more other processors to perform one or more matrix multiply and accumulate operations using one or more matrices comprising the one or more rounded TF32 values.

### Claim 19 (depends on 17)

The system of claim 17, wherein the one or more processors are further to change one or more numbers of one or more datatypes different from FP32 to generate one or more other TF32 numbers.

### Claim 20 (depends on 17)

The system of claim 17, wherein the one or more processors are to cause the one or more FP32 values to be truncated using a method indicated by the one or more rounding attributes.

### Claim 21 (depends on 17)

The system of claim 17, wherein the one or more rounding attributes indicate how to perform truncation of the one or more FP32 numbers.

### Claim 22 (depends on 17)

The system of claim 17, wherein the one or more processors are to cause the one or more FP32 numbers to be truncated automatically.

### Claim 23 (depends on 17)

The system of claim 17, wherein the one or more processors are to cause the one or more FP32 numbers to be truncated by discarding bits from each of the one or more FP32 numbers.

### Claim 24 (depends on 17)

The system of claim 17, wherein the one or more circuits are further to cause one or more matrix operations to be performed using one or more matrices comprising the one or more TF32 numbers.

### Claim 25

A machine-readable medium having stored thereon instructions that, if performed by one or more processors, cause the one or more processors to cause one or more thirty-two bit floating point (FP32) numbers to be truncated to generate one or more rounded thirty-two bit TensorFloat (TF32) numbers based, at least in part, on one or more rounding attributes.

### Claim 26 (depends on 25)

The machine-readable medium of claim 25, wherein the instructions, if performed by the one or more processors, further cause the one or more processors to cause a matrix multiply and accumulate operation to be performed using the one or more TF32 numbers.

### Claim 27 (depends on 25)

The machine-readable medium of claim 25, wherein the instructions, if performed by the one or more processors, further cause the one or more processors to cause a matrix multiply and accumulate operation to be performed using the one or more TF32 numbers and multiple groups of threads performing the same instruction, each group to be performed by a different matrix engine.

### Claim 28 (depends on 25)

The machine-readable medium of claim 25, wherein the one or more rounding attributes are indicated in a set of parameters of an application programming interface (API) to perform a matrix multiply and accumulate operation, the set of parameters further indicating a matrix operand comprising the one or more FP32 numbers.

### Claim 29 (depends on 25)

The machine-readable medium of claim 25, wherein the instructions, if performed by the one or more processors, further cause the one or more processors to select, based, at least in part, on the one or more rounding attributes, a way of rounding from a plurality of different ways of rounding.

### Claim 30 (depends on 25)

The machine-readable medium of claim 25, wherein the instructions, if performed by the one or more processors, further cause the one or more processors to compile code to generate machine instructions to perform truncation of the one or more FP32 numbers to generate the one or more rounded FP32 numbers.

### Claim 31 (depends on 25)

The machine-readable medium of claim 25, further comprising instructions that, if performed by the one or more processors, further cause the one or more processors to generate one or more TF32 numbers from one or more brain float (BF16) numbers.

### Claim 32 (depends on 25)

The machine-readable medium of claim 25, further comprising instructions that, if performed by the one or more processors, further cause the one or more processors to: generate one or more TF32 numbers from one or more double precision 64 bit floating point (FP64) numbers.
