Open AmosLewis opened 7 months ago
After this lands https://github.com/llvm/torch-mlir/pull/3214
Next set of missing OPs :
Resize https://github.com/nod-ai/SHARK-Turbine/issues/616:
%1468 = torch.operator "onnx.Resize"(%1373, %none, %none, %1467) {torch.onnx.coordinate_transformation_mode = "half_pixel", torch.onnx.cubic_coeff_a = -7.500000e-01 : f32, 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<[?,?,?,?],f32>
%6440 = torch.operator "onnx.Resize"(%6336, %none, %none, %6439) {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<[1,256,?,?],f32>, !torch.none, !torch.none, !torch.vtensor<[4],si64>) -> !torch.vtensor<[?,?,?,?],f32>
%6569 = torch.operator "onnx.Resize"(%6465, %none, %none, %6568) {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<[4],si64>) -> !torch.vtensor<[?,?,?,?],f32>
onnx.If https://github.com/nod-ai/SHARK-Turbine/issues/332 :
%13899 = torch.operator "onnx.If"(%13898) : (!torch.vtensor<[],i1>) -> !torch.vtensor<[?],si64> {...}
NonMaxSuppression https://github.com/nod-ai/SHARK-Turbine/issues/650:
%14077 = torch.operator "onnx.NonMaxSuppression"(%14070, %14074, %14075, %14076) : (!torch.vtensor<[1,?,?],f32>, !torch.vtensor<[1,1,?],f32>, !torch.vtensor<[1],si64>, !torch.vtensor<[1],f32>) -> !torch.vtensor<[?,3],si64>
Hi @renxida, still getting the error for Onnx.If:
retinanet_resnet50_fpn_vaiq_int8.default.torch-onnx.mlir:6276:13: error: failed to legalize operation 'torch.operator' that was explicitly marked illegal
%6272 = torch.operator "onnx.If"(%6271) : (!torch.vtensor<[],i1>) -> !torch.vtensor<[?],si64> {
After Integrate torch-mlir@ec6d7aa onnx.resize op https://github.com/iree-org/iree/pull/17358: Still onnx.if failed.
retinanet_resnet50_fpn_vaiq_int8.default.torch-onnx.mlir:6276:13: error: failed to legalize operation 'torch.operator' that was explicitly marked illegal
%6272 = torch.operator "onnx.If"(%6271) : (!torch.vtensor<[],i1>) -> !torch.vtensor<[?],si64> {
^
retinanet_resnet50_fpn_vaiq_int8.default.torch-onnx.mlir:6276:13: note: see current operation:
%23747 = "torch.operator"(%23746) <{name = "onnx.If"}> ({
%23822 = "torch.operator"(%23713) <{name = "onnx.ReduceMax"}> {torch.onnx.keepdims = 0 : si64} : (!torch.vtensor<[?,?],f32>) -> !torch.vtensor<[],f32>
%23823 = "torch.operator"(%23721) <{name = "onnx.Cast"}> {torch.onnx.to = 1 : si64} : (!torch.vtensor<[?],si64>) -> !torch.vtensor<[?],f32>
%23824 = "torch.operator"() <{name = "onnx.Constant"}> {torch.onnx.value = dense_resource<__3571> : tensor<f32>} : () -> !torch.vtensor<[],f32>
%23825 = "torch.operator"(%23822, %23824) <{name = "onnx.Add"}> : (!torch.vtensor<[],f32>, !torch.vtensor<[],f32>) -> !torch.vtensor<[],f32>
%23826 = "torch.operator"(%23823, %23825) <{name = "onnx.Mul"}> : (!torch.vtensor<[?],f32>, !torch.vtensor<[],f32>) -> !torch.vtensor<[?],f32>
%23827 = "torch.operator"() <{name = "onnx.Constant"}> {torch.onnx.value = dense_resource<__3572> : tensor<1xsi64>} : () -> !torch.vtensor<[1],si64>
%23828 = "torch.operator"(%23826, %23827) <{name = "onnx.Unsqueeze"}> : (!torch.vtensor<[?],f32>, !torch.vtensor<[1],si64>) -> !torch.vtensor<[?,1],f32>
%23829 = "torch.operator"(%23713, %23828) <{name = "onnx.Add"}> : (!torch.vtensor<[?,?],f32>, !torch.vtensor<[?,1],f32>) -> !torch.vtensor<[?,?],f32>
%23830 = "torch.operator"() <{name = "onnx.Constant"}> {torch.onnx.value = dense_resource<__3573> : tensor<1xsi64>} : () -> !torch.vtensor<[1],si64>
%23831 = "torch.operator"(%23829, %23830) <{name = "onnx.Unsqueeze"}> : (!torch.vtensor<[?,?],f32>, !torch.vtensor<[1],si64>) -> !torch.vtensor<[1,?,?],f32>
%23832 = "torch.operator"() <{name = "onnx.Constant"}> {torch.onnx.value = dense_resource<__3574> : tensor<1xsi64>} : () -> !torch.vtensor<[1],si64>
%23833 = "torch.operator"(%23717, %23832) <{name = "onnx.Unsqueeze"}> : (!torch.vtensor<[?],f32>, !torch.vtensor<[1],si64>) -> !torch.vtensor<[1,?],f32>
%23834 = "torch.operator"() <{name = "onnx.Constant"}> {torch.onnx.value = dense_resource<__3575> : tensor<1xsi64>} : () -> !torch.vtensor<[1],si64>
%23835 = "torch.operator"(%23833, %23834) <{name = "onnx.Unsqueeze"}> : (!torch.vtensor<[1,?],f32>, !torch.vtensor<[1],si64>) -> !torch.vtensor<[1,1,?],f32>
%23836 = "torch.operator"() <{name = "onnx.Constant"}> {torch.onnx.value = dense_resource<__3576> : tensor<1xsi64>} : () -> !torch.vtensor<[1],si64>
%23837 = "torch.operator"() <{name = "onnx.Constant"}> {torch.onnx.value = dense_resource<__3577> : tensor<1xf32>} : () -> !torch.vtensor<[1],f32>
%23838 = "torch.operator"(%23831, %23835, %23836, %23837) <{name = "onnx.NonMaxSuppression"}> : (!torch.vtensor<[1,?,?],f32>, !torch.vtensor<[1,1,?],f32>, !torch.vtensor<[1],si64>, !torch.vtensor<[1],f32>) -> !torch.vtensor<[?,3],si64>
%23839 = "torch.operator"() <{name = "onnx.Constant"}> {torch.onnx.value = dense_resource<__3578> : tensor<1xsi64>} : () -> !torch.vtensor<[1],si64>
%23840 = "torch.operator"(%23838, %23839) <{name = "onnx.Gather"}> {torch.onnx.axis = 1 : si64} : (!torch.vtensor<[?,3],si64>, !torch.vtensor<[1],si64>) -> !torch.vtensor<[?,1],si64>
%23841 = "torch.operator"() <{name = "onnx.Constant"}> {torch.onnx.value = dense_resource<__3579> : tensor<1xsi64>} : () -> !torch.vtensor<[1],si64>
%23842 = "torch.operator"(%23840, %23841) <{name = "onnx.Squeeze"}> : (!torch.vtensor<[?,1],si64>, !torch.vtensor<[1],si64>) -> !torch.vtensor<[?],si64>
"torch.operator_terminator"(%23842) : (!torch.vtensor<[?],si64>) -> ()
}, {
%23821 = "torch.operator"() <{name = "onnx.Constant"}> {torch.onnx.value = dense_resource<__3580> : tensor<0xsi64>} : () -> !torch.vtensor<[0],si64>
"torch.operator_terminator"(%23821) : (!torch.vtensor<[0],si64>) -> ()
}) : (!torch.vtensor<[],i1>) -> !torch.vtensor<[?],si64>
Failed op:
Before fixing expand op, we cannot get any other fail op signature information. The following cmd is blocked by expand.