[PATCH] D140088: Add LLVM type support for fp8

Stella Laurenzo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 9 10:04:44 PST 2023


stellaraccident added a comment.
Herald added a subscriber: StephenFan.

In D140088#4015926 <https://reviews.llvm.org/D140088#4015926>, @nikic wrote:

> Is there an RFC for this change? In https://discourse.llvm.org/t/rfc-add-apfloat-and-mlir-type-support-for-fp8-e5m2/65279 the addition of an LLVM IR type was explicitly out of scope. See also in particular the comment by @efriedma here: https://discourse.llvm.org/t/rfc-add-apfloat-and-mlir-type-support-for-fp8-e5m2/65279/3
>
> I'm personally rather skeptical about adding new ad-hoc floating-point types to IR without at least some restructuring of the existing system. At the IR level, my expectation would be that all the different float types get consolidated into a single type that is parameterized over the floating-point semantics.

Indeed, the original RFC was scoped to enable a further discussion about adding these types to LLVM IR but did not address that topic itself. I don't work on this level of LLVM, and all I can offer is:

- On the MLIR side, we concluded that we didn't need to figure out a generalization strategy for this scope (yet) given the existing parameterization on fltSemantics (which is similar to LLVM).
- Much of this was modeled after patches to add BFLOAT16 support to APFloat/MLIR/LLVM, and that was deemed a straight-forward addition (but we don't just blindly carry forward precedent, so just fyi).

Sounds like an RFC is in order?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140088/new/

https://reviews.llvm.org/D140088



More information about the llvm-commits mailing list