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

Failed to legalize operation onnx.AveragePool. #816

Open
vinayakdsci opened this issue Sep 9, 2024 · 1 comment
Open

Failed to legalize operation onnx.AveragePool. #816

vinayakdsci opened this issue Sep 9, 2024 · 1 comment
Assignees

Comments

@vinayakdsci
Copy link

vinayakdsci commented Sep 9, 2024

The ONNX operator onnx.AveragePool fails during lowering with the error Failed to legalize operation 'onnx.AveragePool' , as reported in #812.

module {
  func.func @inception_v1 (%arg1: !torch.vtensor<[1,1024,6,6],f32>) -> !torch.vtensor<[1,1024,1,1],f32>  attributes {torch.onnx_meta.ir_version = 3 : si64, torch.onnx_meta.opset_version = 17 : si64, torch.onnx_meta.producer_name = "onnx-caffe2", torch.onnx_meta.producer_version = ""} {
    %256 = torch.operator "onnx.AveragePool"(%arg1) {torch.onnx.kernel_shape = [7 : si64, 7 : si64], torch.onnx.pads = [0 : si64, 0 : si64, 1 : si64, 1 : si64], torch.onnx.strides = [1 : si64, 1 : si64]} : (!torch.vtensor<[1,1024,6,6],f32>) -> !torch.vtensor<[1,1024,1,1],f32> 
    return %256 : !torch.vtensor<[1,1024,1,1],f32>
  }
}

commands:

torch-mlir-opt -split-input-file -verify-diagnostics -convert-torch-onnx-to-torch --mlir-print-ir-after-all t1.mlir

error:

within split at t1.mlir:1 offset :3:12: error: unexpected error: failed to legalize operation 'torch.operator' that was explicitly marked illegal
    %256 = torch.operator "onnx.AveragePool"(%arg1) {torch.onnx.kernel_shape = [7 : si64, 7 : si64], torch.onnx.pads = [0 : si64, 0 : si64, 1 : si64, 1 : si64], torch.onnx.strides = [1 : si64, 1 : si64]} : (!torch.vtensor<[1,1024,6,6],f32>) -> !torch.vtensor<[1,1024,1,1],f32> 
           ^
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