# US 2021/0286620 A1 · Systems and methods for performing 16-bit floating-point matrix dot product instructions

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

- Number: US 2021/0286620 A1
- Document ID: US20210286620A1
- Status: Published application
- Kind: A1
- Application number: 17/216,566
- Filed: 2021-03-29
- Published: 2021-09-16
- Earliest claimed: 2018-11-09
- Assignees: Intel Corporation
- Applicants: Intel Corporation
- Inventors: Alexander F. HEINECKE; Robert VALENTINE; Mark J. CHARNEY; Raanan SADE; Menachem ADELMAN; Zeev SPERBER; Amit GRADSTEIN; Simon RUBANOVICH
- Web page: https://patentgrep.com/patent/US20210286620A1

## CPC

- G06F 9/30014: {with variable precision}
- G06F 9/30036: {Instructions to perform operations on packed data, e.g. vector, tile or matrix operations}
- G06F 9/3001: {Arithmetic instructions}
- G06F 9/30025: {Format conversion instructions, e.g. Floating-Point to Integer, decimal conversion}
- G06F 9/30038: {using a mask}
- G06F 9/30043: {LOAD or STORE instructions; Clear instruction}
- G06F 9/30076: {to perform miscellaneous control operations, e.g. NOP}
- G06F 9/30109: {having multiple operands in a single register}
- G06F 9/3016: {Decoding the operand specifier, e.g. specifier format}
- G06F 9/3802: {Instruction prefetching}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Disclosed embodiments relate to computing dot products of nibbles in tile operands. In one example, a processor includes decode circuitry to decode a tile dot product instruction having fields for an opcode, a destination identifier to identify a M by N destination matrix, a first source identifier to identify a M by K first source matrix, and a second source identifier to identify a K by N second source matrix, each of the matrices containing doubleword elements, and execution circuitry to execute the decoded instruction to perform a flow K times for each element (m, n) of the specified destination matrix to generate eight products by multiplying each nibble of a doubleword element (M,K) of the specified first source matrix by a corresponding nibble of a doubleword element (K,N) of the specified second source matrix, and to accumulate and saturate the eight products with previous contents of the doubleword element.

## Claims

### Claim 1

A processor comprising:
a general-purpose central processing unit (CPU) core, comprising:
a control register to specify a round mode;
fetch circuitry to fetch an instruction;
decode circuitry to decode the instruction, the instruction having an opcode, a first field to specify a first storage location of a plurality of data elements corresponding to a first matrix having M rows by N columns of 32-bit single precision floating-point data elements, a second field to specify a second storage location of a plurality of data elements corresponding to a second matrix having M rows by K columns of 16-bit floating-point data elements having a bfloat16 format, and a third field to specify a third storage location of a plurality of data elements corresponding to a third matrix having K rows by N columns of 16-bit floating-point data elements having the bfloat16 format; and
execution circuitry coupled with the decode circuitry, the execution circuitry to perform operations corresponding to the instruction to, for each row m of the M rows of the second matrix, and for each column n of the N columns of the third matrix:
generate a dot product from K 16-bit floating-point data elements corresponding to the row m of the second matrix and K 16-bit floating-point data elements corresponding to the column n of the third matrix, including application of a single round mode regardless of the round mode specified by the control register;
accumulate the dot product with a 32-bit single precision floating-point data element corresponding to a row m of the M rows, and corresponding to a column n of the N columns, of the first matrix, including application of the single round mode regardless of the round mode specified by the control register to generate a result 32-bit single precision floating-point data element; and
store the result 32-bit single precision floating-point data element in a position of the first storage location corresponding to the row m and the column n of the first matrix.

### Claim 2 (depends on 1)

The processor of claim 1, wherein the processor is not to consult the control register due to the instruction.

### Claim 3 (depends on 1)

The processor of claim 1, wherein the processor is not to update a status register due to the instruction.

### Claim 4 (depends on 1)

The processor of claim 1, wherein the processor is not to denote exceptions due to the instruction.

### Claim 5 (depends on 1)

The processor of claim 1, wherein the execution circuitry is to perform an operation corresponding to the instruction to process denormal values of the second and third matrices as zero.

### Claim 6 (depends on 1)

The processor of claim 1, wherein the execution circuitry is to perform an operation corresponding to the instruction to flush denormal values to zero.

### Claim 7 (depends on 1)

The processor of claim 1, wherein the M rows of the second matrix and the N columns of the third matrix are equal in number.

### Claim 8 (depends on 1)

The processor of claim 1, wherein the first, second, and third storage locations are in 128-bit vector registers.

### Claim 9 (depends on 1)

The processor of claim 1, wherein each dot product is a 32-bit single precision floating-point dot product.

### Claim 10 (depends on 1)

The processor of claim 1, wherein the general-purpose CPU core further comprises:
a branch prediction circuitry;
a register rename circuitry; and
scheduler circuitry to schedule the decoded instruction for execution.

### Claim 11 (depends on 1)

The processor of claim 1, wherein the core is a reduced instruction set computing (RISC) core.

### Claim 12 (depends on 1)

The processor of claim 1, wherein the single round mode is fixed for the instruction.

### Claim 13

A system on a chip (SoC) comprising:
an memory controller; and
a general-purpose central processing unit (CPU) core coupled with the memory controller, the general-purpose CPU core comprising:
a control register to specify a round mode;
fetch circuitry to fetch an instruction;
decode circuitry to decode the instruction, the instruction having an opcode, a first field to specify a first storage location of a plurality of data elements corresponding to a first matrix having M rows by N columns of 32-bit single precision floating-point data elements, a second field to specify a second storage location of a plurality of data elements corresponding to a second matrix having M rows by K columns of 16-bit floating-point data elements having a bfloat16 format, and a third field to specify a third storage location of a plurality of data elements corresponding to a third matrix having K rows by N columns of 16-bit floating-point data elements having the bfloat16 format; and
execution circuitry coupled with the decode circuitry, the execution circuitry to perform operations corresponding to the instruction to, for each row m of the M rows of the second matrix, and for each column n of the N columns of the third matrix:
generate a dot product from K 16-bit floating-point data elements corresponding to the row m of the second matrix and K 16-bit floating-point data elements corresponding to the column n of the third matrix, including application of a single round mode regardless of the round mode specified by the control register;
accumulate the dot product with a 32-bit single precision floating-point data element corresponding to a row m of the M rows, and corresponding to a column n of the N columns, of the first matrix, including application of the single round mode regardless of the round mode specified by the control register to generate a result 32-bit single precision floating-point data element; and
store the result 32-bit single precision floating-point data element in a position of the first storage location corresponding to the row m and the column n of the first matrix.

### Claim 14 (depends on 13)

The SoC of claim 13, wherein the general-purpose CPU core is not to consult the control register due to the instruction, and further comprising a network processor coupled with the general-purpose CPU core.

### Claim 15 (depends on 13)

The SoC of claim 13, wherein the general-purpose CPU core is not to update a status register due to the instruction, and further comprising a coprocessor coupled with the general-purpose CPU core.

### Claim 16 (depends on 13)

The SoC of claim 13, wherein the execution circuitry is to perform an operation corresponding to the instruction to process denormal values of the second and third matrices as zero, and further comprising a network processor coupled with the general-purpose CPU core.

### Claim 17 (depends on 13)

The SoC of claim 13, wherein the single round mode is fixed for the instruction, and further comprising a coprocessor coupled with the general-purpose CPU core.

### Claim 18 (depends on 13)

The SoC of claim 13, wherein the core is a reduced instruction set computing (RISC) core, and further comprising an image processor coupled with the general-purpose CPU core.

### Claim 19

A system comprising:
a memory; and
a general-purpose central processing unit (CPU) core coupled with the memory, the general-purpose CPU core comprising:
a control register to specify a round mode;
fetch circuitry to fetch an instruction;
decode circuitry to decode the instruction, the instruction having an opcode, a first field to specify a first storage location of a plurality of data elements corresponding to a first matrix having M rows by N columns of 32-bit single precision floating-point data elements, a second field to specify a second storage location of a plurality of data elements corresponding to a second matrix having M rows by K columns of 16-bit floating-point data elements having a bfloat16 format, and a third field to specify a third storage location of a plurality of data elements corresponding to a third matrix having K rows by N columns of 16-bit floating-point data elements having the bfloat16 format; and
execution circuitry coupled with the decode circuitry, the execution circuitry to perform operations corresponding to the instruction to, for each row m of the M rows of the second matrix, and for each column n of the N columns of the third matrix:
generate a dot product from K 16-bit floating-point data elements corresponding to the row m of the second matrix and K 16-bit floating-point data elements corresponding to the column n of the third matrix, including application of a single round mode regardless of the round mode specified by the control register;
accumulate the dot product with a 32-bit single precision floating-point data element corresponding to a row m of the M rows, and corresponding to a column n of the N columns, of the first matrix, including application of the single round mode regardless of the round mode specified by the control register to generate a result 32-bit single precision floating-point data element; and
store the result 32-bit single precision floating-point data element in a position of the first storage location corresponding to the row m and the column n of the first matrix.

