Skip to content

failed to legalize operation 'onnx.Einsum' #3260

@Hemaprasannakc

Description

@Hemaprasannakc

While compiling the detr-DocLayNet model , zDLC compilation fails with failed to legalize operation 'onnx.Einsum'

podman run --rm -v ${ZDLC_MODEL_DIR}:/workdir:z ${ZDLC_IMAGE} --EmitLib --O3 --onnx-op-stats=JSON -march=z17 --mtriple=s390x-ibm-loz ${ZDLC_MODEL_NAME}.onnx [1/6] Wed Aug 20 05:45:53 2025 (0s) Importing ONNX Model to MLIR Module from "cmarkea_detr_layout.onnx" [2/6] Wed Aug 20 05:45:53 2025 (0s) Compiling and Optimizing MLIR Module failed to legalize operation 'onnx.Einsum' { "func.func" : 1, "func.return" : 1, "onnx.Add" : 242, "onnx.Cast" : 7, "onnx.Concat" : 288, "onnx.Constant" : 967, "onnx.Conv" : 26, "onnx.Cos" : 2, "onnx.CumSum" : 2, "onnx.Dim" : 258, "onnx.Div" : 4, "onnx.Einsum" : 1, "onnx.Expand" : 8, "onnx.Flatten" : 1, "onnx.Gather" : 1, "onnx.LayerNormalization" : 36, "onnx.MatMul" : 175, "onnx.MaxPoolSingleOut" : 1, "onnx.Mul" : 97, "onnx.NoValue" : 1, "onnx.Not" : 1, "onnx.Relu" : 68, "onnx.Reshape" : 270, "onnx.Resize" : 4, "onnx.Sigmoid" : 1, "onnx.Sin" : 2, "onnx.Slice" : 11, "onnx.Softmax" : 19, "onnx.Squeeze" : 18, "onnx.Sub" : 2, "onnx.Tile" : 5, "onnx.Transpose" : 94, "onnx.Unsqueeze" : 80, "onnx.Where" : 3 }

But the same when ran with--EmitONNXIR is not failing.

podman run --rm -v ${ZDLC_MODEL_DIR}:/workdir:z ${ZDLC_IMAGE} --EmitONNXIR --O3 --onnx-op-stats=JSON -march=z17  --mtriple=s390x-ibm-loz ${ZDLC_MODEL_NAME}.onnx

Warning: --onnx-op-stats requires targets like --EmitMLIR, --EmitLLVMIR, or binary-generating emit commands.

[1/3] Wed Aug 20 05:46:48 2025 (0s) Importing ONNX Model to MLIR Module from "cmarkea_detr_layout.onnx"
[2/3] Wed Aug 20 05:46:48 2025 (0s) Compiling and Optimizing MLIR Module
[3/3] Wed Aug 20 05:46:49 2025 (1s) Compilation completed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions