Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conv2d output shape mismatch #1054

Open
azecevicTT opened this issue Jan 16, 2025 · 4 comments
Open

Conv2d output shape mismatch #1054

azecevicTT opened this issue Jan 16, 2025 · 4 comments
Assignees
Milestone

Comments

@azecevicTT
Copy link

Part of the generated MLIR from the model:

module {
  func.func @main(%arg0: tensor<1x224x224x3xf32>, %arg1: tensor<32x3x3x3xf32>) -> (tensor<1x111x112x32xf32>) {
    %0 = tensor.empty() : tensor<1x111x112x32xf32>
    %1 = "ttir.conv2d"(%arg0, %arg1, %0) <{dilation_height = 1 : si32, dilation_width = 1 : si32, groups = 1 : si32, padding_bottom = 1 : si32, padding_left = 0 : si32, padding_right = 1 : si32, padding_top = 0 : si32, stride_height = 2 : si32, stride_width = 2 : si32}> {channel_last = 1 : si32} : (tensor<1x224x224x3xf32>, tensor<32x3x3x3xf32>, tensor<1x111x112x32xf32>) -> tensor<1x111x112x32xf32>
    return %1 : tensor<1x111x112x32xf32>
  }
}

It should be checked if the output shape should be 1x111x112x32 instead of 1x112x112x32 for these arguments.

@meenakshiramanathan1
Copy link
Contributor

@azecevicTT , can I get repro steps for this?

@azecevicTT
Copy link
Author

I believe @nvukobratTT have repro steps for this, this is just a part of the MLIR that I got that seems like an error on FE side.

@nvukobratTT
Copy link
Contributor

@meenakshiramanathan1 one of the MobileNet is problematic (e.g. v1 196). Feel free to checkout skipped test with this msg:

pytest.skip("Hitting segmentation fault in MLIR")

@meenakshiramanathan1
Copy link
Contributor

meenakshiramanathan1 commented Jan 20, 2025

@azecevicTT Tried reproducing the conv2d layer with required attributes , below given mlir module and the one given in description is same except for output shape for ttir.conv2d module

    %5 = "ttir.conv2d"(%3, %arg1, %arg2, %4) <{dilation_height = 1 : si32, dilation_width = 1 : si32, groups = 1 : si32, padding_bottom = 1 : si32, padding_left = 0 : si32, padding_right = 1 : si32, padding_top = 0 : si32, stride_height = 2 : si32, stride_width = 2 : si32}> {channel_last = 1 : si32} : (tensor<1x224x224x3xf32>, tensor<32x3x3x3xf32>, tensor<1x32x1x1xf32>, 

tensor<1x112x112x32xf32>) -> tensor<1x112x112x32xf32>

The output shape of this generated MLIR module is 1x112x112x32

Reproduce

git checkout mramanathan/conv2d
pytest forge/test/models/pytorch/vision/test_conv2d.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants