Skip to content

Commit 3254742

Browse files
committed
[mlir][tosa] Add accumulator verifier for FP8 types for AvgPool2D
Signed-off-by: Jerry Ge <[email protected]> Change-Id: I04b34f62e622893b52417a96ab33166c96c846d7
1 parent 9965f3d commit 3254742

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

mlir/lib/Dialect/Tosa/IR/TosaOps.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,11 @@ LogicalResult tosa::AvgPool2dOp::verify() {
600600
if (inputETy.isF32() && !accType.isF32())
601601
return emitOpError("accumulator type for f32 tensor is not f32");
602602

603+
if ((llvm::isa<Float8E5M2Type>(inputETy) ||
604+
llvm::isa<Float8E4M3FNType>(inputETy)) &&
605+
!accType.isF16())
606+
return emitOpError("accumulator type for f8 tensor is not f16");
607+
603608
if (inputETy != inputZpETy)
604609
return emitOpError("expect both input and its zero point are the same "
605610
"element type, got ")

0 commit comments

Comments
 (0)