Skip to content

[TorchONNXToTorch] Failed to lower torch.operator "onnx.Einsum" #4535

@riestmo-nxp

Description

@riestmo-nxp

torch-mlir fails with the following error when running the torch-onnx-to-torch-backend-pipeline on the test case below:

einsum.mlir:3:10: error: 'torch.aten.permute' op expected input and output tensors to have same rank, but 6 != 25. %0 = torch.operator "onnx.Einsum"(%arg0, %arg1) {torch.onnx.equation = "...bt pide , ...bo pie -> ...bot pid"} : (!torch.vtensor<[1,1,2,2,3,3],f32>, !torch.vtensor<[1,280,2,2,3],f32>) -> !torch.vtensor<[1,280,1,2,2,3],f32> ^ einsum.mlir:3:10: note: see current operation: %84 = "torch.aten.permute"(%arg0, %83) : (!torch.vtensor<[1,1,2,2,3,3],f32>, !torch.list<int>) -> !torch.vtensor<[1,1,2,2,3,3,94256647605752,94256647577264,6,1,94256647577104,0,1,280,2,2,3,94256647605752,94256647577360,5,94256647577104,0,1,1,280],f32>

The error can be reproduces using the following command torch-mlir-opt --torch-onnx-to-torch-backend-pipeline einsum.mlir with the following test case:

einsum.mlir

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions