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 compile onnx.Resize with dynamic shapes #3903

Open
jinchen62 opened this issue Dec 4, 2024 · 0 comments
Open

Failed to compile onnx.Resize with dynamic shapes #3903

jinchen62 opened this issue Dec 4, 2024 · 0 comments

Comments

@jinchen62
Copy link
Collaborator

Got the following error when lowering onnx.Resize with dynamic shapes.

error: failed to legalize operation 'arith.sitofp' that was explicitly marked illegal

Reproducer:

func.func @repro(%arg0: !torch.vtensor<[?,1280,?,?],f32>, %arg1: !torch.vtensor<[4],f32>) -> !torch.vtensor<[?,1280,?,?],f32> attributes {torch.onnx_meta.ir_version = 9 : si64, torch.onnx_meta.opset_version = 19 : si64, torch.onnx_meta.producer_name = "backend-test", torch.onnx_meta.producer_version = ""} {
  %none = torch.constant.none
  %0 = torch.operator "onnx.Resize"(%arg0, %none, %arg1) {torch.onnx.coordinate_transformation_mode = "asymmetric", torch.onnx.mode = "nearest", torch.onnx.nearest_mode = "floor"} : (!torch.vtensor<[?,1280,?,?],f32>, !torch.none, !torch.vtensor<[4],f32>) -> !torch.vtensor<[?,1280,?,?],f32>
  return %0 : !torch.vtensor<[?,1280,?,?],f32>
}

Commands:

torch-mlir-opt --torch-onnx-to-torch-backend-pipeline --convert-torch-to-linalg repro.mlir -o repro_linalg.mlir
iree-compile --iree-hal-target-backends=llvm-cpu --iree-llvmcpu-target-cpu=host repro_linalg.mlir -o test.vmfb

It's failing at https://github.com/llvm/torch-mlir/blob/main/lib/Conversion/TorchToLinalg/Uncategorized.cpp#L3187 when trying to convert the dynamic input shape to float for multiplying with scales.

@jinchen62 jinchen62 changed the title Failed to lower onnx.Resize with dynamic shapes Failed to compile onnx.Resize with dynamic shapes Dec 4, 2024
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

1 participant