[Mlir-commits] [mlir] [mlir][tosa] Add F32 to F16 type narrowing pass (PR #218900)

Luke Hutton llvmlistbot at llvm.org
Tue Sep 1 07:58:00 PDT 2026


================
@@ -245,6 +245,30 @@ def TosaNarrowF64ToF32Pass : Pass<"tosa-narrow-f64-to-f32", "func::FuncOp"> {
   ];
 }
 
+def TosaNarrowF32ToF16Pass : Pass<"tosa-narrow-f32-to-f16", "func::FuncOp"> {
+  let summary = "Narrow F32 TOSA operations to F16";
+  let description = [{
+    This pass destructively narrows TOSA operations with 32-bit floating-point
+    tensor types to 16-bit floating-point tensor types. It can reduce model
----------------
lhutton1 wrote:

While the descriptions for similar passes above also don't state this, I think it's worth indicating that it's the users responsibility to check that their input values sized appropriately after this conversion has been used. Failing to do so will result reduced accuracy, or worse, incorrect outputs.

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


More information about the Mlir-commits mailing list