Instructions to convert from FP16 to BF8
Abstract
Techniques for converting FP16 data elements to BF8 data elements using a single instruction are described. An exemplary apparatus includes decoder circuitry to decode a single instruction, the single instruction to include a one or more fields to identify a source operand, one or more fields to identify a destination operand, and one or more fields for an opcode, the opcode to indicate that execution circuitry is to convert packed half-precision floating-point data from the identified source to packed bfloat8 data and store the packed bfloat8 data into corresponding data element positions of the identified destination operand; and execution circuitry to execute the decoded instruction according to the opcode to convert packed half-precision floating-point data from the identified source to packed bfloat8 data and store the packed bfloat8 data into corresponding data element positions.
Interactive Citation Constellation Global Citation Ranking
Interactive SVG Citation Constellation renders in Rust/WebAssembly. Prior art cited: 33 · Forward citations: 0.
Claims (18 — 3 Independent, 15 Dependent)
- Claim 1Independent Claim
An apparatus comprising: a plurality of memory controllers; a level-two (L2) cache memory coupled to the plurality of memory controllers; a processor coupled to the plurality of memory controllers, and coupled to the L2 cache memory, the processor having a plurality of cores and a plurality of levels of cache memory, the cores including circuitry to perform operations corresponding to an instruction, the instruction to identify a source register that is to include a plurality of half-precision floating-point data elements and to identify a destination register, wherein the half-precision floating-point data elements are 16-bit data elements, the operations including to: convert the plurality of half-precision floating-point data elements to a plurality of corresponding 8-bit floating-point data elements, wherein, when one or more of the half-precision floating-point data elements are normal numbers, conversion of the one or more normal numbers to one or more corresponding 8-bit floating-point data elements is to be performed according to a round to nearest even rounding mode, and the one or more corresponding 8-bit floating-point data elements are each to include one sign bit, five exponent bits, and two mantissa bits, wherein for each normal half-precision floating-point data element, a corresponding 8-bit floating-point data element is to be converted from the half-precision floating point data element using a rounding bias; and store the plurality of 8-bit floating-point data elements in the destination register; an interconnect interface coupled to the processor; and a bus controller interface coupled to the processor.
- Claim 2Depends on #1
The apparatus of claim 1, wherein the instruction allows only the round to nearest even rounding mode for the conversion of the one or more normal numbers to the one or more corresponding 8-bit floating-point data elements.
- Claim 3Depends on #1
The apparatus of claim 1, wherein the cores comprise graphics cores.
- Claim 4Depends on #1
The apparatus of claim 1, wherein the cores comprise heterogeneous cores.
- Claim 5Depends on #1
The apparatus of claim 1, wherein the cores comprise heterogeneous graphics cores.
- Claim 6Depends on #1
The apparatus of claim 1, further comprising an instruction converter to convert the instruction into one or more instructions of a different instruction set executable by the cores.
- Claim 7Depends on #1
The apparatus of claim 1, wherein, when one or more of the half-precision floating-point data elements are not-a-number (NaN) data elements, conversion of the one or more NaN data elements is to include setting a most significant bit of a mantissa of each of one or more corresponding 8-bit floating-point data elements.
- Claim 8Depends on #1
The apparatus of claim 1, wherein, when one or more of the half-precision floating-point data elements are not-a-number (NaN) data elements, conversion of the one or more NaN data elements is to include modifying a bit of a mantissa of each of one or more corresponding 8-bit floating-point data elements.
- Claim 9Depends on #1
The apparatus of claim 1, wherein, when one or more of the half-precision floating-point data elements are not-a-number (NaN) data elements, conversion of the one or more NaN data elements is to include forcing quiet NAN (QNAN) for each of one or more corresponding 8-bit floating-point data elements.
- Claim 10Independent Claim
An apparatus comprising: circuitry to receive an instruction, the instruction to identify a source register that is to include a plurality of half-precision floating-point data elements and to identify a destination register, wherein the half-precision floating-point data elements are 16-bit data elements; a plurality of memory controllers; a level-two (L2) cache memory coupled to the plurality of memory controllers; execution circuitry to perform operations corresponding to the instruction, including to: convert the plurality of half-precision floating-point data elements to a plurality of corresponding 8-bit floating-point data elements, wherein, when one or more of the half-precision floating-point data elements are normal numbers, conversion of the one or more normal numbers to one or more corresponding 8-bit floating-point data elements is to be performed according to a round to nearest even rounding mode, and the one or more corresponding 8-bit floating-point data elements are each to include one sign bit, five exponent bits, and two mantissa bits, wherein, when one or more of the half-precision floating-point data elements are not-a-number (NaN) data elements, conversion of the one or more NaN data elements is to include truncating a most significant 8 bits of the half-precision floating-point data element and setting a most significant bit of a mantissa of each of one or more corresponding 8-bit floating-point data elements, wherein for each normal half-precision floating-point data element, a corresponding 8-bit floating-point data element is to be converted from the half-precision floating point data element using a rounding bias; and store the plurality of 8-bit floating-point data elements in the destination register; an interconnect interface coupled to the execution circuitry; and a bus controller interface coupled to the execution circuitry.
- Claim 11Depends on #10
The apparatus of claim 10, wherein the instruction allows only the round to nearest even rounding mode for the conversion of the one or more normal numbers to the one or more corresponding 8-bit floating-point data elements.
- Claim 12Depends on #10
The apparatus of claim 10, wherein the execution circuitry is within a graphics core.
- Claim 13Depends on #10
The apparatus of claim 10, further comprising an instruction converter to convert the instruction into one or more instructions of a different instruction set executable by the execution circuitry.
- Claim 14Independent Claim
An apparatus comprising: an instruction converter to convert a first instruction into one or more other instructions, the first instruction to identify a source register that is to include a plurality of half-precision floating-point data elements and to identify a destination register, wherein the half-precision floating-point data elements are 16-bit data elements; a plurality of memory controllers; a level-two (L2) cache memory coupled to the plurality of memory controllers; execution circuitry to perform operations corresponding to the first instruction, including to: convert the plurality of half-precision floating-point data elements to a plurality of corresponding 8-bit floating-point data elements, wherein, when one or more of the half-precision floating-point data elements are normal numbers, conversion of the one or more normal numbers to one or more corresponding 8-bit floating-point data elements is to be performed according to a round to nearest even rounding mode, and the one or more corresponding 8-bit floating-point data elements are each to include one sign bit, five exponent bits, and two mantissa bits, wherein for each normal half-precision floating-point data element, a corresponding 8-bit floating-point data element is to be converted from the half-precision floating point data element using a rounding bias; and store the plurality of 8-bit floating-point data elements in the destination register; an interconnect interface coupled to the execution circuitry; and a bus controller interface coupled to the execution circuitry.
- Claim 15Depends on #14
The apparatus of claim 14, wherein the first instruction allows only the round to nearest even rounding mode for the conversion of the one or more normal numbers to the one or more corresponding 8-bit floating-point data elements.
- Claim 16Depends on #14
The apparatus of claim 14, wherein, when one or more of the half-precision floating-point data elements are not-a-number (NaN) data elements, conversion of the one or more NaN data elements is to include modifying a bit of a mantissa of each of one or more corresponding 8-bit floating-point data elements.
- Claim 17Depends on #14
The apparatus of claim 14, wherein, when one or more of the half-precision floating-point data elements are not-a-number (NaN) data elements, conversion of the one or more NaN data elements is to include forcing quiet NAN (QNAN) for each of one or more corresponding 8-bit floating-point data elements.
- Claim 18Depends on #14
The apparatus of claim 14, wherein the execution circuitry is part of a graphics core.
Technical Overview & Description
BACKGROUND State of the art AI uses different 32-bit and 16-bit floating point formats such as, for example, Brain floating point 16 (also known as, for example, bloat16 or BF16), Institute of Electrical and Electronics Engineers (IEEE) half-precision floating point (also known as, for example, FP16 or float16) and single-precision floating point (also known as, for example, FP32 or float32). Recent work has also shown that 8-bit float point formats, such as bfloat8 (using a 1-5-2 format (1-bit sign, 5-bit exponent, and 2-bit mantissa), are a viable option for input data for mixed precision computation such as fused multiply-add (FMA) with BF8 inputs and a FP32 accumulator. BRIEF DESCRIPTION OF DRAWINGS Various embodiments in accordance with the present disclosure will be described with reference to the drawings, in which: FIG. 1 illustrates an exemplary execution of a VCVTNEPH2BF8 instruction. FIG. 2 illustrates an exemplary execution of a VCVTNE2PH2BF8 instruction. FIG. 3 illustrates embodiments of hardware to process an instruction such as the FP16 to BF8 (e.g., VCVTNE2PH2BF8 and VCVTNEPH2BF8) instructions. FIG. 4 illustrates an embodiment of method performed by a processor to process a VCVTNEPH2BF8 instruction. FIG. 5 illustrates embodiments of method performed by a processor to process a VCVTNEPH2BF8 instruction. FIG. 6 illustrates embodiments of pseudocode for performing the VCVTNEPH2BF8 instruction. FIG. 7 illustrates an embodiment of method performed by a processor to process a VCVTNE2PH2BF8 instruction. FIGS. 8 (A) -(B) illustrates embodiments of method performed by a processor to process a VCVTNE2PH2BF8 instruction. FIG. 9 illustrates embodiments of pseudocode for performing the VCVTNE2PH2BF8 instruction. FIG. 10 illustrates embodiments of an exemplary system. FIG. 11 illustrates a block diagram of embodiments of a processor.
Cited By — Indexed Forward Citations (0 of 0 total)
No indexed citing patents in this generation yet. Ingest USPTO/PatentsView bulk citation tables via patents-ingest to expand the local forward citation graph.
References Cited — Backward Prior Art (33)
| Patent | Title | Year | Citations |
|---|---|---|---|
| JP 4,020,169 B2 | 燃焼合成反応を用いる火花溶着用の電極棒、その製法及びこの電極を用いた火花溶着金属被覆法 | 2007 | 0 |
Non-Patent Literature (10)
- Kusswurm
- ‘
- Modern Arm Assembly Language Programming
- ’
- Published Oct. 8, 2020. (Year: 2020).
- Devnath et al.
- ‘
- A Mathematical Approach Towards Quantization of Floating Point Weights in Low Power Neural Networks
- ’
- 2020 33rd International Conference on VLSI Design and 2020 19th International Conference on Embedded Systems (VLSID), Jan. 2020. (Year: 2020).