Skip to content

Commit e0dbf2b

Browse files
committed
Add f8E4M3 IEEE 754 type to mlir
1 parent 38a8850 commit e0dbf2b

File tree

24 files changed

+136
-10
lines changed

24 files changed

+136
-10
lines changed

mlir/include/mlir-c/BuiltinTypes.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,16 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat8E5M2(MlirType type);
8989
/// context.
9090
MLIR_CAPI_EXPORTED MlirType mlirFloat8E5M2TypeGet(MlirContext ctx);
9191

92+
/// Returns the typeID of an Float8E4M3 type.
93+
MLIR_CAPI_EXPORTED MlirTypeID mlirFloat8E4M3TypeGetTypeID(void);
94+
95+
/// Checks whether the given type is an f8E4M3 type.
96+
MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat8E4M3(MlirType type);
97+
98+
/// Creates an f8E4M3 type in the given context. The type is owned by the
99+
/// context.
100+
MLIR_CAPI_EXPORTED MlirType mlirFloat8E4M3TypeGet(MlirContext ctx);
101+
92102
/// Returns the typeID of an Float8E4M3FN type.
93103
MLIR_CAPI_EXPORTED MlirTypeID mlirFloat8E4M3FNTypeGetTypeID(void);
94104

mlir/include/mlir/IR/Builders.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ class Builder {
6161

6262
// Types.
6363
FloatType getFloat8E5M2Type();
64+
FloatType getFloat8E4M3Type();
6465
FloatType getFloat8E4M3FNType();
6566
FloatType getFloat8E5M2FNUZType();
6667
FloatType getFloat8E4M3FNUZType();

mlir/include/mlir/IR/BuiltinTypes.h

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ class FloatType : public Type {
5656
static FloatType getF80(MLIRContext *ctx);
5757
static FloatType getF128(MLIRContext *ctx);
5858
static FloatType getFloat8E5M2(MLIRContext *ctx);
59+
static FloatType getFloat8E4M3(MLIRContext *ctx);
5960
static FloatType getFloat8E4M3FN(MLIRContext *ctx);
6061
static FloatType getFloat8E5M2FNUZ(MLIRContext *ctx);
6162
static FloatType getFloat8E4M3FNUZ(MLIRContext *ctx);
@@ -405,16 +406,20 @@ inline bool BaseMemRefType::isValidElementType(Type type) {
405406
}
406407

407408
inline bool FloatType::classof(Type type) {
408-
return llvm::isa<Float8E5M2Type, Float8E4M3FNType, Float8E5M2FNUZType,
409-
Float8E4M3FNUZType, Float8E4M3B11FNUZType, BFloat16Type,
410-
Float16Type, FloatTF32Type, Float32Type, Float64Type,
411-
Float80Type, Float128Type>(type);
409+
return llvm::isa<
410+
Float8E5M2Type, Float8E4M3Type, Float8E4M3FNType, Float8E5M2FNUZType,
411+
Float8E4M3FNUZType, Float8E4M3B11FNUZType, BFloat16Type, Float16Type,
412+
FloatTF32Type, Float32Type, Float64Type, Float80Type, Float128Type>(type);
412413
}
413414

414415
inline FloatType FloatType::getFloat8E5M2(MLIRContext *ctx) {
415416
return Float8E5M2Type::get(ctx);
416417
}
417418

419+
inline FloatType FloatType::getFloat8E4M3(MLIRContext *ctx) {
420+
return Float8E4M3Type::get(ctx);
421+
}
422+
418423
inline FloatType FloatType::getFloat8E4M3FN(MLIRContext *ctx) {
419424
return Float8E4M3FNType::get(ctx);
420425
}

mlir/include/mlir/IR/BuiltinTypes.td

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,25 @@ def Builtin_Float8E5M2 : Builtin_FloatType<"Float8E5M2", "f8E5M2"> {
9797
}];
9898
}
9999

