IP Library Granted Patent US 12,423,379
Granted Patent B2
US 12,423,379 · App. 17/368,374 · Granted Sep 23, 2025

In situ sparse matrix expansion

Inventors: Reginald Clifford Young (Palo Alto, CA); Trevor John Gale (San Francisco, CA)
Assignee: Google LLC
G06F17/16
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,423,379
App. No.
17/368,374
Granted
Sep 23, 2025
Kind
B2
Abstract

Methods, systems, and apparatus, including computer programs encoded on computer storage media, for loading a matrix into a circuit having an array having M×N cells. One of the methods includes: receiving a plurality of non-zero input values from a first input matrix; receiving index metadata that indicates, for each non-zero input value in the plurality of input values, which cell of the M×N cells in the array the non-zero input value should be loaded into; sending the non-zero input values and the index metadata to the M×N cells; and at a particular cell of the M×N cells in the array: receiving a particular non-zero input value and corresponding index metadata; and determining from the corresponding index metadata for the particular non-zero input value whether to store the particular non-zero input value at the cell or to shift the particular non-zero input value to another cell.

Claims (53)

1. A method performed by a hardware device comprising circuitry for an array having M×N cells, the method comprising:

receiving, at the hardware device, a plurality of non-zero input values from a first input matrix to be multiplied with a second input matrix using the array, the first input matrix comprising the plurality of non-zero input values and a plurality of zero input values;

receiving, at the hardware device, index metadata that indicates, for each non-zero input value in the plurality of non-zero input values, which cell of the M×N cells in the array a non-zero input value should be loaded into;

sending, using the hardware device, the plurality of non-zero input values and the index metadata to the M×N cells, wherein the sending comprises,

at a particular cell of the M×N cells in the array:

receiving a particular non-zero input value and corresponding index metadata for the particular non-zero input value; and

determining from the corresponding index metadata for the particular non-zero input value whether to store the particular non-zero input value at the particular cell for use in performing multiplication or to shift the particular non-zero input value to another cell,

wherein M and N are positive integers larger than one, and wherein, after the sending, one or more cells of the M×N cells do not store a non-zero input value; and

performing the multiplication by operating each of the one or more cells that do not store a non-zero input value as if a zero input value had been loaded into each of the one or more cells.

2. The method of claim 1 , further comprising, at the particular cell of the M×N cells in the array and prior to sending the plurality of non-zero input values and the index metadata to the M×N cells: automatically loading a zero input value into the particular cell.

3. The method of claim 1 , wherein sending the plurality of non-zero input values and the index metadata to the MXN cells comprises sending the plurality of non-zero input values along a first dimension of the array that has the M×N cells.

4. The method of claim 3 , wherein the first dimension of the array comprises a vertical dimension of the array; and

sending the plurality of non-zero input values and the index metadata to the M×N cells along the first dimension of the array comprises sending the plurality of non-zero input values and the index metadata beginning from a top fringe of the array.

5. The method of claim 3 , wherein the first dimension of the array comprises a horizontal dimension of the array; and

sending the plurality of non-zero input values and the index metadata to the M×N cells along the first dimension of the array comprises sending the plurality of non-zero input values and the index metadata beginning from a left fringe of the array.

6. The method of claim 1 , wherein the index metadata comprises an absolute fixed-length row index for each non-zero input value.

7. The method of claim 1 , wherein the index metadata comprises a run-length encoded row index for each non-zero input value.

8. The method of claim 1 , wherein the index metadata comprises a bitmap of locations of the plurality of non-zero input values in the M×N cells of the array.

9. The method of claim 3 , wherein the hardware device further comprises a comparator for each cell in the M×N cells of the array, the comparator configured to compare (i) the index metadata for each non-zero input value with (ii) an index of a respective cell that indicates its location in the M×N cells along the first dimension of the array.

10. The method of claim 1 , wherein the plurality of non-zero input values are in a compressed sparse column (CSC) matrix format.

