IP Library Granted Patent US 10,579,383
Granted Patent B1
US 10,579,383 · App. 15/992,793 · Granted Mar 3, 2020

Systems and methods for efficient scaling of quantized integers

Inventors: Nadav Rotem (Santa Clara, CA); Jong Soo Park (Mountain View, CA); Zhaoxia Deng (San Mateo, CA); Abdulkadir Utku Diril (Menlo Park, CA); Mikhail Smelyanskiy (Burlingame, CA); Roman Dzhabarov (Menlo Park, CA); James Wesley Hegeman (Menlo Park, CA)
Assignee: Facebook, Inc.
G06F9/3555G06F7/483G06F7/49
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,579,383
App. No.
15/992,793
Granted
Mar 3, 2020
Kind
B1
Abstract

The disclosed computer-implemented method may include receiving an input value and a floating-point scaling factor and determining (1) an integer scaling factor based on the floating-point scaling factor, (2) a pre-scaling adjustment value representative of a number of places by which to shift a binary representation of the input value prior to a scaling operation, and (3) a post-scaling adjustment value representative of a number of places by which to shift the binary representation of the input value following the scaling operation. The method may further include calculating a scaled result value by (1) shifting rightwards the binary representation of the input value by the pre-scaling adjustment value, (2) scaling the shifted binary representation of the input value by the integer scaling factor, and (3) shifting rightwards the shifted and scaled binary value by the post-scaling adjustment value. Various other methods, systems, and computer-readable media are also disclosed.

Claims (69)

1. A computer-implemented method comprising:

receiving, at an artificial neural network (ANN), an input value and a floating-point scaling factor for a scaling operation that is configured to scale one or more quantized integers to lower bit depths;

determining, at the ANN:

an integer scaling factor based on the floating-point scaling factor;

a pre-scaling adjustment value representative of a number of places by which to shift a binary representation of the input value prior to a scaling operation; and

a post-scaling adjustment value representative of a number of places by which to shift the binary representation of the input value following the scaling operation; and

calculating, at the ANN, a scaled result value by:

shifting rightwards the binary representation of the input value by the pre-scaling adjustment value;

scaling the shifted binary representation of the input value by the integer scaling factor; and

shifting rightwards the shifted and scaled binary representation of the input value by the post-scaling adjustment value.

2. The computer-implemented method of claim 1 , wherein the input value comprises a 32-bit signed binary integer value.

3. The computer-implemented method of claim 1 , further comprising adjusting the scaled result value in accordance with a predetermined offset value.

4. The computer-implemented method of claim 1 , further comprising mapping the scaled result value to an 8-bit signed binary integer value.

5. The computer-implemented method of claim 1 , wherein scaling the shifted binary representation of the input value comprises executing an integer multiplication operation using the shifted binary representation of the input value and the integer scaling factor.

6. The computer-implemented method of claim 1 , wherein determining the integer scaling factor, the pre-scaling adjustment value, and the post-scaling adjustment value comprises:

while at least one of:

the floating-point scaling factor is less than a predetermined floor value, or

the post-scaling adjustment value is less than a predetermined maximum shift value,

incrementing the post-scaling adjustment value by a predetermined increment; and

scaling the floating-point scaling factor by a predetermined scaling value.

7. The computer-implemented method of claim 6 , wherein the predetermined maximum shift value is at most half of a word size of the binary representation of the input value.

8. The computer-implemented method of claim 6 , wherein:

the predetermined increment comprises a positive integer value;

the predetermined scaling value comprises a result of an exponentiation operation with a base of two and the positive integer value as an exponent; and

scaling the floating-point scaling factor by the predetermined scaling value comprises multiplying the floating-point scaling factor by the predetermined scaling value.

9. The computer-implemented method of claim 6 , wherein determining the integer scaling factor, the pre-scaling adjustment value, and the post-scaling adjustment value further comprises, while the floating-point scaling factor is less than a predetermined maximum floating-point scaling factor and the pre-scaling adjustment value is less than the post-scaling adjustment value scaled by an additional predetermined scaling value:

incrementing the pre-scaling adjustment value by the predetermined increment; and

scaling the floating-point scaling factor by the predetermined scaling value.

10. The computer-implemented method of claim 9 , wherein the predetermined maximum floating-point scaling factor is a maximum value that is representable within a target binary word size.

11. The computer-implemented method of claim 9 , wherein determining the integer scaling factor further comprises:

rounding the scaled floating-point scaling factor to a nearest integer value; and

designating the nearest integer value as the integer scaling factor.

12. A system comprising:

a receiving module, stored in memory of an artificial neural network (ANN), that receives an input value and a floating-point scaling factor for a scaling operation that is configured to scale one or more quantized integers to lower bit depths;

a determining module, stored in the memory of the ANN, that determines:

an integer scaling factor based on the floating-point scaling factor;

a pre-scaling adjustment value representative of a number of places by which to shift a binary representation of the input value prior to a scaling operation; and

a post-scaling adjustment value representative of a number of places by which to shift the binary representation of the input value following the scaling operation;

a calculating module, stored in the memory of the ANN, that calculates a scaled result value by:

shifting rightwards the binary representation of the input value by the pre-scaling adjustment value;

scaling the shifted binary representation of the input value by the integer scaling factor; and

shifting rightwards the shifted and scaled binary representation of the input value by the post-scaling adjustment value; and

at least one physical processor of the ANN that executes the receiving module, the determining module, and the calculating module.

13. The system of claim 12 , wherein the input value comprises a 32-bit signed binary integer value.

14. The system of claim 12 , wherein the calculating module further adjusts the scaled result value in accordance with a predetermined offset value.

15. The system of claim 12 , further comprising a mapping module that maps the scaled result value to an 8-bit signed binary integer value.

16. The system of claim 12 , wherein the calculating module scales the shifted binary representation of the input value by executing an integer multiplication operation using the shifted binary representation of the input value and the integer scaling factor.

17. The system of claim 12 , wherein the determining module determines the integer scaling factor, the pre-scaling adjustment value, and the post-scaling adjustment value by:

while at least one of:

the floating-point scaling factor is less than a predetermined floor value, or

the post-scaling adjustment value is less than a predetermined maximum shift value,

incrementing the post-scaling adjustment value by a predetermined increment; and

scaling the floating-point scaling factor by a predetermined scaling value.

18. The system of claim 17 , wherein the determining module determines the integer scaling factor, the pre-scaling adjustment value, and the post-scaling adjustment value further by, while the floating-point scaling factor is less than a predetermined maximum floating-point scaling factor and the pre-scaling adjustment value is less than the post-scaling adjustment value scaled by an additional predetermined scaling value:

incrementing the pre-scaling adjustment value by the predetermined increment; and

scaling the floating-point scaling factor by the predetermined scaling value.

19. The system of claim 18 , wherein the determining module further determines the integer scaling factor by:

rounding the scaled floating-point scaling factor to a nearest integer value; and

designating the nearest integer value as the integer scaling factor.

20. A non-transitory, computer-readable medium comprising computer-readable instructions that, when executed by at least one processor of a computing device, cause the computing device to:

receive, at an artificial neural network (ANN), an input value and a floating-point scaling factor for a scaling operation that is configured to scale one or more quantized integers to lower bit depths;

determine, at the ANN:

an integer scaling factor based on the floating-point scaling factor;

a pre-scaling adjustment value representative of a number of places by which to shift a binary representation of the input value prior to a scaling operation; and

a post-scaling adjustment value representative of a number of places by which to shift the binary representation of the input value following the scaling operation; and

calculate, at the ANN, a scaled result value by:

shifting rightwards the binary representation of the input value by the pre-scaling adjustment value;

scaling the shifted binary representation of the input value by the integer scaling factor; and

shifting rightwards the shifted and scaled binary representation of the input value by the post-scaling adjustment value.

Assignments (3)
CHANGE OF NAME Recorded Feb 18, 2022
From: FACEBOOK, INC.
To: META PLATFORMS, INC.
Reel/Frame 059191/0695 →
CORRECTIVE ASSIGNMENT TO CORRECT THE THE COMMA AFTER THE PERIOD IN "INC." IN THE ASSIGNEE'S NAME. THE ASSIGNEE'S NAME SHOULD APPEAR: FACEBOOK, INC. PREVIOUSLY RECORDED AT REEL: 049692 FRAME: 0236. ASSIGNOR(S) HEREBY CONFIRMS THE ASSIGNMENT. Recorded Jan 31, 2022
From: ROTEM, NADAV; PARK, JONG SOO; DIRIL, ABDULKADIR UTKU; SMELYANSKIY, MIKHAIL; DZHABAROV, ROMAN; HEGEMAN, JAMES; DENG, ZHAOXIA
To: FACEBOOK, INC.
Reel/Frame 058904/0495 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jul 8, 2019
From: ROTEM, NADAV; PARK, JONG SOO; DENG, ZHAOXIA; DIRIL, ABDULKADIR UTKU; SMELYANSKIY, MIKHAIL; DZHABAROV, ROMAN; HEGEMAN, JAMES
To: FACEBOOK, INC.,
Reel/Frame 049692/0236 →
Cited By (1)
US 12,475,355