IP Library › Granted Patent US 12,405,786
Granted Patent B1
US 12,405,786 · App. 18/588,724 · Granted Sep 2, 2025

Hardware support for conversion between integer and floating-point data

Inventors: Christopher A. Burns (Austin, TX); Terence M. Potter (Austin, TX); Yoong Chert Foo (London, GB)
Assignee: Apple Inc.
G06F9/30014
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,405,786
App. No.
18/588,724
Granted
Sep 2, 2025
Kind
B1
Abstract

Techniques are disclosed relating to conversion operations in the context of integer and floating-point processor operations. In some embodiments, floating-point pipeline circuitry is configured to execute a single instruction to convert an N-bit integer value to an M-bit floating-point result. To execute the instruction, source modifier circuitry may generate an intermediate M-bit representation based on the N-bit integer value. Fused multiply-add circuitry may perform a fused multiply-add operation to generate the M-bit floating-point result, where the fused multiply-add operation operates on: the intermediate M-bit representation, a quantization scale factor value indicated by the instruction, and a zero-point value indicated by the instruction. In some embodiments that support down-conversion, the floating-point pipeline circuitry is also configured to execute a single instruction to convert an M-bit floating-point value to an N-bit integer result value.

Claims (81)

1. An apparatus, comprising:

floating-point pipeline circuitry configured to execute a single instruction to convert an N-bit integer value to an M-bit floating-point result, the floating-point pipeline circuitry comprising:

source modifier circuitry configured to generate an intermediate M-bit representation based on the N-bit integer value; and

fused multiply-add circuitry configured to perform a fused multiply-add operation to generate the M-bit floating-point result, wherein the fused multiply-add operation operates on:

the intermediate M-bit representation;

a quantization scale factor value indicated by the instruction; and

a zero-point value indicated by the instruction.

2. The apparatus of claim 1 , wherein the quantization scale factor and the zero-point value are M-bit floating-point representations.

3. The apparatus of claim 1 , wherein N is eight and M is thirty-two.

4. The apparatus of claim 1 , wherein the N-bit integer value is included in a packed matrix tile being summed prior to a multiplication by matrix multiply acceleration hardware.

5. The apparatus of claim 1 , wherein the floating-point pipeline circuitry is further configured to use the source modifier circuitry and fused multiply-add circuitry to execute a single instruction to convert two N/2-bit integer values to Q-bit floating-point results.

6. The apparatus of claim 1 , wherein:

the floating-point pipeline circuitry further includes destination modifier circuitry; and

the floating-point pipeline circuitry is further configured to execute a single instruction to:

perform a fused multiply-add operation using the fused multiply-add circuitry to generate an M-bit floating-point intermediate value, wherein the fused multiply-add operation operates on:

an input M-bit floating-point value;

a reciprocal of a quantization scale factor, wherein the reciprocal is indicated by the instruction; and

a quotient of a zero-point value and the quantization scale factor, wherein the quotient is indicated by the instruction; and

modify the M-bit floating-point intermediate value using the destination modifier circuitry to generate an N-bit integer value.

7. The apparatus of claim 6 , wherein the destination modifier circuitry is configured to clamp the intermediate value to a representable range of the N-bit integer value.

8. The apparatus of claim 1 , further comprising:

matrix multiply acceleration hardware configured to:

read input registers that include matrix data;

perform matrix multiplication to generate integer matrix entry results;

convert the integer matrix entry results to floating-point representations prior to writing the matrix entry results to destination registers; and

store the floating-point representations in destination registers as matrix multiplication result data.

9. The apparatus of claim 1 , wherein the apparatus is a computing device that further includes:

a central processing unit;

a display; and

network interface circuitry.

10. The apparatus of claim 1 , wherein:

the N-bit integer value is packed with one or more other N-bit integer values in a storage circuit configured to store M bits; and

load circuitry of the apparatus is configured to access both the N-bit integer value and the one or more other N-bit integer values in a single load operation.

11. The apparatus of claim 1 , wherein the apparatus includes:

a plurality of single-instruction multiple-data pipelines configured to execute instructions; and

fixed-function circuitry configured to control the single-instruction multiple-data pipelines to perform operations for at least one of the following types of programs:

graphics shader programs; and

machine learning programs.

12. A method, comprising:

executing, by a computing system, a single instruction to convert an N-bit integer value to an M-bit floating-point value, wherein the executing includes:

generating an intermediate M-bit representation based on the N-bit integer value; and

performing a fused multiply-add operation to generate the M-bit floating-point value, wherein the fused multiply-add operation operates on:

the intermediate M-bit representation;

