IP Library › Granted Patent US 12,287,843
Granted Patent B2
US 12,287,843 · App. 18/502,291 · Granted Apr 29, 2025

Systems and methods of instructions to accelerate multiplication of sparse matrices using bitmasks that identify non-zero elements

Inventors: Dan Baum (Haifa, IL); Chen Koren (Hadera, IL); Elmoustapha Ould-Ahmed-Vall (Chandler, AZ); Michael Espig (Newberg, OR); Christopher J. Hughes (Santa Clara, CA); Raanan Sade (Kibutz Sarid, IL); Robert Valentine (Kiryat Tivon, IL); Mark J. Charney (Lexington, MA); Alexander F. Heinecke (San Jose, CA)
Assignee: Intel Corporation
G06F17/16G06F9/3001G06F9/30101G06F9/3016G06F9/3802G06F9/3836G06F9/3893
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,287,843
App. No.
18/502,291
Granted
Apr 29, 2025
Kind
B2
Abstract

Disclosed embodiments relate to accelerating multiplication of sparse matrices. In one example, a processor is to fetch and decode an instruction having fields to specify locations of first, second, and third matrices, and an opcode indicating the processor is to multiply and accumulate matching non-zero (NZ) elements of the first and second matrices with corresponding elements of the third matrix, and executing the decoded instruction as per the opcode to generate NZ bitmasks for the first and second matrices, broadcast up to two NZ elements at a time from each row of the first matrix and each column of the second matrix to a processing engine (PE) grid, each PE to multiply and accumulate matching NZ elements of the first and second matrices with corresponding elements of the third matrix. Each PE further to store an NZ element for use in a subsequent multiplications.

Claims (37)

1. An apparatus comprising:

a cache; and

a graphics processing unit coupled to the cache, wherein the graphics processing unit comprises:

a first register to store elements from a first matrix that has zero and non-zero values in a compressed format,

a second register to store elements from a second matrix,

a scheduler circuit to schedule an instruction for execution, the instruction comprising fields to specify the first register, the second register, an accumulation matrix, a destination matrix, indications of a logical matrix position of the elements in at least the first matrix in a non-compressed format, and an opcode to indicate the instruction is a sparse matrix instruction and that execution circuitry including a processing engine is to select a proper subset of elements of the second register from the second matrix as an input into a multiply-accumulator circuit of the processing engine based on the indications, multiply the elements from the first matrix with corresponding elements of the proper subset of elements of the second matrix to generate products, accumulate the products with corresponding elements of the accumulation matrix to produce sums, and store the sums in corresponding elements of the destination matrix, and

the execution circuitry, including the processing engine, to execute the instruction according to the opcode,

wherein the first matrix has M rows by K columns, the second matrix has K rows by N columns, the accumulation matrix has M rows by N columns, and the instruction includes a suffix to the opcode that when set to a first value is to explicitly specify a first set of K, M, and N values, and when set to a different second value is to explicitly specify a different second set of K, M, and N values.

2. The apparatus of claim 1 , wherein the processing engine comprises a multiplexer, and the multiplexer is to be controlled based on the indications of the logical matrix position of the elements in at least the first matrix in the non-compressed format to select the proper subset of elements of the second register from the second matrix as the input into the multiply-accumulator circuit.

3. The apparatus of claim 2 , wherein the graphics processing unit comprises a plurality of instances of the processing engine.

4. The apparatus of claim 1 , further comprising a central processing unit coupled to the graphics processing unit, wherein the graphics processing unit and the central processing unit are in a same package.

5. The apparatus of claim 1 , wherein the graphics processing unit supports multithreading.

6. The apparatus of claim 1 , wherein the elements from the first matrix are in the first register in row major layout.

7. The apparatus of claim 1 , wherein the instruction includes a second suffix to the opcode that when set to a first value is to explicitly specify the elements are floating-point format and when set to a different second value is to explicitly specify the elements are integer format.

8. The apparatus of claim 1 , wherein the execution circuitry further comprises an integer execution circuit and a floating-point execution circuit.

9. A method comprising:

storing elements from a first matrix that has zero and non-zero values in a compressed format in a first register of a graphics processing unit;

storing elements from a second matrix in a second register of the graphics processing unit;

scheduling, by a scheduler circuit of the graphics processing unit, an instruction for execution, the instruction comprising fields to specify the first register, the second register, an accumulation matrix, a destination matrix, indications of a logical matrix position of the elements in at least the first matrix in a non-compressed format, and an opcode to indicate the instruction is a sparse matrix instruction and that execution circuitry of the graphics processing unit including a processing engine is to select a proper subset of elements of the second register from the second matrix as an input into a multiply-accumulator circuit of the processing engine based on the indications, multiply the elements from the first matrix with corresponding elements of the proper subset of elements of the second matrix to generate products, accumulate the products with corresponding elements of the accumulation matrix to produce sums, and store the sums in corresponding elements of the destination matrix; and

