[Mlir-commits] [mlir] [mlir][tosa] Fold PadOp to tensor operations (PR #132700)

Luke Hutton llvmlistbot at llvm.org
Wed Apr 2 02:41:21 PDT 2025


https://github.com/lhutton1 commented:

Thanks for the updates! I think we'd still need to check that the PadOp `pad_const` is zero.. at least in the general case. For quantized this becomes a bit more complicated since we'd have to take into account the zero point of the tensor operation. I think this should look something like:
- `tosa.conv2d`: `pad_const` == `conv2d.getInputZeroPoint()`
- `tosa.max_pool2d`: `pad_const` == `max_pool2d.getInputZeroPoint() - <minimum-in-dtype-value>`
- `tosa.avg_pool2d`: `pad_const` == `avg_pool2d.getInputZeroPoint()`

Perhaps we can restrict to floating point types for now and expand on quantized later?

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


More information about the Mlir-commits mailing list