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

[e2e][onnx][model] onnx.Resize [(half_pixel, linear), (asymmetric, nearest)] #616

Closed
PhaneeshB opened this issue Apr 15, 2024 · 3 comments
Closed
Assignees

Comments

@PhaneeshB
Copy link
Contributor

PhaneeshB commented Apr 15, 2024

Models requiring onnx.Resize with attributes:

Run any of there models in SHARK-TestSuite with

cd e2eshark
python run.py --torchmlirbuild /path_to/torch-mlir/build  --ireebuild /path-to/iree-build --cachedir /path-to/model-cache-dir -r test-onnx --tolerance .001 .001 --mode onnx --report --tests  onnx/models/<MODEL_NAME>

Error Messages with the Op usage:

half_pixel, linear :

DeepLabV3_resnet50_vaiq_int8.default.onnx.torch.mlir:3583:13: error: failed to legalize operation 'torch.operator' that was explicitly marked illegal
    %2814 = torch.operator "onnx.Resize"(%2768, %none, %none, %2813) {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,256,1,1],f32>, !torch.none, !torch.none, !torch.vtensor<[4],si64>) -> !torch.vtensor<[?,?,?,?],f32> 
            ^
DeepLabV3_resnet50_vaiq_int8.default.onnx.torch.mlir:3583:13: note: see current operation: %1275 = "torch.operator"(%1274, %146, %146, %1) <{name = "onnx.Resize"}> {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,256,1,1],f32>, !torch.none, !torch.none, !torch.vtensor<[4],si64>) -> !torch.vtensor<[?,?,?,?],f32>
---
FCN_vaiq_int8.default.onnx.torch.mlir:3474:13: error: failed to legalize operation 'torch.operator' that was explicitly marked illegal
    %2729 = torch.operator "onnx.Resize"(%2657, %none, %none, %2728) {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,21,28,28],f32>, !torch.none, !torch.none, !torch.vtensor<[4],si64>) -> !torch.vtensor<[?,?,?,?],f32> 
            ^
FCN_vaiq_int8.default.onnx.torch.mlir:3474:13: note: see current operation: %1210 = "torch.operator"(%1209, %129, %129, %0) <{name = "onnx.Resize"}> {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,21,28,28],f32>, !torch.none, !torch.none, !torch.vtensor<[4],si64>) -> !torch.vtensor<[?,?,?,?],f32>
---
LRASPP_vaiq_int8.default.onnx.torch.mlir:5253:13: error: failed to legalize operation 'torch.operator' that was explicitly marked illegal
    %4120 = torch.operator "onnx.Resize"(%4072, %none, %none, %4119) {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,128,14,14],f32>, !torch.none, !torch.none, !torch.vtensor<[4],si64>) -> !torch.vtensor<[?,?,?,?],f32> 
            ^
LRASPP_vaiq_int8.default.onnx.torch.mlir:5253:13: note: see current operation: %1780 = "torch.operator"(%1779, %164, %164, %1) <{name = "onnx.Resize"}> {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,128,14,14],f32>, !torch.none, !torch.none, !torch.vtensor<[4],si64>) -> !torch.vtensor<[?,?,?,?],f32>
---
U-2-Net_vaiq_int8.default.onnx.torch.mlir:949:12: error: failed to legalize operation 'torch.operator' that was explicitly marked illegal
    %762 = torch.operator "onnx.Resize"(%714, %none, %none, %761) {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,32,10,10],f32>, !torch.none, !torch.none, !torch.vtensor<[4],si64>) -> !torch.vtensor<[?,?,?,?],f32> 
           ^
U-2-Net_vaiq_int8.default.onnx.torch.mlir:949:12: note: see current operation: %493 = "torch.operator"(%492, %277, %277, %24) <{name = "onnx.Resize"}> {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,32,10,10],f32>, !torch.none, !torch.none, !torch.vtensor<[4],si64>) -> !torch.vtensor<[?,?,?,?],f32>

