IP Library Granted Patent US 10,977,002
Granted Patent B2
US 10,977,002 · App. 16/511,085 · Granted Apr 13, 2021

System and method for supporting alternate number format for efficient multiplication

Inventors: Ganesh Venkatesh (San Jose, CA); Liangzhen Lai (Fremont, CA); Pierce I-Jen Chuang (Sunnyvale, CA); Meng Li (Union City, CA); Vikas Chandra (Fremont, CA)
Assignee: Facebook Technologies, LLC
G06F7/5443G06F5/01G06F7/523G06F7/5334G06F7/57
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 10,977,002
App. No.
16/511,085
Granted
Apr 13, 2021
Kind
B2
Abstract

Disclosed herein includes a system, a method, and a device including shift circuitry and add circuitry for performing multiplication of a first value and a second value for a neural network. The first value has a predetermined format including a first bit, and two or more second bits to represent a value of zero or 2 n where n is an integer greater than or equal to 0. The device shifts, when the two or more second bits represent the value of 2 n , the second value by (n+1) bits via the shift circuitry to provide a first result, selectively outputs zero or the second value, based on a value of the first bit of the first value, to provide a second result, and adds the first result and the second results via the add circuitry to provide a result of the multiplication of the first and second values.

Claims (48)

1. A device comprising:

circuitry comprising shift circuitry and add circuitry for performing multiplication of a first value and a second value for a neural network, the first value having a predetermined format comprising a first bit, and two or more second bits to represent a value of zero or 2 n wherein n is an integer greater than or equal to 0, the circuitry configured to:

when the two or more second bits represent the value of 2 n , shift the second value by (n+1) bits via the shift circuitry to provide a first multiplication result,

based on a value of the first bit of the first value, selectively output zero or the second value to provide a second multiplication result, and

add the first multiplication result and the second multiplication result via the add circuitry to provide a result of the multiplication of the first value and the second value.

2. The device according to claim 1 , wherein the first bit of the first value is a least significant bit of the first value.

3. The device according to claim 1 , wherein the circuitry is configured to provide, when the two or more second bits represent the value of zero, the value of zero as the first multiplication result.

4. The device according to claim 1 , wherein the second value uses a linear number format to represent a binary number.

5. The device according to claim 1 , wherein:

the second value has the predetermined format comprising a first bit, and two or more second bits to represent a value of zero or 2 m wherein m is an integer greater than or equal to zero, the circuitry is further configured to:

when the two or more second bits of the first value represent the value of 2 n and the two or more second bits of the second value represent the value of 2 m , shift the value of 2 m+1 by (n+1) bits via the shift circuitry to provide a third multiplication result,

based on a value of the first bit of the second value, selectively output zero or the value of 2 n+1 to provide a fourth multiplication result,

based on the value of the first bit of the first value, selectively output zero or the value of 2 m+1 to provide a fifth multiplication result,

based on the value of the first bit of the first value, selectively output zero or the value of the first bit of the second value to provide a sixth multiplication result, and

add the third to sixth multiplication results via the add circuitry to provide a result of the multiplication of the first value and the second value.

6. The device according to claim 1 , wherein “1 1” as the two or more second bits of the first value represents a value of 4.

7. The device according to claim 1 , wherein the first value further comprises a third bit to indicate that the first value is signed or unsigned.

8. The device according to claim 7 , wherein the circuitry is configured to determine a sign of the result of the multiplication of the first value and the second value based on a value of the third bit of the first value.

9. The device according to claim 1 , wherein:

the circuitry is further configured to perform convolution for a first layer of the neural network using weight data and activation data representing an activation function, and

the first value represents a value of one of the weight data and the activation data for the first layer of the neural network.

10. The device according to claim 9 , wherein the second value represents a value of the other of the weight data and the activation data for the first layer of the neural network.

11. A method comprising:

performing multiplication of a first value and a second value for a neural network, the first value having a predetermined format comprising a first bit, and two or more second bits to represent a value of zero or 2 n wherein n is an integer greater than or equal to 0,

wherein performing the multiplication of the first value and the second value comprises:

when the two or more second bits represent the value of 2 n , shifting, by shift circuitry, the second value by (n+1) bits to provide a first multiplication result,

based on a value of the first bit of the first value, selectively outputting zero or the second value to provide a second multiplication result, and

adding, by add circuitry, the first multiplication result and the second multiplication result to provide a result of the multiplication of the first value and the second value.

12. The method according to claim 11 , wherein the first bit of the first value is a least significant bit of the first value.

13. The method according to claim 11 , wherein performing the multiplication of the first value and the second value comprises:

providing, when the two or more second bits represent the value of zero, the value of zero as the first multiplication result.

14. The method according to claim 11 , wherein the second value uses a linear number format to represent a binary number.

15. The method according to claim 11 , wherein:

the second value has the predetermined format comprising a first bit, and two or more second bits to represent a value of zero or 2 m wherein m is an integer greater than or equal to zero, and

performing the multiplication of the first value and the second value further comprises:

when the two or more second bits of the first value represent the value of 2 n and the two or more second bits of the second value represent the value of 2 m , shifting, by the shift circuitry, the value of 2 m+1 by (n+1) bits to provide a third multiplication result,

based on a value of the first bit of the second value, selectively outputting zero or the value of 2 n+1 to provide a fourth multiplication result,

based on the value of the first bit of the first value, selectively outputting zero or the value of 2 m+1 to provide a fifth multiplication result,

based on the value of the first bit of the first value, selectively outputting zero or the value of the first bit of the second value to provide a sixth multiplication result, and

adding, by the add circuitry, the third to sixth multiplication results to provide a result of the multiplication of the first value and the second value.

16. The method according to claim 11 , wherein “1 1” as the two or more second bits of the first value represents a value of 4.

17. The method according to claim 11 , wherein the first value further comprises a third bit to indicate that the first value is signed or unsigned.

18. The method according to claim 17 , wherein performing the multiplication of the first value and the second value further comprises:

determining a sign of the result of the multiplication of the first value and the second value based on a value of the third bit of the first value.

19. The method according to claim 11 , further comprising:

performing convolution for a first layer of the neural network using weight data and activation data representing an activation function,

wherein the first value represents a value of one of the weight data and the activation data for the first layer of the neural network.

20. The method according to claim 19 , wherein the second value represents a value of the other of the weight data and the activation data for the first layer of the neural network.

Assignments (2)
CHANGE OF NAME Recorded Jul 22, 2022
From: FACEBOOK TECHNOLOGIES, LLC
To: META PLATFORMS TECHNOLOGIES, LLC
Reel/Frame 060816/0634 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Oct 7, 2019
From: VENKATESH, GANESH; LAI, LIANGZHEN; CHUANG, PIERCE I-JEN; LI, MENG; CHANDRA, VIKAS
To: FACEBOOK TECHNOLOGIES, LLC
Reel/Frame 050645/0115 →
Continuity (1)
Related Publication 20210019115A1 · Jan 21, 2021