IP Library › Granted Patent US 12,197,533
Granted Patent B2
US 12,197,533 · App. 17/214,784 · Granted Jan 14, 2025

Approximation of matrices for matrix multiply operations

Inventors: Pramod Vasant Argade (San Diego, CA); Swapnil P. Sakharshete (San Diego, CA); Maxim V. Kazakov (San Diego, CA); Alexander M. Potapov (San Diego, CA)
Assignee: Advanced Micro Devices, Inc.
G06F17/16G06F7/523G06F7/5443G06F7/556
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,197,533
App. No.
17/214,784
Granted
Jan 14, 2025
Kind
B2
Abstract

A processing device is provided which comprises memory configured to store data and a processor configured to receive a portion of data of a first matrix comprising a first plurality of elements and receive a portion of data of a second matrix comprising a second plurality of elements. The processor is also configured to determine values for a third matrix by dropping a number of products from products of pairs of elements of the first and second matrices based on approximating the products of the pairs of elements as a sum of the exponents of the pairs of elements and performing matrix multiplication on remaining products of the pairs of elements of the first and second matrices.

Claims (49)

1. A processing device that improves computational efficiency of a computing system, the processing device comprising:

memory configured to store data; and

a processor that is communicatively coupled to the memory, wherein the processor is configured to:

receive a portion of data of a first matrix and a portion of data of a second matrix, wherein the first matrix comprises a first plurality of elements and the second matrix comprises a second plurality of elements;

calculate values for a third matrix, wherein the values of the third matrix are determined by:

dropping a target number of products, determined at run time, from products of pairs of unsorted elements of the first matrix and unsorted elements of the second matrix based on approximating the products of the pairs of elements as a sum of values of bits of corresponding significance of exponents of the pairs of elements; and

performing matrix multiplication on remaining products of the pairs of elements of the first matrix and the second matrix.

2. The processing device according to claim 1 , wherein the products having the smallest sum of the exponents are dropped.

3. The processing device according to claim 2 , further comprising a plurality of multiplier accumulators (MACs), and

wherein the target number reduces a number of MACs used to perform the matrix multiplication.

4. The processing device according to claim 1 , wherein the processor is configured to determine which products are to be used to perform the matrix multiplication by:

summing values of bits of corresponding significance of the exponents of the product, starting with the most significant bits for the exponents of the product, and

comparing each result of the summing to the target number until the target number of product exponent values is determined.

5. The processing device according to claim 1 , wherein the first plurality of elements and the second plurality of elements are in an integer data type format.

6. The processing device according to claim 1 , wherein the processor is configured to extract the exponents of the product by:

determining absolute values of the first plurality of elements and the second plurality of elements;

determining, for each element, a number of leading zeros, and

approximating, for each element, an exponent value as a difference between a number of element bits −1 and the number of leading zeros of the element.

7. The processing device according to claim 6 , wherein the processor is configured to further extract the exponents of the product by representing each element as 1.M*2 e , where M is a mantissa and e is the exponent value.

8. The processing device according to claim 1 , wherein the first plurality of elements and the second plurality of elements are in a float data type format.

9. The processing device according to claim 1 , further comprising a display device,

wherein information generated from the matrix multiplication is displayed on the display device.

10. The processing device of claim 1 , wherein the computing system is a machine learning network and the third matrix is utilized to train the machine learning network.

11. The processing device of claim 10 , wherein the target number is determined based on an effect the approximating will have on an accuracy of the machine learning network.

12. A method that improves computational efficiency of a computing system, the method comprising:

receiving a portion of data of a first matrix and a portion of data of a second matrix, wherein the first matrix comprises a first plurality of elements and the second matrix comprises a second plurality of elements;

calculating values for a third matrix, wherein the values of the third matrix are determined by:

dropping a target number of products, determined at run time, from products of pairs of unsorted elements of the first matrix and unsorted elements of the second matrix based on approximating the products of the pairs of elements as a sum of values of bits of corresponding significance of exponents of the pairs of elements; and

performing matrix multiplication on remaining products of the pairs of elements of the first matrix and the second matrix.

13. The method according to claim 12 , wherein the products having the smallest sum of the exponents are dropped.

14. The method according to claim 12 , further comprising determining which products are to be used to perform the matrix multiplication by:

summing values of bits of corresponding significance of the exponents of the product, starting with the most significant bits for the exponents of the product, and

comparing each result of the summing to the target number until the target number of product exponent values is determined.

15. The method according to claim 12 , wherein the first plurality of elements and the second plurality of elements are in an integer data type format.

16. The method according to claim 15 , further comprising extracting the exponents of the product by:

