-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC] Add a new type to StableHLO: E4M3B11FNUZ #1308
Conversation
X. Sun et al. (https://dl.acm.org/doi/10.5555/3454287.3454728) published a paper showing that an FP format with 4 bits of exponent, 3 bits of significand and an exponent bias of 11 would work quite well for ML applications. Google hardware supports a variant of this format where 0x80 is used to represent NaN, as in the Float8E4M3FNUZ format. Just like the Float8E4M3FNUZ format, this format does not support -0 and values which would map to it will become +0. This format is proposed for inclusion in OpenXLA's StableHLO dialect: openxla/stablehlo#1308 As part of inclusion in that dialect, APFloat needs to know how to handle this format.
APFloat and related changes are posted for review here. |
Adding this type makes sense to me and I expect that we will see more requests of this kind as the use of different floating point formats proliferates across hardware. We need to be able to target these different floating point types from stablehlo. At some point we will need to start thinking about optionality/portability of fp8 formats and whether we want to have some sort of hierarchy so that compilers can chose a specific implementation type for a specified type at the stablehlo level. We already have the concept of a |
X. Sun et al. (https://dl.acm.org/doi/10.5555/3454287.3454728) published a paper showing that an FP format with 4 bits of exponent, 3 bits of significand and an exponent bias of 11 would work quite well for ML applications. Google hardware supports a variant of this format where 0x80 is used to represent NaN, as in the Float8E4M3FNUZ format. Just like the Float8E4M3FNUZ format, this format does not support -0 and values which would map to it will become +0. This format is proposed for inclusion in OpenXLA's StableHLO dialect: openxla/stablehlo#1308 As part of inclusion in that dialect, APFloat needs to know how to handle this format. Differential Revision: https://reviews.llvm.org/D146441
As discussed at the community meeting on Tuesday 3/21, the review period for this RFC closes today. There is support for introducing this new type to StableHLO, and we haven't received any blocking feedback, so the RFC is now approved. |
As proposed in [RFC: E4M3B11FNUZ in XLA](https://github.com/openxla/stablehlo/blob/main/rfcs/20230309-e4m3b11.md) (openxla#1308), this change adds support for this type to StableHLO. This includes the type definitions, vhlo, and interpreter support. The testing approach mirrors the Float8E4M3FNUZ tests, since it is also a "non-standard" floating point type supported by StableHLO.
As proposed in [RFC: E4M3B11FNUZ in XLA](https://github.com/openxla/stablehlo/blob/main/rfcs/20230309-e4m3b11.md) (openxla#1308), this change adds support for this type to StableHLO. This includes the type definitions, vhlo, and interpreter support. The testing approach mirrors the Float8E4M3FNUZ tests, since it is also a "non-standard" floating point type supported by StableHLO.
As proposed in [RFC: E4M3B11FNUZ in XLA](https://github.com/openxla/stablehlo/blob/main/rfcs/20230309-e4m3b11.md) (#1308), this change adds support for these types to StableHLO. This includes the type definitions, vhlo, and interpreter support. The testing approach mirrors the Float8E4M3FNUZ tests, since it is also a "non-standard" floating point type supported by StableHLO.
This is a proposal to add a new floating point type to StableHLO, please see rfcs/20230309-e4m3b11.md for more details.