Skip to content

'linalg.conv_2d_nchw_fchw' op inferred input/output operand dims mismatch #18387

Closed

Description

What happened?

repro.mlir:72:11: error: 'linalg.conv_2d_nchw_fchw' op inferred input/output operand #1 has shape's dimension #1 to be 4, but found 3
    %24 = linalg.conv_2d_nchw_fchw {dilations = dense<1> : vector<2xi64>, strides = dense<2> : vector<2xi64>} ins(%padded, %arg1 : tensor<?x?x?x?xf32>, tensor<32x3x3x3xf32>) outs(%broadcasted : tensor<?x32x?x?xf32>) -> tensor<?x32x?x?xf32>
          ^
repro.mlir:7:3: note: called from
  func.func @torch_jit(%arg0: tensor<1x3x224x224xf32>, %arg1: tensor<32x3x3x3xf32>) -> tensor<?x32x?x?xf32> {
  ^
repro.mlir:72:11: note: see current operation: 
%12 = "linalg.conv_2d_nchw_fchw"(%8, %5, %11) <{dilations = dense<1> : vector<2xi64>, operandSegmentSizes = array<i32: 2, 1>, strides = dense<2> : vector<2xi64>}> ({
^bb0(%arg5: f32, %arg6: f32, %arg7: f32):
  %17 = "arith.mulf"(%arg5, %arg6) <{fastmath = #arith.fastmath<none>}> : (f32, f32) -> f32
  %18 = "arith.addf"(%arg7, %17) <{fastmath = #arith.fastmath<none>}> : (f32, f32) -> f32
  "linalg.yield"(%18) : (f32) -> ()
}) {linalg.memoized_indexing_maps = [affine_map<(d0, d1, d2, d3, d4, d5, d6) -> (d0, d4, d2 * 2 + d5, d3 * 2 + d6)>, affine_map<(d0, d1, d2, d3, d4, d5, d6) -> (d1, d4, d5, d6)>, affine_map<(d0, d1, d2, d3, d4, d5, d6) -> (d0, d1, d2, d3)>]} : (tensor<2x4x224x224xf32>, tensor<32x3x3x3xf32>, tensor<2x32x111x111xf32>) -> tensor<2x32x111x111xf32>
    %24 = linalg.conv_2d_nchw_fchw {dilations = dense<1> : vector<2xi64>, strides = dense<2> : vector<2xi64>} ins(%padded, %arg1 : tensor<?x?x?x?xf32>, tensor<32x3x3x3xf32>) outs(%broadcasted : tensor<?x32x?x?xf32>) -> tensor<?x32x?x?xf32>
          ^

Steps to reproduce your issue

  1. repro: https://gist.github.com/jinchen62/57c051d783a05c99512a82f8cd80855f
  2. iree-compile --iree-input-demote-i64-to-i32 --iree-hal-target-backends=llvm-cpu repro.mlir -o test.vmfb

What component(s) does this issue relate to?

No response

Version information

Build TOM locally

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bug 🐞Something isn't working

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions