iree icon indicating copy to clipboard operation
iree copied to clipboard

torch.aten.multinomial: failed to legalize operation 'torch.constant.bool'

Open dbabokin opened this issue 1 year ago • 0 comments

What happened?

Here's the full reproducer:

> cat module.torch
module {
  func.func @main(%arg0: !torch.vtensor<[1,256000],f32>) -> !torch.vtensor<[1,1],si64>
  {
    %int1 = torch.constant.int 1
    %true = torch.constant.bool true
    %none = torch.constant.none
    %2519 = torch.aten.multinomial %arg0, %int1, %true, %none : !torch.vtensor<[1,256000],f32>, !torch.int, !torch.bool, !torch.none -> !torch.vtensor<[1,1],si64>
    return %2519 : !torch.vtensor<[1,1],si64>
  }
}
> iree-compile --iree-input-type=torch --iree-hal-target-backends=llvm-cpu module.torch
<unknown>:0: error: failed to legalize operation 'torch.constant.bool'
<unknown>:0: note: see current operation: %0 = "torch.constant.bool"() <{value = true}> : () -> !torch.bool

This comes from running Google's Gemma model through SHARK-Turbine.

I would appreciate the pointers where to look to understand the problem better.

Steps to reproduce your issue

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

What component(s) does this issue relate to?

MLIR

Version information

No response

Additional context

No response

dbabokin avatar Apr 26 '24 00:04 dbabokin