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

[GPU]: 'arith.extui' op operand type 'i64' and result type 'i32' are cast incompatible #19179

Open
pdhirajkumarprasad opened this issue Nov 18, 2024 · 0 comments
Assignees
Labels
bug 🐞 Something isn't working

Comments

@pdhirajkumarprasad
Copy link

What happened?

For the given IR

module {
  func.func @main_graph(%arg0: !torch.vtensor<[?],i1>, %arg1: !torch.vtensor<[?,?],i1>) -> !torch.vtensor<[?],si64>  attributes {torch.onnx_meta.ir_version = 7 : si64, torch.onnx_meta.opset_version = 21 : si64, torch.onnx_meta.producer_name = "pytorch", torch.onnx_meta.producer_version = "2.4.0"} {
    %1 = torch.operator "onnx.And"(%arg0, %arg1) : (!torch.vtensor<[?],i1>, !torch.vtensor<[?,?],i1>) -> !torch.vtensor<[?,?],i1> 
    %2 = torch.operator "onnx.Cast"(%1) {torch.onnx.to = 7 : si64} : (!torch.vtensor<[?,?],i1>) -> !torch.vtensor<[?,?],si64> 
    %3 = torch.operator "onnx.Constant"() {torch.onnx.value = dense_resource<__4> : tensor<1xsi64>} : () -> !torch.vtensor<[1],si64> 
    %4 = torch.operator "onnx.ReduceSum"(%2, %3) {torch.onnx.keepdims = 0 : si64} : (!torch.vtensor<[?,?],si64>, !torch.vtensor<[1],si64>) -> !torch.vtensor<[?],si64> 
    return %4 : !torch.vtensor<[?],si64>
  }
}

{-#
  dialect_resources: {
    builtin: {
      __4: "0x08000000FFFFFFFFFFFFFFFF"
    }
  }
#-}

getting error as

model.torch_onnx.mlir:6:10: error: 'arith.extui' op operand type 'i64' and result type 'i32' are cast incompatible
    %4 = torch.operator "onnx.ReduceSum"(%2, %3) {torch.onnx.keepdims = 0 : si64} : (!torch.vtensor<[?,?],si64>, !torch.vtensor<[1],si64>) -> !torch.vtensor<[?],si64> 
         ^

The same model works fine in CPU

Steps to reproduce your issue

command:

iree-compile --iree-hal-target-backends=rocm --iree-hip-target=gfx942 -o abc.vmfb model.torch_onnx.mlir

Version : IREE compiler version 3.0.0rc20241117 @ 29c451b

Detail log:
dump.log

What component(s) does this issue relate to?

Compiler

Version information

No response

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants