# US 2024/0201948 A1 · Combined sparse and block floating arithmetic

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2024/0201948 A1
- Document ID: US20240201948A1
- Status: Published application
- Kind: A1
- Application number: 18/083,273
- Filed: 2022-12-16
- Published: 2024-06-20
- Earliest claimed: 2022-12-16
- Assignees: Advanced Micro Devices, Inc.
- Applicants: Advanced Micro Devices, Inc.
- Inventors: Gabriel H. Loh
- Web page: https://patentgrep.com/patent/US20240201948A1

## CPC

- G06F 7/483: Computations with numbers represented by a non-linear combination of denominational numbers, e.g. rational numbers, logarithmic number system or floating-point numbers {(G06F7/4806, G06F7/4824, G06F7/49, G06F7/491, G06F7/544 take precedence)}
- G06F 7/49942: {Significance control}
- H03M 7/24: Conversion to or from floating-point codes
- G06F 5/012: {in floating-point computations}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- H03M: CODING; DECODING; CODE CONVERSION IN GENERAL (using fluidic means F15C4/00; optical analogue/digital converters G02F7/00; coding, decoding or code conversion, specially adapted for particular applications, see the relevant subclasses, e.g. G01D, G01R, G06F, G06T, G09G, G10L, G11B, G11C, H04B, H04L, H04M, H04N; ciphering or deciphering for cryptography or other purposes involving the need for secrecy G09C)

## Abstract

A processing device for encoding floating point numbers comprising memory configured to store data comprising the floating point numbers and circuitry. The circuitry is configured to, for a set of the floating point numbers, identify which of the floating point numbers represent a zero value and which of the floating point numbers represent a non-zero value, convert the floating point numbers which represent a non-zero value into a block floating point format value and generate an encoded sparse block floating point format value. The circuitry is also configured to, decode floating point numbers. For an encoded block floating point format value, the circuitry converts the encoded block floating point format value to a set of non-zero floating point numbers based on a sparsity mask previously generated to encode the encoded block floating point format value and generates a non-sparse set of floating point values.

## Claims

### Claim 1

A processing device for encoding floating point numbers comprising:
memory configured to store data comprising the floating point numbers; and
circuitry configured to, for a set of the floating point numbers:
identify which of the floating point numbers represent a zero value and which of the floating point numbers represent a non-zero value;
convert the floating point numbers representing a non-zero value into a block floating point format value; and
generate an encoded sparse block floating point format value.

### Claim 2 (depends on 1)

The processing device of claim 1, wherein the circuitry is configured to generate a sparsity mask which indicates, via a single bit value for each floating point number in the set of floating point numbers, the floating point numbers identified as representing a zero value and the floating point numbers identified as representing a non-zero value.

### Claim 3 (depends on 2)

The processing device of claim 2, wherein the circuitry is configured to generate the encoded sparse block floating point format value by combining the sparsity mask and the block floating point format value.

### Claim 4 (depends on 2)

The processing device of claim 2, wherein the circuitry is configured to encode the floating point numbers indicated by the sparsity mask as representing a zero value by storing each of the floating point numbers indicated as representing a zero value as a single bit in the memory.

### Claim 5 (depends on 1)

The processing device of claim 1, wherein the circuitry is configured to convert the floating point numbers representing a non-zero value into a block floating point format by:
comparing exponents from each of the floating point numbers representing a non-zero value,
determining a shared exponent value; and
adjusting significands of the floating point numbers representing a non-zero value.

### Claim 6 (depends on 5)

The processing device of claim 5, wherein the circuitry is configured to determine the shared exponent value by selecting an exponent value having a largest value among the exponent values of each of the floating point numbers representing a non-zero value.

### Claim 7 (depends on 6)

The processing device of claim 6, wherein the circuitry is configured to adjust the significands of the floating point numbers representing a non-zero value by shifting, for each floating point number representing a non-zero value, the significands by an amount of bits equal to a difference between the selected exponent value and its corresponding exponent value.

### Claim 8 (depends on 5)

The processing device of claim 5, wherein the circuitry comprises at least one of hardware logic gates and a processor.

### Claim 9

A method for encoding floating point numbers comprising:
for a set of the floating point numbers:
identifying which of the floating point numbers represent a zero value and which of the floating point numbers represent a non-zero value;
converting the floating point numbers representing a non-zero value into a block floating point format value; and
generating an encoded sparse block floating point format value.

### Claim 10 (depends on 9)

The method of claim 9, further comprising generating a sparsity mask which indicates, via a single bit value for each floating point number in the set of the floating point numbers, the floating point numbers identified as representing a zero value and the floating point numbers identified as representing a non-zero value.

### Claim 11 (depends on 10)

The method of claim 10, further comprising generating the encoded sparse block floating point format value by combining the sparsity mask and the block floating point format value.

### Claim 12 (depends on 10)

The method of claim 10, further comprising encoding the floating point numbers indicated by the sparsity mask as representing a zero value by storing each of the floating point numbers indicated as representing a zero value as a single bit.

### Claim 13 (depends on 9)

The method of claim 9, further comprising converting the floating point numbers which represent a non-zero value into a block floating point format by:
comparing exponents from each of the floating point numbers representing a non-zero value,
determining a shared exponent value; and
adjusting significands of the floating point numbers representing a non-zero value.

### Claim 14 (depends on 13)

The method of claim 13, further comprising determining the shared exponent value by selecting an exponent value having a largest value among the exponent values of each of the floating point numbers representing a non-zero value.

### Claim 15 (depends on 14)

The method of claim 14, further comprising adjusting the significands of the floating point numbers representing a non-zero value by shifting, for each floating point number representing a non-zero value, the significands by an amount of bits equal to a difference between the selected exponent value and its corresponding exponent value.

### Claim 16

A processing device for decoding floating point numbers comprising:
memory configured to store data comprising the floating point numbers; and
circuitry configured to, for an encoded block floating point format value:
convert the encoded block floating point format value to a set of non-zero floating point numbers based on a sparsity mask previously generated to encode the encoded block floating point format value; and
generate a non-sparse set of floating point values.

### Claim 17 (depends on 16)

The processing device of claim 16, wherein the circuitry is configured to convert the encoded block floating point format value to the set of non-zero floating point numbers based on zero value floating point numbers previously identified by bits in the sparsity mask.

### Claim 18 (depends on 16)

The processing device of claim 16, wherein the non-sparse set of floating point values is a non-sparse set of block floating point values.

### Claim 19 (depends on 16)

The processing device of claim 16, wherein the non-sparse set of floating point values is a non-sparse set of independent specified floating point values.

### Claim 20 (depends on 16)

The processing device of claim 16, further comprising a display device configured to display information derived from the floating point numbers.
