We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
For the below IR,
module { func.func @resize(%arg0: !torch.vtensor<[1,3,224,224],f32>) -> !torch.vtensor<[1,3,800,800],f32> attributes {torch.onnx_meta.ir_version = 8 : si64, torch.onnx_meta.opset_version = 21 : si64, torch.onnx_meta.opset_versions = {ai.onnx.ml = 5 : si64, ai.onnx.preview.training = 1 : si64, ai.onnx.training = 1 : si64, com.microsoft = 1 : si64, com.microsoft.experimental = 1 : si64, com.microsoft.nchwc = 1 : si64, org.pytorch.aten = 1 : si64}, torch.onnx_meta.producer_name = "pytorch", torch.onnx_meta.producer_version = "2.1.0"} { %none = torch.constant.none %cst = torch.operator "onnx.Constant"() {torch.onnx.value = dense_resource<__transform_Concat_1_output_0> : tensor<4xsi64>} : () -> !torch.vtensor<[4],si64> %0 = torch.operator "onnx.Resize"(%arg0, %none, %none, %cst) {torch.onnx.antialias = 0 : si64, torch.onnx.coordinate_transformation_mode = "half_pixel", torch.onnx.cubic_coeff_a = -7.500000e-01 : f32, torch.onnx.exclude_outside = 0 : si64, torch.onnx.extrapolation_value = 0.000000e+00 : f32, torch.onnx.keep_aspect_ratio_policy = "stretch", torch.onnx.mode = "linear", torch.onnx.nearest_mode = "floor"} : (!torch.vtensor<[1,3,224,224],f32>, !torch.none, !torch.none, !torch.vtensor<[4],si64>) -> !torch.vtensor<[1,3,800,800],f32> return %0 : !torch.vtensor<[1,3,800,800],f32> } } {-# dialect_resources: { builtin: { __transform_Concat_1_output_0: "0x080000000100000000000000030000000000000020030000000000002003000000000000" } } #-}
Getting error as
model_torch_onnx.mlir:5:10: error: failed to legalize operation 'torch.operator' that was explicitly marked illegal %0 = torch.operator "onnx.Resize"(%arg0, %none, %none, %cst) {torch.onnx.antialias = 0 : si64, torch.onnx.coordinate_transformation_mode = "half_pixel", torch.onnx.cubic_coeff_a = -7.500000e-01 : f32, torch.onnx.exclude_outside = 0 : si64, torch.onnx.extrapolation_value = 0.000000e+00 : f32, torch.onnx.keep_aspect_ratio_policy = "stretch", torch.onnx.mode = "linear", torch.onnx.nearest_mode = "floor"} : (!torch.vtensor<[1,3,224,224],f32>, !torch.none, !torch.none, !torch.vtensor<[4],si64>) -> !torch.vtensor<[1,3,800,800],f32> ^
Command
iree-compile --iree-hal-target-backends=llvm-cpu --iree-llvmcpu-target-cpu=host -o test.vmfb model_torch_onnx.mlir
Models Impacted:
fcos_resnet50_fpn_Opset18_torchvision fasterrcnn_mobilenet_v3_large_320_fpn_Opset18_torchvision fasterrcnn_mobilenet_v3_large_fpn_Opset18_torchvision fasterrcnn_resnet50_fpn_v2_Opset18_torchvision maskrcnn_resnet50_fpn_v2_Opset18_torchvision retinanet_resnet50_fpn_v2_Opset18_torchvision
The text was updated successfully, but these errors were encountered:
The keep aspect ratio policy attribute is mis-handled. The value "stretch" is default, so we shouldn't be erroring out.
"stretch"
The code in https://github.com/llvm/torch-mlir/blob/a265d283357f572c5437f9217ea85fa9770d374c/lib/Conversion/TorchOnnxToTorch/DefaultDomainQtoZ.cpp#L2714-L2719 should be merged into the subsequent if statement as:
std::string keepAspectRatioPolicy; if (... || ... || binder.customOpNameStringAttr(keepAspectRatioPolicy, "keep_aspect_ratio_policy", "stretch") || ...) return failure(); // near other similar checks: if (keepAspectRatioPolicy != "stretch") return rewriter.notifyMatchFailure(binder.op, "unimplemented: non-default keep_aspect_ratio_policy attribute");
Sorry, something went wrong.
Review llvm/torch-mlir#4044
pravg-amd
No branches or pull requests
For the below IR,
Getting error as
Command
Models Impacted:
fcos_resnet50_fpn_Opset18_torchvision
fasterrcnn_mobilenet_v3_large_320_fpn_Opset18_torchvision
fasterrcnn_mobilenet_v3_large_fpn_Opset18_torchvision
fasterrcnn_resnet50_fpn_v2_Opset18_torchvision
maskrcnn_resnet50_fpn_v2_Opset18_torchvision
retinanet_resnet50_fpn_v2_Opset18_torchvision
The text was updated successfully, but these errors were encountered: