[all-commits] [llvm/llvm-project] 3f9cab: [MLIR] Add f8E8M0FNU type (#111028)

Sergey Kozub via All-commits all-commits at lists.llvm.org
Fri Oct 4 00:23:34 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3f9cabae0029bcbe88835aaa4c417ce41e584fb1
      https://github.com/llvm/llvm-project/commit/3f9cabae0029bcbe88835aaa4c417ce41e584fb1
  Author: Sergey Kozub <skozub at nvidia.com>
  Date:   2024-10-04 (Fri, 04 Oct 2024)

  Changed paths:
    M mlir/include/mlir-c/BuiltinTypes.h
    M mlir/include/mlir/IR/Builders.h
    M mlir/include/mlir/IR/BuiltinTypes.h
    M mlir/include/mlir/IR/BuiltinTypes.td
    M mlir/include/mlir/IR/CommonTypeConstraints.td
    M mlir/include/mlir/IR/Types.h
    M mlir/lib/AsmParser/TokenKinds.def
    M mlir/lib/AsmParser/TypeParser.cpp
    M mlir/lib/Bindings/Python/IRTypes.cpp
    M mlir/lib/CAPI/IR/BuiltinTypes.cpp
    M mlir/lib/Conversion/LLVMCommon/TypeConverter.cpp
    M mlir/lib/Dialect/Arith/Utils/Utils.cpp
    M mlir/lib/IR/AsmPrinter.cpp
    M mlir/lib/IR/Builders.cpp
    M mlir/lib/IR/BuiltinTypes.cpp
    M mlir/lib/IR/MLIRContext.cpp
    M mlir/lib/IR/Types.cpp
    M mlir/python/mlir/_mlir_libs/_mlir/ir.pyi
    M mlir/python/mlir/extras/types.py
    M mlir/test/IR/attribute.mlir
    M mlir/test/Target/LLVMIR/llvmir.mlir
    M mlir/test/python/ir/builtin_types.py
    M mlir/utils/lldb-scripts/mlirDataFormatters.py
    M mlir/utils/tree-sitter-mlir/grammar.js

  Log Message:
  -----------
  [MLIR] Add f8E8M0FNU type (#111028)

This PR adds `f8E8M0FNU` type to MLIR.

`f8E8M0FNU` type is proposed in [OpenCompute MX
Specification](https://www.opencompute.org/documents/ocp-microscaling-formats-mx-v1-0-spec-final-pdf).
It defines a 8-bit floating point number with bit layout S0E8M0. Unlike
IEEE-754 types, there are no infinity, denormals, zeros or negative
values.

```c
f8E8M0FNU
- Exponent bias: 127
- Maximum stored exponent value: 254 (binary 1111'1110)
- Maximum unbiased exponent value: 254 - 127 = 127
- Minimum stored exponent value: 0 (binary 0000'0000)
- Minimum unbiased exponent value: 0 − 127 = -127
- Doesn't have zero
- Doesn't have infinity
- NaN is encoded as binary 1111'1111

Additional details:
- Zeros cannot be represented
- Negative values cannot be represented
- Mantissa is always 1
```

Related PRs:
- [PR-107127](https://github.com/llvm/llvm-project/pull/107127)
[APFloat] Add APFloat support for E8M0 type
- [PR-105573](https://github.com/llvm/llvm-project/pull/105573) [MLIR]
Add f6E3M2FN type - was used as a template for this PR
- [PR-107999](https://github.com/llvm/llvm-project/pull/107999) [MLIR]
Add f6E2M3FN type
- [PR-108877](https://github.com/llvm/llvm-project/pull/108877) [MLIR]
Add f4E2M1FN type



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list