[Mlir-commits] [mlir] [mlir] Fix padding shape computation in PadTilingInterface (PR #149576)
Fabian Mora
llvmlistbot at llvm.org
Mon Jul 21 07:33:07 PDT 2025
fabianmcg wrote:
Thanks for the explanation, yes this is one of those issues. The above fix works for `convs` with strides `1`, but if you try something like:
```
func.func @conv_2d_nhwc_fhwc(%arg0: tensor<1x42x16x4xf32>, %arg1: tensor<16x3x3x4xf32>, %arg2: tensor<1x14x14x16xf32>) -> tensor<1x14x14x16xf32> {
%0 = linalg.conv_2d_nhwc_fhwc
{dilations = dense<1> : tensor<2xi64>, strides = dense<[3, 1]> : tensor<2xi64> }
ins(%arg0, %arg1: tensor<1x42x16x4xf32>, tensor<16x3x3x4xf32>)
outs(%arg2: tensor<1x14x14x16xf32>) -> tensor<1x14x14x16xf32>
return %0 : tensor<1x14x14x16xf32>
}
module attributes {transform.with_named_sequence} {
transform.named_sequence @__transform_main(%arg1: !transform.any_op {transform.readonly}) {
%0 = transform.structured.match ops{["linalg.conv_2d_nhwc_fhwc"]} in %arg1 : (!transform.any_op) -> !transform.any_op
%padded, %pad = transform.structured.pad_tiling_interface %0 to padding_sizes [0, 0, 0, 0, 0, 0, 16] pad_to_multiple_of {
padding_values = [0.0 : f32, 0.0 : f32, 0.0 : f32, 0.0 : f32, 0.0 : f32, 0.0 : f32, 0.0 : f32]
} : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
transform.yield
}
}
```
the problem reappears.
https://github.com/llvm/llvm-project/pull/149576
More information about the Mlir-commits
mailing list