11. The method of claim 1 , wherein the hardware device further comprises a first-in, first-out (FIFO) register for each cell in the M×N cells of the array, and wherein loading a respective non-zero input value into each cell comprises enqueuing the respective non-zero input value in the FIFO register associated with each cell.

12. The method of claim 1 , further comprising, for each cell in the array storing a particular non-zero input value:

receiving, at the hardware device, a second input value from the second input matrix; and

determining, using the hardware device, a respective multiplication product based on the particular non-zero input value and the second input value.

13. The method of claim 1 , wherein the plurality of non-zero input values move by one cell per clock cycle.

14. The method of claim 1 , further comprising:

determining that the first input matrix includes a column that only has zero input values; and

in response, adding a sign bit to an index defined by corresponding index metadata for each zero input value in the column.

15. A system comprising one or more computers and computer-readable medium coupled to the one or more computers and having instructions stored thereon, which, when executed by the one or more computers, cause the one or more computers to perform operations comprising:

receiving, at a hardware device comprising circuitry for an array having M×N cells, a plurality of non-zero input values from a first input matrix to be multiplied with a second input matrix using the array, the first input matrix comprising the plurality of non-zero input values and a plurality of zero input values;

receiving, at the hardware device, index metadata that indicates, for each non-zero input value in the plurality of non-zero input values, which cell of the M×N cells in the array a non-zero input value should be loaded into;

sending, using the hardware device, the plurality of non-zero input values and the index metadata to the MXN cells, wherein the sending comprises,

at a particular cell of the M×N cells in the array:

receiving a particular non-zero input value and corresponding index metadata for the particular non-zero input value; and

determining from the corresponding index metadata for the particular non-zero input value whether to store the particular non-zero input value at the particular cell for use in performing multiplication or to shift the particular non-zero input value to another cell,

wherein M and N are positive integers larger than one, and wherein, after the sending, one or more cells of the M×N cells do not store a non-zero input value; and

performing the multiplication by operating each of the one or more cells that do not store a non-zero input value as if a zero input value had been loaded into each of the one or more cells.

16. The system of claim 15 , wherein the operations further comprise, at the particular cell of the M×N cells in the array and prior to sending the plurality of non-zero input values and the index metadata to the M×N cells: automatically loading a zero input value into the particular cell.

17. The system of claim 15 , wherein sending the plurality of non-zero input values and the index metadata to the M×N cells comprises sending the plurality of non-zero input values along a first dimension of the array that has the M×N cells.

18. The system of claim 17 , wherein the first dimension of the array comprises a vertical dimension of the array; and

sending the plurality of non-zero input values and the index metadata to the M×N cells along the first dimension of the array comprises sending the plurality of non-zero input values and the index metadata beginning from a top fringe of the array.

19. The system of claim 17 , wherein the first dimension of the array comprises a horizontal dimension of the array; and

sending the plurality of non-zero input values and the index metadata to the M×N cells along the first dimension of the array comprises sending the plurality of non-zero input values and the index metadata beginning from a left fringe of the array.

20. The system of claim 17 , wherein the hardware device further comprises a comparator for each cell in the M×N cells of the array, the comparator configured to compare (i) the index metadata for each non-zero input value with (ii) an index of a respective cell that indicates its location in the M×N cells along the first dimension of the array.

21. A non-transitory computer-readable medium having instructions stored thereon, which, when executed by one or more computers, cause the one or more computers to perform operations comprising:

receiving, at a hardware device comprising circuitry for an array having M×N cells, a plurality of non-zero input values from a first input matrix to be multiplied with a second input matrix using the array, the first input matrix comprising the plurality of non-zero input values and a plurality of zero input values;

receiving, at the hardware device, index metadata that indicates, for each non-zero input value in the plurality of non-zero input values, which cell of the M×N cells in the array a non-zero input value should be loaded into;