100+
//===----------------------------------------------------------------------===//
101+
// Float8E4M3Type
102+
103+
def Builtin_Float8E4M3 : Builtin_FloatType<"Float8E4M3", "f8E4M3"> {
104+
let summary = "8-bit floating point with 3 bit mantissa";
105+
let description = [{
106+
An 8-bit floating point type with 1 sign bit, 4 bits exponent and 3 bits
107+
mantissa. This is not a standard type as defined by IEEE-754, but it
108+
follows similar conventions with the following characteristics:
109+
110+
* bit encoding: S1E4M3
111+
* exponent bias: 7
112+
* infinities: supported with exponent set to all 1s and mantissa 0s
113+
* NaNs: supported with exponent bits set to all 1s and mantissa of
114+
(001, 010, 011, 100, 101, 110, 111)
115+
* denormals when exponent is 0
116+
}];
117+
}
118+
100119
//===----------------------------------------------------------------------===//
101120
// Float8E4M3FNType
102121

mlir/include/mlir/IR/CommonTypeConstraints.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,8 @@ def F8E4M3FN : Type<CPred<"$_self.isFloat8E4M3FN()">, "f8E4M3FN type">,
331331
BuildableType<"$_builder.getFloat8E4M3FNType()">;
332332
def F8E5M2 : Type<CPred<"$_self.isFloat8E5M2()">, "f8E5M2 type">,
333333
BuildableType<"$_builder.getFloat8E5M2Type()">;
334+
def F8E4M3 : Type<CPred<"$_self.isFloat8E4M3()">, "f8E4M3 type">,
335+
BuildableType<"$_builder.getFloat8E4M3Type()">;
334336
def F8E4M3FNUZ : Type<CPred<"$_self.isFloat8E4M3FNUZ()">, "f8E4M3FNUZ type">,
335337
BuildableType<"$_builder.getFloat8E4M3FNUZType()">;
336338
def F8E4M3B11FNUZ : Type<CPred<"$_self.isFloat8E4M3B11FNUZ()">, "f8E4M3B11FNUZ type">,

mlir/include/mlir/IR/Types.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ class Type {
126126
// derived types should use isa/dyn_cast.
127127
bool isIndex() const;
128128
bool isFloat8E5M2() const;
129+
bool isFloat8E4M3() const;
129130
bool isFloat8E4M3FN() const;
130131
bool isFloat8E5M2FNUZ() const;
131132
bool isFloat8E4M3FNUZ() const;

mlir/lib/AsmParser/TokenKinds.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ TOK_KEYWORD(f32)
9595
TOK_KEYWORD(f64)
9696
TOK_KEYWORD(f80)
9797
TOK_KEYWORD(f8E5M2)
98+
TOK_KEYWORD(f8E4M3)
9899
TOK_KEYWORD(f8E4M3FN)
99100
TOK_KEYWORD(f8E5M2FNUZ)
100101
TOK_KEYWORD(f8E4M3FNUZ)

mlir/lib/AsmParser/TypeParser.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ OptionalParseResult Parser::parseOptionalType(Type &type) {
4141
case Token::kw_vector:
4242
case Token::inttype:
4343
case Token::kw_f8E5M2:
44+
case Token::kw_f8E4M3:
4445
case Token::kw_f8E4M3FN:
4546
case Token::kw_f8E5M2FNUZ:
4647
case Token::kw_f8E4M3FNUZ:
@@ -305,6 +306,9 @@ Type Parser::parseNonFunctionType() {
305306
case Token::kw_f8E5M2:
306307
consumeToken(Token::kw_f8E5M2);
307308
return builder.getFloat8E5M2Type();
309+
case Token::kw_f8E4M3:
310+
consumeToken(Token::kw_f8E4M3);
311+
return builder.getFloat8E4M3Type();
308312
case Token::kw_f8E4M3FN:
309313
consumeToken(Token::kw_f8E4M3FN);
310314
return builder.getFloat8E4M3FNType();

mlir/lib/Bindings/Python/IRTypes.cpp

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ class PyFloat8E4M3FNType
143143
}
144144
};
145145

146-
/// Floating Point Type subclass - Float8M5E2Type.
146+
/// Floating Point Type subclass - Float8E5M2Type.
147147
class PyFloat8E5M2Type : public PyConcreteType<PyFloat8E5M2Type, PyFloatType> {
148148
public:
149149
static constexpr IsAFunctionTy isaFunction = mlirTypeIsAFloat8E5M2;
@@ -163,6 +163,26 @@ class PyFloat8E5M2Type : public PyConcreteType<PyFloat8E5M2Type, PyFloatType> {
163163
}
164164
};
165165

166+
/// Floating Point Type subclass - Float8E4M3Type.
167+
class PyFloat8E4M3Type : public PyConcreteType<PyFloat8E4M3Type, PyFloatType> {
168+
public:
169+
static constexpr IsAFunctionTy isaFunction = mlirTypeIsAFloat8E4M3;
170+
static constexpr GetTypeIDFunctionTy getTypeIdFunction =
171+
mlirFloat8E4M3TypeGetTypeID;
172+
static constexpr const char *pyClassName = "Float8E4M3Type";
173+
using PyConcreteType::PyConcreteType;
174+
175+
static void bindDerived(ClassTy &c) {
176+
c.def_static(
177+
"get",
178+
[](DefaultingPyMlirContext context) {
179+
MlirType t = mlirFloat8E4M3TypeGet(context->get());
180+
return PyFloat8E4M3Type(context->getRef(), t);
181+
},
182+
py::arg("context") = py::none(), "Create a float8_e4m3 type.");
183+
}
184+
};
185+
166186
/// Floating Point Type subclass - Float8E4M3FNUZ.
167187
class PyFloat8E4M3FNUZType
168188
: public PyConcreteType<PyFloat8E4M3FNUZType, PyFloatType> {
@@ -840,6 +860,7 @@ void mlir::python::populateIRTypes(py::module &m) {
840860
PyIndexType::bind(m);
841861
PyFloat8E4M3FNType::bind(m);
842862
PyFloat8E5M2Type::bind(m);
863+
PyFloat8E4M3Type::bind(m);
843864
PyFloat8E4M3FNUZType::bind(m);
844865
PyFloat8E4M3B11FNUZType::bind(m);
845866
PyFloat8E5M2FNUZType::bind(m);

mlir/lib/CAPI/IR/BuiltinTypes.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,18 @@ MlirType mlirFloat8E5M2TypeGet(MlirContext ctx) {
9898
return wrap(FloatType::getFloat8E5M2(unwrap(ctx)));
9999
}
100100

101+
MlirTypeID mlirFloat8E4M3TypeGetTypeID() {
102+
return wrap(Float8E4M3Type::getTypeID());
103+
}
104+
105+
bool mlirTypeIsAFloat8E4M3(MlirType type) {
106+
return unwrap(type).isFloat8E4M3();
107+
}
108+
109+
MlirType mlirFloat8E4M3TypeGet(MlirContext ctx) {
110+
return wrap(FloatType::getFloat8E4M3(unwrap(ctx)));
111+
}
112+
101113
MlirTypeID mlirFloat8E4M3FNTypeGetTypeID() {
102114
return wrap(Float8E4M3FNType::getTypeID());
103115
}

mlir/lib/Conversion/LLVMCommon/TypeConverter.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,9 @@ Type LLVMTypeConverter::convertIntegerType(IntegerType type) const {
233233
}
234234

235235
Type LLVMTypeConverter::convertFloatType(FloatType type) const {
236-
if (type.isFloat8E5M2() || type.isFloat8E4M3FN() || type.isFloat8E5M2FNUZ() ||
237-
type.isFloat8E4M3FNUZ() || type.isFloat8E4M3B11FNUZ())
236+
if (type.isFloat8E5M2() || type.isFloat8E4M3() || type.isFloat8E4M3FN() ||
237+
type.isFloat8E5M2FNUZ() || type.isFloat8E4M3FNUZ() ||
238+
type.isFloat8E4M3B11FNUZ())
238239
return IntegerType::get(&getContext(), type.getWidth());
239240
return type;
240241
}

mlir/lib/Dialect/Arith/Transforms/EmulateUnsupportedFloats.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ static std::optional<FloatType> parseFloatType(MLIRContext *ctx,
5656
Builder b(ctx);
5757
return llvm::StringSwitch<std::optional<FloatType>>(name)
5858
.Case("f8E5M2", b.getFloat8E5M2Type())
59+
.Case("f8E4M3", b.getFloat8E4M3Type())
5960
.Case("f8E4M3FN", b.getFloat8E4M3FNType())
6061
.Case("f8E5M2FNUZ", b.getFloat8E5M2FNUZType())
6162
.Case("f8E4M3FNUZ", b.getFloat8E4M3FNUZType())

mlir/lib/IR/AsmPrinter.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2576,6 +2576,7 @@ void AsmPrinter::Impl::printTypeImpl(Type type) {
25762576
})
25772577
.Case<IndexType>([&](Type) { os << "index"; })
25782578
.Case<Float8E5M2Type>([&](Type) { os << "f8E5M2"; })
2579+
.Case<Float8E4M3Type>([&](Type) { os << "f8E4M3"; })
25792580
.Case<Float8E4M3FNType>([&](Type) { os << "f8E4M3FN"; })
25802581
.Case<Float8E5M2FNUZType>([&](Type) { os << "f8E5M2FNUZ"; })
25812582
.Case<Float8E4M3FNUZType>([&](Type) { os << "f8E4M3FNUZ"; })

mlir/lib/IR/Builders.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ FloatType Builder::getFloat8E5M2Type() {
3838
return FloatType::getFloat8E5M2(context);
3939
}
4040

41+
FloatType Builder::getFloat8E4M3Type() {
42+
return FloatType::getFloat8E4M3(context);
43+
}
44+
4145
FloatType Builder::getFloat8E4M3FNType() {
4246
return FloatType::getFloat8E4M3FN(context);
4347
}

mlir/lib/IR/BuiltinTypes.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,9 @@ IntegerType IntegerType::scaleElementBitwidth(unsigned scale) {
8787
//===----------------------------------------------------------------------===//
8888

8989
unsigned FloatType::getWidth() {
90-
if (llvm::isa<Float8E5M2Type, Float8E4M3FNType, Float8E5M2FNUZType,
91-
Float8E4M3FNUZType, Float8E4M3B11FNUZType>(*this))
90+
if (llvm::isa<Float8E5M2Type, Float8E4M3Type, Float8E4M3FNType,
91+
Float8E5M2FNUZType, Float8E4M3FNUZType, Float8E4M3B11FNUZType>(
92+
*this))
9293
return 8;
9394
if (llvm::isa<Float16Type, BFloat16Type>(*this))
9495
return 16;
@@ -107,6 +108,8 @@ unsigned FloatType::getWidth() {
107108
const llvm::fltSemantics &FloatType::getFloatSemantics() {
108109
if (llvm::isa<Float8E5M2Type>(*this))
109110
return APFloat::Float8E5M2();
111+
if (llvm::isa<Float8E4M3Type>(*this))
112+
return APFloat::Float8E4M3();
110113
if (llvm::isa<Float8E4M3FNType>(*this))
111114
return APFloat::Float8E4M3FN();
112115
if (llvm::isa<Float8E5M2FNUZType>(*this))

mlir/lib/IR/MLIRContext.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ class MLIRContextImpl {
222222

223223
/// Cached Type Instances.
224224
Float8E5M2Type f8E5M2Ty;
225+
Float8E4M3Type f8E4M3Ty;
225226
Float8E4M3FNType f8E4M3FNTy;
226227
Float8E5M2FNUZType f8E5M2FNUZTy;
227228
Float8E4M3FNUZType f8E4M3FNUZTy;
@@ -312,6 +313,7 @@ MLIRContext::MLIRContext(const DialectRegistry &registry, Threading setting)
312313
//// Types.
313314
/// Floating-point Types.
314315
impl->f8E5M2Ty = TypeUniquer::get<Float8E5M2Type>(this);
316+
impl->f8E4M3Ty = TypeUniquer::get<Float8E4M3Type>(this);
315317
impl->f8E4M3FNTy = TypeUniquer::get<Float8E4M3FNType>(this);
316318
impl->f8E5M2FNUZTy = TypeUniquer::get<Float8E5M2FNUZType>(this);
317319
impl->f8E4M3FNUZTy = TypeUniquer::get<Float8E4M3FNUZType>(this);
@@ -1012,6 +1014,9 @@ StorageUniquer &MLIRContext::getTypeUniquer() { return getImpl().typeUniquer; }
10121014
Float8E5M2Type Float8E5M2Type::get(MLIRContext *context) {
10131015
return context->getImpl().f8E5M2Ty;
10141016
}
1017+
Float8E4M3Type Float8E4M3Type::get(MLIRContext *context) {
1018+
return context->getImpl().f8E4M3Ty;
1019+
}
10151020
Float8E4M3FNType Float8E4M3FNType::get(MLIRContext *context) {
10161021
return context->getImpl().f8E4M3FNTy;
10171022
}

mlir/lib/IR/Types.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Type AbstractType::replaceImmediateSubElements(Type type,
3535
MLIRContext *Type::getContext() const { return getDialect().getContext(); }
3636

3737
bool Type::isFloat8E5M2() const { return llvm::isa<Float8E5M2Type>(*this); }
38+
bool Type::isFloat8E4M3() const { return llvm::isa<Float8E4M3Type>(*this); }
3839
bool Type::isFloat8E4M3FN() const { return llvm::isa<Float8E4M3FNType>(*this); }
3940
bool Type::isFloat8E5M2FNUZ() const {
4041
return llvm::isa<Float8E5M2FNUZType>(*this);

mlir/python/mlir/_mlir_libs/_mlir/ir.pyi

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ __all__ = [
123123
"Float8E4M3B11FNUZType",
124124
"Float8E4M3FNType",
125125
"Float8E4M3FNUZType",
126+
"Float8E4M3Type",
126127
"Float8E5M2FNUZType",
127128
"Float8E5M2Type",
128129
"FloatAttr",
@@ -1575,6 +1576,19 @@ class Float8E4M3FNUZType(FloatType):
15751576
@property
15761577
def typeid(self) -> TypeID: ...
15771578

1579+
class Float8E4M3Type(FloatType):
1580+
static_typeid: ClassVar[TypeID]
1581+
@staticmethod
1582+
def get(context: Optional[Context] = None) -> Float8E4M3Type:
1583+
"""
1584+
Create a float8_e4m3 type.
1585+
"""
1586+
@staticmethod
1587+
def isinstance(other: Type) -> bool: ...
1588+
def __init__(self, cast_from_type: Type) -> None: ...
1589+
@property
1590+
def typeid(self) -> TypeID: ...
1591+
15781592
class Float8E5M2FNUZType(FloatType):
15791593
static_typeid: ClassVar[TypeID]
15801594
@staticmethod

mlir/python/mlir/extras/types.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
F64Type,
1515
Float8E4M3B11FNUZType,
1616
Float8E4M3FNType,
17+
Float8E4M3Type,
1718
Float8E5M2Type,
1819
FunctionType,
1920
IndexType,
@@ -68,6 +69,7 @@ def ui(width):
6869
bf16 = lambda: BF16Type.get()
6970

7071
f8E5M2 = lambda: Float8E5M2Type.get()
72+
f8E4M3 = lambda: Float8E4M3Type.get()
7173
f8E4M3FN = lambda: Float8E4M3FNType.get()
7274
f8E4M3B11FNUZ = lambda: Float8E4M3B11FNUZType.get()
7375

mlir/test/IR/attribute.mlir

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ func.func @float_attrs_pass() {
4040
// CHECK: float_attr = 2.000000e+00 : f8E5M2
4141
float_attr = 2. : f8E5M2
4242
} : () -> ()
43+
"test.float_attrs"() {
44+
// CHECK: float_attr = 2.000000e+00 : f8E4M3
45+
float_attr = 2. : f8E4M3
46+
} : () -> ()
4347
"test.float_attrs"() {
4448
// CHECK: float_attr = 2.000000e+00 : f8E4M3FN
4549
float_attr = 2. : f8E4M3FN

mlir/test/Target/LLVMIR/llvmir.mlir

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ llvm.mlir.global internal constant @string_const("foobar") : !llvm.array<6 x i8>
3939
// CHECK: @int_global_undef = internal global i64 undef
4040
llvm.mlir.global internal @int_global_undef() : i64
4141

42+
// CHECK: @f8E4M3_global_as_i8 = internal global i8 60
43+
llvm.mlir.global internal @f8E4M3_global_as_i8(1.5 : f8E4M3) : i8
44+
4245
// CHECK: @f8E4M3FN_global_as_i8 = internal global i8 60
4346
llvm.mlir.global internal @f8E4M3FN_global_as_i8(1.5 : f8E4M3FN) : i8
4447

mlir/test/python/ir/builtin_types.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ def testTypeIsInstance():
113113
def testFloatTypeSubclasses():
114114
ctx = Context()
115115
# CHECK: True
116+
print(isinstance(Type.parse("f8E4M3", ctx), FloatType))
117+
# CHECK: True
116118
print(isinstance(Type.parse("f8E4M3FN", ctx), FloatType))
117119
# CHECK: True
118120
print(isinstance(Type.parse("f8E5M2", ctx), FloatType))
@@ -229,6 +231,8 @@ def testIndexType():
229231
@run
230232
def testFloatType():
231233
with Context():
234+
# CHECK: float: f8E4M3
235+
print("float:", Float8E4M3Type.get())
232236
# CHECK: float: f8E4M3FN
233237
print("float:", Float8E4M3FNType.get())
234238
# CHECK: float: f8E5M2
@@ -601,6 +605,7 @@ def testTypeIDs():
601605
types = [
602606
(IntegerType, IntegerType.get_signless(16)),
603607
(IndexType, IndexType.get()),
608+
(Float8E4M3Type, Float8E4M3Type.get()),
604609
(Float8E4M3FNType, Float8E4M3FNType.get()),
605610
(Float8E5M2Type, Float8E5M2Type.get()),
606611
(Float8E4M3FNUZType, Float8E4M3FNUZType.get()),
@@ -624,6 +629,7 @@ def testTypeIDs():
624629

625630
# CHECK: IntegerType(i16)
626631
# CHECK: IndexType(index)
632+
# CHECK: Float8E4M3Type(f8E4M3)
627633
# CHECK: Float8E4M3FNType(f8E4M3FN)
628634
# CHECK: Float8E5M2Type(f8E5M2)
629635
# CHECK: Float8E4M3FNUZType(f8E4M3FNUZ)
@@ -704,6 +710,9 @@ def print_downcasted(typ):
704710
# CHECK: Float8E4M3B11FNUZType
705711
# CHECK: Float8E4M3B11FNUZType(f8E4M3B11FNUZ)
706712
print_downcasted(Float8E4M3B11FNUZType.get())
713+
# CHECK: Float8E4M3Type
714+
# CHECK: Float8E4M3Type(f8E4M3)
715+
print_downcasted(Float8E4M3Type.get())
707716
# CHECK: Float8E4M3FNType
708717
# CHECK: Float8E4M3FNType(f8E4M3FN)
709718
print_downcasted(Float8E4M3FNType.get())

0 commit comments

Comments
 (0)