asymmetric, nearest :


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>
---
RRDB_ESRGAN_vaiq_int8.default.onnx.torch.mlir:27157:14: error: failed to legalize operation 'torch.operator' that was explicitly marked illegal
    %21858 = torch.operator "onnx.Resize"(%21853, %none, %21857) {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,64,224,224],f32>, !torch.none, !torch.vtensor<[4],f32>) -> !torch.vtensor<[?,?,?,?],f32> 
             ^
RRDB_ESRGAN_vaiq_int8.default.onnx.torch.mlir:27157:14: note: see current operation: %9581 = "torch.operator"(%9580, %725, %1) <{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<[1,64,224,224],f32>, !torch.none, !torch.vtensor<[4],f32>) -> !torch.vtensor<[?,?,?,?],f32>
---
YoloNetV3_vaiq_int8.default.onnx.torch.mlir:3685:13: error: failed to legalize operation 'torch.operator' that was explicitly marked illegal
    %2879 = torch.operator "onnx.Resize"(%2874, %none, %2878) {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<[4,256,13,13],f32>, !torch.none, !torch.vtensor<[4],f32>) -> !torch.vtensor<[?,?,?,?],f32> 
            ^
YoloNetV3_vaiq_int8.default.onnx.torch.mlir:3685:13: note: see current operation: %1309 = "torch.operator"(%1308, %143, %0) <{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<[4,256,13,13],f32>, !torch.none, !torch.vtensor<[4],f32>) -> !torch.vtensor<[?,?,?,?],f32>
---
yolov8n_vaiq_int8.default.onnx.torch.mlir:2342:13: error: failed to legalize operation 'torch.operator' that was explicitly marked illegal
    %1919 = torch.operator "onnx.Resize"(%1914, %none, %1918) {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,20,20],f32>, !torch.none, !torch.vtensor<[4],f32>) -> !torch.vtensor<[?,?,?,?],f32> 
            ^
yolov8n_vaiq_int8.default.onnx.torch.mlir:2342:13: note: see current operation: %873 = "torch.operator"(%872, %157, %7) <{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<[1,256,20,20],f32>, !torch.none, !torch.vtensor<[4],f32>) -> !torch.vtensor<[?,?,?,?],f32>
This was referenced Apr 15, 2024
@aldesilv
Copy link
Collaborator

llvm/torch-mlir#3013

@PhaneeshB PhaneeshB changed the title onnx.Resize [(half_pixel, linear), (asymmetric, nearest)] [e2e][onnx][model] onnx.Resize [(half_pixel, linear), (asymmetric, nearest)] Apr 15, 2024
@PhaneeshB
Copy link
Contributor Author

Another instance of the same issue : #599

rsuderman pushed a commit to llvm/torch-mlir that referenced this issue May 17, 2024
…ering (#3351)

Addresses [Shark-Turbine
#196](nod-ai/SHARK-TestSuite#196)

Related tracker [Shark-Turbine
#566](nod-ai/SHARK-ModelDev#566)

Related onnx.Resize issues [Shark-Turbine
#616](nod-ai/SHARK-ModelDev#616)
BaneTrifa pushed a commit to BaneTrifa/torch-mlir that referenced this issue May 24, 2024
…ering (llvm#3351)

Addresses [Shark-Turbine
llvm#196](nod-ai/SHARK-TestSuite#196)

Related tracker [Shark-Turbine
llvm#566](nod-ai/SHARK-ModelDev#566)

Related onnx.Resize issues [Shark-Turbine
llvm#616](nod-ai/SHARK-ModelDev#616)
@zjgarvey
Copy link
Collaborator

zjgarvey commented Jun 3, 2024

Resize should have sufficient support now, closing this for now. Reopen if issues resurface.

@zjgarvey zjgarvey closed this as completed Jun 3, 2024
sjarus pushed a commit to sjarus/torch-mlir that referenced this issue Jun 6, 2024
…ering (llvm#3351)

Addresses [Shark-Turbine
llvm#196](nod-ai/SHARK-TestSuite#196)

Related tracker [Shark-Turbine
llvm#566](nod-ai/SHARK-ModelDev#566)

Related onnx.Resize issues [Shark-Turbine
llvm#616](nod-ai/SHARK-ModelDev#616)
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