determining absolute values of the first plurality of elements and the second plurality of elements;

determining, for each element, a number of leading zeros, and

approximating, for each element, an exponent value as a difference between a number of element bits −1 and the number of leading zeros of the element.

17. The method according to claim 16 , further comprising extracting the exponents by representing each element as 1.M*2 e , where M is a mantissa and e is the exponent value.

18. The method according to claim 12 , wherein:

the computing system is a machine learning network and the third matrix is utilized to train the machine learning network, and

the target number is determined based on an effect the approximating will have on an accuracy of the machine learning network.

19. A non-transitory computer readable medium comprising instructions for improving computational of a computing system, the instructions when executed by a processor cause the processor to execute a method comprising:

receiving a portion of data of a first matrix and a portion of data of a second matrix, wherein the first matrix comprises a first plurality of elements and the second matrix comprises a second plurality of elements;

calculating values for a third matrix, wherein the values of the third matrix are determined by:

dropping a target number of products, determined at runtime, from products of pairs of unsorted elements of the first matrix and unsorted elements of the second matrix based on approximating the products of the pairs of elements as a sum of values of bits of corresponding significance of exponents of the pairs of elements; and

performing matrix multiplication on remaining products of the pairs of elements of the first matrix and the second matrix.

20. The non-transitory computer readable medium of claim 19 , wherein the products having the smallest sum of the exponents are dropped.

21. The non-transitory computer readable medium of claim 19 , wherein the computing system is a machine learning network and the third matrix is utilized to train the machine learning network.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 3, 2021
From: SAKHARSHETE, SWAPNIL P.; ARGADE, PRAMOD VASANT; KAZAKOV, MAXIM V.; POTAPOV, ALEXANDER M.
To: ADVANCED MICRO DEVICES, INC.
Reel/Frame 057072/0164 →
Continuity (1)
Related Publication 20220309126A1 · Sep 29, 2022
References Cited (29)
US 8620984B2 · Mazahreh · 2013 [cited by applicant]
US 9600194B1 · Gschwind · 2017 [cited by applicant]
US 10747501B2 · Heddes et al. · 2020 [cited by applicant]
US 11150298B1 · Bingham et al. · 2021 [cited by applicant]
US 11500962B1 · Meyer · 2022 [cited by examiner]
US 20090024685A1 · Salama et al. · 2009 [cited by applicant]
US 20120198212A1 · Raubuch · 2012 [cited by applicant]
US 20130007075A1 · Oliver et al. · 2013 [cited by applicant]
US 20140331014A1 · Liao · 2014 [cited by applicant]
US 20140351564A1 · Bekas et al. · 2014 [cited by applicant]
US 20140365548A1 · Mortensen · 2014 [cited by examiner]
US 20160140084A1 · Daga · 2016 [cited by examiner]
US 20170147531A1 · Costas et al. · 2017 [cited by applicant]
US 20190042250A1 · Anders et al. · 2019 [cited by applicant]
US 20190065146A1 · Heddes et al. · 2019 [cited by applicant]
US 20190212980A1 · Malladi · 2019 [cited by applicant]
US 20190272308A1 · Doi · 2019 [cited by applicant]
US 20190340492A1 · Burger · 2019 [cited by applicant]
US 20200364558A1 · Kwon et al. · 2020 [cited by applicant]
US 20220075598A1 · Werner et al. · 2022 [cited by applicant]
US 20220108157A1 · Hunter · 2022 [cited by examiner]
US 20220291901A1 · Zhang · 2022 [cited by examiner]
DE 102013018915A1 · 2014 [cited by examiner]
KR 1020200050895A · 2020 [cited by applicant]
Michael L. Scott, Programming Language Pragmatics (3rd Edition), 2009, Elsevier, p. 303-316. Retrieved from Knovel. (Year: 2009). [cited by examiner]
Joe Z., Answer on “Converting Int to Float or Float to Int using Bitwise operations (software floating point)”, Dec. 2013, Stack Overflow, p. 2. Snapshot from Wayback Machine captured on Oct. 6, 2019. (Year: 2019). [cited by examiner]
T. H. Myer and I. E. Sutherland, ‘On the Design of Display Processors’, Commun. ACM, vol. 11, No. 6, pp. 410-414, Jun. 1968. (Year: 1968). [cited by examiner]
Tannenbaum, Machine Translation of DE-102013018915-A1, 2014. (Year: 2014). [cited by examiner]
Artemov, Anton V., “Approximate Multiplication of Nearly Sparse Matrices with Decay in a Fully Recursive Distributed Task-Based Parallel Framework”, arXiv:1906.08148v7, Feb. 20, 2021, 27 pgs. [cited by applicant]