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

"onnx.Resize" failed to legalize operation 'torch.operator' that was explicitly marked illegal #599

Open
afalkenberg1 opened this issue Apr 4, 2024 · 3 comments
Assignees

Comments

@afalkenberg1
Copy link

pytorch-3dunet_vaiq_int8
fails at iree-compile

pytorch-3dunet_vaiq_int8.default.onnx.torch.mlir:2346:13: error: failed to legalize operation 'torch.operator' that was explicitly marked illegal
%1777 = torch.operator "onnx.Resize"(%1716, %none, %none, %1776) {torch.onnx.coordinate_transformation_mode = "asymmetric", torch.onnx.cubic_coeff_a = -7.500000e-01 : f32, torch.onnx.mode = "nearest", torch.onnx.nearest_mode = "floor"} : (!torch.vtensor<[?,256,?,?,?],f32>, !torch.none, !torch.none, !torch.vtensor<[5],si64>) -> !torch.vtensor<[?,?,?,?,?],f32>
^
pytorch-3dunet_vaiq_int8.default.onnx.torch.mlir:2346:13: note: see current operation: %864 = "torch.operator"(%859, %76, %76, %863) <{name = "onnx.Resize"}> {torch.onnx.coordinate_transformation_mode = "asymmetric", torch.onnx.cubic_coeff_a = -7.500000e-01 : f32, torch.onnx.mode = "nearest", torch.onnx.nearest_mode = "floor"} : (!torch.vtensor<[?,256,?,?,?],f32>, !torch.none, !torch.none, !torch.vtensor<[5],si64>) -> !torch.vtensor<[?,?,?,?,?],f32>

@pdhirajkumarprasad
Copy link

we have 11 models failing in CI.

crossvit_15_240
crossvit_15_dagger_240
crossvit_15_dagger_408
crossvit_18_240
crossvit_18_dagger_240
crossvit_18_dagger_408
crossvit_9_240
crossvit_9_dagger_240
crossvit_base_240
crossvit_small_240
crossvit_tiny_240

Simple IR to reproduce the issue:

module {
  func.func @torch_jit(%arg0: !torch.vtensor<[1,3,240,240],f32>) -> !torch.vtensor<[1,3,224,224],f32>  attributes {torch.onnx_meta.ir_version = 7 : si64, torch.onnx_meta.opset_version = 21 : si64, torch.onnx_meta.producer_name = "pytorch", torch.onnx_meta.producer_version = "1.12.1"} {
    %none = torch.constant.none
    %1 = torch.operator "onnx.Shape"(%arg0) : (!torch.vtensor<[1,3,240,240],f32>) -> !torch.vtensor<[4],si64> 
    %2 = torch.operator "onnx.Resize"(%arg0, %none, %none, %1) {torch.onnx.coordinate_transformation_mode = "pytorch_half_pixel", torch.onnx.cubic_coeff_a = -7.500000e-01 : f32, torch.onnx.mode = "cubic", torch.onnx.nearest_mode = "floor"} : (!torch.vtensor<[1,3,240,240],f32>, !torch.none, !torch.none, !torch.vtensor<[4],si64>) -> !torch.vtensor<[1,3,224,224],f32> 
    return %2 : !torch.vtensor<[1,3,224,224],f32>
  }
}

@pdhirajkumarprasad
Copy link

@ScottTodd, most of these models were working but recent change in front-end, broke some of these and we are looking into that

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

4 participants