iree-org / iree

A retargetable MLIR-based machine learning compiler and runtime toolkit.
http://iree.dev/
Apache License 2.0
2.86k stars 622 forks source link

Crash in OptimizeIntArithmetic Pass #19167

Closed IanWood1 closed 1 week ago

IanWood1 commented 1 week ago

What happened?

Running the tests in https://github.com/nod-ai/shark-ai build_tools/integration_tests/llm with 60cf4ab0c3c6af622673aa9d3a365f5db1a5dd21 causes a crash in OptimizeIntArithmetic:

iree-compile: /home/ianwood2/iree/third_party/llvm-project/mlir/lib/IR/Types.cpp:134: unsigned int mlir::Type::getIntOrFloatBitWidth() const: Assertion `isIntOrFloat() && "only integers and floats have a bitwidth"' failed.

Steps to reproduce your issue

TODO: will update shortly with a minimal repro

Version information

60cf4ab0c3c6af622673aa9d3a365f5db1a5dd21

Additional context

~Initially, I suspected recent changes to OptimizeIntArithmetic https://github.com/iree-org/iree/commit/81dd4e629539facd3d57723c455d7922b427c000 to be the culprit but iree still crashes with it reverted~

Edit: actually there are 2 seperate errors, that commit being one of the causes