a quantization scale factor value indicated by the instruction; and

a zero-point value indicated by the instruction.

13. The method of claim 12 , wherein the quantization scale factor and the zero-point value are M-bit representations.

14. The method of claim 12 , wherein the N-bit integer value is included in a packed matrix tile being summed prior to a multiplication by matrix multiply acceleration hardware.

15. The method of claim 12 , further comprising:

executing, by the computing system, a single instruction to:

perform a fused multiply-add operation to generate an M-bit floating-point intermediate value, wherein the fused multiply-add operation operates on:

an input M-bit floating-point value;

a reciprocal of a quantization scale factor, wherein the reciprocal is indicated by the instruction; and

a quotient of a zero-point value and the quantization scale factor, wherein the quotient is indicated by the instruction; and

modify the M-bit floating-point intermediate value to generate an N-bit integer value.

16. The method of claim 15 , wherein the modifying includes clamping the intermediate value to a representable range of the N-bit integer value.

17. The method of claim 12 , further comprising:

reading, by matrix multiply acceleration circuitry, input registers that include matrix data;

performing, by the matrix multiply acceleration circuitry, matrix multiplication to generate integer matrix entry results;

converting the integer matrix entry results to floating-point representations prior to writing the matrix entry results to destination registers; and

storing the floating-point representations in destination registers as matrix multiplication result data.

18. A non-transitory computer-readable medium having instructions of a hardware description programming language stored thereon that, when processed by a computing system, program the computing system to generate a computer simulation model, wherein the model represents a hardware circuit that includes:

floating-point pipeline circuitry configured to execute a single instruction to convert an N-bit integer value to an M-bit floating-point value, the floating-point pipeline circuitry comprising:

source modifier circuitry configured to generate an intermediate M-bit representation based on the N-bit integer value; and

fused multiply-add circuitry configured to perform a fused multiply-add operation to generate the M-bit floating-point value, wherein the fused multiply-add operation operates on:

the intermediate M-bit representation;

a quantization scale factor value indicated by the instruction; and

a zero-point value indicated by the instruction.

19. The non-transitory computer-readable medium of claim 18 , wherein:

the floating-point pipeline circuitry further includes destination modifier circuitry; and

the floating-point pipeline circuitry is further configured to execute a single instruction to:

perform a fused multiply-add operation using the fused multiply-add circuitry to generate an M-bit floating-point intermediate value, wherein the fused multiply-add operation operates on:

an input M-bit floating-point value;

a reciprocal of a quantization scale factor, wherein the reciprocal is indicated by the instruction; and

a quotient of a zero-point value and the quantization scale factor, wherein the quotient is indicated by the instruction; and

modify the M-bit floating-point intermediate value using the destination modifier circuitry to generate an N-bit integer value.

20. The non-transitory computer-readable medium of claim 18 , the circuit further comprising:

matrix multiply acceleration hardware configured to:

read input registers that include matrix data;

perform matrix multiplication to generate integer matrix entry results;

convert the integer matrix entry results to floating-point representations prior to writing the matrix entry results to destination registers; and

store the floating-point representations in destination registers as matrix multiplication result data.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 28, 2024
From: BURNS, CHRISTOPHER A.; POTTER, TERENCE M.; FOO, YOONG CHERT
To: APPLE INC.
Reel/Frame 066583/0162 →
References Cited (14)
US 6591361B1 · Liao · 2003 [cited by examiner]
US 10853067B2 · Henry et al. · 2020 [cited by applicant]
US 20040128331A1 · Hinds · 2004 [cited by examiner]
US 20090172349A1 · Sprangle · 2009 [cited by examiner]
US 20200167632A1 · Kim · 2020 [cited by examiner]
US 20210224033A1 · Li · 2021 [cited by examiner]
US 20210311703A1 · Kim · 2021 [cited by examiner]
US 20220066737A1 · Mu et al. · 2022 [cited by applicant]
US 20220067530A1 · Khailany · 2022 [cited by examiner]
US 20220137963A1 · Yang · 2022 [cited by examiner]
US 20230376272A1 · Van Baalen et al. · 2023 [cited by applicant]
US 20240211763A1 · Trusov · 2024 [cited by examiner]
S. Kim, et al., “Performance Evaluation of INT8 Quantized Inference on Mobile GPUs,” Dec. 6, 2021, pp. 164245-164255, vol. 9, IEEE Access. [cited by applicant]
Pengchao Hu et al, “TPU-MLIR: A Compiler For TPU Using MLIR,” Feb. 9, 2023, pp. 1-11, Sophgo Inc. [cited by applicant]