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

error: 'tensor.cast' op operand type 'tensor<0xi64>' and result type 'tensor<12xi64>' are cast incompatible #1611

Open
silvasean opened this issue Nov 18, 2022 · 0 comments
Assignees

Comments

@silvasean
Copy link
Contributor

@vid-999 this appears to be a bug in #1066 PTAL

Reproduce with

torch-mlir-opt -convert-torch-to-linalg repro.mlir 
module {
  func.func @forward(%arg0: !torch.vtensor<[24],si64>, %arg1: !torch.vtensor<[4],si64>, %arg2: !torch.vtensor<[12],si64>, %arg3: !torch.vtensor<[10,4],f32>) -> !torch.vtensor<[4,4],f32> {
    %int0 = torch.constant.int 0
    %int-1 = torch.constant.int -1
    %false = torch.constant.bool false
    %none = torch.constant.none
    %result0, %result1, %result2, %result3 = torch.aten.embedding_bag.padding_idx %arg3, %arg2, %arg1, %false, %int0, %false, %none, %false, %int-1 : !torch.vtensor<[10,4],f32>, !torch.vtensor<[12],si64>, !torch.vtensor<[4],si64>, !torch.bool, !torch.int, !torch.bool, !torch.none, !torch.bool, !torch.int -> !torch.vtensor<[4,4],f32>, !torch.vtensor<[12],si64>, !torch.vtensor<[4],si64>, !torch.vtensor<[4],si64>
    return %result0 : !torch.vtensor<[4,4],f32>
  }
}

Full error:

/tmp/repro4.mlir:7:46: error: 'tensor.cast' op operand type 'tensor<0xi64>' and result type 'tensor<12xi64>' are cast incompatible
    %result0, %result1, %result2, %result3 = torch.aten.embedding_bag.padding_idx %arg3, %arg2, %arg1, %false, %int0, %false, %none, %false, %int-1 : !torch.vtensor<[10,4],f32>, !torch.vtensor<[12],si64>, !torch.vtensor<[4],si64>, !torch.bool, !torch.int, !torch.bool, !torch.none, !torch.bool, !torch.int -> !torch.vtensor<[4,4],f32>, !torch.vtensor<[12],si64>, !torch.vtensor<[4],si64>, !torch.vtensor<[4],si64>
                                             ^
/tmp/repro4.mlir:7:46: note: see current operation: %22 = "tensor.cast"(%21) : (tensor<0xi64>) -> tensor<12xi64>
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

2 participants