[Mlir-commits] [mlir] [mlir][tosa] Add FP8 support (PR #127730)

Tai Ly llvmlistbot at llvm.org
Wed Feb 19 10:56:35 PST 2025


================
@@ -258,14 +263,22 @@ static LogicalResult verifyConvOp(T op) {
     return failure();
   }
 
-  if (isa<Float8E5M2Type>(inputEType) || isa<Float8E4M3FNType>(inputEType) ||
-      isa<Float8E5M2Type>(weightEType) || isa<Float8E4M3FNType>(weightEType)) {
+  if (llvm::isa<Float8E5M2Type>(inputEType) ||
+      llvm::isa<Float8E4M3FNType>(inputEType) ||
+      llvm::isa<Float8E5M2Type>(weightEType) ||
+      llvm::isa<Float8E4M3FNType>(weightEType)) {
     if (inputEType != weightEType) {
       op.emitOpError(
           "expect both input and weight to have same element type, got ")
           << inputEType << " and " << weightEType;
       return failure();
     }
+
+    if (!resultEType.isF16()) {
+      op.emitOpError("expect bias and result element type to be f16, got ")
----------------
Tai78641 wrote:

These checks in verify functions prevent construction of ops with invalid data types.
moving the checking to the validation pass will mean we allow construction of invalid data types, and then when validation pass is run, we disallow these ops. This may free up the dialect too much?

https://github.com/llvm/llvm-project/pull/127730


More information about the Mlir-commits mailing list