executing, by the execution circuitry including the processing engine, the instruction according to the opcode,

wherein the first matrix has M rows by K columns, the second matrix has K rows by N columns, the accumulation matrix has M rows by N columns, and the instruction includes a suffix to the opcode that when set to a first value explicitly specifies a first set of K, M, and N values, and when set to a different second value explicitly specifies a different second set of K, M, and N values.

10. The method of claim 9 , wherein the processing engine comprises a multiplexer, and further comprising controlling the multiplexer based on the indications of the logical matrix position of the elements in at least the first matrix in the non-compressed format to select the proper subset of elements of the second register from the second matrix as the input into the multiply-accumulator circuit.

11. The method of claim 10 , wherein the graphics processing unit comprises a plurality of instances of the processing engine.

12. The method of claim 9 , further comprising sending data from the graphics processing unit to a central processing unit, wherein the graphics processing unit and the central processing unit are in a same package.

13. The method of claim 9 , wherein the graphics processing unit supports multithreading.

14. The method of claim 9 , wherein the elements from the first matrix are in the first register in row major layout.

15. The method of claim 9 , wherein the instruction includes a second suffix to the opcode that when set to a first value explicitly specifies the elements are floating-point format and when set to a different second value explicitly specifies the elements are integer format.

16. The method of claim 9 , wherein the execution circuitry further comprises an integer execution circuit and a floating-point execution circuit.

17. A non-transitory machine-readable medium containing code to which a machine is to respond by:

storing elements from a first matrix that has zero and non-zero values in a compressed format in a first register of a graphics processing unit;

storing elements from a second matrix in a second register of the graphics processing unit;

scheduling, by a scheduler circuit of the graphics processing unit, an instruction for execution, the instruction comprising fields to specify the first register, the second register, an accumulation matrix, a destination matrix, indications of a logical matrix position of the elements in at least the first matrix in a non-compressed format, and an opcode to indicate the instruction is a sparse matrix instruction and that execution circuitry of the graphics processing unit including a processing engine is to select a proper subset of elements of the second register from the second matrix as an input into a multiply-accumulator circuit of the processing engine based on the indications, multiply the elements from the first matrix with corresponding elements of the proper subset of elements of the second matrix to generate products, accumulate the products with corresponding elements of the accumulation matrix to produce sums, and store the sums in corresponding elements of the destination matrix; and

executing, by the execution circuitry including the processing engine, the instruction according to the opcode,

wherein the first matrix has M rows by K columns, the second matrix has K rows by N columns, the accumulation matrix has M rows by N columns, and the instruction includes a suffix to the opcode that when set to a first value explicitly specifies a first set of K, M, and N values, and when set to a different second value explicitly specifies a different second set of K, M, and N values.

18. The non-transitory machine-readable medium of claim 17 , wherein the processing engine comprises a multiplexer, and the machine is further to respond to the code by controlling the multiplexer based on the indications of the logical matrix position of the elements in at least the first matrix in the non-compressed format to select the proper subset of elements of the second register from the second matrix as the input into the multiply-accumulator circuit.

19. The non-transitory machine-readable medium of claim 18 , wherein the graphics processing unit comprises a plurality of instances of the processing engine.

20. The non-transitory machine-readable medium of claim 17 , wherein the instruction includes a second suffix to the opcode that when set to a first value explicitly specifies the elements are floating-point format and when set to a different second value explicitly specifies the elements are integer format.

