Skip to content
This repository has been archived by the owner on Apr 27, 2024. It is now read-only.

Run examples/bert.py, it report expected mlir::RankedTensorType, but got: 'i32' #76

Open
zhping5678 opened this issue Dec 27, 2022 · 2 comments

Comments

@zhping5678
Copy link

When I run the demo in 'examples/bert.py' and invoke iree_torch.compile_to_vmfb(linalg_on_tensors_mlir, args.iree_backend), it reports expected mlir::RankedTensorType, but got: 'i32'

Complete information is below.

Compiling with IREE
Traceback (most recent call last):
  File "../iree-torch/examples/bert.py", line 115, in <module>
    main()
  File "../iree-torch/examples/bert.py", line 102, in main
    iree_vmfb = iree_torch.compile_to_vmfb(linalg_on_tensors_mlir, args.iree_backend)
  File "~/anaconda3/envs/python38/lib/python3.8/site-packages/iree_torch/__init__.py", line 103, in compile_to_vmfb
    return ireec.compile_str(bytecode,
  File "~/anaconda3/envs/python38/lib/python3.8/site-packages/iree/compiler/tools/core.py", line 277, in compile_str
    result = invoke_immediate(cl, immediate_input=input_bytes)
  File "~/anaconda3/envs/python38/lib/python3.8/site-packages/iree/compiler/tools/binaries.py", line 196, in invoke_immediate
    raise CompilerToolError(process)
iree.compiler.tools.binaries.CompilerToolError: Error invoking IREE compiler tool iree-compile
Diagnostics:
<stdin>:0:0: error: expected mlir::RankedTensorType, but got: 'i32'
<stdin>:0:0: note: in bytecode version 0 produced by: MLIR16.0.0git
@jpienaar
Copy link
Member

@dellis23 do you know what might cause this?

@dellis23
Copy link
Contributor

In general, these sorts of issues tend to be caused by version skew and incompatibilities between torch-mlir and IREE. We're discussing solutions internally. I just tested out the notebook version of that example, and things seem to be working right now. Did this end up resolving for you @zhping5678? Does the linked colab work for you?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants