IP Library Granted Patent US 12,175,246
Granted Patent B2
US 12,175,246 · App. 18/460,497 · Granted Dec 24, 2024

Systems and methods for performing matrix compress and decompress instructions

Inventors: Dan Baum (Haifa, IL); Michael Espig (Newberg, OR); James Guilford (Northborough, MA); Wajdi K. Feghali (Boston, MA); Raanan Sade (Portland, OR); Christopher J. Hughes (Santa Clara, CA); Robert Valentine (Kiryat Tivon, IL); Bret Toll (Hillsboro, OR); Elmoustapha Ould-Ahmed-Vall (Gilbert, AZ); Mark J. Charney (Lexington, MA); Vinodh Gopal (Westborough, MA); Ronen Zohar (Sunnyvale, CA); Alexander F. Heinecke (San Jose, CA)
Assignee: Intel Corporation
G06F9/30178G06F9/30036G06F9/3013G06F9/30145G06F9/3802
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,175,246
App. No.
18/460,497
Granted
Dec 24, 2024
Kind
B2
Abstract

Disclosed embodiments relate to matrix compress/decompress instructions. In one example, a processor includes fetch circuitry to fetch a compress instruction having a format with fields to specify an opcode and locations of decompressed source and compressed destination matrices, decode circuitry to decode the fetched compress instructions, and execution circuitry, responsive to the decoded compress instruction, to: generate a compressed result according to a compress algorithm by compressing the specified decompressed source matrix by either packing non-zero-valued elements together and storing the matrix position of each non-zero-valued element in a header, or using fewer bits to represent one or more elements and using the header to identify matrix elements being represented by fewer bits; and store the compressed result to the specified compressed destination matrix.

Claims (29)

1. A system comprising:

a memory to store instructions;

execution circuitry to execute the instructions to perform operations to compress a first tile of a first source matrix to generate a first compressed tile, the first source matrix comprising a plurality of integer data elements and the first tile comprising a first subset of the integer data elements, wherein the first tile is to be compressed by packing one or more non-zero-valued integer data elements of the first subset of integer data elements over zero-valued integer data elements and storing a matrix position of the one or more non-zero-valued integer data element in an index; and

matrix multiplication circuitry to multiply the first compressed tile and a second tile of a second source matrix, the second tile comprising a second subset of integer data elements of the second source matrix, the matrix multiplication circuitry comprising:

a plurality of multiply-accumulate circuits to perform a plurality of fused multiply-add operations to multiply the second subset of integer data elements of the second source matrix by corresponding non-zero-valued integer data elements of the first source matrix identified based on the index to generate a plurality of products, and to add groups of the plurality of products to generate corresponding result data elements of a result matrix.

2. The system of claim 1 , further comprising an execution unit including the execution circuitry and the matrix multiplication circuitry, the execution unit to execute at least one instruction to cause the execution circuitry to compress the first tile of the first source matrix to generate the first compressed tile and to cause the matrix multiplication circuitry to multiply the first compressed tile and a second tile of a second source matrix.

3. The system of claim 1 , wherein the first tile comprises one of a plurality of tiles of the first source matrix and the second tile comprises one of a plurality of tiles of the second source matrix, each tile of the plurality of tiles of the first source matrix to be multiplied by a corresponding tile of the plurality of tiles of the second source matrix to perform a multiplication of the first source matrix and the second source matrix.

4. The system of claim 1 , wherein the first source matrix comprises a sparse matrix comprising a greater or equal number of zero-value data elements than non-zero-value data elements.

5. The system of claim 1 , wherein the result data elements comprise 32-bit values.

6. The system of claim 1 , further comprising:

a first plurality of registers, each register of the first plurality of registers to store at least a portion of the first subset of integer data elements; and

a second plurality of registers, each register of the second plurality of registers to store at least a portion of the second subset of integer data elements.

7. The system of claim 1 , wherein the result data elements comprise 32-bit values.

8. The system of claim 1 , wherein the plurality of integer data elements of the first source matrix and the second source matrix comprise 4-bit or 8-bit integer data elements.

9. The system of claim 1 , wherein the corresponding result data elements of the result matrix have a bit width which is four times a bit width of the plurality of integer data elements of the first source matrix and the second source matrix.

10. A non-transitory machine-readable medium having program code stored thereon which, when executed by one or more processors, causes the one or more processors to perform operations comprising:

compressing a first tile of a first source matrix to generate a first compressed tile, the first source matrix comprising a plurality of integer data elements and the first tile comprising a first subset of the integer data elements, wherein the first tile is to be compressed by packing one or more non-zero-valued integer data elements of the first subset of integer data elements over zero-valued integer data elements and storing a matrix position of the one or more non-zero-valued integer data element in an index;

multiplying the first compressed tile and a second tile of a second source matrix, the second tile comprising a second subset of integer data elements of the second source matrix, wherein multiplying the first compressed tile and a second tile of a second source matrix comprises:

performing a plurality of fused multiply-add operations on a plurality of multiply-accumulate circuits to multiply the second subset of integer data elements of the second source matrix by corresponding non-zero-valued integer data elements of the first source matrix identified based on the index to generate a plurality of products, and to add groups of the plurality of products to generate corresponding result data elements of a result matrix.

11. The non-transitory machine-readable medium of claim 10 , further comprising: executing at least one instruction of the program code to cause the first tile of the first source matrix to be compressed to generate the first compressed tile and to cause the plurality of multiply-accumulate circuits to multiply the first compressed tile and a second tile of a second source matrix.

12. The non-transitory machine-readable medium of claim 10 , wherein the first tile comprises one of a plurality of tiles of the first source matrix and the second tile comprises one of a plurality of tiles of the second source matrix, each tile of the plurality of tiles of the first source matrix to be multiplied by a corresponding tile of the plurality of tiles of the second source matrix to perform a multiplication of the first source matrix and the second source matrix.

13. The non-transitory machine-readable medium of claim 10 , wherein the first source matrix comprises a sparse matrix comprising a greater or equal number of zero-value data elements than non-zero-value data elements.

14. The non-transitory machine-readable medium of claim 10 , wherein the result data elements comprise 32-bit values.

15. The non-transitory machine-readable medium of claim 10 , further comprising program code to cause the one or more processors to perform the operations of:

storing at least a portion of the first subset of integer data elements in a first plurality of registers; and

storing at least a portion of the second subset of integer data elements in a second plurality of registers.

16. The non-transitory machine-readable medium of claim 10 , wherein the result data elements comprise 32-bit values.

17. The non-transitory machine-readable medium of claim 10 , wherein the plurality of integer data elements of the first source matrix and the second source matrix comprise 4-bit or 8-bit integer data elements.

18. The non-transitory machine-readable medium of claim 10 , wherein the corresponding result data elements of the result matrix have a bit width which is four times a bit width of the plurality of integer data elements of the first source matrix and the second source matrix.

Continuity (4)
Continuation 17672253 · Feb 15, 2022
Continuation 16934003 · Jul 20, 2020
Continuation 16144902 · Sep 27, 2018
Related Publication 20240045690A1 · Feb 8, 2024
Cited By (1)
US 12,688,043