Continuity (3)
Continuation 17485055 · Sep 24, 2021
Continuation 16234374 · Dec 27, 2018
Related Publication 20240078285A1 · Mar 7, 2024
References Cited (107)
US 5206822A · Taylor · 1993 [cited by applicant]
US 5247632A · Newman · 1993 [cited by applicant]
US 5475822A · Sibigtroth et al. · 1995 [cited by applicant]
US 5892962A · Cloutier · 1999 [cited by applicant]
US 6161219A · Ramkumar et al. · 2000 [cited by applicant]
US 6212112B1 · Naura et al. · 2001 [cited by applicant]
US 6332186B1 · Elwood et al. · 2001 [cited by applicant]
US 6877020B1 · Bratt et al. · 2005 [cited by applicant]
US 7003542B2 · Devir · 2006 [cited by applicant]
US 7209939B2 · Castrapel et al. · 2007 [cited by applicant]
US 7725521B2 · Chen et al. · 2010 [cited by applicant]
US 7792895B1 · Juffa et al. · 2010 [cited by applicant]
US 7873812B1 · Mimar · 2011 [cited by applicant]
US 7912889B1 · Juffa et al. · 2011 [cited by applicant]
US 7932910B2 · Hansen et al. · 2011 [cited by applicant]
US 8392487B1 · Mesh et al. · 2013 [cited by applicant]
US 8626815B1 · Langhammer · 2014 [cited by applicant]
US 8924455B1 · Barman et al. · 2014 [cited by applicant]
US 8984043B2 · Ginzburg et al. · 2015 [cited by applicant]
US 9442723B2 · Yang et al. · 2016 [cited by applicant]
US 9906359B2 · Gueron · 2018 [cited by applicant]
US 9960907B2 · Gueron · 2018 [cited by applicant]
US 10535114B2 · Bolz · 2020 [cited by applicant]
US 20030126176A1 · Devir · 2003 [cited by applicant]
US 20040111587A1 · Nair et al. · 2004 [cited by applicant]
US 20040133617A1 · Chen et al. · 2004 [cited by applicant]
US 20050193050A1 · Sazegari · 2005 [cited by applicant]
US 20060101245A1 · Nair et al. · 2006 [cited by applicant]
US 20060190517A1 · Guerrero · 2006 [cited by applicant]
US 20070186210A1 · Hussain et al. · 2007 [cited by applicant]
US 20080071851A1 · Zohar et al. · 2008 [cited by applicant]
US 20080133881A1 · Georgi et al. · 2008 [cited by applicant]
US 20080140994A1 · Khailany et al. · 2008 [cited by applicant]
US 20080208942A1 · Won et al. · 2008 [cited by applicant]
US 20090043836A1 · Dupaquis et al. · 2009 [cited by applicant]
US 20090132787A1 · Rakib et al. · 2009 [cited by applicant]
US 20090292758A1 · Brokenshire et al. · 2009 [cited by applicant]
US 20090300091A1 · Brokenshire et al. · 2009 [cited by applicant]
US 20090300249A1 · Moyer et al. · 2009 [cited by applicant]
US 20100180100A1 · Lu et al. · 2010 [cited by applicant]
US 20100325187A1 · Juffa et al. · 2010 [cited by applicant]
US 20120011348A1 · Eichenberger et al. · 2012 [cited by applicant]
US 20120079252A1 · Sprangle · 2012 [cited by applicant]
US 20120113133A1 · Shpigelblat · 2012 [cited by applicant]
US 20120137074A1 · Kim et al. · 2012 [cited by applicant]
US 20120254588A1 · Adrian et al. · 2012 [cited by applicant]
US 20120314774A1 · Yang et al. · 2012 [cited by applicant]
US 20130305020A1 · Valentine et al. · 2013 [cited by applicant]
US 20140006753A1 · Gopal et al. · 2014 [cited by applicant]
US 20140032876A1 · Burkart et al. · 2014 [cited by applicant]
US 20140059322A1 · Ould-Ahmed-Vall et al. · 2014 [cited by applicant]
US 20140149480A1 · Catanzaro et al. · 2014 [cited by applicant]
US 20150067302A1 · Gueron · 2015 [cited by applicant]
US 20150074163A1 · Horio · 2015 [cited by applicant]
US 20150199266A1 · Franchetti et al. · 2015 [cited by applicant]
US 20170293659A1 · Huang · 2017 [cited by applicant]
US 20180113708A1 · Corbal et al. · 2018 [cited by applicant]
US 20180246855A1 · Redfern et al. · 2018 [cited by applicant]
US 20180267938A1 · Chen et al. · 2018 [cited by applicant]
US 20180293691A1 · Nurvitadhi et al. · 2018 [cited by applicant]
US 20180321938A1 · Boswell et al. · 2018 [cited by applicant]
US 20180336163A1 · Phelps et al. · 2018 [cited by applicant]
US 20180341484A1 · Fowers et al. · 2018 [cited by applicant]
US 20190042250A1 · Anders et al. · 2019 [cited by applicant]
US 20190042538A1 · Koren et al. · 2019 [cited by applicant]
US 20190042542A1 · Narayanamoorthy et al. · 2019 [cited by applicant]
US 20190065150A1 · Heddes et al. · 2019 [cited by applicant]
US 20190079761A1 · Deame et al. · 2019 [cited by applicant]
US 20190205358A1 · Diril et al. · 2019 [cited by applicant]
US 20190278600A1 · Frumkin et al. · 2019 [cited by applicant]
US 20200034145A1 · Bainville et al. · 2020 [cited by applicant]
US 20200117450A1 · Mansell et al. · 2020 [cited by applicant]
US 20200265107A1 · Narayanamoorthy et al. · 2020 [cited by applicant]
US 20200265108A1 · Dong et al. · 2020 [cited by applicant]
US 20200334038A1 · Anders et al. · 2020 [cited by applicant]
US 20200334323A1 · Narayanamoorthy et al. · 2020 [cited by applicant]
US 20210035258A1 · Ray et al. · 2021 [cited by applicant]
US 20210103550A1 · Appu et al. · 2021 [cited by applicant]
KR 1020110079495A · 2011 [cited by applicant]
WO 2004053841A2 · 2004 [cited by applicant]
WO 2016003740A1 · 2016 [cited by applicant]
WO 2016105727A1 · 2016 [cited by applicant]
WO 2018125250A1 · 2018 [cited by applicant]
Corrected Notice of Allowability, U.S. Appl. No. 15/201,442, Jan. 22, 2019, 5 pages. [cited by applicant]
Corrected Notice of Allowability, U.S. Appl. No. 15/201,442, Mar. 11, 2019, 2 pages. [cited by applicant]
Final Office Action, U.S. Appl. No. 16/234,374, Apr. 1, 2022, 13 pages. [cited by applicant]
Final Office Action, U.S. Appl. No. 16/234,374, Dec. 8, 2020, 13 pages. [cited by applicant]
Final Office Action, U.S. Appl. No. 17/485,055, Mar. 15, 2022, 23 pages. [cited by applicant]
Intel Corporation, “Intel 64 and IA-32 Architectures Software Developer's Manual,” Document reference No. 325462-052US, Sep. 2014, pp. 1, 14-1-14-36. [cited by applicant]
Intel Corporation, “Intel Advanced Vector Extensions Programming Reference,” Document reference No. 319433-011, Jun. 2011, 595 pages. [cited by applicant]
International Preliminary Report on Patentability, PCT App. No. PCT/US2017/036038, Jan. 17, 2019, 14 pages. [cited by applicant]
International Preliminary Report on Patentability, PCT App. No. PCT/US2017/040546, Oct. 3, 2019, 10 pages. [cited by applicant]
International Search Report and Written Opinion, PCT App. No. PCT/US2017/036038, Sep. 5, 2017 , 15 pages. [cited by applicant]
International Search Report and Written Opinion, PCT App. No. PCT/US2017/040534, Jan. 3, 2018, 11 pages. [cited by applicant]
International Search Report and Written Opinion, PCT App. No. PCT/US2017/040536, Dec. 20, 2017, 11 pages. [cited by applicant]
International Search Report and Written Opinion, PCT App. No. PCT/US2017/040537, Dec. 20, 2017, 11 pages. [cited by applicant]
International Search Report and Written Opinion, PCT App. No. PCT/US2017/040540, Jan. 3, 2018, 14 pages. [cited by applicant]
International Search Report and Written Opinion, PCT App. No. PCT/US2017/040546, Jan. 24, 2018, 15 pages. [cited by applicant]
Lahr, David L., “Distractions: Timing Matrix Multiplication in SciDB and Setting the No. of Worker Instances in SciDB and Running Matrix Multiplication Piecemeal”, Available Online at <http://dllahr.blogspot.com/2012/11… [cited by applicant]
Non-Final Office Action, U.S. Appl. No. 15/201,442, filed May 4, 2018, 11 pages. [cited by applicant]
Non-Final Office Action, U.S. Appl. No. 16/234,374, filed Jul. 7, 2021, 11 pages. [cited by applicant]
Non-Final Office Action, U.S. Appl. No. 16/234,374, filed May 18, 2020, 12 pages. [cited by applicant]
Non-Final Office Action, U.S. Appl. No. 16/398,200, filed Jul. 28, 2020, 17 pages. [cited by applicant]
Non-Final Office Action, U.S. Appl. No. 17/485,055, filed May 3, 2023, 17 pages. [cited by applicant]
Non-Final Office Action, U.S. Appl. No. 17/485,055, filed Nov. 2, 2021, 12 pages. [cited by applicant]
Notice of Allowance, U.S. Appl. No. 15/201,442, filed Dec. 14, 2018, 5 pages. [cited by applicant]
Notice of Allowance, U.S. Appl. No. 17/485,055, filed Aug. 18, 2023, 8 pages. [cited by applicant]