Skip to content

error: failed to legalize operation 'torch.operator' that was explicitly marked illegal (onnx.Greater) #946

@amd-vivekag

Description

@amd-vivekag

Getting following error:

small.mlir:5:10: error: failed to legalize operation 'torch.operator' that was explicitly marked illegal
    %2 = torch.operator "onnx.Greater"(%arg1, %1) : (!torch.vtensor<[?],si64>, !torch.vtensor<[?,1],si64>) -> !torch.vtensor<[?,?],i1>
         ^
/wrk/xhdhdnobkup3/vagrawal/scratch/AIGShark/nodai/SharkTestSuite_vivekag/SHARK-TestSuite/alt_e2eshark/test-run/hf_TinyLlama-1.1B-Chat-v1.0/model.torch_onnx.small.mlir:5:10: note: see current operation: %23 = "torch.operator"(%arg1, %22) <{name = "onnx.Greater"}> : (!torch.vtensor<[?],si64>, !torch.vtensor<[?,1],si64>) -> !torch.vtensor<[?,?],i1>

Steps to reproduce:

iree-compile small.mlir --iree-hal-target-backends=llvm-cpu --iree-llvmcpu-target-cpu=host -o compiled_model.vmfb

small.mlir:

module {
  func.func @main_graph(%arg0: !torch.vtensor<[?],si64>, %arg1: !torch.vtensor<[?],si64>) -> !torch.vtensor<[?,?],i1> attributes {torch.onnx_meta.ir_version = 7 : si64, torch.onnx_meta.opset_version = 14 : si64, torch.onnx_meta.producer_name = "pytorch", torch.onnx_meta.producer_version = "2.7.0"} {
    %0 = torch.operator "onnx.Constant"() {torch.onnx.value = dense_resource<__model_Constant_8_attr__value> : tensor<2xsi64>} : () -> !torch.vtensor<[2],si64>
    %1 = torch.operator "onnx.Reshape"(%arg0, %0) {torch.onnx.allowzero = 0 : si64} : (!torch.vtensor<[?],si64>, !torch.vtensor<[2],si64>) -> !torch.vtensor<[?,1],si64>
    %2 = torch.operator "onnx.Greater"(%arg1, %1) : (!torch.vtensor<[?],si64>, !torch.vtensor<[?,1],si64>) -> !torch.vtensor<[?,?],i1>
    return %2 : !torch.vtensor<[?,?],i1>
  }
}

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