### Claim 20 (depends on 19)

The system of claim 19, wherein the general-purpose CPU core is not to consult the control register due to the instruction, and wherein the system further comprises a mass storage device coupled to the general-purpose CPU core.

### Claim 21 (depends on 19)

The system of claim 19, wherein the general-purpose CPU core is not to update a status register due to the instruction, and wherein the system further comprises a Peripheral Component Interconnect (PCI) Express bus coupled to the general-purpose CPU core.

### Claim 22 (depends on 19)

The system of claim 19, wherein the execution circuitry is to perform an operation corresponding to the instruction to process denormal values of the second and third matrices as zero, and wherein the system further comprises a communication device coupled to the general-purpose CPU core.

### Claim 23 (depends on 19)

The system of claim 19, wherein the single round mode is fixed for the instruction, wherein the system further comprises a mass storage device coupled to the general-purpose CPU core.

### Claim 24 (depends on 19)

The system of claim 19, wherein the general-purpose CPU core is a reduced instruction set computing (RISC) core, and wherein the system further comprises a Peripheral Component Interconnect (PCI) Express bus coupled to the general-purpose CPU core.

### Claim 25

A method comprising:
processing data with a general-purpose central processing unit (CPU) core:
specifying a round mode in a control register;
fetching an instruction;
decoding the instruction, the instruction having an opcode, a first field specifying a first storage location of a plurality of data elements corresponding to a first matrix having M rows by N columns of 32-bit single precision floating-point data elements, a second field specifying a second storage location of a plurality of data elements corresponding to a second matrix having M rows by K columns of 16-bit floating-point data elements having a bfloat16 format, and a third field specifying a third storage location of a plurality of data elements corresponding to a third matrix having K rows by N columns of 16-bit floating-point data elements having the bfloat16 format;
performing operations corresponding to the instruction including, for each row m of the M rows of the second matrix, and for each column n of the N columns of the third matrix:
generating a dot product from K 16-bit floating-point data elements corresponding to the row m of the second matrix and K 16-bit floating-point data elements corresponding to the column n of the third matrix, including application of a single round mode regardless of the round mode specified by the control register;
accumulating the dot product with a 32-bit single precision floating-point data element corresponding to a row m of the M rows, and corresponding to a column n of the N columns, of the first matrix, including application of the single round mode regardless of the round mode specified by the control register to generate a result 32-bit single precision floating-point data element; and
storing the result 32-bit single precision floating-point data element in a position of the first storage location corresponding to the row m and the column n of the first matrix.

### Claim 26 (depends on 25)

The method of claim 25, further comprising processing denormal values of the second and third matrices as zero.

### Claim 27

A processor comprising:
a general-purpose central processing unit (CPU) core, comprising:
a control register to specify a round mode;
fetch circuitry to fetch an instruction;
decode circuitry to decode the instruction, the instruction having an opcode, the instruction to specify a first storage location of a plurality of data elements corresponding to a first matrix having M rows by N columns of 32-bit single precision floating-point data elements, to specify a second storage location of a plurality of data elements corresponding to a second matrix having M rows by K columns of 16-bit floating-point data elements having a bfloat16 format, and to specify a third storage location of a plurality of data elements corresponding to a third matrix having K rows by N columns of 16-bit floating-point data elements having the bfloat16 format; and
execution circuitry coupled with the decode circuitry, the execution circuitry to perform operations corresponding to the instruction to, for each row m of the M rows of the second matrix, and for each column n of the N columns of the third matrix:
generate a dot product from K 16-bit floating-point data elements corresponding to the row m of the second matrix and K 16-bit floating-point data elements corresponding to the column n of the third matrix;
accumulate the dot product with a 32-bit single precision floating-point data element corresponding to a row m of the M rows, and corresponding to a column n of the N columns, of the first matrix, including application of a single round to nearest even round mode regardless of the round mode specified by the control register to generate a result 32-bit single precision floating-point data element; and
store the result 32-bit single precision floating-point data element in a position of the first storage location corresponding to the row m and the column n of the first matrix.

### Claim 28 (depends on 27)

The processor of claim 27, wherein the processor is not to consult the control register due to the instruction.

### Claim 29 (depends on 28)

The processor of claim 28, wherein the execution circuitry is to perform an operation corresponding to the instruction to process denormal values of the second and third matrices as zero.

### Claim 30 (depends on 27)

The processor of claim 27, wherein the processor is not to update a status register due to the instruction.

### Claim 31 (depends on 30)

The processor of claim 30, wherein the execution circuitry is to perform an operation corresponding to the instruction to flush denormal values to zero.
