This is an archive of the discontinued LLVM Phabricator instance.

Add Float8E4M3FN type to MLIR.
ClosedPublic

Authored by reedwm on Nov 15 2022, 4:05 PM.

Details

Summary

The paper https://arxiv.org/abs/2209.05433 introduces two new FP8 dtypes: E5M2 (called Float8E5M2 in LLVM) and E4M3 (called Float8E4M3FN in LLVM). Support for Float8E5M2 in APFloat and MLIR was added in https://reviews.llvm.org/D133823. Support for Float8E4M3FN in APFloat was added in https://reviews.llvm.org/D137760. This change adds Float8E4M3FN to MLIR as well.

There is an RFC for adding the FP8 dtypes here: https://discourse.llvm.org/t/rfc-add-apfloat-and-mlir-type-support-for-fp8-e5m2/65279.

This change is identical to the MLIR changes in the patch that added Float8E5M2, except that Float8E4M3FN is added instead.

Diff Detail

Event Timeline

reedwm created this revision.Nov 15 2022, 4:05 PM
Herald added a project: Restricted Project. · View Herald Transcript
reedwm requested review of this revision.Nov 15 2022, 4:05 PM
rriddle accepted this revision.Nov 15 2022, 4:09 PM
This revision is now accepted and ready to land.Nov 15 2022, 4:09 PM
stellaraccident accepted this revision.Nov 15 2022, 5:17 PM

Thanks - this is great!

bkramer accepted this revision.Nov 16 2022, 1:24 AM
This revision was landed with ongoing or failed builds.Nov 16 2022, 1:30 AM
Closed by commit rGe08ca4bb1dfe: Add Float8E4M3FN type to MLIR. (authored by reedwm, committed by bkramer). · Explain Why
This revision was automatically updated to reflect the committed changes.