sending, using the hardware device, the plurality of non-zero input values and the index metadata to the M×N cells, wherein the sending comprises,

at a particular cell of the M×N cells in the array:

receiving a particular non-zero input value and corresponding index metadata for the particular non-zero input value; and

determining from the corresponding index metadata for the particular non-zero input value whether to store the particular non-zero input value at the particular cell for use in performing multiplication or to shift the particular non-zero input value to another cell,

wherein M and N are positive integers larger than one, and wherein, after the sending, one or more cells of the M×N cells do not store a non-zero input value; and

performing the multiplication by operating each of the one or more cells that do not store a non-zero input value as if a zero input value had been loaded into each of the one or more cells.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 23, 2021
From: YOUNG, REGINALD CLIFFORD; GALE, TREVOR JOHN
To: GOOGLE LLC
Reel/Frame 057252/0225 →
Continuity (1)
Related Publication 20230010897A1 · Jan 12, 2023
References Cited (23)
US 10621269B2 · Phelps et al. · 2020 [cited by applicant]
US 20140108481A1 · Davis · 2014 [cited by examiner]
US 20190042250A1 · Anders et al. · 2019 [cited by applicant]
US 20190042538A1 · Koren et al. · 2019 [cited by applicant]
US 20190379396A1 · Bajic · 2019 [cited by examiner]
US 20200226444A1 · Sharma et al. · 2020 [cited by applicant]
US 20200278888A1 · Connor et al. · 2020 [cited by applicant]
US 20210035258A1 · Ray et al. · 2021 [cited by applicant]
US 20210097130A1 · Liu et al. · 2021 [cited by applicant]
JP 2020521192A · 2020 [cited by applicant]
JP 2020140713A · 2020 [cited by applicant]
JP 2021082289A · 2021 [cited by applicant]
E. Qin et al., “SIGMA: A Sparse and Irregular GEMM Accelerator with Flexible Interconnects for DNN Training,” 2020 IEEE International Symposium on High Performance Computer Architecture (HPCA), San Diego, CA, USA, 2020,… [cited by examiner]
Automatically Definition in Cambridge Dictionary, Aug. 19, 2019, https://web.archive.org/web/20190828113545/https://dictionary.cambridge.org/us/dictionary/english/automatically (Year: 2019). [cited by examiner]
Dave et al., “Hardware Acceleration of Sparse and Irregular Tensor Computations of ML Models: A Survey and Insights”, Jul. 2, 2020, https://arxiv.org/pdf/2007.00864v1 (Year: 2020). [cited by examiner]
International Preliminary Report on Patentability in International Appln. No. PCT/US2022/036258, mailed on Jan. 18, 2024, 9 pages. [cited by applicant]
Extended European Search Report in European Appln. No. 22167898.0, dated Oct. 28, 2022, 11 pages. [cited by applicant]
Shail et al., “Hardware Acceleration of Sparse and Irregular Tensor Computations of ML Models: A Survey and Insights, ” arXiv, Jul. 22, 2021, 44 pages. [cited by applicant]
Shi et al., “VersaGNN: A versatile accelerator for graph neural networks,” arXiv, May 4, 2021, 13 pages. [cited by applicant]
Xin et al., “Sparse-TPU: adapting systolic arrays for sparse matrices,” Proceedings of the 34th ACM International Conference on Supercomputing, Jun. 2020, 12 pages. [cited by applicant]
International Search Report and Written Opinion in International Appln. No. PCT/US2022/036258, dated Oct. 28, 2022, 16 pages. [cited by applicant]
Enoki et al., “Performance of System for Analyzing Diffusion of Social Media Messages in Real Time, ” IEICE Technical Report, Jun. 2014, 114(101):6 pages. [cited by applicant]
Office Action in Japanese Appln. No. 2023-570438, mailed on May 7, 2025, 8 pages (with English translation). [cited by applicant]