[Mlir-commits] [mlir] [mlir][tosa] Make Convolution Zero Points Inputs (PR #122939)

Luke Hutton llvmlistbot at llvm.org
Thu Jan 30 08:35:49 PST 2025


================
@@ -256,14 +282,53 @@ static LogicalResult verifyConvOp(T op) {
     return failure();
   }
 
-  // Quantized type must have constructed the quantizationattr, and unquantized
-  // types should not have a quantizationattr.
-  if ((inputIsQuant && !op.getQuantizationInfo()) ||
-      (!inputIsQuant && op.getQuantizationInfo())) {
-    op.emitOpError("quantizationattr is required for quantized type, and not "
-                   "allowed for float type");
-    return failure();
+  // We require an explicit input zero point and weight zero point for i8
+  // convolution. It isn't invalid to provide zero points for other types but
+  // they will be ignored.
----------------
lhutton1 wrote:

This last sentence reads as though a floating point operation with `zp=100` wouldn't result in an error, yet there's a check to make sure it's zero below. The behaviour below seems correct according to the spec, so maybe worth updating the sentence here to align?

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


More information about the Mlir-commits mailing list