Skip to content

Commit

Permalink
[RFC] Add support for int2 in StableHLO (#2403)
Browse files Browse the repository at this point in the history
To be shared to OpenXLA Discuss shortly.

---------

Co-authored-by: Sergei Lebedev <[email protected]>
  • Loading branch information
GleasonK and superbobry authored Jun 26, 2024
1 parent aad3d9d commit 2066701
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions rfcs/20240620-int2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# FP8 in StableHLO

Status: In review<br/>
Initial version: 06/20/2024<br/>
Last updated: 06/20/2024<br/>

## Introduction

Sub-byte integer types are commonly used for model quantization. StableHLO
currently supports signed and unsigned 4-bit integer types. Here we propose to
extend the specification to cover 2-bit integer types as well.

## Proposal

Change the Types section of the spec to include si2 (signed 2-bit integer) and
ui2 (unsigned 2-bit integer):

```text
SignedIntegerType ::= 'si2' | 'si4' | 'si8' | 'si16' | 'si32' | 'si64'
UnsignedIntegerType ::= 'ui2' | 'ui4' | 'ui8' | 'ui16' | 'ui32' | 'ui64'
```

Add 2 to the list of supported bit width for integer types

```text
Integer types can be either signed (si) or unsigned (ui) and have one of the
supported bit widths (2, 4, 8, 16, 32 or 64).
```

0 comments on commit 2066701

Please sign in to comment.